changeset 8969:01cc3ee6ecb1 draft

(svn r12761) -Codechange: lots of minor whitespace coding style fixes around operators.
author rubidium <rubidium@openttd.org>
date Fri, 18 Apr 2008 04:37:06 +0000
parents cd248dc7d93f
children 3667cbc7dc1d
files src/ai/default/default.cpp src/ai/trolly/pathfinder.cpp src/ai/trolly/trolly.cpp src/blitter/32bpp_base.hpp src/core/enum_type.hpp src/depot_gui.cpp src/misc_gui.cpp src/namegen.cpp src/network/network.cpp src/newgrf.cpp src/order_gui.cpp src/player_gui.cpp src/players.cpp src/roadveh_cmd.cpp src/saveload.cpp src/settings.cpp src/settings_gui.cpp src/signs_gui.cpp src/station_cmd.cpp src/stdafx.h src/strgen/strgen.cpp src/strings.cpp src/toolbar_gui.cpp src/town_cmd.cpp src/town_gui.cpp src/train_cmd.cpp src/unmovable_cmd.cpp src/vehicle_gui.cpp src/video/win32_v.cpp src/viewport.cpp src/widget.cpp src/win32.cpp src/window_gui.h
diffstat 33 files changed, 70 insertions(+), 70 deletions(-) [+]
line wrap: on
line diff
--- a/src/ai/default/default.cpp
+++ b/src/ai/default/default.cpp
@@ -3995,11 +3995,11 @@
 		if (_players_ai[p->index].state != old_state) {
 			if (hasdots)
 				printf("\n");
-			hasdots=false;
+			hasdots = false;
 			printf("AiState: %s\n", _ai_state_names[old_state=_players_ai[p->index].state]);
 		} else {
 			printf(".");
-			hasdots=true;
+			hasdots = true;
 		}
 	}
 #endif
