diff options
Diffstat (limited to 'src')
33 files changed, 70 insertions, 70 deletions
diff --git a/src/ai/default/default.cpp b/src/ai/default/default.cpp index ed7f103a2..70d470d63 100644 --- a/src/ai/default/default.cpp +++ b/src/ai/default/default.cpp @@ -3995,11 +3995,11 @@ void AiDoGameLoop(Player *p) 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 diff --git a/src/ai/trolly/pathfinder.cpp b/src/ai/trolly/pathfinder.cpp index 0928a3a35..e58c92a27 100644 --- a/src/ai/trolly/pathfinder.cpp +++ b/src/ai/trolly/pathfinder.cpp @@ -342,7 +342,7 @@ static void AyStar_AiPathFinder_GetNeighbours(AyStar *aystar, OpenListNode *curr // 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; diff --git a/src/ai/trolly/trolly.cpp b/src/ai/trolly/trolly.cpp index 3df5f06ac..49133386d 100644 --- a/src/ai/trolly/trolly.cpp +++ b/src/ai/trolly/trolly.cpp @@ -796,7 +796,7 @@ static void AiNew_State_FindDepot(Player *p) _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 @@ static void AiNew_State_FindDepot(Player *p) 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 @@ static void AiNew_State_VerifyRoute(Player *p) _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(); } diff --git a/src/blitter/32bpp_base.hpp b/src/blitter/32bpp_base.hpp index 828136201..5a664cd0b 100644 --- a/src/blitter/32bpp_base.hpp +++ b/src/blitter/32bpp_base.hpp @@ -104,7 +104,7 @@ public: } /** - * Make a colour grey-based. + * Make a colour grey - based. * @param colour the colour to make grey. * @return the new colour, now grey. */ diff --git a/src/core/enum_type.hpp b/src/core/enum_type.hpp index 725d3985f..de83b6d55 100644 --- a/src/core/enum_type.hpp +++ b/src/core/enum_type.hpp @@ -66,7 +66,7 @@ struct MakeEnumPropsT { /** 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. */ diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp index e5a0b8e67..e964a8d84 100644 --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -205,7 +205,7 @@ static void DrawVehicleInDepot(Window *w, const Vehicle *v, int x, int y) 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) diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index 25dc02aa3..f8faea218 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -1394,7 +1394,7 @@ static const Widget _save_dialog_widgets[] = { { 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}, diff --git a/src/namegen.cpp b/src/namegen.cpp index 3027e920b..4fc370767 100644 --- a/src/namegen.cpp +++ b/src/namegen.cpp @@ -305,7 +305,7 @@ static byte MakeFinnishTownName(char *buf, uint32 seed, const char *last) 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); } diff --git a/src/network/network.cpp b/src/network/network.cpp index bbb6bb833..8ec1a2a8a 100644 --- a/src/network/network.cpp +++ b/src/network/network.cpp @@ -391,7 +391,7 @@ static void NetworkFindIPs() 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; diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 4614645d0..3719aaf13 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -2121,8 +2121,8 @@ static bool IndustriesChangeInfo(uint indid, int numinfo, int prop, byte **bufp, 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 diff --git a/src/order_gui.cpp b/src/order_gui.cpp index b14ec8edb..8a953d029 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -541,7 +541,7 @@ static void OrdersPlaceObj(const Vehicle *v, TileIndex tile, Window *w) 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 Widget _orders_train_widgets[] = { 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 Widget _orders_widgets[] = { 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 Widget _other_orders_widgets[] = { 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 diff --git a/src/player_gui.cpp b/src/player_gui.cpp index 190fac7e5..53d2a2c5a 100644 --- a/src/player_gui.cpp +++ b/src/player_gui.cpp @@ -135,7 +135,7 @@ static const Widget _player_finances_widgets[] = { { 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}, diff --git a/src/players.cpp b/src/players.cpp index b323e5e7a..fc696c5b2 100644 --- a/src/players.cpp +++ b/src/players.cpp @@ -314,7 +314,7 @@ static void GenerateCompanyName(Player *p) 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 @@ bad_town_name:; } } -#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 const byte _color_similar_2[16] = {5, 7, 255, 255, 255, 8, 7, 6, 5, 12, 2 static byte GeneratePlayerColor() { byte colors[16], pcolor, t2; - int i,j,n; + int i, j, n; uint32 r; Player *p; @@ -389,14 +389,14 @@ static byte GeneratePlayerColor() /* 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 @@ CommandCost CmdSetAutoReplace(TileIndex tile, uint32 flags, uint32 p1, uint32 p2 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 @@ static const SaveLoad _player_desc[] = { 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), diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp index 4ec5ba5c0..a1c083447 100644 --- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -1293,7 +1293,7 @@ static bool RoadVehLeaveDepot(Vehicle *v, bool first) 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 @@ static bool IndividualRoadVehicleController(Vehicle *v, const Vehicle *prev) 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 @@ static bool IndividualRoadVehicleController(Vehicle *v, const Vehicle *prev) /* 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; } diff --git a/src/saveload.cpp b/src/saveload.cpp index 4e73c5898..ff8851752 100644 --- a/src/saveload.cpp +++ b/src/saveload.cpp @@ -343,7 +343,7 @@ void SlSetLength(size_t length) /* 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 @@ static void WriteZlibLoop(z_streamp z, byte *p, uint len, int mode) 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) diff --git a/src/settings.cpp b/src/settings.cpp index e4a98942d..307db3ecc 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -83,7 +83,7 @@ static void pool_free(SettingsMemoryPool **pool); static bool IsSignedVarMemType(VarType vt); struct SettingsMemoryPool { - uint pos,size; + uint pos, size; SettingsMemoryPool *next; byte mem[1]; }; @@ -242,7 +242,7 @@ static IniFile *ini_load(const char *filename) /* 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 @@ static IniFile *ini_load(const char *filename) /* 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; diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 436a60b74..c699443b6 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -64,7 +64,7 @@ static StringID *BuildDynamicDropdown(StringID base, int num) { 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 @@ static void GameOptionsWndProc(Window *w, WindowEvent *e) 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 @@ CommandCost CmdSetRoadDriveSide(TileIndex tile, uint32 flags, uint32 p1, uint32 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 @@ static void PatchesSelectionWndProc(Window *w, WindowEvent *e) 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); diff --git a/src/signs_gui.cpp b/src/signs_gui.cpp index b0d559e2d..f0cea0eda 100644 --- a/src/signs_gui.cpp +++ b/src/signs_gui.cpp @@ -219,7 +219,7 @@ static void QuerySignEditWndProc(Window *w, WindowEvent *e) 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; diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 8d21f7b1e..78a59c48d 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -2507,7 +2507,7 @@ static void UpdateStationRating(Station *st) { int b = ge->last_speed; - if ((b-=85) >= 0) + if ((b -= 85) >= 0) rating += b >> 2; } @@ -3065,15 +3065,15 @@ extern const TileTypeProcs _tile_type_station_procs = { }; 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), diff --git a/src/stdafx.h b/src/stdafx.h index 76818d93f..9b48a1d67 100644 --- a/src/stdafx.h +++ b/src/stdafx.h @@ -296,9 +296,9 @@ assert_compile(sizeof(uint8) == 1); #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 */ diff --git a/src/strgen/strgen.cpp b/src/strgen/strgen.cpp index 7ace1f1ea..ca151755d 100644 --- a/src/strgen/strgen.cpp +++ b/src/strgen/strgen.cpp @@ -777,7 +777,7 @@ static bool CheckCommandsMatch(char *a, char *b, const char *name) static void HandleString(char *str, bool master) { - char *s,*t; + char *s, *t; LangString *ent; char *casep; diff --git a/src/strings.cpp b/src/strings.cpp index bc6bfff44..76d8f7eea 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -1195,7 +1195,7 @@ static char *GetSpecialPlayerNameString(char *buff, int ind, const int64 *argv, } /* 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); } diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp index bb3d063ad..088e80f8e 100644 --- a/src/toolbar_gui.cpp +++ b/src/toolbar_gui.cpp @@ -46,7 +46,7 @@ extern RoadType _last_built_roadtype; * 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 ToolbarZoomInClick(Window *w) 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 @@ void MainToolbarWndProc(Window *w, WindowEvent *e) 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 @@ void ScenEditToolbarWndProc(Window *w, WindowEvent *e) 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 @@ void ScenEditToolbarWndProc(Window *w, WindowEvent *e) 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; diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index c1a6999b1..466c834dd 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -2345,7 +2345,7 @@ static void UpdateTownGrowRate(Town *t) 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; } diff --git a/src/town_gui.cpp b/src/town_gui.cpp index 27812c879..4c563db34 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -149,7 +149,7 @@ static void TownAuthorityWndProc(Window *w, WindowEvent *e) 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); diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 15cec8113..751cc1889 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -1304,7 +1304,7 @@ CommandCost CmdStartStopTrain(TileIndex tile, uint32 flags, uint32 p1, uint32 p2 * @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 @@ static void HandleCrashedTrain(Vehicle *v) 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); } diff --git a/src/unmovable_cmd.cpp b/src/unmovable_cmd.cpp index c64a256bc..a1daae73c 100644 --- a/src/unmovable_cmd.cpp +++ b/src/unmovable_cmd.cpp @@ -158,7 +158,7 @@ CommandCost CmdSellLandArea(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) 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); diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index e8cdd455b..47480910d 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -1437,7 +1437,7 @@ extern void DrawShipDetails(const Vehicle *v, int x, int y); 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 diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp index 91f7439fa..5030362c6 100644 --- a/src/video/win32_v.cpp +++ b/src/video/win32_v.cpp @@ -308,7 +308,7 @@ static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP case WM_PAINT: { PAINTSTRUCT ps; - HDC dc,dc2; + HDC dc, dc2; HBITMAP old_bmp; HPALETTE old_palette; diff --git a/src/viewport.cpp b/src/viewport.cpp index 84378a617..36b9a6c3d 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -1015,7 +1015,7 @@ static void ViewportAddTownNames(DrawPixelInfo *dpi) 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 @@ static void ViewportAddStationNames(DrawPixelInfo *dpi) 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 @@ static void ViewportAddWaypoints(DrawPixelInfo *dpi) 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); } } diff --git a/src/widget.cpp b/src/widget.cpp index 38bfe98d3..ae70a2e31 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -86,7 +86,7 @@ void ScrollbarClickHandler(Window *w, const Widget *wi, int x, int y) 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) { diff --git a/src/win32.cpp b/src/win32.cpp index 4fb2b67a4..3aad60434 100644 --- a/src/win32.cpp +++ b/src/win32.cpp @@ -249,7 +249,7 @@ static bool EmergencySave() #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); diff --git a/src/window_gui.h b/src/window_gui.h index c8aa57ce3..8fcfa0ce8 100644 --- a/src/window_gui.h +++ b/src/window_gui.h @@ -42,7 +42,7 @@ typedef void WindowProc(Window *w, WindowEvent *e); 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 */ |