diff --git a/src/action/action_spellcast.cpp b/src/action/action_spellcast.cpp
index 6021a7f83..df44548ef 100644
--- a/src/action/action_spellcast.cpp
+++ b/src/action/action_spellcast.cpp
@@ -306,8 +306,8 @@ bool COrder_SpellCast::SpellMoveToTarget(CUnit &unit)
 										unit.Type->Name.c_str(), spell.Name.c_str());
 				} else if (unit.Player->CheckCosts(spell.Costs)) {
 					unit.Player->Notify(NotifyYellow, unit.tilePos,
-						_("%s: not enough resources to cast spell: %s"),
-						unit.Type->Name.c_str(), spell.Name.c_str());
+										_("%s: not enough resources to cast spell: %s"),
+										unit.Type->Name.c_str(), spell.Name.c_str());
 				} else {
 					unit.Player->Notify(NotifyYellow, unit.tilePos,
 										_("%s: can't cast spell: %s"),
diff --git a/src/action/actions.cpp b/src/action/actions.cpp
index cc6e620d2..72ae29173 100644
--- a/src/action/actions.cpp
+++ b/src/action/actions.cpp
@@ -259,8 +259,8 @@ static void HandleRegenerations(CUnit &unit)
 		&& unit.CurrentAction() != UnitActionDie) {
 		if (((100 * unit.Variable[HP_INDEX].Value) / unit.Variable[HP_INDEX].Max) <= unit.Type->BurnPercent
 			&& unit.Type->BurnDamageRate) {
-				HitUnit(NoUnitP, unit, unit.Type->BurnDamageRate);
-				burn = true;
+			HitUnit(NoUnitP, unit, unit.Type->BurnDamageRate);
+			burn = true;
 		}
 
 		if (unit.Variable[POISON_INDEX].Value && unit.Type->PoisonDrain) {
@@ -329,7 +329,7 @@ static void HandleBuffsEachSecond(CUnit &unit)
 	for (unsigned int i = 0; i < UnitTypeVar.GetNumberVariable(); i++) {
 		if (i == BLOODLUST_INDEX || i == HASTE_INDEX || i == SLOW_INDEX
 			|| i == INVISIBLE_INDEX || i == UNHOLYARMOR_INDEX || i == POISON_INDEX) {
-				continue;
+			continue;
 		}
 		if (unit.Variable[i].Enable && unit.Variable[i].Increase) {
 			IncreaseVariable(unit, i);
diff --git a/src/include/netconnect.h b/src/include/netconnect.h
index 3c66cb3f0..69f01d2cd 100644
--- a/src/include/netconnect.h
+++ b/src/include/netconnect.h
@@ -102,7 +102,7 @@ public:
 	static size_t Size() { return 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 * PlayerMax + 4 * PlayerMax + 4 * PlayerMax + 4 * PlayerMax; }
 	void Clear() {
 		ResourcesOption = UnitsOption = FogOfWar = RevealMap = TilesetSelection =
-			GameTypeOption = Difficulty = MapRichness = 0;
+																   GameTypeOption = Difficulty = MapRichness = 0;
 		memset(CompOpt, 0, sizeof(CompOpt));
 		memset(Ready, 0, sizeof(Ready));
 		memset(LastFrame, 0, sizeof(LastFrame));
diff --git a/src/include/util.h b/src/include/util.h
index 76ca0987c..99a69bc37 100644
--- a/src/include/util.h
+++ b/src/include/util.h
@@ -122,7 +122,7 @@ extern size_t strnlen(const char *str, size_t strsize);
 #else
 extern char *optarg;
 extern int optind, opterr, optopt;
-int getopt(int argc, char * const argv[], const char *optstring);
+int getopt(int argc, char *const argv[], const char *optstring);
 #endif
 
 /*----------------------------------------------------------------------------
diff --git a/src/include/video.h b/src/include/video.h
index 578f02cce..a86ae566b 100644
--- a/src/include/video.h
+++ b/src/include/video.h
@@ -298,11 +298,11 @@ public:
 	void FillTransCircleClip(Uint32 color, int x, int y, int radius, unsigned char alpha);
 
 	inline Uint32 MapRGB(SDL_PixelFormat *f, Uint8 r, Uint8 g, Uint8 b) {
-		#if defined(USE_OPENGL) || defined(USE_GLES)
+#if defined(USE_OPENGL) || defined(USE_GLES)
 		if (UseOpenGL) {
 			return MapRGBA(f, r, g, b, 0xFF);
 		} else
-		#endif
+#endif
 		{
 			return SDL_MapRGB(f, r, g, b);
 		}
@@ -311,11 +311,11 @@ public:
 		return MapRGB(f, color.R, color.G, color.B);
 	}
 	inline Uint32 MapRGBA(SDL_PixelFormat *f, Uint8 r, Uint8 g, Uint8 b, Uint8 a) {
-		#if defined(USE_OPENGL) || defined(USE_GLES)
+#if defined(USE_OPENGL) || defined(USE_GLES)
 		if (UseOpenGL) {
 			return ((r << RSHIFT) | (g << GSHIFT) | (b << BSHIFT) | (a << ASHIFT));
 		} else
-		#endif
+#endif
 		{
 			return SDL_MapRGBA(f, r, g, b, a);
 		}
@@ -324,26 +324,26 @@ public:
 		return MapRGBA(f, color.R, color.G, color.B, color.A);
 	}
 	inline void GetRGB(Uint32 c, SDL_PixelFormat *f, Uint8 *r, Uint8 *g, Uint8 *b) {
-		#if defined(USE_OPENGL) || defined(USE_GLES)
+#if defined(USE_OPENGL) || defined(USE_GLES)
 		if (UseOpenGL) {
 			*r = (c >> RSHIFT) & 0xff;
 			*g = (c >> GSHIFT) & 0xff;
 			*b = (c >> BSHIFT) & 0xff;
 		} else
-		#endif
+#endif
 		{
 			SDL_GetRGB(c, f, r, g, b);
 		}
 	}
 	inline void GetRGBA(Uint32 c, SDL_PixelFormat *f, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a) {
-		#if defined(USE_OPENGL) || defined(USE_GLES)
+#if defined(USE_OPENGL) || defined(USE_GLES)
 		if (UseOpenGL) {
 			*r = (c >> RSHIFT) & 0xff;
 			*g = (c >> GSHIFT) & 0xff;
 			*b = (c >> BSHIFT) & 0xff;
 			*a = (c >> ASHIFT) & 0xff;
 		} else
-		#endif
+#endif
 		{
 			SDL_GetRGBA(c, f, r, g, b, a);
 		}
diff --git a/src/spell/script_spell.cpp b/src/spell/script_spell.cpp
index 60b04f351..313487f0d 100644
--- a/src/spell/script_spell.cpp
+++ b/src/spell/script_spell.cpp
@@ -265,7 +265,6 @@ static void CclSpellAutocast(lua_State *l, AutoCastInfo *autocast)
 			lua_pop(l, 1);
 
 			lua_pop(l, 1);
-			
 		} else if (!strcmp(value, "condition")) {
 			if (!autocast->Condition) {
 				autocast->Condition = new ConditionInfo;
diff --git a/src/spell/spells.cpp b/src/spell/spells.cpp
index 9c4173fbd..96c3fa48e 100644
--- a/src/spell/spells.cpp
+++ b/src/spell/spells.cpp
@@ -293,13 +293,12 @@ static Target *SelectTargetUnitsOfAutoCast(CUnit &caster, const SpellType &spell
 				// For the best target???
 				if (autocast->PriorytyVar != ACP_NOVALUE) {
 					std::sort(table.begin(), table.begin() + n,
-						AutoCastPrioritySort(caster, autocast->PriorytyVar, autocast->ReverseSort));
+							  AutoCastPrioritySort(caster, autocast->PriorytyVar, autocast->ReverseSort));
 					return NewTargetUnit(*table[0]);
 				} else { // Use the old behavior
 					return NewTargetUnit(*table[SyncRand() % n]);
 				}
-				
-			} 
+			}
 			break;
 		}
 		default:
diff --git a/src/unit/script_unittype.cpp b/src/unit/script_unittype.cpp
index 9f2a9ddd5..ac01ca04f 100644
--- a/src/unit/script_unittype.cpp
+++ b/src/unit/script_unittype.cpp
@@ -1573,7 +1573,7 @@ static int CclDefineDecorations(lua_State *l)
 						decovarstaticsprite->n = LuaToNumber(l, -2);
 						decovarstaticsprite->FadeValue = LuaToNumber(l, -1);
 						lua_pop(l, 3);
-					}					
+					}
 					decovar = decovarstaticsprite;
 				} else { // Error
 					LuaError(l, "invalid method '%s' for Method in DefineDecorations" _C_ key);
diff --git a/src/video/cursor.cpp b/src/video/cursor.cpp
index 4832bd6e9..e9793ec96 100644
--- a/src/video/cursor.cpp
+++ b/src/video/cursor.cpp
@@ -263,7 +263,7 @@ void DrawCursor()
 #else
 	if (
 #endif
-			!GameRunning && !Editor.Running) {
+		!GameRunning && !Editor.Running) {
 		if (!HiddenSurface
 			|| HiddenSurface->w != GameCursor->G->getWidth()
 			|| HiddenSurface->h != GameCursor->G->getHeight()) {
@@ -303,7 +303,7 @@ void HideCursor()
 #else
 	if (
 #endif
-			!GameRunning && !Editor.Running && GameCursor) {
+		!GameRunning && !Editor.Running && GameCursor) {
 		const PixelPos pos = CursorScreenPos - GameCursor->HotPos;
 		SDL_Rect dstRect = {Sint16(pos.x), Sint16(pos.y), 0, 0 };
 		SDL_BlitSurface(HiddenSurface, NULL, TheScreen, &dstRect);
diff --git a/src/video/sdl.cpp b/src/video/sdl.cpp
index 75d675be7..0a8b4fd5e 100644
--- a/src/video/sdl.cpp
+++ b/src/video/sdl.cpp
@@ -670,7 +670,7 @@ void InitVideoSdl()
 		// Get the SDL window handle
 		SDL_SysWMinfo sysInfo; //Will hold our Window information
 		SDL_VERSION(&sysInfo.version); //Set SDL version
-		if(SDL_GetWMInfo(&sysInfo) <= 0) {
+		if (SDL_GetWMInfo(&sysInfo) <= 0) {
 			fprintf(stderr, "Unable to get window handle\n");
 			exit(1);
 		}