summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-08-01 18:53:30 +0000
committerrubidium <rubidium@openttd.org>2010-08-01 18:53:30 +0000
commite356cb94050797cccbf05b3a411105528da8ee90 (patch)
tree3d98354dc5983a03e685f116b1b5c5b73607de0f /src
parent605f6d0ed3c81a77d533f3db40ed50350d57536c (diff)
downloadopenttd-e356cb94050797cccbf05b3a411105528da8ee90.tar.xz
(svn r20281) -Codechange: unify case scope closure + break coding style
Diffstat (limited to 'src')
-rw-r--r--src/ai/api/ai_abstractlist.cpp6
-rw-r--r--src/ai/api/ai_engine.cpp2
-rw-r--r--src/ai/api/ai_event_types.cpp2
-rw-r--r--src/airport_gui.cpp9
-rw-r--r--src/articulated_vehicles.cpp6
-rw-r--r--src/autoreplace_gui.cpp9
-rw-r--r--src/blitter/8bpp_optimized.cpp6
-rw-r--r--src/bridge_gui.cpp3
-rw-r--r--src/build_vehicle_gui.cpp3
-rw-r--r--src/cheat_gui.cpp9
-rw-r--r--src/company_cmd.cpp6
-rw-r--r--src/company_gui.cpp18
-rw-r--r--src/console_cmds.cpp3
-rw-r--r--src/console_gui.cpp3
-rw-r--r--src/depot_gui.cpp17
-rw-r--r--src/fios_gui.cpp9
-rw-r--r--src/genworld_gui.cpp6
-rw-r--r--src/graph_gui.cpp3
-rw-r--r--src/group_gui.cpp3
-rw-r--r--src/industry_cmd.cpp6
-rw-r--r--src/industry_gui.cpp21
-rw-r--r--src/landscape.cpp9
-rw-r--r--src/main_gui.cpp3
-rw-r--r--src/misc_gui.cpp6
-rw-r--r--src/music_gui.cpp39
-rw-r--r--src/network/network.cpp3
-rw-r--r--src/network/network_chat_gui.cpp3
-rw-r--r--src/network/network_client.cpp3
-rw-r--r--src/network/network_content_gui.cpp3
-rw-r--r--src/network/network_gui.cpp18
-rw-r--r--src/newgrf.cpp144
-rw-r--r--src/newgrf_debug_gui.cpp9
-rw-r--r--src/newgrf_engine.cpp12
-rw-r--r--src/newgrf_gui.cpp3
-rw-r--r--src/newgrf_text.cpp3
-rw-r--r--src/openttd.cpp3
-rw-r--r--src/order_cmd.cpp15
-rw-r--r--src/order_gui.cpp18
-rw-r--r--src/pathfinder/npf/npf.cpp3
-rw-r--r--src/pathfinder/yapf/yapf_road.cpp3
-rw-r--r--src/rail_cmd.cpp3
-rw-r--r--src/rail_gui.cpp3
-rw-r--r--src/road.cpp3
-rw-r--r--src/road_cmd.cpp30
-rw-r--r--src/road_gui.cpp6
-rw-r--r--src/saveload/afterload.cpp3
-rw-r--r--src/saveload/oldloader_sl.cpp3
-rw-r--r--src/settings.cpp6
-rw-r--r--src/settings_gui.cpp9
-rw-r--r--src/signs_gui.cpp3
-rw-r--r--src/smallmap_gui.cpp6
-rw-r--r--src/statusbar_gui.cpp6
-rw-r--r--src/strings.cpp6
-rw-r--r--src/terraform_gui.cpp3
-rw-r--r--src/timetable_gui.cpp18
-rw-r--r--src/toolbar_gui.cpp3
-rw-r--r--src/town_gui.cpp3
-rw-r--r--src/tree_cmd.cpp3
-rw-r--r--src/tunnelbridge_cmd.cpp15
-rw-r--r--src/vehicle_cmd.cpp3
-rw-r--r--src/vehicle_gui.cpp33
-rw-r--r--src/video/win32_v.cpp3
-rw-r--r--src/viewport.cpp6
-rw-r--r--src/viewport_gui.cpp6
-rw-r--r--src/water_cmd.cpp6
-rw-r--r--src/window.cpp3
66 files changed, 427 insertions, 215 deletions
diff --git a/src/ai/api/ai_abstractlist.cpp b/src/ai/api/ai_abstractlist.cpp
index ec2b7d4f5..e51713465 100644
--- a/src/ai/api/ai_abstractlist.cpp
+++ b/src/ai/api/ai_abstractlist.cpp
@@ -808,13 +808,15 @@ SQInteger AIAbstractList::Valuate(HSQUIRRELVM vm)
switch (sq_gettype(vm, -1)) {
case OT_INTEGER: {
sq_getinteger(vm, -1, &value);
- } break;
+ break;
+ }
case OT_BOOL: {
SQBool v;
sq_getbool(vm, -1, &v);
value = v ? 1 : 0;
- } break;
+ break;
+ }
default: {
/* See below for explanation. The extra pop is the return value. */
diff --git a/src/ai/api/ai_engine.cpp b/src/ai/api/ai_engine.cpp
index c235255ba..7710360e8 100644
--- a/src/ai/api/ai_engine.cpp
+++ b/src/ai/api/ai_engine.cpp
@@ -95,7 +95,7 @@
return capacities[c];
}
return -1;
- } break;
+ }
case VEH_SHIP:
case VEH_AIRCRAFT:
diff --git a/src/ai/api/ai_event_types.cpp b/src/ai/api/ai_event_types.cpp
index d1e962c4c..b61e07605 100644
--- a/src/ai/api/ai_event_types.cpp
+++ b/src/ai/api/ai_event_types.cpp
@@ -56,7 +56,7 @@ int32 AIEventEnginePreview::GetCapacity()
return capacities[c];
}
return -1;
- } break;
+ }
case VEH_SHIP:
case VEH_AIRCRAFT:
diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp
index 01f421753..772499a4a 100644
--- a/src/airport_gui.cpp
+++ b/src/airport_gui.cpp
@@ -257,7 +257,8 @@ public:
d.width += padding.width;
d.height += padding.height;
*size = maxdim(*size, d);
- } break;
+ break;
+ }
case BAIRW_AIRPORT_LIST: {
for (int i = 0; i < NUM_AIRPORTS; i++) {
@@ -269,7 +270,8 @@ public:
this->line_height = FONT_HEIGHT_NORMAL + WD_MATRIX_TOP + WD_MATRIX_BOTTOM;
size->height = this->vscroll.GetCapacity() * this->line_height;
- } break;
+ break;
+ }
default: break;
}
@@ -356,7 +358,8 @@ public:
if (num_clicked >= this->vscroll.GetCount()) break;
const AirportSpec *as = GetAirportSpecFromClass(_selected_airport_class, num_clicked);
if (as->IsAvailable()) this->SelectOtherAirport(num_clicked);
- } break;
+ break;
+ }
case BAIRW_BTN_DONTHILIGHT: case BAIRW_BTN_DOHILIGHT:
_settings_client.gui.station_show_coverage = (widget != BAIRW_BTN_DONTHILIGHT);
diff --git a/src/articulated_vehicles.cpp b/src/articulated_vehicles.cpp
index 47c4f06cf..40581143a 100644
--- a/src/articulated_vehicles.cpp
+++ b/src/articulated_vehicles.cpp
@@ -340,7 +340,8 @@ void AddArticulatedParts(Vehicle *first)
}
t->SetArticulatedPart();
- } break;
+ break;
+ }
case VEH_ROAD: {
RoadVehicle *front = RoadVehicle::From(first);
@@ -366,7 +367,8 @@ void AddArticulatedParts(Vehicle *first)
}
rv->SetArticulatedPart();
- } break;
+ break;
+ }
}
/* get common values from first engine */
diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp
index 963721beb..36612de78 100644
--- a/src/autoreplace_gui.cpp
+++ b/src/autoreplace_gui.cpp
@@ -288,7 +288,8 @@ public:
d.width += padding.width;
d.height += padding.height;
*size = maxdim(*size, d);
- } break;
+ break;
+ }
}
}
@@ -433,13 +434,15 @@ public:
EngineID veh_to = this->sel_engine[1];
DoCommandP(0, this->sel_group << 16, veh_from + (veh_to << 16), CMD_SET_AUTOREPLACE);
this->SetDirty();
- } break;
+ break;
+ }
case RVW_WIDGET_STOP_REPLACE: { // Stop replacing
EngineID veh_from = this->sel_engine[0];
DoCommandP(0, this->sel_group << 16, veh_from + (INVALID_ENGINE << 16), CMD_SET_AUTOREPLACE);
this->SetDirty();
- } break;
+ break;
+ }
case RVW_WIDGET_LEFT_MATRIX:
case RVW_WIDGET_RIGHT_MATRIX: {
diff --git a/src/blitter/8bpp_optimized.cpp b/src/blitter/8bpp_optimized.cpp
index 4cc86673a..dcd616add 100644
--- a/src/blitter/8bpp_optimized.cpp
+++ b/src/blitter/8bpp_optimized.cpp
@@ -88,7 +88,8 @@ void Blitter_8bppOptimized::Draw(Blitter::BlitterParams *bp, BlitterMode mode, Z
if (m != 0) *dst = m;
dst++; src++;
} while (--pixels != 0);
- } break;
+ break;
+ }
case BM_TRANSPARENT: {
const uint8 *remap = bp->remap;
@@ -97,7 +98,8 @@ void Blitter_8bppOptimized::Draw(Blitter::BlitterParams *bp, BlitterMode mode, Z
*dst = remap[*dst];
dst++;
} while (--pixels != 0);
- } break;
+ break;
+ }
default:
memcpy(dst, src, pixels);
diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp
index 5f3e07aab..89703005e 100644
--- a/src/bridge_gui.cpp
+++ b/src/bridge_gui.cpp
@@ -254,7 +254,8 @@ public:
this->BuildBridge(i);
delete this;
}
- } break;
+ break;
+ }
case BBSW_DROPDOWN_ORDER:
this->bridges->ToggleSortOrder();
diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp
index cfeec04e2..0802cc088 100644
--- a/src/build_vehicle_gui.cpp
+++ b/src/build_vehicle_gui.cpp
@@ -1072,7 +1072,8 @@ struct BuildVehicleWindow : Window {
SetBit(hidden_mask, 9);
}
ShowDropDownMenu(this, _sort_listing[this->vehicle_type], this->sort_criteria, BUILD_VEHICLE_WIDGET_SORT_DROPDOWN, 0, hidden_mask);
- } break;
+ break;
+ }
case BUILD_VEHICLE_WIDGET_CARGO_FILTER_DROPDOWN: // Select cargo filtering criteria dropdown menu
ShowDropDownMenu(this, this->cargo_filter_texts, this->cargo_filter_criteria, BUILD_VEHICLE_WIDGET_CARGO_FILTER_DROPDOWN, 0, 0);
diff --git a/src/cheat_gui.cpp b/src/cheat_gui.cpp
index bfe57759c..94b9e64a3 100644
--- a/src/cheat_gui.cpp
+++ b/src/cheat_gui.cpp
@@ -179,7 +179,8 @@ struct CheatWindow : Window {
DrawFrameRect(button_left, y + 1, button_left + 20 - 1, y + FONT_HEIGHT_NORMAL - 1, on ? COLOUR_GREEN : COLOUR_RED, on ? FR_LOWERED : FR_NONE);
SetDParam(0, on ? STR_CONFIG_SETTING_ON : STR_CONFIG_SETTING_OFF);
- } break;
+ break;
+ }
default: {
int32 val = (int32)ReadValue(ce->variable, ce->type);
@@ -198,7 +199,8 @@ struct CheatWindow : Window {
GetString(buf, STR_CHEAT_CHANGE_COMPANY, lastof(buf));
uint offset = 10 + GetStringBoundingBox(buf).width;
DrawCompanyIcon(_local_company, rtl ? text_right - offset - 10 : text_left + offset, y + 2);
- } break;
+ break;
+ }
/* Set correct string for switch climate cheat */
case STR_CHEAT_SWITCH_CLIMATE: val += STR_CHEAT_SWITCH_CLIMATE_TEMPERATE_LANDSCAPE;
@@ -206,7 +208,8 @@ struct CheatWindow : Window {
default: SetDParam(0, val);
}
- } break;
+ break;
+ }
}
DrawString(text_left, text_right, y + 1, ce->str);
diff --git a/src/company_cmd.cpp b/src/company_cmd.cpp
index a7578be1d..76fab7cc2 100644
--- a/src/company_cmd.cpp
+++ b/src/company_cmd.cpp
@@ -826,7 +826,8 @@ CommandCost CmdCompanyCtrl(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
}
}
#endif /* ENABLE_NETWORK */
- } break;
+ break;
+ }
case 1: // Make a new AI company
if (!(flags & DC_EXEC)) return CommandCost();
@@ -859,7 +860,8 @@ CommandCost CmdCompanyCtrl(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
CompanyID c_index = c->index;
delete c;
AI::BroadcastNewEvent(new AIEventCompanyBankrupt(c_index));
- } break;
+ break;
+ }
default: return CMD_ERROR;
}
diff --git a/src/company_gui.cpp b/src/company_gui.cpp
index bbaff4ec3..b9705584b 100644
--- a/src/company_gui.cpp
+++ b/src/company_gui.cpp
@@ -645,7 +645,8 @@ public:
for (const StringID *id = _colour_dropdown; id != endof(_colour_dropdown); id++) {
size->width = max(size->width, GetStringBoundingBox(*id).width + 34);
}
- } break;
+ break;
+ }
}
}
@@ -1814,7 +1815,8 @@ struct CompanyWindow : Window
size->width = max(size->width, GetStringBoundingBox(STR_COMPANY_VIEW_SHARES_OWNED_BY).width);
}
- } break;
+ break;
+ }
#ifdef ENABLE_NETWORK
case CW_WIDGET_HAS_PASSWORD:
@@ -1868,7 +1870,8 @@ struct CompanyWindow : Window
}
}
}
- } break;
+ break;
+ }
case CW_WIDGET_DESC_OWNERS: {
const Company *c2;
@@ -1884,7 +1887,8 @@ struct CompanyWindow : Window
y += FONT_HEIGHT_NORMAL;
}
}
- } break;
+ break;
+ }
#ifdef ENABLE_NETWORK
case CW_WIDGET_HAS_PASSWORD:
@@ -2102,14 +2106,16 @@ struct BuyCompanyWindow : Window {
case BCW_FACE: {
const Company *c = Company::Get((CompanyID)this->window_number);
DrawCompanyManagerFace(c->face, c->colour, r.left, r.top);
- } break;
+ break;
+ }
case BCW_QUESTION: {
const Company *c = Company::Get((CompanyID)this->window_number);
SetDParam(0, c->index);
SetDParam(1, c->bankrupt_value);
DrawStringMultiLine(r.left, r.right, r.top, r.bottom, STR_BUY_COMPANY_MESSAGE, TC_FROMSTRING, SA_CENTER);
- } break;
+ break;
+ }
}
}
diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp
index a2bec2870..c0cfcdf0b 100644
--- a/src/console_cmds.cpp
+++ b/src/console_cmds.cpp
@@ -300,7 +300,8 @@ DEF_CONSOLE_CMD(ConLoad)
strecpy(_file_to_saveload.name, FiosBrowseTo(item), lastof(_file_to_saveload.name));
strecpy(_file_to_saveload.title, item->title, lastof(_file_to_saveload.title));
- } break;
+ break;
+ }
default: IConsolePrintF(CC_ERROR, "%s: Not a savegame.", file);
}
} else {
diff --git a/src/console_gui.cpp b/src/console_gui.cpp
index 03fe19931..d69610b26 100644
--- a/src/console_gui.cpp
+++ b/src/console_gui.cpp
@@ -290,7 +290,8 @@ struct IConsoleWindow : Window
IConsoleClearCommand();
if (cmd != NULL) IConsoleCmdExec(cmd);
- } break;
+ break;
+ }
case WKC_CTRL | WKC_RETURN:
_iconsole_mode = (_iconsole_mode == ICONSOLE_FULL) ? ICONSOLE_OPENED : ICONSOLE_FULL;
diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp
index e29396987..dc75c2941 100644
--- a/src/depot_gui.cpp
+++ b/src/depot_gui.cpp
@@ -281,7 +281,8 @@ struct DepotWindow : Window {
DrawAircraftImage(v, image_left, image_right,
y + max(spr->height + spr->y_offs - 14, 0), // tall sprites needs an y offset
this->sel);
- } break;
+ break;
+ }
default: NOT_REACHED();
}
@@ -506,7 +507,8 @@ struct DepotWindow : Window {
}
_cursor.vehchain = _ctrl_pressed;
}
- } break;
+ break;
+ }
case MODE_SHOW_VEHICLE: // show info window
ShowVehicleViewWindow(v);
@@ -654,7 +656,8 @@ struct DepotWindow : Window {
}
fill->width = resize->width;
fill->height = resize->height;
- } break;
+ break;
+ }
}
}
@@ -736,7 +739,7 @@ struct DepotWindow : Window {
} else {
ResetObjectToPlace();
}
- break;
+ break;
case DEPOT_WIDGET_LOCATION:
if (_ctrl_pressed) {
@@ -948,7 +951,8 @@ struct DepotWindow : Window {
} else if (this->GetVehicleFromDepotWndPt(pt.x - nwi->pos_x, pt.y - nwi->pos_y, &v, NULL) == MODE_DRAG_VEHICLE && v != NULL && sel == v->index) {
ShowVehicleViewWindow(v);
}
- } break;
+ break;
+ }
case DEPOT_WIDGET_SELL: case DEPOT_WIDGET_SELL_CHAIN: {
if (this->IsWidgetDisabled(widget)) return;
@@ -970,7 +974,8 @@ struct DepotWindow : Window {
}
if (!DoCommandP(v->tile, v->index, sell_cmd, GetCmdSellVeh(v->type)) && is_engine) _backup_orders_tile = 0;
- } break;
+ break;
+ }
default:
this->sel = INVALID_VEHICLE;
diff --git a/src/fios_gui.cpp b/src/fios_gui.cpp
index 7cf6bb3d4..d94398027 100644
--- a/src/fios_gui.cpp
+++ b/src/fios_gui.cpp
@@ -346,7 +346,8 @@ public:
if (str != STR_ERROR_UNABLE_TO_READ_DRIVE) SetDParam(0, tot);
DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + FONT_HEIGHT_NORMAL + WD_FRAMERECT_TOP, str);
DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, path, TC_BLACK);
- } break;
+ break;
+ }
case SLWW_DRIVES_DIRECTORIES_LIST: {
GfxFillRect(r.left + 1, r.top + 1, r.right, r.bottom, 0xD7);
@@ -362,7 +363,8 @@ public:
y += this->resize.step_height;
if (y >= this->vscroll.GetCapacity() * this->resize.step_height + r.top + WD_FRAMERECT_TOP) break;
}
- } break;
+ break;
+ }
case SLWW_DETAILS: {
GfxFillRect(r.left + WD_FRAMERECT_LEFT, r.top + WD_FRAMERECT_TOP,
@@ -455,7 +457,8 @@ public:
}
}
}
- } break;
+ break;
+ }
}
}
diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp
index 5c67e7ab0..53239433b 100644
--- a/src/genworld_gui.cpp
+++ b/src/genworld_gui.cpp
@@ -515,7 +515,8 @@ struct GenerateLandscapeWindow : public QueryStringBaseWindow {
* outer most boundaries (left and right) as draw locations. */
const NWidgetBase *nwi_spacer = this->GetWidget<NWidgetBase>(GLAND_HEIGHTMAP_NAME_SPACER);
DrawString(min(r.left, nwi_spacer->pos_x), max<int>(r.right, nwi_spacer->pos_x + nwi_spacer->current_x), r.top, this->name, TC_ORANGE);
- } break;
+ break;
+ }
}
}
@@ -1199,7 +1200,8 @@ struct GenerateProgressWindow : public Window {
/* We need some spacing for the 'border' */
size->height += 8;
size->width += 8;
- } break;
+ break;
+ }
case GPWW_PROGRESS_TEXT:
for (uint i = 0; i < GWP_CLASS_COUNT; i++) {
diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp
index f95db2ec8..48305a030 100644
--- a/src/graph_gui.cpp
+++ b/src/graph_gui.cpp
@@ -1002,7 +1002,8 @@ struct PaymentRatesGraphWindow : BaseGraphWindow {
}
this->UpdateLoweredWidgets();
this->SetDirty();
- } break;
+ break;
+ }
default:
if (widget >= CPW_CARGO_FIRST) {
diff --git a/src/group_gui.cpp b/src/group_gui.cpp
index ccda6309d..79d1a4546 100644
--- a/src/group_gui.cpp
+++ b/src/group_gui.cpp
@@ -239,7 +239,8 @@ public:
d.height += padding.height;
d.width += padding.width;
*size = maxdim(*size, d);
- } break;
+ break;
+ }
}
}
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp
index c3bb22baa..08f91d3c3 100644
--- a/src/industry_cmd.cpp
+++ b/src/industry_cmd.cpp
@@ -691,7 +691,8 @@ static void AnimateTile_Industry(TileIndex tile)
SetIndustryAnimationState(tile, m);
MarkTileDirtyByTile(tile);
}
- } break;
+ break;
+ }
}
}
@@ -745,7 +746,8 @@ static void MakeIndustryTileBigger(TileIndex tile)
GetIndustryIndex(tile) == GetIndustryIndex(other)) {
BuildOilRig(tile);
}
- } break;
+ break;
+ }
case GFX_TOY_FACTORY:
case GFX_BUBBLE_CATCHER:
diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp
index 51bc3001b..2e384ed84 100644
--- a/src/industry_gui.cpp
+++ b/src/industry_gui.cpp
@@ -329,7 +329,8 @@ public:
/* Set it to something more sane :) */
size->height = height * FONT_HEIGHT_NORMAL + WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM;
size->width = d.width + WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT;
- } break;
+ break;
+ }
case DPIW_FUND_WIDGET: {
Dimension d = GetStringBoundingBox(STR_FUND_INDUSTRY_BUILD_NEW_INDUSTRY);
@@ -445,7 +446,8 @@ public:
}
}
}
- } break;
+ break;
+ }
}
}
@@ -478,7 +480,8 @@ public:
this->SetWidgetsDisabledState(!this->enabled[this->selected_index], DPIW_DISPLAY_WIDGET, DPIW_FUND_WIDGET, WIDGET_LIST_END);
if (this->enabled[this->selected_index] && click_count > 1) this->OnClick(pt, DPIW_FUND_WIDGET, 1);
}
- } break;
+ break;
+ }
case DPIW_DISPLAY_WIDGET:
if (this->selected_type != INVALID_INDUSTRYTYPE) ShowIndustryCargoesWindow(this->selected_type);
@@ -502,7 +505,8 @@ public:
} else {
HandlePlacePushButton(this, DPIW_FUND_WIDGET, SPR_CURSOR_INDUSTRY, HT_RECT, NULL);
}
- } break;
+ break;
+ }
}
}
@@ -803,7 +807,8 @@ public:
ShowQueryString(STR_JUST_INT, STR_CONFIG_GAME_PRODUCTION, 10, 100, this, CS_ALPHANUMERAL, QSF_NONE);
}
}
- } break;
+ break;
+ }
case IVW_GOTO: {
Industry *i = Industry::Get(this->window_number);
@@ -1138,7 +1143,8 @@ public:
y += this->resize.step_height;
if (++n == this->vscroll.GetCapacity()) break; // max number of industries in 1 window
}
- } break;
+ break;
+ }
}
}
@@ -1200,7 +1206,8 @@ public:
ScrollMainWindowToTile(this->industries[p]->location.tile);
}
}
- } break;
+ break;
+ }
}
}
diff --git a/src/landscape.cpp b/src/landscape.cpp
index 77cfbe516..bf200f0b3 100644
--- a/src/landscape.cpp
+++ b/src/landscape.cpp
@@ -901,7 +901,8 @@ void GenerateLandscape(byte mode)
for (uint i = ScaleByMapSize(GB(r, 9, 7) + 450); i != 0; --i) {
GenerateTerrain(4, flag);
}
- } break;
+ break;
+ }
case LT_TROPIC: {
uint32 r = Random();
@@ -920,7 +921,8 @@ void GenerateLandscape(byte mode)
for (uint i = ScaleByMapSize(GB(r, 17, 7) + 410); i != 0; --i) {
GenerateTerrain(3, flag);
}
- } break;
+ break;
+ }
default: {
uint32 r = Random();
@@ -929,7 +931,8 @@ void GenerateLandscape(byte mode)
for (; i != 0; --i) {
GenerateTerrain(_settings_game.difficulty.terrain_type, 0);
}
- } break;
+ break;
+ }
}
}
diff --git a/src/main_gui.cpp b/src/main_gui.cpp
index 4bcf82c14..0d1410c95 100644
--- a/src/main_gui.cpp
+++ b/src/main_gui.cpp
@@ -74,7 +74,8 @@ void HandleOnEditText(const char *str)
/* Give 'id' the money, and substract it from ourself */
DoCommandP(0, money_c, _rename_id, CMD_GIVE_MONEY | CMD_MSG(STR_ERROR_INSUFFICIENT_FUNDS), CcGiveMoney, str);
- } break;
+ break;
+ }
#endif /* ENABLE_NETWORK */
default: NOT_REACHED();
}
diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp
index a4b2102c8..a705cd403 100644
--- a/src/misc_gui.cpp
+++ b/src/misc_gui.cpp
@@ -1363,7 +1363,8 @@ struct QueryStringWindow : public QueryStringBaseWindow
case HEBR_EDITING: {
Window *osk = FindWindowById(WC_OSK, 0);
if (osk != NULL && osk->parent == this) osk->InvalidateData();
- } break;
+ break;
+ }
case HEBR_CONFIRM: this->OnOk();
/* FALL THROUGH */
case HEBR_CANCEL: delete this; break; // close window, abandon changes
@@ -1515,7 +1516,8 @@ struct QueryWindow : public Window {
proc(parent, true);
proc = NULL;
}
- } break;
+ break;
+ }
case QUERY_WIDGET_NO:
delete this;
break;
diff --git a/src/music_gui.cpp b/src/music_gui.cpp
index 380ba09ce..e215a121e 100644
--- a/src/music_gui.cpp
+++ b/src/music_gui.cpp
@@ -334,7 +334,8 @@ struct MusicTrackSelectionWindow : public Window {
d.width += padding.width;
d.height += padding.height;
*size = maxdim(*size, d);
- } break;
+ break;
+ }
case MTSW_LIST_LEFT: case MTSW_LIST_RIGHT: {
Dimension d = {0, 0};
@@ -353,7 +354,8 @@ struct MusicTrackSelectionWindow : public Window {
d.width += padding.width;
d.height += padding.height;
*size = maxdim(*size, d);
- } break;
+ break;
+ }
}
}
@@ -374,7 +376,8 @@ struct MusicTrackSelectionWindow : public Window {
DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_PLAYLIST_TRACK_NAME);
y += FONT_HEIGHT_SMALL;
}
- } break;
+ break;
+ }
case MTSW_LIST_RIGHT: {
GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, 0);
@@ -388,7 +391,8 @@ struct MusicTrackSelectionWindow : public Window {
DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_PLAYLIST_TRACK_NAME);
y += FONT_HEIGHT_SMALL;
}
- } break;
+ break;
+ }
}
}
@@ -422,7 +426,8 @@ struct MusicTrackSelectionWindow : public Window {
break;
}
}
- } break;
+ break;
+ }
case MTSW_LIST_RIGHT: { // remove from playlist
int y = this->GetRowFromWidget(pt.y, widget, 0, FONT_HEIGHT_SMALL);
@@ -437,7 +442,8 @@ struct MusicTrackSelectionWindow : public Window {
this->SetDirty();
SelectSongToPlay();
- } break;
+ break;
+ }
case MTSW_CLEAR: // clear
for (uint i = 0; _playlists[msf.playlist][i] != 0; i++) _playlists[msf.playlist][i] = 0;
@@ -549,14 +555,16 @@ struct MusicWindow : public Window {
d.width += padding.width;
d.height += padding.height;
*size = maxdim(*size, d);
- } break;
+ break;
+ }
case MW_TRACK_NR: {
Dimension d = GetStringBoundingBox(STR_MUSIC_TRACK_NONE);
d.width += WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT;
d.height += WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM;
*size = maxdim(*size, d);
- } break;
+ break;
+ }
case MW_TRACK_NAME: {
Dimension d = GetStringBoundingBox(STR_MUSIC_TITLE_NONE);
@@ -567,7 +575,8 @@ struct MusicWindow : public Window {
d.width += WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT;
d.height += WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM;
*size = maxdim(*size, d);
- } break;
+ break;
+ }
/* Hack-ish: set the proper widget data; only needs to be done once
* per (Re)Init as that's the only time the language changes. */
@@ -604,7 +613,8 @@ struct MusicWindow : public Window {
str = STR_MUSIC_TRACK_DIGIT;
}
DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, str);
- } break;
+ break;
+ }
case MW_TRACK_NAME: {
GfxFillRect(r.left, r.top + 1, r.right - 1, r.bottom, 0);
@@ -614,7 +624,8 @@ struct MusicWindow : public Window {
SetDParamStr(0, GetSongName(_music_wnd_cursong - 1));
}
DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, str, TC_FROMSTRING, SA_HOR_CENTER);
- } break;
+ break;
+ }
case MW_MUSIC_VOL: case MW_EFFECT_VOL: {
DrawFrameRect(r.left, r.top + 2, r.right, r.bottom - 2, COLOUR_GREY, FR_LOWERED);
@@ -626,7 +637,8 @@ struct MusicWindow : public Window {
x += r.left;
}
DrawFrameRect(x, r.top, x + slider_width, r.bottom, COLOUR_GREY, FR_NONE);
- } break;
+ break;
+ }
}
}
@@ -680,7 +692,8 @@ struct MusicWindow : public Window {
}
_left_button_clicked = false;
- } break;
+ break;
+ }
case MW_SHUFFLE: // toggle shuffle
msf.shuffle ^= 1;
diff --git a/src/network/network.cpp b/src/network/network.cpp
index 32f4a70e6..a1cb58a9e 100644
--- a/src/network/network.cpp
+++ b/src/network/network.cpp
@@ -389,7 +389,8 @@ void NetworkHandlePauseChange(PauseMode prev_mode, PauseMode changed_mode)
char buffer[DRAW_STRING_BUFFER];
GetString(buffer, str, lastof(buffer));
NetworkTextMessage(NETWORK_ACTION_SERVER_MESSAGE, CC_DEFAULT, false, NULL, buffer);
- } break;
+ break;
+ }
default:
return;
diff --git a/src/network/network_chat_gui.cpp b/src/network/network_chat_gui.cpp
index a81e70c8c..57c4ac6c3 100644
--- a/src/network/network_chat_gui.cpp
+++ b/src/network/network_chat_gui.cpp
@@ -507,7 +507,8 @@ struct NetworkChatWindow : public QueryStringBaseWindow {
case HEBR_EDITING: {
Window *osk = FindWindowById(WC_OSK, 0);
if (osk != NULL && osk->parent == this) osk->InvalidateData();
- } break;
+ break;
+ }
case HEBR_CONFIRM:
SendChat(this->text.buf, this->dtype, this->dest);
/* FALL THROUGH */
diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp
index 4e80354eb..a764a0410 100644
--- a/src/network/network_client.cpp
+++ b/src/network/network_client.cpp
@@ -789,7 +789,8 @@ DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER_CHAT)
GetString(name, str, lastof(name));
ci = NetworkFindClientInfoFromClientID(_network_own_client_id);
- } break;
+ break;
+ }
default: return NETWORK_RECV_STATUS_MALFORMED_PACKET;
}
diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp
index f73de7582..764843abc 100644
--- a/src/network/network_content_gui.cpp
+++ b/src/network/network_content_gui.cpp
@@ -603,7 +603,8 @@ public:
}
this->InvalidateData();
- } break;
+ break;
+ }
case NCLWW_CHECKBOX:
case NCLWW_TYPE:
diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp
index dbf48e091..b26947a2c 100644
--- a/src/network/network_gui.cpp
+++ b/src/network/network_gui.cpp
@@ -540,7 +540,8 @@ public:
this->DrawServerLine(ngl, y, ngl == this->server);
y += this->resize.step_height;
}
- } break;
+ break;
+ }
case NGWW_LASTJOINED:
/* Draw the last joined server, if any */
@@ -696,7 +697,8 @@ public:
/* FIXME the disabling should go into some InvalidateData, which is called instead of the SetDirty */
if (click_count > 1 && !this->IsWidgetDisabled(NGWW_JOIN)) this->OnClick(pt, NGWW_JOIN, 1);
- } break;
+ break;
+ }
case NGWW_LASTJOINED: {
NetworkGameList *last_joined = NetworkGameListAddItem(NetworkAddress(_settings_client.network.last_host, _settings_client.network.last_port));
@@ -716,7 +718,8 @@ public:
/* FIXME the disabling should go into some InvalidateData, which is called instead of the SetDirty */
if (click_count > 1 && !this->IsWidgetDisabled(NGWW_JOIN)) this->OnClick(pt, NGWW_JOIN, 1);
}
- } break;
+ break;
+ }
case NGWW_FIND: // Find server automatically
switch (_settings_client.network.lan_internet) {
@@ -1171,7 +1174,8 @@ struct NetworkStartServerWindow : public QueryStringBaseWindow {
this->map = (y == 0) ? NULL : _fios_items.Get(y - 1);
this->SetDirty();
- } break;
+ break;
+ }
case NSSW_CONNTYPE_BTN: // Connection type
ShowDropDownMenu(this, _connection_types_dropdown, _settings_client.network.server_advertise, NSSW_CONNTYPE_BTN, 0, 0); // do it for widget NSSW_CONNTYPE_BTN
@@ -1227,7 +1231,8 @@ struct NetworkStartServerWindow : public QueryStringBaseWindow {
}
}
ShowDropDownMenu(this, _language_dropdown, sel, NSSW_LANGUAGE_BTN, 0, 0);
- } break;
+ break;
+ }
case NSSW_START: // Start game
_is_network_server = true;
@@ -1631,7 +1636,8 @@ struct NetworkLobbyWindow : public Window {
/* FIXME the disabling should go into some InvalidateData, which is called instead of the SetDirty */
if (click_count > 1 && !this->IsWidgetDisabled(NLWW_JOIN)) this->OnClick(pt, NLWW_JOIN, 1);
- } break;
+ break;
+ }
case NLWW_JOIN: // Join company
/* Button can be clicked only when it is enabled */
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index 4abe302d2..673b42336 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -543,7 +543,8 @@ static ChangeInfoResult RailVehicleChangeInfo(uint engine, int numinfo, int prop
grfmsg(1, "RailVehicleChangeInfo: Invalid track type %d specified, ignoring", tracktype);
break;
}
- } break;
+ break;
+ }
case 0x08: // AI passenger service
/* Tells the AI that this engine is designed for
@@ -556,7 +557,8 @@ static ChangeInfoResult RailVehicleChangeInfo(uint engine, int numinfo, int prop
if (speed == 0xFFFF) speed = 0;
rvi->max_speed = speed;
- } break;
+ break;
+ }
case PROP_TRAIN_POWER: // 0x0B Power
rvi->power = buf->ReadWord();
@@ -587,7 +589,8 @@ static ChangeInfoResult RailVehicleChangeInfo(uint engine, int numinfo, int prop
if (spriteid < 0xFD) spriteid >>= 1;
rvi->image_index = spriteid;
- } break;
+ break;
+ }
case 0x13: { // Dual-headed
uint8 dual = buf->ReadByte();
@@ -598,7 +601,8 @@ static ChangeInfoResult RailVehicleChangeInfo(uint engine, int numinfo, int prop
rvi->railveh_type = rvi->power == 0 ?
RAILVEH_WAGON : RAILVEH_SINGLEHEAD;
}
- } break;
+ break;
+ }
case PROP_TRAIN_CARGO_CAPACITY: // 0x14 Cargo capacity
rvi->capacity = buf->ReadByte();
@@ -616,7 +620,8 @@ static ChangeInfoResult RailVehicleChangeInfo(uint engine, int numinfo, int prop
ei->cargo_type = CT_INVALID;
grfmsg(2, "RailVehicleChangeInfo: Invalid cargo type %d, using first refittable", ctype);
}
- } break;
+ break;
+ }
case PROP_TRAIN_WEIGHT: // 0x16 Weight
SB(rvi->weight, 0, 8, buf->ReadByte());
@@ -664,7 +669,8 @@ static ChangeInfoResult RailVehicleChangeInfo(uint engine, int numinfo, int prop
}
rvi->engclass = engclass;
- } break;
+ break;
+ }
case 0x1A: // Alter purchase list sort order
AlterVehicleListOrder(e->index, buf->ReadExtendedByte());
@@ -718,7 +724,8 @@ static ChangeInfoResult RailVehicleChangeInfo(uint engine, int numinfo, int prop
} else {
SB(rvi->weight, 8, 8, weight);
}
- } break;
+ break;
+ }
case PROP_TRAIN_USER_DATA: // 0x25 User-defined bit mask to set when checking veh. var. 42
rvi->user_def_data = buf->ReadByte();
@@ -787,7 +794,8 @@ static ChangeInfoResult RoadVehicleChangeInfo(uint engine, int numinfo, int prop
if (spriteid < 0xFD) spriteid >>= 1;
rvi->image_index = spriteid;
- } break;
+ break;
+ }
case PROP_ROADVEH_CARGO_CAPACITY: // 0x0F Cargo capacity
rvi->capacity = buf->ReadByte();
@@ -804,7 +812,8 @@ static ChangeInfoResult RoadVehicleChangeInfo(uint engine, int numinfo, int prop
ei->cargo_type = CT_INVALID;
grfmsg(2, "RoadVehicleChangeInfo: Invalid cargo type %d, using first refittable", cargo);
}
- } break;
+ break;
+ }
case PROP_ROADVEH_COST_FACTOR: // 0x11 Cost factor
rvi->cost_factor = buf->ReadByte();
@@ -902,7 +911,8 @@ static ChangeInfoResult ShipVehicleChangeInfo(uint engine, int numinfo, int prop
if (spriteid < 0xFD) spriteid >>= 1;
svi->image_index = spriteid;
- } break;
+ break;
+ }
case 0x09: // Refittable
svi->old_refittable = (buf->ReadByte() != 0);
@@ -927,7 +937,8 @@ static ChangeInfoResult ShipVehicleChangeInfo(uint engine, int numinfo, int prop
ei->cargo_type = CT_INVALID;
grfmsg(2, "ShipVehicleChangeInfo: Invalid cargo type %d, using first refittable", cargo);
}
- } break;
+ break;
+ }
case PROP_SHIP_CARGO_CAPACITY: // 0x0D Cargo capacity
svi->capacity = buf->ReadWord();
@@ -1016,7 +1027,8 @@ static ChangeInfoResult AircraftVehicleChangeInfo(uint engine, int numinfo, int
if (spriteid < 0xFD) spriteid >>= 1;
avi->image_index = spriteid;
- } break;
+ break;
+ }
case 0x09: // Helicopter
if (buf->ReadByte() == 0) {
@@ -1138,7 +1150,8 @@ static ChangeInfoResult StationChangeInfo(uint stid, int numinfo, int prop, Byte
/* Swap classid because we read it in BE meaning WAYP or DFLT */
uint32 classid = buf->ReadDWord();
(*spec)->sclass = AllocateStationClass(BSWAP32(classid));
- } break;
+ break;
+ }
case 0x09: // Define sprite layout
statspec->tiles = buf->ReadExtendedByte();
@@ -1200,7 +1213,8 @@ static ChangeInfoResult StationChangeInfo(uint stid, int numinfo, int prop, Byte
statspec->tiles = srcstatspec->tiles;
statspec->renderdata = srcstatspec->renderdata;
statspec->copied_renderdata = true;
- } break;
+ break;
+ }
case 0x0B: // Callback mask
statspec->callback_mask = buf->ReadByte();
@@ -1279,7 +1293,8 @@ static ChangeInfoResult StationChangeInfo(uint stid, int numinfo, int prop, Byte
statspec->platforms = srcstatspec->platforms;
statspec->layouts = srcstatspec->layouts;
statspec->copied_layouts = true;
- } break;
+ break;
+ }
case 0x10: // Little/lots cargo threshold
statspec->cargo_threshold = buf->ReadWord();
@@ -1423,7 +1438,8 @@ static ChangeInfoResult BridgeChangeInfo(uint brid, int numinfo, int prop, ByteR
MapSpriteMappingRecolour(&bridge->sprite_table[tableid][sprite]);
}
}
- } break;
+ break;
+ }
case 0x0E: // Flags; bit 0 - disable far pillars
bridge->flags = buf->ReadByte();
@@ -1436,13 +1452,15 @@ static ChangeInfoResult BridgeChangeInfo(uint brid, int numinfo, int prop, ByteR
case 0x10: { // purchase string
StringID newone = GetGRFStringID(_cur_grffile->grfid, buf->ReadWord());
if (newone != STR_UNDEFINED) bridge->material = newone;
- } break;
+ break;
+ }
case 0x11: // description of bridge with rails or roads
case 0x12: {
StringID newone = GetGRFStringID(_cur_grffile->grfid, buf->ReadWord());
if (newone != STR_UNDEFINED) bridge->transport_name[prop - 0x11] = newone;
- } break;
+ break;
+ }
case 0x13: // 16 bits cost multiplier
bridge->price = buf->ReadWord();
@@ -1503,7 +1521,8 @@ static ChangeInfoResult IgnoreTownHouseProperty(int prop, ByteReader *buf)
byte count = buf->ReadByte();
for (byte j = 0; j < count; j++) buf->ReadByte();
ret = CIR_UNHANDLED;
- } break;
+ break;
+ }
default:
ret = CIR_UNKNOWN;
@@ -1584,7 +1603,8 @@ static ChangeInfoResult TownHouseChangeInfo(uint hid, int numinfo, int prop, Byt
if (housespec->min_year < 1930) housespec->min_year = 1930;
_loaded_newgrf_features.has_newhouses = true;
- } break;
+ break;
+ }
case 0x09: // Building flags
housespec->building_flags = (BuildingFlags)buf->ReadByte();
@@ -1594,7 +1614,8 @@ static ChangeInfoResult TownHouseChangeInfo(uint hid, int numinfo, int prop, Byt
uint16 years = buf->ReadWord();
housespec->min_year = GB(years, 0, 8) > 150 ? MAX_YEAR : ORIGINAL_BASE_YEAR + GB(years, 0, 8);
housespec->max_year = GB(years, 8, 8) > 150 ? MAX_YEAR : ORIGINAL_BASE_YEAR + GB(years, 8, 8);
- } break;
+ break;
+ }
case 0x0B: // Population
housespec->population = buf->ReadByte();
@@ -1622,7 +1643,8 @@ static ChangeInfoResult TownHouseChangeInfo(uint hid, int numinfo, int prop, Byt
housespec->accepts_cargo[2] = cid;
housespec->cargo_acceptance[2] = abs(goods); // but we do need positive value here
- } break;
+ break;
+ }
case 0x10: // Local authority rating decrease on removal
housespec->remove_rating_decrease = buf->ReadWord();
@@ -1655,7 +1677,8 @@ static ChangeInfoResult TownHouseChangeInfo(uint hid, int numinfo, int prop, Byt
}
_house_mngr.Add(hid + i, _cur_grffile->grfid, override);
- } break;
+ break;
+ }
case 0x16: // Periodic refresh multiplier
housespec->processing_time = buf->ReadByte();
@@ -1707,7 +1730,8 @@ static ChangeInfoResult TownHouseChangeInfo(uint hid, int numinfo, int prop, Byt
housespec->accepts_cargo[j] = cargo;
}
}
- } break;
+ break;
+ }
case 0x1F: // Minimum life span
housespec->minimum_life = buf->ReadByte();
@@ -1717,7 +1741,8 @@ static ChangeInfoResult TownHouseChangeInfo(uint hid, int numinfo, int prop, Byt
byte count = buf->ReadByte();
for (byte j = 0; j < count; j++) buf->ReadByte();
ret = CIR_UNHANDLED;
- } break;
+ break;
+ }
case 0x21: // long introduction year
housespec->min_year = buf->ReadWord();
@@ -1751,7 +1776,8 @@ static ChangeInfoResult GlobalVarChangeInfo(uint gvid, int numinfo, int prop, By
} else {
grfmsg(1, "GlobalVarChangeInfo: Price %d out of range, ignoring", price);
}
- } break;
+ break;
+ }
case 0x09: // Cargo translation table
/* This is loaded during the reservation stage, so just skip it here. */
@@ -1766,7 +1792,8 @@ static ChangeInfoResult GlobalVarChangeInfo(uint gvid, int numinfo, int prop, By
if ((newone != STR_UNDEFINED) && (curidx < NUM_CURRENCY)) {
_currency_specs[curidx].name = newone;
}
- } break;
+ break;
+ }
case 0x0B: { // Currency multipliers
uint curidx = GetNewgrfCurrencyIdConverted(gvid + i);
@@ -1780,7 +1807,8 @@ static ChangeInfoResult GlobalVarChangeInfo(uint gvid, int numinfo, int prop, By
} else {
grfmsg(1, "GlobalVarChangeInfo: Currency multipliers %d out of range, ignoring", curidx);
}
- } break;
+ break;
+ }
case 0x0C: { // Currency options
uint curidx = GetNewgrfCurrencyIdConverted(gvid + i);
@@ -1795,7 +1823,8 @@ static ChangeInfoResult GlobalVarChangeInfo(uint gvid, int numinfo, int prop, By
} else {
grfmsg(1, "GlobalVarChangeInfo: Currency option %d out of range, ignoring", curidx);
}
- } break;
+ break;
+ }
case 0x0D: { // Currency prefix symbol
uint curidx = GetNewgrfCurrencyIdConverted(gvid + i);
@@ -1807,7 +1836,8 @@ static ChangeInfoResult GlobalVarChangeInfo(uint gvid, int numinfo, int prop, By
} else {
grfmsg(1, "GlobalVarChangeInfo: Currency symbol %d out of range, ignoring", curidx);
}
- } break;
+ break;
+ }
case 0x0E: { // Currency suffix symbol
uint curidx = GetNewgrfCurrencyIdConverted(gvid + i);
@@ -1819,7 +1849,8 @@ static ChangeInfoResult GlobalVarChangeInfo(uint gvid, int numinfo, int prop, By
} else {
grfmsg(1, "GlobalVarChangeInfo: Currency symbol %d out of range, ignoring", curidx);
}
- } break;
+ break;
+ }
case 0x0F: { // Euro introduction dates
uint curidx = GetNewgrfCurrencyIdConverted(gvid + i);
@@ -1830,7 +1861,8 @@ static ChangeInfoResult GlobalVarChangeInfo(uint gvid, int numinfo, int prop, By
} else {
grfmsg(1, "GlobalVarChangeInfo: Euro intro date %d out of range, ignoring", curidx);
}
- } break;
+ break;
+ }
case 0x10: // Snow line height table
if (numinfo > 1 || IsSnowLineSet()) {
@@ -2051,7 +2083,8 @@ static ChangeInfoResult CargoChangeInfo(uint cid, int numinfo, int prop, ByteRea
grfmsg(1, "CargoChangeInfo: Unknown town growth substitute value %d, setting to none.", substitute_type);
case 0xFF: cs->town_effect = TE_NONE; break;
}
- } break;
+ break;
+ }
case 0x19: // Town growth coefficient
cs->multipliertowngrowth = buf->ReadWord();
@@ -2108,7 +2141,8 @@ static ChangeInfoResult SoundEffectChangeInfo(uint sid, int numinfo, int prop, B
/* Literally copy the data of the new sound over the original */
*old_sound = *sound;
}
- } break;
+ break;
+ }
default:
ret = CIR_UNKNOWN;
@@ -2200,7 +2234,8 @@ static ChangeInfoResult IndustrytilesChangeInfo(uint indtid, int numinfo, int pr
tsp->grf_prop.grffile = _cur_grffile;
_industile_mngr.AddEntityID(indtid + i, _cur_grffile->grfid, subs_id); // pre-reserve the tile slot
}
- } break;
+ break;
+ }
case 0x09: { // Industry tile override
byte ovrid = buf->ReadByte();
@@ -2212,7 +2247,8 @@ static ChangeInfoResult IndustrytilesChangeInfo(uint indtid, int numinfo, int pr
}
_industile_mngr.Add(indtid + i, _cur_grffile->grfid, ovrid);
- } break;
+ break;
+ }
case 0x0A: // Tile acceptance
case 0x0B:
@@ -2220,7 +2256,8 @@ static ChangeInfoResult IndustrytilesChangeInfo(uint indtid, int numinfo, int pr
uint16 acctp = buf->ReadWord();
tsp->accepts_cargo[prop - 0x0A] = GetCargoTranslation(GB(acctp, 0, 8), _cur_grffile);
tsp->acceptance[prop - 0x0A] = GB(acctp, 8, 8);
- } break;
+ break;
+ }
case 0x0D: // Land shape flags
tsp->slopes_refused = (Slope)buf->ReadByte();
@@ -2311,7 +2348,8 @@ static ChangeInfoResult IgnoreIndustryProperty(int prop, ByteReader *buf)
if (gfx == 0xFE) buf->ReadWord();
}
}
- } break;
+ break;
+ }
case 0x11:
case 0x16:
@@ -2323,7 +2361,8 @@ static ChangeInfoResult IgnoreIndustryProperty(int prop, ByteReader *buf)
for (uint8 j = 0; j < number_of_sounds; j++) {
buf->ReadByte();
}
- } break;
+ break;
+ }
default:
ret = CIR_UNKNOWN;
@@ -2408,7 +2447,8 @@ static ChangeInfoResult IndustriesChangeInfo(uint indid, int numinfo, int prop,
* rely on callbacks, not on the original placement functions */
indsp->check_proc = CHECK_NOTHING;
}
- } break;
+ break;
+ }
case 0x09: { // Industry type override
byte ovrid = buf->ReadByte();
@@ -2420,7 +2460,8 @@ static ChangeInfoResult IndustriesChangeInfo(uint indid, int numinfo, int prop,
}
indsp->grf_prop.override = ovrid;
_industry_mngr.Add(indid + i, _cur_grffile->grfid, ovrid);
- } break;
+ break;
+ }
case 0x0A: { // Set industry layout(s)
indsp->num_table = buf->ReadByte(); // Number of layaouts
@@ -2519,7 +2560,8 @@ static ChangeInfoResult IndustriesChangeInfo(uint indid, int numinfo, int prop,
indsp->table = tile_table;
SetBit(indsp->cleanup_flag, 1);
free(itt);
- } break;
+ break;
+ }
case 0x0B: // Industry production flags
indsp->life_type = (IndustryLifeType)buf->ReadByte();
@@ -2581,7 +2623,8 @@ static ChangeInfoResult IndustriesChangeInfo(uint indid, int numinfo, int prop,
indsp->random_sounds = sounds;
SetBit(indsp->cleanup_flag, 0);
- } break;
+ break;
+ }
case 0x16: // Conflicting industry types
for (byte j = 0; j < 3; j++) indsp->conflicting[j] = buf->ReadByte();
@@ -2614,7 +2657,8 @@ static ChangeInfoResult IndustriesChangeInfo(uint indid, int numinfo, int prop,
uint32 multiples = buf->ReadDWord();
indsp->input_cargo_multiplier[prop - 0x1C][0] = GB(multiples, 0, 16);
indsp->input_cargo_multiplier[prop - 0x1C][1] = GB(multiples, 16, 16);
- } break;
+ break;
+ }
case 0x1F: // Industry name
indsp->name = buf->ReadWord();
@@ -2629,7 +2673,8 @@ static ChangeInfoResult IndustriesChangeInfo(uint indid, int numinfo, int prop,
case 0x22: { // Callback additional mask
byte aflag = buf->ReadByte();
SB(indsp->callback_mask, (prop - 0x21) * 8, 8, aflag);
- } break;
+ break;
+ }
case 0x23: // removal cost multiplier
indsp->removal_cost_multiplier = buf->ReadDWord();
@@ -2729,7 +2774,8 @@ static ChangeInfoResult AirportChangeInfo(uint airport, int numinfo, int prop, B
/* Create a copy of the original tiletable so it can be freed later. */
DuplicateTileTable(as);
}
- } break;
+ break;
+ }
case 0x0C:
as->min_year = buf->ReadWord();
@@ -2975,7 +3021,8 @@ static ChangeInfoResult AirportTilesChangeInfo(uint airtid, int numinfo, int pro
tsp->grf_prop.grffile = _cur_grffile;
_airporttile_mngr.AddEntityID(airtid + i, _cur_grffile->grfid, subs_id); // pre-reserve the tile slot
}
- } break;
+ break;
+ }
case 0x09: { // Airport tile override
byte override = buf->ReadByte();
@@ -2987,7 +3034,8 @@ static ChangeInfoResult AirportTilesChangeInfo(uint airtid, int numinfo, int pro
}
_airporttile_mngr.Add(airtid + i, _cur_grffile->grfid, override);
- } break;
+ break;
+ }
case 0x0E: // Callback flags
tsp->callback_flags = buf->ReadByte();
diff --git a/src/newgrf_debug_gui.cpp b/src/newgrf_debug_gui.cpp
index 2fcef1c72..4e4d89955 100644
--- a/src/newgrf_debug_gui.cpp
+++ b/src/newgrf_debug_gui.cpp
@@ -415,7 +415,8 @@ struct NewGRFInspectWindow : Window {
case NIW_PARENT: {
uint index = GetFeatureHelper(this->window_number)->GetParent(GetFeatureIndex(this->window_number));
::ShowNewGRFInspectWindow((GrfSpecFeature)GB(index, 24, 8), GetFeatureIndex(index));
- } break;
+ break;
+ }
case NIW_MAINPANEL: {
/* Does this feature have variables? */
@@ -580,7 +581,8 @@ struct SpriteAlignerWindow : Window {
const Sprite *spr = GetSprite(this->current_sprite, ST_NORMAL);
SetDParam(0, spr->x_offs);
SetDParam(1, spr->y_offs);
- } break;
+ break;
+ }
default:
break;
@@ -711,7 +713,8 @@ struct SpriteAlignerWindow : Window {
/* Ofcourse, we need to redraw the sprite, but where is it used?
* Everywhere is a safe bet. */
MarkWholeScreenDirty();
- } break;
+ break;
+ }
}
}
diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp
index cd48b48da..d2a2edca0 100644
--- a/src/newgrf_engine.cpp
+++ b/src/newgrf_engine.cpp
@@ -396,7 +396,8 @@ static inline const Vehicle *GRV(const ResolverObject *object)
}
}
if (v == NULL) v = self;
- } break;
+ break;
+ }
}
uint32 count = GB(object->count, 0, 4);
if (count == 0) count = GetRegister(0x100);
@@ -793,7 +794,8 @@ static uint32 VehicleGetVariable(const ResolverObject *object, byte variable, by
case 0x7D: return GB(t->First()->index, 8, 8);
case 0x7F: return 0; // Used for vehicle reversing hack in TTDP
}
- } break;
+ break;
+ }
case VEH_ROAD: {
RoadVehicle *rv = RoadVehicle::From(v);
@@ -806,7 +808,8 @@ static uint32 VehicleGetVariable(const ResolverObject *object, byte variable, by
case 0x68: return rv->crashed_ctr;
case 0x69: return GB(rv->crashed_ctr, 8, 8);
}
- } break;
+ break;
+ }
case VEH_AIRCRAFT: {
Aircraft *a = Aircraft::From(v);
@@ -815,7 +818,8 @@ static uint32 VehicleGetVariable(const ResolverObject *object, byte variable, by
case 0x63: return a->targetairport; // Airport to which the action refers
case 0x66: return MapAircraftMovementAction(a); // Current movement action
}
- } break;
+ break;
+ }
default: break;
}
diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp
index 32d683e8b..c81d85179 100644
--- a/src/newgrf_gui.cpp
+++ b/src/newgrf_gui.cpp
@@ -620,7 +620,8 @@ struct NewGRFWindow : public QueryStringBaseWindow {
y += step_height;
}
}
- } break;
+ break;
+ }
case SNGRFS_AVAIL_LIST: {
GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, 0xD7);
diff --git a/src/newgrf_text.cpp b/src/newgrf_text.cpp
index ccbdb37de..7cb8fd334 100644
--- a/src/newgrf_text.cpp
+++ b/src/newgrf_text.cpp
@@ -287,7 +287,8 @@ char *TranslateTTDPatchCodes(uint32 grfid, const char *str)
tmp |= ((uint8)*str++) << 8;
d += Utf8Encode(d, SCC_NEWGRF_PUSH_WORD);
d += Utf8Encode(d, tmp);
- } break;
+ break;
+ }
case 4:
d += Utf8Encode(d, SCC_NEWGRF_UNPRINT);
d += Utf8Encode(d, *str++);
diff --git a/src/openttd.cpp b/src/openttd.cpp
index 0d3916ff2..2e6b604b5 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -507,7 +507,8 @@ int ttd_main(int argc, char *argv[])
CreateConsole();
#endif
if (mgo.opt != NULL) SetDebugString(mgo.opt);
- } break;
+ break;
+ }
case 'e': _switch_mode = SM_EDITOR; break;
case 'i':
/* there is an argument, it is not empty, and it is exactly 1 char long */
diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp
index 0c43bdd3f..2f4c3bbab 100644
--- a/src/order_cmd.cpp
+++ b/src/order_cmd.cpp
@@ -625,7 +625,8 @@ CommandCost CmdInsertOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
if (occ == OCC_IS_TRUE || occ == OCC_IS_FALSE) return CMD_ERROR;
break;
}
- } break;
+ break;
+ }
default: return CMD_ERROR;
}
@@ -1081,7 +1082,8 @@ CommandCost CmdModifyOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
default:
NOT_REACHED();
}
- } break;
+ break;
+ }
case MOF_COND_VARIABLE: {
order->SetConditionVariable((OrderConditionVariable)data);
@@ -1105,7 +1107,8 @@ CommandCost CmdModifyOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
if (occ == OCC_IS_TRUE || occ == OCC_IS_FALSE) order->SetConditionComparator(OCC_EQUALS);
break;
}
- } break;
+ break;
+ }
case MOF_COND_COMPARATOR:
order->SetConditionComparator((OrderConditionComparator)data);
@@ -1209,7 +1212,8 @@ CommandCost CmdCloneOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
InvalidateWindowClassesData(GetWindowClassForVehicleType(dst->type), 0);
}
- } break;
+ break;
+ }
case CO_COPY: {
Vehicle *src = Vehicle::GetIfValid(veh_src);
@@ -1264,7 +1268,8 @@ CommandCost CmdCloneOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
InvalidateWindowClassesData(GetWindowClassForVehicleType(dst->type), 0);
}
- } break;
+ break;
+ }
case CO_UNSHARE: return DecloneOrder(dst, flags);
default: return CMD_ERROR;
diff --git a/src/order_gui.cpp b/src/order_gui.cpp
index 5edcaa108..0a6965b8a 100644
--- a/src/order_gui.cpp
+++ b/src/order_gui.cpp
@@ -230,7 +230,8 @@ void DrawOrderString(const Vehicle *v, const Order *order, int order_index, int
SetDParam(5, order->GetStopLocation() + STR_ORDER_STOP_LOCATION_NEAR_END);
}
}
- } break;
+ break;
+ }
case OT_GOTO_DEPOT:
if (order->GetDepotActionType() & ODATFB_NEAREST_DEPOT) {
@@ -812,7 +813,8 @@ public:
/* Moving selected order */
this->selected_order = to;
- } break;
+ break;
+ }
}
this->vscroll.SetCount(this->vehicle->GetNumOrders() + 1);
@@ -1069,7 +1071,8 @@ public:
}
this->UpdateButtonState();
- } break;
+ break;
+ }
case ORDER_WIDGET_SKIP:
this->OrderClick_Skip(0);
@@ -1136,7 +1139,8 @@ public:
case ORDER_WIDGET_COND_COMPARATOR: {
const Order *o = this->vehicle->GetOrder(this->OrderGetSel());
ShowDropDownMenu(this, _order_conditional_condition, o->GetConditionComparator(), ORDER_WIDGET_COND_COMPARATOR, 0, (o->GetConditionVariable() == OCV_REQUIRES_SERVICE) ? 0x3F : 0xC0);
- } break;
+ break;
+ }
case ORDER_WIDGET_COND_VALUE: {
const Order *order = this->vehicle->GetOrder(this->OrderGetSel());
@@ -1144,7 +1148,8 @@ public:
if (order->GetConditionVariable() == OCV_MAX_SPEED) value = ConvertSpeedToDisplaySpeed(value);
SetDParam(0, value);
ShowQueryString(STR_JUST_INT, STR_ORDER_CONDITIONAL_VALUE_CAPT, 5, 100, this, CS_NUMERAL, QSF_NONE);
- } break;
+ break;
+ }
case ORDER_WIDGET_SHARED_ORDER_LIST:
ShowVehicleListWindow(this->vehicle);
@@ -1224,7 +1229,8 @@ public:
this->selected_order = -1;
this->UpdateButtonState();
}
- } break;
+ break;
+ }
case ORDER_WIDGET_DELETE:
this->OrderClick_Delete(0);
diff --git a/src/pathfinder/npf/npf.cpp b/src/pathfinder/npf/npf.cpp
index 3f34f55f8..851163ac6 100644
--- a/src/pathfinder/npf/npf.cpp
+++ b/src/pathfinder/npf/npf.cpp
@@ -363,7 +363,8 @@ static int32 NPFRoadPathCost(AyStar *as, AyStarNode *current, OpenListNode *pare
/* Increase cost for filled road stops */
cost += _settings_game.pf.npf.npf_road_bay_occupied_penalty * (!rs->IsFreeBay(0) + !rs->IsFreeBay(1)) / 2;
}
- } break;
+ break;
+ }
default:
break;
diff --git a/src/pathfinder/yapf/yapf_road.cpp b/src/pathfinder/yapf/yapf_road.cpp
index baed8d414..47a89ab81 100644
--- a/src/pathfinder/yapf/yapf_road.cpp
+++ b/src/pathfinder/yapf/yapf_road.cpp
@@ -81,7 +81,8 @@ protected:
/* Increase cost for filled road stops */
cost += Yapf().PfGetSettings().road_stop_bay_occupied_penalty * (!rs->IsFreeBay(0) + !rs->IsFreeBay(1)) / 2;
}
- } break;
+ break;
+ }
default:
break;
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp
index b0d535362..9cce011bb 100644
--- a/src/rail_cmd.cpp
+++ b/src/rail_cmd.cpp
@@ -1547,7 +1547,8 @@ CommandCost CmdConvertRail(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
}
cost.AddCost((GetTunnelBridgeLength(tile, endtile) + 2) * RailConvertCost(type, totype));
- } break;
+ break;
+ }
default: // MP_STATION, MP_ROAD
if (flags & DC_EXEC) {
diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp
index 48c113210..c0348d95f 100644
--- a/src/rail_gui.cpp
+++ b/src/rail_gui.cpp
@@ -1313,7 +1313,8 @@ public:
SndPlayFx(SND_15_BEEP);
this->SetDirty();
DeleteWindowById(WC_SELECT_STATION, 0);
- } break;
+ break;
+ }
case BRSW_HIGHLIGHT_OFF:
case BRSW_HIGHLIGHT_ON:
diff --git a/src/road.cpp b/src/road.cpp
index a5bd9abd6..4142f0bfa 100644
--- a/src/road.cpp
+++ b/src/road.cpp
@@ -66,7 +66,8 @@ RoadBits CleanUpRoadBits(const TileIndex tile, RoadBits org_rb)
connective = (neighbor_rb & mirrored_rb) || // Neighbor has got the fitting RoadBit
HasExactlyOneBit(neighbor_rb); // Neighbor has got only one Roadbit
- } break;
+ break;
+ }
case MP_RAILWAY:
connective = IsPossibleCrossing(neighbor_tile, DiagDirToAxis(dir));
diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp
index 96f2b0b5c..6863e549b 100644
--- a/src/road_cmd.cpp
+++ b/src/road_cmd.cpp
@@ -186,20 +186,23 @@ static CommandCost RemoveRoad(TileIndex tile, DoCommandFlag flags, RoadBits piec
case MP_ROAD: {
CommandCost ret = EnsureNoVehicleOnGround(tile);
if (ret.Failed()) return ret;
- } break;
+ break;
+ }
case MP_STATION: {
if (!IsDriveThroughStopTile(tile)) return CMD_ERROR;
CommandCost ret = EnsureNoVehicleOnGround(tile);
if (ret.Failed()) return ret;
- } break;
+ break;
+ }
case MP_TUNNELBRIDGE: {
if (GetTunnelBridgeTransportType(tile) != TRANSPORT_ROAD) return CMD_ERROR;
CommandCost ret = TunnelBridgeIsFree(tile, GetOtherTunnelBridgeEnd(tile));
if (ret.Failed()) return ret;
- } break;
+ break;
+ }
default:
return CMD_ERROR;
@@ -520,7 +523,8 @@ CommandCost CmdBuildRoad(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
}
return_cmd_error(STR_ERROR_ALREADY_BUILT);
}
- } break;
+ break;
+ }
case ROAD_TILE_CROSSING:
other_bits = GetCrossingRoadBits(tile);
@@ -594,7 +598,8 @@ CommandCost CmdBuildRoad(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
pieces = curbits; // we need to pay for both roadbits
if (HasTileRoadType(tile, rt)) return_cmd_error(STR_ERROR_ALREADY_BUILT);
- } break;
+ break;
+ }
case MP_TUNNELBRIDGE: {
if (GetTunnelBridgeTransportType(tile) != TRANSPORT_ROAD) goto do_clear;
@@ -603,7 +608,8 @@ CommandCost CmdBuildRoad(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
/* Don't allow adding roadtype to the bridge/tunnel when vehicles are already driving on it */
CommandCost ret = TunnelBridgeIsFree(tile, GetOtherTunnelBridgeEnd(tile));
if (ret.Failed()) return ret;
- } break;
+ break;
+ }
default: {
do_clear:;
@@ -611,7 +617,8 @@ do_clear:;
if (ret.Failed()) return ret;
cost.AddCost(ret);
tile_cleared = true;
- } break;
+ break;
+ }
}
if (other_bits != pieces) {
@@ -672,7 +679,8 @@ do_clear:;
if (rt == ROADTYPE_ROAD) SetTownIndex(tile, p2);
}
if (rtt != ROAD_TILE_CROSSING) SetRoadBits(tile, existing | pieces, rt);
- } break;
+ break;
+ }
case MP_TUNNELBRIDGE: {
TileIndex other_end = GetOtherTunnelBridgeEnd(tile);
@@ -690,7 +698,8 @@ do_clear:;
for (TileIndex t = tile + delta; t != other_end; t += delta) MarkTileDirtyByTile(t);
}
- } break;
+ break;
+ }
case MP_STATION:
assert(IsDriveThroughStopTile(tile));
@@ -1601,7 +1610,8 @@ static VehicleEnterTileStatus VehicleEnter_Road(Vehicle *v, TileIndex tile, int
InvalidateWindowData(WC_VEHICLE_DEPOT, rv->tile);
return VETSB_ENTERED_WORMHOLE;
}
- } break;
+ break;
+ }
default: break;
}
diff --git a/src/road_gui.cpp b/src/road_gui.cpp
index 38f23299d..635a661dd 100644
--- a/src/road_gui.cpp
+++ b/src/road_gui.cpp
@@ -653,12 +653,14 @@ struct BuildRoadToolbarWindow : Window {
case DDSP_REMOVE_BUSSTOP: {
TileArea ta(start_tile, end_tile);
DoCommandP(ta.tile, ta.w | ta.h << 8, ROADSTOP_BUS, CMD_REMOVE_ROAD_STOP | CMD_MSG(_road_type_infos[_cur_roadtype].err_remove_station[ROADSTOP_BUS]), CcPlaySound1D);
- } break;
+ break;
+ }
case DDSP_REMOVE_TRUCKSTOP: {
TileArea ta(start_tile, end_tile);
DoCommandP(ta.tile, ta.w | ta.h << 8, ROADSTOP_TRUCK, CMD_REMOVE_ROAD_STOP | CMD_MSG(_road_type_infos[_cur_roadtype].err_remove_station[ROADSTOP_TRUCK]), CcPlaySound1D);
- } break;
+ break;
+ }
}
}
}
diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp
index 8d49abd62..6c0f9a7d8 100644
--- a/src/saveload/afterload.cpp
+++ b/src/saveload/afterload.cpp
@@ -699,7 +699,8 @@ bool AfterLoadGame()
return false;
}
SB(_m[t].m6, 3, 3, st);
- } break;
+ break;
+ }
}
}
}
diff --git a/src/saveload/oldloader_sl.cpp b/src/saveload/oldloader_sl.cpp
index f9bd99bae..da1afdd7c 100644
--- a/src/saveload/oldloader_sl.cpp
+++ b/src/saveload/oldloader_sl.cpp
@@ -1530,7 +1530,8 @@ static bool LoadTTDPatchExtraChunks(LoadgameState *ls, int num)
/* Append static NewGRF configuration */
AppendStaticGRFConfigs(&_grfconfig);
- } break;
+ break;
+ }
/* TTDPatch version and configuration */
case 0x3:
diff --git a/src/settings.cpp b/src/settings.cpp
index b696ed7dc..19f394339 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -395,7 +395,8 @@ static void Write_ValidateSetting(void *ptr, const SettingDesc *sd, int32 val)
case SLE_VAR_I32: {
/* Override the minimum value. No value below sdb->min, except special value 0 */
if (!(sdb->flags & SGF_0ISDISABLED) || val != 0) val = Clamp(val, sdb->min, sdb->max);
- } break;
+ break;
+ }
case SLE_VAR_U32: {
/* Override the minimum value. No value below sdb->min, except special value 0 */
uint min = ((sdb->flags & SGF_0ISDISABLED) && (uint)val <= (uint)sdb->min) ? 0 : sdb->min;
@@ -585,7 +586,8 @@ static void IniSaveSettings(IniFile *ini, const SettingDesc *sd, const char *grp
case SDT_MANYOFMANY: MakeManyOfMany(buf, lastof(buf), sdb->many, i); break;
default: NOT_REACHED();
}
- } break;
+ break;
+ }
case SDT_STRING:
switch (GetVarMemType(sld->conv)) {
diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp
index 3ec335146..5491506d7 100644
--- a/src/settings_gui.cpp
+++ b/src/settings_gui.cpp
@@ -299,7 +299,8 @@ struct GameOptionsWindow : Window {
}
ShowDropDownMenu(this, _driveside_dropdown, this->opt->vehicle.road_side, GOW_ROADSIDE_DROPDOWN, i, 0);
- } break;
+ break;
+ }
case GOW_TOWNNAME_DROPDOWN: // Setup townname dropdown
ShowTownnameDropdown(this, this->opt->game_creation.town_name);
@@ -322,7 +323,8 @@ struct GameOptionsWindow : Window {
}
ShowDropDownList(this, list, _dynlang.curr, GOW_LANG_DROPDOWN);
- } break;
+ break;
+ }
case GOW_RESOLUTION_DROPDOWN: // Setup resolution dropdown
ShowDropDownMenu(this, BuildDynamicDropdown(SPECSTR_RESOLUTION_START, _num_resolutions), GetCurRes(), GOW_RESOLUTION_DROPDOWN, 0, 0);
@@ -1627,7 +1629,8 @@ struct GameSettingsWindow : Window {
this->flags4 |= WF_TIMEOUT_BEGIN;
_left_button_clicked = false;
}
- } break;
+ break;
+ }
default: NOT_REACHED();
}
diff --git a/src/signs_gui.cpp b/src/signs_gui.cpp
index a054d0fed..db9ce47af 100644
--- a/src/signs_gui.cpp
+++ b/src/signs_gui.cpp
@@ -170,7 +170,8 @@ struct SignListWindow : Window, SignList {
resize->height = max<uint>(FONT_HEIGHT_NORMAL, GetSpriteSize(SPR_COMPANY_ICON).height);
Dimension d = {this->text_offset + MAX_LENGTH_SIGN_NAME_PIXELS + WD_FRAMETEXT_RIGHT, WD_FRAMERECT_TOP + 5 * resize->height + WD_FRAMERECT_BOTTOM};
*size = maxdim(*size, d);
- } break;
+ break;
+ }
case SLW_CAPTION:
SetDParam(0, max<size_t>(1000, Sign::GetPoolSize()));
diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp
index 8869a8353..c3b7c0a3e 100644
--- a/src/smallmap_gui.cpp
+++ b/src/smallmap_gui.cpp
@@ -1067,7 +1067,8 @@ public:
DrawPixelInfo new_dpi;
if (!FillDrawPixelInfo(&new_dpi, r.left + 1, r.top + 1, r.right - r.left - 1, r.bottom - r.top - 1)) return;
this->DrawSmallMap(&new_dpi);
- } break;
+ break;
+ }
case SM_WIDGET_LEGEND: {
uint columns = this->GetNumberColumnsLegend(r.right - r.left + 1);
@@ -1152,7 +1153,8 @@ public:
w->viewport->dest_scrollpos_y = pt.y - (w->viewport->virtual_height >> 1);
this->SetDirty();
- } break;
+ break;
+ }
case SM_WIDGET_ZOOM_IN:
case SM_WIDGET_ZOOM_OUT: {
diff --git a/src/statusbar_gui.cpp b/src/statusbar_gui.cpp
index debfdb7e9..a8b142498 100644
--- a/src/statusbar_gui.cpp
+++ b/src/statusbar_gui.cpp
@@ -123,7 +123,8 @@ struct StatusBarWindow : Window {
FOR_ALL_COMPANIES(c) max_money = max<int64>(c->money, max_money);
SetDParam(0, 100LL * max_money);
d = GetStringBoundingBox(STR_COMPANY_MONEY);
- } break;
+ break;
+ }
default:
return;
@@ -150,7 +151,8 @@ struct StatusBarWindow : Window {
SetDParam(0, c->money);
DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, STR_COMPANY_MONEY, TC_FROMSTRING, SA_HOR_CENTER);
}
- } break;
+ break;
+ }
case SBW_MIDDLE:
/* Draw status bar */
diff --git a/src/strings.cpp b/src/strings.cpp
index be7340616..1ed0a5ea6 100644
--- a/src/strings.cpp
+++ b/src/strings.cpp
@@ -672,7 +672,8 @@ static char *FormatString(char *buff, const char *str, int64 *argv, uint casei,
}
break;
}
- } break;
+ break;
+ }
case SCC_STRING1: { // {STRING1}
/* String that consumes ONE argument */
@@ -878,7 +879,8 @@ static char *FormatString(char *buff, const char *str, int64 *argv, uint casei,
case SCC_ZEROFILL_NUM: { // {ZEROFILL_NUM}
int64 num = GetInt64(&argv);
buff = FormatZerofillNumber(buff, num, GetInt64(&argv), last);
- } break;
+ break;
+ }
case SCC_HEX: // {HEX}
buff = FormatHexNumber(buff, (uint64)GetInt64(&argv), last);
diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp
index 2c6a9a42a..4dcb616c6 100644
--- a/src/terraform_gui.cpp
+++ b/src/terraform_gui.cpp
@@ -676,7 +676,8 @@ struct ScenarioEditorLandscapeGenerationWindow : Window {
SndPlayFx(SND_15_BEEP);
this->SetDirty();
- } break;
+ break;
+ }
case ETTW_NEW_SCENARIO: // gen random land
this->HandleButtonClick(widget);
ShowCreateScenario();
diff --git a/src/timetable_gui.cpp b/src/timetable_gui.cpp
index 42f2753f6..e38e0d938 100644
--- a/src/timetable_gui.cpp
+++ b/src/timetable_gui.cpp
@@ -298,7 +298,8 @@ struct TimetableWindow : Window {
this->sel_index = 2 * selected_order - (int)travel;
/* travel time of first order needs special handling */
if (this->sel_index == -1) this->sel_index = this->vehicle->GetNumOrders() * 2 - 1;
- } break;
+ break;
+ }
}
}
@@ -454,7 +455,8 @@ struct TimetableWindow : Window {
}
y += FONT_HEIGHT_NORMAL;
}
- } break;
+ break;
+ }
case TTV_SUMMARY_PANEL: {
int y = r.top + WD_FRAMERECT_TOP;
@@ -511,7 +513,8 @@ struct TimetableWindow : Window {
this->DeleteChildWindows();
this->sel_index = (selected == INVALID_ORDER || selected == this->sel_index) ? -1 : selected;
- } break;
+ break;
+ }
case TTV_START_DATE: // Change the date that the timetable starts.
ShowSetDateWindow(this, v->index, _date, _cur_year, _cur_year + 15, ChangeTimetableStartCallback);
@@ -537,12 +540,14 @@ struct TimetableWindow : Window {
}
ShowQueryString(current, STR_TIMETABLE_CHANGE_TIME, 31, 150, this, CS_NUMERAL, QSF_NONE);
- } break;
+ break;
+ }
case TTV_CLEAR_TIME: { // Clear waiting time button.
uint32 p1 = PackTimetableArgs(v, this->sel_index);
DoCommandP(0, p1, 0, CMD_CHANGE_TIMETABLE | CMD_MSG(STR_ERROR_CAN_T_TIMETABLE_VEHICLE));
- } break;
+ break;
+ }
case TTV_RESET_LATENESS: // Reset the vehicle's late counter.
DoCommandP(0, v->index, 0, CMD_SET_VEHICLE_ON_TIME | CMD_MSG(STR_ERROR_CAN_T_TIMETABLE_VEHICLE));
@@ -553,7 +558,8 @@ struct TimetableWindow : Window {
if (!HasBit(v->vehicle_flags, VF_AUTOFILL_TIMETABLE)) SetBit(p2, 0);
if (_ctrl_pressed) SetBit(p2, 1);
DoCommandP(0, v->index, p2, CMD_AUTOFILL_TIMETABLE | CMD_MSG(STR_ERROR_CAN_T_TIMETABLE_VEHICLE));
- } break;
+ break;
+ }
case TTV_EXPECTED:
this->show_expected = !this->show_expected;
diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp
index 5e8f27b63..06ce3c969 100644
--- a/src/toolbar_gui.cpp
+++ b/src/toolbar_gui.cpp
@@ -1572,7 +1572,8 @@ public:
} else {
DrawString(r.left, r.right, (height - FONT_HEIGHT_NORMAL) / 2, STR_SCENEDIT_TOOLBAR_SCENARIO_EDITOR, TC_FROMSTRING, SA_HOR_CENTER);
}
- } break;
+ break;
+ }
}
}
diff --git a/src/town_gui.cpp b/src/town_gui.cpp
index 511ff915d..e19bac29f 100644
--- a/src/town_gui.cpp
+++ b/src/town_gui.cpp
@@ -806,7 +806,8 @@ public:
y += this->resize.step_height;
if (++n == this->vscroll.GetCapacity()) break; // max number of towns in 1 window
}
- } break;
+ break;
+ }
}
}
diff --git a/src/tree_cmd.cpp b/src/tree_cmd.cpp
index 085eea223..3b537478b 100644
--- a/src/tree_cmd.cpp
+++ b/src/tree_cmd.cpp
@@ -431,7 +431,8 @@ CommandCost CmdPlantTree(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
}
}
cost.AddCost(_price[PR_BUILD_TREES]);
- } break;
+ break;
+ }
default:
msg = STR_ERROR_SITE_UNSUITABLE;
diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp
index af3e264bc..0996e0009 100644
--- a/src/tunnelbridge_cmd.cpp
+++ b/src/tunnelbridge_cmd.cpp
@@ -1550,7 +1550,8 @@ static VehicleEnterTileStatus VehicleEnter_TunnelBridge(Vehicle *v, TileIndex ti
t->track = TRACK_BIT_WORMHOLE;
ClrBit(t->gv_flags, GVF_GOINGUP_BIT);
ClrBit(t->gv_flags, GVF_GOINGDOWN_BIT);
- } break;
+ break;
+ }
case VEH_ROAD: {
RoadVehicle *rv = RoadVehicle::From(v);
@@ -1558,7 +1559,8 @@ static VehicleEnterTileStatus VehicleEnter_TunnelBridge(Vehicle *v, TileIndex ti
/* There are no slopes inside bridges / tunnels. */
ClrBit(rv->gv_flags, GVF_GOINGUP_BIT);
ClrBit(rv->gv_flags, GVF_GOINGDOWN_BIT);
- } break;
+ break;
+ }
case VEH_SHIP:
Ship::From(v)->state = TRACK_BIT_WORMHOLE;
@@ -1576,7 +1578,8 @@ static VehicleEnterTileStatus VehicleEnter_TunnelBridge(Vehicle *v, TileIndex ti
t->track = (DiagDirToAxis(dir) == AXIS_X ? TRACK_BIT_X : TRACK_BIT_Y);
return VETSB_ENTERED_WORMHOLE;
}
- } break;
+ break;
+ }
case VEH_ROAD: {
RoadVehicle *rv = RoadVehicle::From(v);
@@ -1585,7 +1588,8 @@ static VehicleEnterTileStatus VehicleEnter_TunnelBridge(Vehicle *v, TileIndex ti
rv->frame = 0;
return VETSB_ENTERED_WORMHOLE;
}
- } break;
+ break;
+ }
case VEH_SHIP: {
Ship *ship = Ship::From(v);
@@ -1593,7 +1597,8 @@ static VehicleEnterTileStatus VehicleEnter_TunnelBridge(Vehicle *v, TileIndex ti
ship->state = (DiagDirToAxis(dir) == AXIS_X ? TRACK_BIT_X : TRACK_BIT_Y);
return VETSB_ENTERED_WORMHOLE;
}
- } break;
+ break;
+ }
default: NOT_REACHED();
}
diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp
index 2b08f9280..2cc91b762 100644
--- a/src/vehicle_cmd.cpp
+++ b/src/vehicle_cmd.cpp
@@ -95,7 +95,8 @@ CommandCost CmdStartStopVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1,
Aircraft *a = Aircraft::From(v);
/* cannot stop airplane when in flight, or when taking off / landing */
if (!(v->vehstatus & VS_CRASHED) && a->state >= STARTTAKEOFF && a->state < TERM7) return_cmd_error(STR_ERROR_AIRCRAFT_IS_IN_FLIGHT);
- } break;
+ break;
+ }
default: return CMD_ERROR;
}
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp
index 3a99ae1a1..f6e51ccd3 100644
--- a/src/vehicle_gui.cpp
+++ b/src/vehicle_gui.cpp
@@ -775,7 +775,8 @@ static int CDECL VehicleLengthSorter(const Vehicle * const *a, const Vehicle * c
const RoadVehicle *u;
for (u = RoadVehicle::From(*a); u != NULL; u = u->Next()) r += u->rcache.cached_veh_length;
for (u = RoadVehicle::From(*b); u != NULL; u = u->Next()) r -= u->rcache.cached_veh_length;
- } break;
+ break;
+ }
default: NOT_REACHED();
}
@@ -1149,7 +1150,8 @@ public:
break;
default: NOT_REACHED();
}
- } break;
+ break;
+ }
}
}
@@ -1220,7 +1222,8 @@ public:
const Vehicle *v = this->vehicles[id_v];
ShowVehicleViewWindow(v);
- } break;
+ break;
+ }
case VLW_WIDGET_AVAILABLE_VEHICLES:
ShowBuildVehicleWindow(INVALID_TILE, this->vehicle_type);
@@ -1523,7 +1526,8 @@ struct VehicleDetailsWindow : Window {
SetDParam(0, STR_VEHICLE_INFO_AGE);
dim = maxdim(dim, GetStringBoundingBox(STR_VEHICLE_INFO_AGE_RUNNING_COST_YR));
size->width = dim.width + WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT;
- } break;
+ break;
+ }
case VLD_WIDGET_MIDDLE_DETAILS: {
const Vehicle *v = Vehicle::Get(this->window_number);
@@ -1683,7 +1687,8 @@ struct VehicleDetailsWindow : Window {
DrawVehicleImage(v, sprite_left + WD_FRAMERECT_LEFT, sprite_right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, INVALID_VEHICLE, 0);
}
DrawVehicleDetails(v, text_left + WD_FRAMERECT_LEFT, text_right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, this->vscroll.GetPosition(), this->vscroll.GetCapacity(), this->tab);
- } break;
+ break;
+ }
case VLD_WIDGET_SERVICING_INTERVAL:
/* Draw service interval text */
@@ -1724,7 +1729,8 @@ struct VehicleDetailsWindow : Window {
SetDParam(0, v->index);
ShowQueryString(STR_VEHICLE_NAME, STR_QUERY_RENAME_TRAIN_CAPTION + v->type,
MAX_LENGTH_VEHICLE_NAME_BYTES, MAX_LENGTH_VEHICLE_NAME_PIXELS, this, CS_ALPHANUMERAL, QSF_ENABLE_DEFAULT);
- } break;
+ break;
+ }
case VLD_WIDGET_INCREASE_SERVICING_INTERVAL: // increase int
case VLD_WIDGET_DECREASE_SERVICING_INTERVAL: { // decrease int
@@ -1736,7 +1742,8 @@ struct VehicleDetailsWindow : Window {
if (mod == v->service_interval) return;
DoCommandP(v->tile, v->index, mod, CMD_CHANGE_SERVICE_INT | CMD_MSG(STR_ERROR_CAN_T_CHANGE_SERVICING));
- } break;
+ break;
+ }
case VLD_WIDGET_DETAILS_CARGO_CARRIED:
case VLD_WIDGET_DETAILS_TRAIN_VEHICLES:
@@ -2054,7 +2061,8 @@ public:
if (v->type != VEH_TRAIN) {
size->height = 0;
size->width = 0;
- } break;
+ break;
+ }
case VVW_WIDGET_VIEWPORT:
size->width = VV_INITIAL_VIEWPORT_WIDTH;
@@ -2123,7 +2131,8 @@ public:
SetDParam(0, v->current_order.GetDestination());
SetDParam(1, v->GetDisplaySpeed());
str = STR_VEHICLE_STATUS_HEADING_FOR_STATION + _settings_client.gui.vehicle_speed;
- } break;
+ break;
+ }
case OT_GOTO_DEPOT: {
SetDParam(0, v->type);
@@ -2134,7 +2143,8 @@ public:
} else {
str = STR_VEHICLE_STATUS_HEADING_FOR_DEPOT_SERVICE + _settings_client.gui.vehicle_speed;
}
- } break;
+ break;
+ }
case OT_LOADING:
str = STR_VEHICLE_STATUS_LOADING_UNLOADING;
@@ -2194,7 +2204,8 @@ public:
} else {
ScrollMainWindowTo(v->x_pos, v->y_pos, v->z_pos);
}
- } break;
+ break;
+ }
case VVW_WIDGET_GOTO_DEPOT: // goto hangar
DoCommandP(v->tile, v->index, _ctrl_pressed ? DEPOT_SERVICE : 0, GetCmdSendToDepot(v));
diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp
index 8962c900f..755d6f17a 100644
--- a/src/video/win32_v.cpp
+++ b/src/video/win32_v.cpp
@@ -647,7 +647,8 @@ static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
ChangeDisplaySettings(NULL, 0);
}
}
- } break;
+ break;
+ }
#endif
}
diff --git a/src/viewport.cpp b/src/viewport.cpp
index 155c54782..56cc51a90 100644
--- a/src/viewport.cpp
+++ b/src/viewport.cpp
@@ -2242,7 +2242,8 @@ static int CalcHeightdiff(HighLightStyle style, uint distance, TileIndex start_t
h1 = TileHeight(TILE_ADD(end_tile, ToTileIndexDiff(heightdiff_line_by_dir[12 + style_t])));
ht = TileHeight(TILE_ADD(end_tile, ToTileIndexDiff(heightdiff_line_by_dir[12 + style_t + 1])));
h1 = max(h1, ht);
- } break;
+ break;
+ }
}
if (swap) Swap(h0, h1);
@@ -2582,7 +2583,8 @@ calc_heightdiff_single_direction:;
}
ShowMeasurementTooltips(measure_strings_length[index], index, params);
- } break;
+ break;
+ }
case VPM_X_AND_Y_LIMITED: // Drag an X by Y constrained rect area.
limit = (_thd.sizelimit - 1) * TILE_SIZE;
diff --git a/src/viewport_gui.cpp b/src/viewport_gui.cpp
index 83b662385..26815c5d5 100644
--- a/src/viewport_gui.cpp
+++ b/src/viewport_gui.cpp
@@ -116,7 +116,8 @@ public:
w->viewport->dest_scrollpos_x = x - (w->viewport->virtual_width - this->viewport->virtual_width) / 2;
w->viewport->dest_scrollpos_y = y - (w->viewport->virtual_height - this->viewport->virtual_height) / 2;
w->viewport->follow_vehicle = INVALID_VEHICLE;
- } break;
+ break;
+ }
case EVW_VIEW_TO_MAIN: { // inverse location button (move this view to same spot as main view) 'Copy Location'
const Window *w = FindWindowById(WC_MAIN_WINDOW, 0);
@@ -125,7 +126,8 @@ public:
this->viewport->dest_scrollpos_x = x + (w->viewport->virtual_width - this->viewport->virtual_width) / 2;
this->viewport->dest_scrollpos_y = y + (w->viewport->virtual_height - this->viewport->virtual_height) / 2;
- } break;
+ break;
+ }
}
}
diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp
index 36ec19ca2..a5cc258b3 100644
--- a/src/water_cmd.cpp
+++ b/src/water_cmd.cpp
@@ -668,12 +668,14 @@ static void DrawTile_Water(TileInfo *ti)
case WATER_TILE_COAST: {
DrawShoreTile(ti->tileh);
DrawBridgeMiddle(ti);
- } break;
+ break;
+ }
case WATER_TILE_LOCK: {
const WaterDrawTileStruct *t = _lock_display_seq[GetSection(ti->tile)];
DrawWaterStuff(ti, t, 0, ti->z > t[3].delta_y ? 24 : 0, true);
- } break;
+ break;
+ }
case WATER_TILE_DEPOT:
DrawWaterClassGround(ti);
diff --git a/src/window.cpp b/src/window.cpp
index a0e1c4c54..d6e93ca5f 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -2724,7 +2724,8 @@ void RelocateAllWindows(int neww, int newh)
} else {
if (top < 0) top = 0;
}
- } break;
+ break;
+ }
}
if (w->viewport != NULL) {