diff --git a/src/ai/default/default.cpp b/src/ai/default/default.cpp index 70d470d638..27a86cd65d 100644 --- a/src/ai/default/default.cpp +++ b/src/ai/default/default.cpp @@ -3097,7 +3097,7 @@ do_some_terraform: Axis axis = (TileX(t1) == TileX(t2) ? AXIS_Y : AXIS_X); /* try to build a long road instead of bridge - CMD_BUILD_LONG_ROAD has to fail if it couldn't build at least one piece! */ - CommandCost cost = DoCommand(t2, t1, (t2 < t1 ? 1 : 2) | (axis << 2) | (ROADTYPE_ROAD << 3), DC_AUTO | DC_NO_WATER, CMD_BUILD_LONG_ROAD); + CommandCost cost = DoCommand(t2, t1, (t2 < t1 ? 1 : 2) | (axis << 2) | (ROADTYPE_ROAD << 3), DC_AUTO | DC_NO_WATER, CMD_BUILD_LONG_ROAD); if (CmdSucceeded(cost) && cost.GetCost() <= p->player_money) { DoCommand(t2, t1, (t2 < t1 ? 1 : 2) | (axis << 2) | (ROADTYPE_ROAD << 3), DC_AUTO | DC_EXEC | DC_NO_WATER, CMD_BUILD_LONG_ROAD); diff --git a/src/group_gui.cpp b/src/group_gui.cpp index 4ccc62ad58..efa8c1af17 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -206,7 +206,7 @@ static void CreateVehicleGroupWindow(Window *w) w->widget[GRP_WIDGET_LIST_VEHICLE].data = (w->vscroll2.cap << 8) + 1; switch (gv->vehicle_type) { - default: NOT_REACHED(); break; + default: NOT_REACHED(); case VEH_TRAIN: gv->_sorting = &_sorting.train; break; case VEH_ROAD: gv->_sorting = &_sorting.roadveh; break; case VEH_SHIP: gv->_sorting = &_sorting.ship; break; @@ -217,11 +217,11 @@ static void CreateVehicleGroupWindow(Window *w) gv->vehicle_type = (VehicleType)GB(w->window_number, 11, 5); gv->l.sort_type = gv->_sorting->criteria; gv->l.flags = VL_REBUILD | (gv->_sorting->order ? VL_DESC : VL_NONE); - gv->l.resort_timer = DAY_TICKS * PERIODIC_RESORT_DAYS; // Set up resort timer + gv->l.resort_timer = DAY_TICKS * PERIODIC_RESORT_DAYS; // Set up resort timer gl->sort_list = NULL; gl->l.flags = VL_REBUILD | VL_NONE; - gl->l.resort_timer = DAY_TICKS * PERIODIC_RESORT_DAYS; // Set up resort timer + gl->l.resort_timer = DAY_TICKS * PERIODIC_RESORT_DAYS; // Set up resort timer gv->group_sel = ALL_GROUP; gv->vehicle_sel = INVALID_VEHICLE; @@ -398,7 +398,7 @@ static void GroupWndProc(Window *w, WindowEvent *e) w->widget[GRP_WIDGET_CAPTION].data = STR_A009_AIRCRAFT; w->widget[GRP_WIDGET_REPLACE_PROTECTION].data = SPR_GROUP_REPLACE_OFF_AIRCRAFT; break; - default: NOT_REACHED(); break; + default: NOT_REACHED(); } } else { const Group *g = GetGroup(gv->group_sel); @@ -423,7 +423,7 @@ static void GroupWndProc(Window *w, WindowEvent *e) w->widget[GRP_WIDGET_CAPTION].data = STR_GROUP_AIRCRAFTS_CAPTION; w->widget[GRP_WIDGET_REPLACE_PROTECTION].data = (g->replace_protection) ? SPR_GROUP_REPLACE_ON_AIRCRAFT : SPR_GROUP_REPLACE_OFF_AIRCRAFT; break; - default: NOT_REACHED(); break; + default: NOT_REACHED(); } } @@ -453,7 +453,7 @@ static void GroupWndProc(Window *w, WindowEvent *e) str_all_veh = STR_GROUP_ALL_AIRCRAFTS; str_no_group_veh = STR_GROUP_DEFAULT_AIRCRAFTS; break; - default: NOT_REACHED(); break; + default: NOT_REACHED(); } DrawString(10, y1, str_all_veh, IsAllGroupID(gv->group_sel) ? TC_WHITE : TC_BLACK); @@ -600,7 +600,7 @@ static void GroupWndProc(Window *w, WindowEvent *e) SetDParam(0, g->index); ShowQueryString(STR_GROUP_NAME, STR_GROUP_RENAME_CAPTION, 31, 150, w, CS_ALPHANUMERAL); - } break; + } break; case GRP_WIDGET_AVAILABLE_VEHICLES: diff --git a/src/intro_gui.cpp b/src/intro_gui.cpp index bab71acf22..e141b3f578 100644 --- a/src/intro_gui.cpp +++ b/src/intro_gui.cpp @@ -106,7 +106,7 @@ static void SelectGameWndProc(Window *w, WindowEvent *e) } break; - case SGI_TEMPERATE_LANDSCAPE: case SGI_ARCTIC_LANDSCAPE: + case SGI_TEMPERATE_LANDSCAPE: case SGI_ARCTIC_LANDSCAPE: case SGI_TROPIC_LANDSCAPE: case SGI_TOYLAND_LANDSCAPE: w->RaiseWidget(_opt_newgame.landscape + SGI_TEMPERATE_LANDSCAPE); SetNewLandscapeType(e->we.click.widget - SGI_TEMPERATE_LANDSCAPE); diff --git a/src/network/network_udp.cpp b/src/network/network_udp.cpp index 2afe4e019b..9593fe38a8 100644 --- a/src/network/network_udp.cpp +++ b/src/network/network_udp.cpp @@ -293,7 +293,7 @@ DEF_UDP_RECEIVE_COMMAND(Client, PACKET_UDP_SERVER_RESPONSE) for (c = item->info.grfconfig; c != NULL; c = c->next) { if (c->status == GCS_NOT_FOUND) item->info.compatible = false; - if (c->status != GCS_NOT_FOUND || strcmp(c->name, UNKNOWN_GRF_NAME_PLACEHOLDER) != 0) continue; + if (c->status != GCS_NOT_FOUND || strcmp(c->name, UNKNOWN_GRF_NAME_PLACEHOLDER) != 0) continue; in_request[in_request_count] = c; in_request_count++; } diff --git a/src/newgrf_industries.cpp b/src/newgrf_industries.cpp index d77cfb8a60..8aa65e4536 100644 --- a/src/newgrf_industries.cpp +++ b/src/newgrf_industries.cpp @@ -287,7 +287,7 @@ uint32 IndustryGetVariable(const ResolverObject *object, byte variable, byte par /* Distance of nearest industry of given type */ case 0x64: return GetClosestIndustry(tile, MapNewGRFIndustryType(parameter, indspec->grf_prop.grffile->grfid), industry); /* Get town zone and Manhattan distance of closest town */ - case 0x65: return GetTownRadiusGroup(industry->town, tile) << 16 | min(DistanceManhattan(tile, industry->town->xy), 0xFFFF); + case 0x65: return GetTownRadiusGroup(industry->town, tile) << 16 | min(DistanceManhattan(tile, industry->town->xy), 0xFFFF); /* Get square of Euclidian distance of closes town */ case 0x66: return GetTownRadiusGroup(industry->town, tile) << 16 | min(DistanceSquare(tile, industry->town->xy), 0xFFFF); diff --git a/src/news_gui.cpp b/src/news_gui.cpp index 248496585a..2d0ccf52c5 100644 --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -402,20 +402,20 @@ static WindowDesc _news_type0_desc = { }; static const SoundFx _news_sounds[NT_END] = { - SND_1D_APPLAUSE, ///< NT_ARRIVAL_PLAYER - SND_1D_APPLAUSE, ///< NT_ARRIVAL_OTHER - SND_BEGIN, ///< NT_ACCIDENT - SND_BEGIN, ///< NT_COMPANY_INFO - SND_BEGIN, ///< NT_OPENCLOSE - SND_BEGIN, ///< NT_ECONOMY - SND_BEGIN, ///< NT_INDUSTRY_PLAYER - SND_BEGIN, ///< NT_INDUSTRY_OTHER - SND_BEGIN, ///< NT_INDUSTRY_NOBODY - SND_BEGIN, ///< NT_ADVICE - SND_1E_OOOOH, ///< NT_NEW_VEHICLES - SND_BEGIN, ///< NT_ACCEPTANCE - SND_BEGIN, ///< NT_SUBSIDIES - SND_BEGIN, ///< NT_GENERAL + SND_1D_APPLAUSE, ///< NT_ARRIVAL_PLAYER + SND_1D_APPLAUSE, ///< NT_ARRIVAL_OTHER + SND_BEGIN, ///< NT_ACCIDENT + SND_BEGIN, ///< NT_COMPANY_INFO + SND_BEGIN, ///< NT_OPENCLOSE + SND_BEGIN, ///< NT_ECONOMY + SND_BEGIN, ///< NT_INDUSTRY_PLAYER + SND_BEGIN, ///< NT_INDUSTRY_OTHER + SND_BEGIN, ///< NT_INDUSTRY_NOBODY + SND_BEGIN, ///< NT_ADVICE + SND_1E_OOOOH, ///< NT_NEW_VEHICLES + SND_BEGIN, ///< NT_ACCEPTANCE + SND_BEGIN, ///< NT_SUBSIDIES + SND_BEGIN, ///< NT_GENERAL }; const char *_news_display_name[NT_END] = { diff --git a/src/signal.cpp b/src/signal.cpp index 544ebc5d29..03747eefee 100644 --- a/src/signal.cpp +++ b/src/signal.cpp @@ -422,11 +422,11 @@ static void UpdateSignalsAroundSegment(SigFlags flags) /* train in the segment */ newstate = SIGNAL_STATE_RED; } else { - /* is it a bidir combo? - then do not count its other signal direction as exit */ + /* is it a bidir combo? - then do not count its other signal direction as exit */ if (sig == SIGTYPE_COMBO && HasSignalOnTrackdir(tile, ReverseTrackdir(trackdir))) { /* at least one more exit */ if (flags & SF_EXIT2 && - /* no green exit */ + /* no green exit */ (!(flags & SF_GREEN) || /* only one green exit, and it is this one - so all other exits are red */ (!(flags & SF_GREEN2) && GetSignalStateByTrackdir(tile, ReverseTrackdir(trackdir)) == SIGNAL_STATE_GREEN))) { @@ -507,7 +507,7 @@ static bool UpdateSignalsInBuffer(Owner owner) case MP_STATION: case MP_ROAD: if ((TrackStatusToTrackBits(GetTileTrackStatus(tile, TRANSPORT_RAIL, 0)) & _enterdir_to_trackbits[dir]) != TRACK_BIT_NONE) { - /* only add to set when there is some 'interesting' track */ + /* only add to set when there is some 'interesting' track */ _tbdset.Add(tile, dir); _tbdset.Add(tile + TileOffsByDiagDir(dir), ReverseDiagDir(dir)); break; diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 78a59c48d2..19b83d99b2 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -435,13 +435,13 @@ static void ShowRejectOrAcceptNews(const Station *st, uint num_items, CargoID *c } /** -* Get a list of the cargo types being produced around the tile (in a rectangle). -* @param produced: Destination array of produced cargo -* @param tile: Center of the search area -* @param w: Width of the center -* @param h: Height of the center -* @param rad: Radius of the search area -*/ + * Get a list of the cargo types being produced around the tile (in a rectangle). + * @param produced: Destination array of produced cargo + * @param tile: Center of the search area + * @param w: Width of the center + * @param h: Height of the center + * @param rad: Radius of the search area + */ void GetProductionAroundTiles(AcceptedCargo produced, TileIndex tile, int w, int h, int rad) { @@ -484,13 +484,13 @@ void GetProductionAroundTiles(AcceptedCargo produced, TileIndex tile, } /** -* Get a list of the cargo types that are accepted around the tile. -* @param accepts: Destination array of accepted cargo -* @param tile: Center of the search area -* @param w: Width of the center -* @param h: Height of the center -* @param rad: Radius of the rectangular search area -*/ + * Get a list of the cargo types that are accepted around the tile. + * @param accepts: Destination array of accepted cargo + * @param tile: Center of the search area + * @param w: Width of the center + * @param h: Height of the center + * @param rad: Radius of the rectangular search area + */ void GetAcceptanceAroundTiles(AcceptedCargo accepts, TileIndex tile, int w, int h, int rad) { @@ -1188,7 +1188,7 @@ CommandCost CmdRemoveFromRailroadStation(TileIndex tile, uint32 flags, uint32 p1 /* Do not allow removing from stations if non-uniform stations are not enabled * The check must be here to give correct error message - */ + */ if (!_patches.nonuniform_stations) return_cmd_error(STR_NONUNIFORM_STATIONS_DISALLOWED); /* If we reached here, the tile is valid so increase the quantity of tiles we will remove */ @@ -2770,10 +2770,10 @@ StationSet FindStationsAroundIndustryTile(TileIndex tile, int w, int h) uint MoveGoodsToStation(TileIndex tile, int w, int h, CargoID type, uint amount) { - Station *st1 = NULL; // Station with best rating - Station *st2 = NULL; // Second best station - uint best_rating1 = 0; // rating of st1 - uint best_rating2 = 0; // rating of st2 + Station *st1 = NULL; // Station with best rating + Station *st2 = NULL; // Second best station + uint best_rating1 = 0; // rating of st1 + uint best_rating2 = 0; // rating of st2 StationSet all_stations = FindStationsAroundIndustryTile(tile, w, h); for (StationSet::iterator st_iter = all_stations.begin(); st_iter != all_stations.end(); ++st_iter) { diff --git a/src/timetable_cmd.cpp b/src/timetable_cmd.cpp index 62f91d0518..4d463fb605 100644 --- a/src/timetable_cmd.cpp +++ b/src/timetable_cmd.cpp @@ -160,15 +160,15 @@ void UpdateVehicleTimetable(Vehicle *v, bool travelling) if (!_patches.timetabling) return; /* Make sure the timetable only starts when the vehicle reaches the first - * order, not when travelling from the depot to the first station. */ - if (v->cur_order_index == 0 && !HasBit(v->vehicle_flags, VF_TIMETABLE_STARTED)) { - SetBit(v->vehicle_flags, VF_TIMETABLE_STARTED); - return; - } + * order, not when travelling from the depot to the first station. */ + if (v->cur_order_index == 0 && !HasBit(v->vehicle_flags, VF_TIMETABLE_STARTED)) { + SetBit(v->vehicle_flags, VF_TIMETABLE_STARTED); + return; + } if (!HasBit(v->vehicle_flags, VF_TIMETABLE_STARTED)) return; - if (HasBit(v->vehicle_flags, VF_AUTOFILL_TIMETABLE)) { + if (HasBit(v->vehicle_flags, VF_AUTOFILL_TIMETABLE)) { if (timetabled == 0) { /* Round the time taken up to the nearest day, as this will avoid * confusion for people who are timetabling in days, and can be @@ -182,7 +182,7 @@ void UpdateVehicleTimetable(Vehicle *v, bool travelling) * assume that autofill is finished and turn it off again. */ ClrBit(v->vehicle_flags, VF_AUTOFILL_TIMETABLE); } - } + } /* Vehicles will wait at stations if they arrive early even if they are not * timetabled to wait there, so make sure the lateness counter is updated diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index 466c834ddb..66cc9e945d 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -1064,7 +1064,7 @@ static void GrowTownInTile(TileIndex *tile_ptr, RoadBits cur_rb, DiagDirection t case TL_3X3_GRID: case TL_2X2_GRID: - rcmd = GetTownRoadGridElement(t1, tile, target_dir); + rcmd = GetTownRoadGridElement(t1, tile, target_dir); break; case TL_BETTER_ROADS: diff --git a/src/vehicle.cpp b/src/vehicle.cpp index dc7348840a..76491b627c 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -2074,7 +2074,7 @@ uint GenerateVehicleSortList(const Vehicle ***sort_list, uint16 *length_of_array break; } - case VLW_GROUP_LIST: + case VLW_GROUP_LIST: FOR_ALL_VEHICLES(v) { if (v->type == type && v->IsPrimaryVehicle() && v->owner == owner && v->group_id == index) { diff --git a/src/waypoint.cpp b/src/waypoint.cpp index b534665598..781c67339d 100644 --- a/src/waypoint.cpp +++ b/src/waypoint.cpp @@ -100,7 +100,7 @@ static void MakeDefaultWaypointName(Waypoint* wp) Waypoint *lwp = GetWaypoint(cid); /* check only valid waypoints... */ - if (lwp->IsValid() && wp != lwp) { + if (lwp->IsValid() && wp != lwp) { /* only waypoints with 'generic' name within the same city */ if (lwp->name == NULL && lwp->town_index == wp->town_index) { /* if lwp->town_cn < next, uint will overflow to '+inf' */ diff --git a/src/win32.cpp b/src/win32.cpp index 3aad604343..741823877e 100644 --- a/src/win32.cpp +++ b/src/win32.cpp @@ -1021,7 +1021,7 @@ void GetCurrentDirectoryW(int length, wchar_t *path) char *getcwd(char *buf, size_t size) { #if defined(WINCE) - TCHAR path[MAX_PATH]; + TCHAR path[MAX_PATH]; GetModuleFileName(NULL, path, MAX_PATH); convert_from_fs(path, buf, size); /* GetModuleFileName returns dir with file, so remove everything behind latest '\\' */