--- a/src/ai/trolly/pathfinder.cpp
+++ b/src/ai/trolly/pathfinder.cpp
@@ -342,7 +342,7 @@
 		//  For now, we check both sides for this tile.. terraforming gives fuzzy result
 		if (tileh == InclinedSlope(dir)) {
 			// Now simply check if a tunnel can be build
-			ret = AI_DoCommand(tile, (PathFinderInfo->rail_or_road?0:0x200), 0, DC_AUTO, CMD_BUILD_TUNNEL);
+			ret = AI_DoCommand(tile, (PathFinderInfo->rail_or_road ? 0 : 0x200), 0, DC_AUTO, CMD_BUILD_TUNNEL);
 			tileh = GetTileSlope(_build_tunnel_endtile, NULL);
 			if (CmdSucceeded(ret) && IsInclinedSlope(tileh)) {
 				aystar->neighbours[aystar->num_neighbours].tile = _build_tunnel_endtile;
--- a/src/ai/trolly/trolly.cpp
+++ b/src/ai/trolly/trolly.cpp
@@ -796,7 +796,7 @@
 
 	_players_ainew[p->index].depot_tile = 0;
 
-	for (i=2;i<_players_ainew[p->index].path_info.route_length-2;i++) {
+	for (i = 2; i < _players_ainew[p->index].path_info.route_length - 2; i++) {
 		tile = _players_ainew[p->index].path_info.route[i];
 		for (j = DIAGDIR_BEGIN; j < DIAGDIR_END; j++) {
 			TileIndex t = tile + TileOffsByDiagDir(j);
@@ -819,9 +819,9 @@
 	while (i > 1 && i < _players_ainew[p->index].path_info.route_length - 2) {
 		i += g;
 		g *= -1;
-		(g < 0?g--:g++);
+		(g < 0 ? g-- : g++);
 
-		if (_players_ainew[p->index].path_info.route_extra[i] != 0 || _players_ainew[p->index].path_info.route_extra[i+1] != 0) {
+		if (_players_ainew[p->index].path_info.route_extra[i] != 0 || _players_ainew[p->index].path_info.route_extra[i + 1] != 0) {
 			// Bridge or tunnel.. we can't place a depot there
 			continue;
 		}
@@ -949,7 +949,7 @@
 	_players_ainew[p->index].cur_veh = 0;
 
 	// Check how much it it going to cost us..
-	for (i=0;i<res;i++) {
+	for (i = 0; i < res; i++) {
 		_players_ainew[p->index].new_cost += AiNew_Build_Vehicle(p, 0, DC_QUERY_COST).GetCost();
 	}
 
--- a/src/blitter/32bpp_base.hpp
+++ b/src/blitter/32bpp_base.hpp
@@ -104,7 +104,7 @@
 	}
 
 	/**
-	* Make a colour grey-based.
+	* Make a colour grey - based.
 	* @param colour the colour to make grey.
 	* @return the new colour, now grey.
 	*/
--- a/src/core/enum_type.hpp
+++ b/src/core/enum_type.hpp
@@ -66,7 +66,7 @@
 /** In some cases we use byte or uint16 to store values that are defined as enum. It is
 	*  necessary in order to control the sizeof() such values. Some compilers make enum
 	*  the same size as int (4 or 8 bytes instead of 1 or 2). As a consequence the strict
-	*  compiler type-checking causes errors like:
+	*  compiler type - checking causes errors like:
 	*     'HasPowerOnRail' : cannot convert parameter 1 from 'byte' to 'RailType' when
 	*  u->u.rail.railtype is passed as argument or type RailType. In such cases it is better
 	*  to teach the compiler that u->u.rail.railtype is to be treated as RailType. */
--- a/src/depot_gui.cpp
+++ b/src/depot_gui.cpp
@@ -205,7 +205,7 @@
 	DrawSprite((v->vehstatus & VS_STOPPED) ? SPR_FLAG_VEH_STOPPED : SPR_FLAG_VEH_RUNNING, PAL_NONE, x + diff_x, y + diff_y);
 
 	SetDParam(0, v->unitnumber);
-	DrawString(x, y + 2, (uint16)(v->max_age-366) >= v->age ? STR_00E2 : STR_00E3, TC_FROMSTRING);
+	DrawString(x, y + 2, (uint16)(v->max_age - 366) >= v->age ? STR_00E2 : STR_00E3, TC_FROMSTRING);
 }
 
 static void DrawDepotWindow(Window *w)
--- a/src/misc_gui.cpp
+++ b/src/misc_gui.cpp
@@ -1394,7 +1394,7 @@
 {      WWT_INSET,     RESIZE_RB,    14,     2,   243,    50,   150, 0x0,              STR_400A_LIST_OF_DRIVES_DIRECTORIES},
 {  WWT_SCROLLBAR,    RESIZE_LRB,    14,   245,   256,    60,   151, 0x0,              STR_0190_SCROLL_BAR_SCROLLS_LIST},
 {      WWT_PANEL,    RESIZE_RTB,    14,     0,   256,   152,   167, 0x0,              STR_NULL},
-{    WWT_EDITBOX,    RESIZE_RTB,    14,     2,   254,   154,   165, STR_SAVE_OSKTITLE,STR_400B_CURRENTLY_SELECTED_NAME},
+{    WWT_EDITBOX,    RESIZE_RTB,    14,     2,   254,   154,   165, STR_SAVE_OSKTITLE, STR_400B_CURRENTLY_SELECTED_NAME},
 { WWT_PUSHTXTBTN,     RESIZE_TB,    14,     0,   127,   168,   179, STR_4003_DELETE,  STR_400C_DELETE_THE_CURRENTLY_SELECTED},
 { WWT_PUSHTXTBTN,     RESIZE_TB,    14,   128,   244,   168,   179, STR_4002_SAVE,    STR_400D_SAVE_THE_CURRENT_GAME_USING},
 {  WWT_RESIZEBOX,   RESIZE_LRTB,    14,   245,   256,   168,   179, 0x0,              STR_RESIZE_BUTTON},
--- a/src/namegen.cpp
+++ b/src/namegen.cpp
@@ -305,7 +305,7 @@
 		uint sel = SeedChance(2,
 			lengthof(name_finnish_1) + lengthof(name_finnish_2), seed);
 		if (sel >= lengthof(name_finnish_1)) {
-			strecat(buf, name_finnish_2[sel-lengthof(name_finnish_1)], last);
+			strecat(buf, name_finnish_2[sel - lengthof(name_finnish_1)], last);
 		} else {
 			strecat(buf, name_finnish_1[sel], last);
 		}
--- a/src/network/network.cpp
+++ b/src/network/network.cpp
@@ -391,7 +391,7 @@
 			uint32 netmask;
 
 			fields = sscanf(*output, "%u: %hhu.%hhu.%hhu.%hhu, netmask %hhu.%hhu.%hhu.%hhu%n",
-												&n, &i1,&i2,&i3,&i4, &j1,&j2,&j3,&j4, &read);
+												&n, &i1, &i2, &i3, &i4, &j1, &j2, &j3, &j4, &read);
 			read += 1;
 			if (fields != 9) {
 				break;
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -2121,8 +2121,8 @@
 			case 0x1D:
 			case 0x1E: {
 					uint32 multiples = grf_load_dword(&buf);
-					indsp->input_cargo_multiplier[prop - 0x1C][0] = GB(multiples, 0,15);
-					indsp->input_cargo_multiplier[prop - 0x1C][1] = GB(multiples, 15,15);
+					indsp->input_cargo_multiplier[prop - 0x1C][0] = GB(multiples, 0, 15);
+					indsp->input_cargo_multiplier[prop - 0x1C][1] = GB(multiples, 15, 15);
 				} break;
 
 			case 0x1F: // Industry name
--- a/src/order_gui.cpp
+++ b/src/order_gui.cpp
@@ -541,7 +541,7 @@
 	if (!cmd.IsValid()) return;
 
 	if (DoCommandP(v->tile, v->index + (OrderGetSel(w) << 16), cmd.Pack(), NULL, CMD_INSERT_ORDER | CMD_MSG(STR_8833_CAN_T_INSERT_NEW_ORDER))) {
-		if (WP(w, order_d).sel != -1) WP(w,order_d).sel++;
+		if (WP(w, order_d).sel != -1) WP(w, order_d).sel++;
 		ResetObjectToPlace();
 	}
 }
@@ -1087,7 +1087,7 @@
 
 static const WindowDesc _orders_train_desc = {
 	WDP_AUTO, WDP_AUTO, 386, 100, 386, 100,
-	WC_VEHICLE_ORDERS,WC_VEHICLE_VIEW,
+	WC_VEHICLE_ORDERS, WC_VEHICLE_VIEW,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_RESIZABLE,
 	_orders_train_widgets,
 	OrdersWndProc
@@ -1128,7 +1128,7 @@
 
 static const WindowDesc _orders_desc = {
 	WDP_AUTO, WDP_AUTO, 386, 100, 386, 100,
-	WC_VEHICLE_ORDERS,WC_VEHICLE_VIEW,
+	WC_VEHICLE_ORDERS, WC_VEHICLE_VIEW,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_RESIZABLE,
 	_orders_widgets,
 	OrdersWndProc
@@ -1169,7 +1169,7 @@
 
 static const WindowDesc _other_orders_desc = {
 	WDP_AUTO, WDP_AUTO, 386, 88, 386, 88,
-	WC_VEHICLE_ORDERS,WC_VEHICLE_VIEW,
+	WC_VEHICLE_ORDERS, WC_VEHICLE_VIEW,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
 	_other_orders_widgets,
 	OrdersWndProc
--- a/src/player_gui.cpp
+++ b/src/player_gui.cpp
@@ -135,7 +135,7 @@
 {    WWT_CAPTION,   RESIZE_NONE,    14,    11,   379,     0,    13, STR_700E_FINANCES,      STR_018C_WINDOW_TITLE_DRAG_THIS},
 {     WWT_IMGBTN,   RESIZE_NONE,    14,   380,   394,     0,    13, SPR_LARGE_SMALL_WINDOW, STR_7075_TOGGLE_LARGE_SMALL_WINDOW},
 {  WWT_STICKYBOX,   RESIZE_NONE,    14,   395,   406,     0,    13, 0x0,                    STR_STICKY_BUTTON},
-{      WWT_PANEL,   RESIZE_NONE,    14,     0,   406,    14, 39 +10 * EXPENSES_END, 0x0,    STR_NULL},
+{      WWT_PANEL,   RESIZE_NONE,    14,     0,   406,    14, 39 + 10 * EXPENSES_END, 0x0,    STR_NULL},
 {      WWT_PANEL,   RESIZE_NONE,    14,     0,   406, 40 + 10 * EXPENSES_END, 73 + 10 * EXPENSES_END, 0x0, STR_NULL},
 { WWT_PUSHTXTBTN,   RESIZE_NONE,    14,     0,   202, 74 + 10 * EXPENSES_END, 85 + 10 * EXPENSES_END, STR_7029_BORROW,        STR_7035_INCREASE_SIZE_OF_LOAN},
 { WWT_PUSHTXTBTN,   RESIZE_NONE,    14,   203,   406, 74 + 10 * EXPENSES_END, 85 + 10 * EXPENSES_END, STR_702A_REPAY,         STR_7036_REPAY_PART_OF_LOAN},
--- a/src/players.cpp
+++ b/src/players.cpp
@@ -314,7 +314,7 @@
 
 	t = ClosestTownFromTile(tile, (uint)-1);
 
-	if (IsInsideMM(t->townnametype, SPECSTR_TOWNNAME_START, SPECSTR_TOWNNAME_LAST+1)) {
+	if (IsInsideMM(t->townnametype, SPECSTR_TOWNNAME_START, SPECSTR_TOWNNAME_LAST + 1)) {
 		str = t->townnametype - SPECSTR_TOWNNAME_START + SPECSTR_PLAYERNAME_START;
 		strp = t->townnameparts;
 
@@ -353,7 +353,7 @@
 	}
 }
 
-#define COLOR_SWAP(i,j) do { byte t=colors[i];colors[i]=colors[j];colors[j]=t; } while(0)
+#define COLOR_SWAP(i, j) do { byte t = colors[i];colors[i] = colors[j];colors[j] = t; } while(0)
 
 static const byte _color_sort[16] = {2, 2, 3, 2, 3, 2, 3, 2, 3, 2, 2, 2, 3, 1, 1, 1};
 static const byte _color_similar_1[16] = {8, 6, 255, 12,  255, 0, 1, 1, 0, 13,  11,  10, 3,   9,  15, 14};
@@ -362,7 +362,7 @@
 static byte GeneratePlayerColor()
 {
 	byte colors[16], pcolor, t2;
-	int i,j,n;
+	int i, j, n;
 	uint32 r;
 	Player *p;
 
@@ -389,14 +389,14 @@
 	/* Move the colors that look similar to each player's color to the side */
 	FOR_ALL_PLAYERS(p) if (p->is_active) {
 		pcolor = p->player_color;
-		for (i=0; i!=16; i++) if (colors[i] == pcolor) {
+		for (i = 0; i != 16; i++) if (colors[i] == pcolor) {
 			colors[i] = 0xFF;
 
 			t2 = _color_similar_1[pcolor];
 			if (t2 == 0xFF) break;
-			for (i=0; i!=15; i++) {
+			for (i = 0; i != 15; i++) {
 				if (colors[i] == t2) {
-					do COLOR_SWAP(i,i+1); while (++i != 15);
+					do COLOR_SWAP(i, i + 1); while (++i != 15);
 					break;
 				}
 			}
@@ -721,7 +721,7 @@
 
 				cost = AddEngineReplacementForPlayer(p, old_engine_type, new_engine_type, id_g, flags);
 			} else {
-				cost = RemoveEngineReplacementForPlayer(p, old_engine_type,id_g, flags);
+				cost = RemoveEngineReplacementForPlayer(p, old_engine_type, id_g, flags);
 			}
 
 			if (IsLocalPlayer()) InvalidateAutoreplaceWindow(old_engine_type, id_g);
@@ -1089,8 +1089,8 @@
 	    SLE_VAR(Player, name_1,          SLE_STRINGID),
 	SLE_CONDSTR(Player, name,            SLE_STR, 0,                       84, SL_MAX_VERSION),
 
-	    SLE_VAR(Player, president_name_1,SLE_UINT16),
-	    SLE_VAR(Player, president_name_2,SLE_UINT32),
+	    SLE_VAR(Player, president_name_1, SLE_UINT16),
+	    SLE_VAR(Player, president_name_2, SLE_UINT32),
 	SLE_CONDSTR(Player, president_name,  SLE_STR, 0,                       84, SL_MAX_VERSION),
 
 	    SLE_VAR(Player, face,            SLE_UINT32),
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -1293,7 +1293,7 @@
 
 	v->cur_image = v->GetImage(v->direction);
 	v->UpdateDeltaXY(v->direction);
-	SetRoadVehPosition(v,x,y);
+	SetRoadVehPosition(v, x, y);
 
 	InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
 
@@ -1390,7 +1390,7 @@
 	Direction new_dir;
 	Direction old_dir;
 	RoadDriveEntry rd;
-	int x,y;
+	int x, y;
 	uint32 r;
 
 	if (v->u.road.overtaking != 0)  {
@@ -1431,7 +1431,7 @@
 			/* Vehicle has just entered a bridge or tunnel */
 			v->cur_image = v->GetImage(v->direction);
 			v->UpdateDeltaXY(v->direction);
-			SetRoadVehPosition(v,gp.x,gp.y);
+			SetRoadVehPosition(v, gp.x, gp.y);
 			return true;
 		}
 
--- a/src/saveload.cpp
+++ b/src/saveload.cpp
@@ -343,7 +343,7 @@
 			/* Ugly encoding of >16M RIFF chunks
 			 * The lower 24 bits are normal
 			 * The uppermost 4 bits are bits 24:27 */
-			assert(length < (1<<28));
+			assert(length < (1 << 28));
 			SlWriteUint32((length & 0xFFFFFF) | ((length >> 24) << 28));
 			break;
 		case CH_ARRAY:
@@ -1218,7 +1218,7 @@
 		z->avail_out = sizeof(buf);
 		r = deflate(z, mode);
 			/* bytes were emitted? */
-		if ((n=sizeof(buf) - z->avail_out) != 0) {
+		if ((n = sizeof(buf) - z->avail_out) != 0) {
 			if (fwrite(buf, n, 1, _sl.fh) != 1) SlError(STR_GAME_SAVELOAD_ERROR_FILE_NOT_WRITEABLE);
 		}
 		if (r == Z_STREAM_END)
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -83,7 +83,7 @@
 static bool IsSignedVarMemType(VarType vt);
 
 struct SettingsMemoryPool {
-	uint pos,size;
+	uint pos, size;
 	SettingsMemoryPool *next;
 	byte mem[1];
 };
@@ -242,7 +242,7 @@
 
 		/* trim whitespace from right side. */
 		e = s + strlen(s);
-		while (e > s && ((c=e[-1]) == '\n' || c == '\r' || c == ' ' || c == '\t')) e--;
+		while (e > s && ((c = e[-1]) == '\n' || c == '\r' || c == ' ' || c == '\t')) e--;
 		*e = '\0';
 
 		/* skip comments and empty lines */
@@ -253,7 +253,7 @@
 			/* add to comment */
 			if (ns > a) {
 				a = max(a, 128U);
-				do a*=2; while (a < ns);
+				do a *= 2; while (a < ns);
 				comment = ReallocT(comment, comment_alloc = a);
 			}
 			pos = comment_size;
--- a/src/settings_gui.cpp
+++ b/src/settings_gui.cpp
@@ -64,7 +64,7 @@
 {
 	static StringID buf[32 + 1];
 	StringID *p = buf;
-	while (--num>=0) *p++ = base++;
+	while (--num >= 0) *p++ = base++;
 	*p = INVALID_STRING_ID;
 	return buf;
 }
@@ -308,7 +308,7 @@
 					break;
 
 				case GAMEOPT_RESOLUTION_BTN: /* Change resolution */
-					if (e->we.dropdown.index < _num_resolutions && ChangeResInGame(_resolutions[e->we.dropdown.index][0],_resolutions[e->we.dropdown.index][1]))
+					if (e->we.dropdown.index < _num_resolutions && ChangeResInGame(_resolutions[e->we.dropdown.index][0], _resolutions[e->we.dropdown.index][1]))
 						SetWindowDirty(w);
 					break;
 
@@ -340,7 +340,7 @@
 
 	if (flags & DC_EXEC) {
 		_opt_ptr->road_side = p1;
-		InvalidateWindow(WC_GAME_OPTIONS,0);
+		InvalidateWindow(WC_GAME_OPTIONS, 0);
 	}
 	return CommandCost();
 }
@@ -1059,7 +1059,7 @@
 
 		case WE_ON_EDIT_TEXT:
 			if (e->we.edittext.str != NULL) {
-				const PatchEntry *pe = &_patches_page[WP(w, def_d).data_1].entries[WP(w,def_d).data_3];
+				const PatchEntry *pe = &_patches_page[WP(w, def_d).data_1].entries[WP(w, def_d).data_3];
 				const SettingDesc *sd = pe->setting;
 				int32 value = atoi(e->we.edittext.str);
 
--- a/src/signs_gui.cpp
+++ b/src/signs_gui.cpp
@@ -219,7 +219,7 @@
 				case QUERY_EDIT_SIGN_WIDGET_NEXT:
 					if (_sign_sort_dirty) GlobalSortSignList();
 					sign_index = _sign_sort[0]->index;
-					for (uint i = 0; i < _num_sign_sort-1; i++) {
+					for (uint i = 0; i < _num_sign_sort - 1; i++) {
 						if (qs->cur_sign == _sign_sort[i]->index) {
 							sign_index = _sign_sort[i + 1]->index;
 							break;
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -2507,7 +2507,7 @@
 
 			{
 				int b = ge->last_speed;
-				if ((b-=85) >= 0)
+				if ((b -= 85) >= 0)
 					rating += b >> 2;
 			}
 
@@ -3065,15 +3065,15 @@
 };
 
 static const SaveLoad _roadstop_desc[] = {
-	SLE_VAR(RoadStop,xy,           SLE_UINT32),
+	SLE_VAR(RoadStop, xy,           SLE_UINT32),
 	SLE_CONDNULL(1, 0, 44),
-	SLE_VAR(RoadStop,status,       SLE_UINT8),
+	SLE_VAR(RoadStop, status,       SLE_UINT8),
 	/* Index was saved in some versions, but this is not needed */
 	SLE_CONDNULL(4, 0, 8),
 	SLE_CONDNULL(2, 0, 44),
 	SLE_CONDNULL(1, 0, 25),
 
-	SLE_REF(RoadStop,next,         REF_ROADSTOPS),
+	SLE_REF(RoadStop, next,         REF_ROADSTOPS),
 	SLE_CONDNULL(2, 0, 44),
 
 	SLE_CONDNULL(4, 0, 24),
--- a/src/stdafx.h
+++ b/src/stdafx.h
@@ -296,9 +296,9 @@
 #define endof(x) (&x[lengthof(x)])
 #define lastof(x) (&x[lengthof(x) - 1])
 
-#define cpp_offsetof(s,m)   (((size_t)&reinterpret_cast<const volatile char&>((((s*)(char*)8)->m))) - 8)
+#define cpp_offsetof(s, m)   (((size_t)&reinterpret_cast<const volatile char&>((((s*)(char*)8)->m))) - 8)
 #if !defined(offsetof)
-	#define offsetof(s,m) cpp_offsetof(s, m)
+	#define offsetof(s, m) cpp_offsetof(s, m)
 #endif /* offsetof */
 
 
--- a/src/strgen/strgen.cpp
+++ b/src/strgen/strgen.cpp
@@ -777,7 +777,7 @@
 
 static void HandleString(char *str, bool master)
 {
-	char *s,*t;
+	char *s, *t;
 	LangString *ent;
 	char *casep;
 
--- a/src/strings.cpp
+++ b/src/strings.cpp
@@ -1195,7 +1195,7 @@
 	}
 
 	/* town name? */
-	if (IsInsideMM(ind - 6, 0, SPECSTR_TOWNNAME_LAST-SPECSTR_TOWNNAME_START + 1)) {
+	if (IsInsideMM(ind - 6, 0, SPECSTR_TOWNNAME_LAST - SPECSTR_TOWNNAME_START + 1)) {
 		buff = GetSpecialTownNameString(buff, ind - 6, GetInt32(&argv), last);
 		return strecpy(buff, " Transport", last);
 	}
--- a/src/toolbar_gui.cpp
+++ b/src/toolbar_gui.cpp
@@ -46,7 +46,7 @@
  * the default position is aligned with the left side of the clicked button */
 Point GetToolbarDropdownPos(uint16 parent_button, int width, int height)
 {
-	const Window *w = FindWindowById(WC_MAIN_TOOLBAR,0);
+	const Window *w = FindWindowById(WC_MAIN_TOOLBAR, 0);
 	Point pos;
 	pos.x = w->widget[GB(parent_button, 0, 8)].left;
 	pos.x = w->left + Clamp(pos.x, 0, w->width - width);
@@ -175,7 +175,7 @@
 
 static void ToolbarZoomOutClick(Window *w)
 {
-	if (DoZoomInOutWindow(ZOOM_OUT,FindWindowById(WC_MAIN_WINDOW, 0))) {
+	if (DoZoomInOutWindow(ZOOM_OUT, FindWindowById(WC_MAIN_WINDOW, 0))) {
 		w->HandleButtonClick(18);
 		SndPlayFx(SND_15_BEEP);
 	}
@@ -387,8 +387,8 @@
 	switch (e->event) {
 		case WE_PAINT:
 			/* Draw brown-red toolbar bg. */
-			GfxFillRect(0, 0, w->width-1, w->height-1, 0xB2);
-			GfxFillRect(0, 0, w->width-1, w->height-1, 0xB4 | (1 << PALETTE_MODIFIER_GREYOUT));
+			GfxFillRect(0, 0, w->width - 1, w->height - 1, 0xB2);
+			GfxFillRect(0, 0, w->width - 1, w->height - 1, 0xB4 | (1 << PALETTE_MODIFIER_GREYOUT));
 
 			/* If spectator, disable all construction buttons
 			* ie : Build road, rail, ships, airports and landscaping
@@ -599,8 +599,8 @@
 			w->SetWidgetDisabledState(7, _patches_newgame.starting_year >= MAX_YEAR);
 
 			/* Draw brown-red toolbar bg. */
-			GfxFillRect(0, 0, w->width-1, w->height-1, 0xB2);
-			GfxFillRect(0, 0, w->width-1, w->height-1, 0xB4 | (1 << PALETTE_MODIFIER_GREYOUT));
+			GfxFillRect(0, 0, w->width - 1, w->height - 1, 0xB2);
+			GfxFillRect(0, 0, w->width - 1, w->height - 1, 0xB4 | (1 << PALETTE_MODIFIER_GREYOUT));
 
 			DrawWindowWidgets(w);
 
@@ -667,7 +667,7 @@
 
 		case WE_RESIZE: {
 			/* There are 15 buttons plus some spacings if the space allows it.
-			* Furthermore there are two panels of which one is non-essential
+			* Furthermore there are two panels of which one is non - essential
 			* and that one can be removed is the space is too small. */
 			uint buttons_width;
 			uint spacing;
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -2345,7 +2345,7 @@
 		if (TilePixelHeight(t->xy) >= GetSnowLine() && t->act_food == 0 && t->population > 90)
 			return;
 	} else if (_opt.landscape == LT_TROPIC) {
-		if (GetTropicZone(t->xy) == TROPICZONE_DESERT && (t->act_food==0 || t->act_water==0) && t->population > 60)
+		if (GetTropicZone(t->xy) == TROPICZONE_DESERT && (t->act_food == 0 || t->act_water == 0) && t->population > 60)
 			return;
 	}
 
--- a/src/town_gui.cpp
+++ b/src/town_gui.cpp
@@ -149,7 +149,7 @@
 
 			SetVScrollCount(w, numact + 1);
 
-			if (WP(w, def_d).data_1 != -1 && !HasBit(buttons, WP(w,def_d).data_1))
+			if (WP(w, def_d).data_1 != -1 && !HasBit(buttons, WP(w, def_d).data_1))
 				WP(w, def_d).data_1 = -1;
 
 			w->SetWidgetDisabledState(6, WP(w, def_d).data_1 == -1);
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -1304,7 +1304,7 @@
  * @param p2 the selling mode
  * - p2 = 0: only sell the single dragged wagon/engine (and any belonging rear-engines)
  * - p2 = 1: sell the vehicle and all vehicles following it in the chain
-             if the wagon is dragged, don't delete the possibly belonging rear-engine to some front
+ *           if the wagon is dragged, don't delete the possibly belonging rear-engine to some front
  * - p2 = 2: when selling attached locos, rearrange all vehicles after it to separate lines;
  *           all wagons of the same type will go on the same line. Used by the AI currently
  */
@@ -3207,7 +3207,7 @@
 
 	if (state <= 240 && !(v->tick_counter & 3)) ChangeTrainDirRandomly(v);
 
-	if (state >= 4440 && !(v->tick_counter&0x1F)) {
+	if (state >= 4440 && !(v->tick_counter & 0x1F)) {
 		DeleteLastWagon(v);
 		InvalidateWindow(WC_REPLACE_VEHICLE, (v->group_id << 16) | VEH_TRAIN);
 	}
--- a/src/unmovable_cmd.cpp
+++ b/src/unmovable_cmd.cpp
@@ -158,7 +158,7 @@
 
 	if (flags & DC_EXEC) DoClearSquare(tile);
 
-	return CommandCost(EXPENSES_CONSTRUCTION,- _price.clear_roughland * 2);
+	return CommandCost(EXPENSES_CONSTRUCTION, - _price.clear_roughland * 2);
 }
 
 static Foundation GetFoundation_Unmovable(TileIndex tile, Slope tileh);
--- a/src/vehicle_gui.cpp
+++ b/src/vehicle_gui.cpp
@@ -1437,7 +1437,7 @@
 extern void DrawAircraftDetails(const Vehicle *v, int x, int y);
 
 /**
-* Draw the details for the given vehicle at the position (x,y) of the Details windows
+* Draw the details for the given vehicle at the position (x, y) of the Details windows
 *
 * @param v current vehicle
 * @param x The x coordinate
--- a/src/video/win32_v.cpp
+++ b/src/video/win32_v.cpp
@@ -308,7 +308,7 @@
 
 		case WM_PAINT: {
 			PAINTSTRUCT ps;
-			HDC dc,dc2;
+			HDC dc, dc2;
 			HBITMAP old_bmp;
 			HPALETTE old_palette;
 
--- a/src/viewport.cpp
+++ b/src/viewport.cpp
@@ -1015,7 +1015,7 @@
 				if (bottom > t->sign.top &&
 						top    < t->sign.top + 24 &&
 						right  > t->sign.left &&
-						left   < t->sign.left + t->sign.width_1*2) {
+						left   < t->sign.left + t->sign.width_1 * 2) {
 					AddStringToDraw(t->sign.left + 1, t->sign.top + 1,
 						_patches.population_in_label ? STR_TOWN_LABEL_POP : STR_TOWN_LABEL,
 						t->index, t->population);
@@ -1082,7 +1082,7 @@
 				if (bottom > st->sign.top &&
 						top    < st->sign.top + 24 &&
 						right  > st->sign.left &&
-						left   < st->sign.left + st->sign.width_1*2) {
+						left   < st->sign.left + st->sign.width_1 * 2) {
 					AddStation(st, STR_305C_0, st->sign.width_1);
 				}
 			}
@@ -1210,7 +1210,7 @@
 				if (bottom > wp->sign.top &&
 						top    < wp->sign.top + 24 &&
 						right  > wp->sign.left &&
-						left   < wp->sign.left + wp->sign.width_1*2) {
+						left   < wp->sign.left + wp->sign.width_1 * 2) {
 					AddWaypoint(wp, STR_WAYPOINT_VIEWPORT, wp->sign.width_1);
 				}
 			}
--- a/src/widget.cpp
+++ b/src/widget.cpp
@@ -86,7 +86,7 @@
 
 		default: NOT_REACHED();
 	}
-	if (pos <= mi+9) {
+	if (pos <= mi + 9) {
 		/* Pressing the upper button? */
 		w->flags4 |= WF_SCROLL_UP;
 		if (_scroller_click_timeout == 0) {
--- a/src/win32.cpp
+++ b/src/win32.cpp
@@ -249,7 +249,7 @@
 #if 0
 
 struct WinInetProcs {
-	HINTERNET (WINAPI *InternetOpen)(LPCTSTR,DWORD, LPCTSTR, LPCTSTR, DWORD);
+	HINTERNET (WINAPI *InternetOpen)(LPCTSTR, DWORD, LPCTSTR, LPCTSTR, DWORD);
 	HINTERNET (WINAPI *InternetConnect)(HINTERNET, LPCTSTR, INTERNET_PORT, LPCTSTR, LPCTSTR, DWORD, DWORD, DWORD);
 	HINTERNET (WINAPI *HttpOpenRequest)(HINTERNET, LPCTSTR, LPCTSTR, LPCTSTR, LPCTSTR, LPCTSTR *, DWORD, DWORD);
 	BOOL (WINAPI *HttpSendRequest)(HINTERNET, LPCTSTR, DWORD, LPVOID, DWORD);
--- a/src/window_gui.h
+++ b/src/window_gui.h
@@ -42,7 +42,7 @@
     Now the window will only change in height in steps of 10.
    You can also give a minimum width and height. The default value is
     the default height/width of the window itself. You can change this
-    AFTER window-creation, with:
+    AFTER window - creation, with:
      w->resize.width or w->resize.height.
    That was all.. good luck, and enjoy :) -- TrueLight */