1
0
Fork 0

(svn r17131) -Codechange: apply coding style to some switch statements

release/1.0
smatz 2009-08-09 14:40:34 +00:00
parent 05a65dcc12
commit e707c82412
7 changed files with 10 additions and 10 deletions

View File

@ -64,7 +64,7 @@
const Town *t = ::Town::Get(town_id); const Town *t = ::Town::Get(town_id);
switch(AICargo::GetTownEffect(cargo_id)) { switch (AICargo::GetTownEffect(cargo_id)) {
case AICargo::TE_PASSENGERS: return t->act_pass; case AICargo::TE_PASSENGERS: return t->act_pass;
case AICargo::TE_MAIL: return t->act_mail; case AICargo::TE_MAIL: return t->act_mail;
default: return -1; default: return -1;
@ -78,7 +78,7 @@
const Town *t = ::Town::Get(town_id); const Town *t = ::Town::Get(town_id);
switch(AICargo::GetTownEffect(cargo_id)) { switch (AICargo::GetTownEffect(cargo_id)) {
case AICargo::TE_PASSENGERS: return t->pct_pass_transported; case AICargo::TE_PASSENGERS: return t->pct_pass_transported;
case AICargo::TE_MAIL: return t->pct_mail_transported; case AICargo::TE_MAIL: return t->pct_mail_transported;
default: return -1; default: return -1;
@ -92,7 +92,7 @@
const Town *t = ::Town::Get(town_id); const Town *t = ::Town::Get(town_id);
switch(AICargo::GetTownEffect(cargo_id)) { switch (AICargo::GetTownEffect(cargo_id)) {
case AICargo::TE_PASSENGERS: return t->max_pass; case AICargo::TE_PASSENGERS: return t->max_pass;
case AICargo::TE_MAIL: return t->max_mail; case AICargo::TE_MAIL: return t->max_mail;
default: return -1; default: return -1;

View File

@ -427,7 +427,7 @@ public:
virtual void OnClick(Point pt, int widget) virtual void OnClick(Point pt, int widget)
{ {
switch(widget) { switch (widget) {
case GRP_WIDGET_SORT_BY_ORDER: // Flip sorting method ascending/descending case GRP_WIDGET_SORT_BY_ORDER: // Flip sorting method ascending/descending
this->vehicles.ToggleSortOrder(); this->vehicles.ToggleSortOrder();
this->SetDirty(); this->SetDirty();

View File

@ -2119,7 +2119,7 @@ static void ChangeIndustryProduction(Industry *i, bool monthly)
/* Get the custom message if any */ /* Get the custom message if any */
if (HasBit(res, 8)) str = MapGRFStringID(indspec->grf_prop.grffile->grfid, GB(GetRegister(0x100), 0, 16)); if (HasBit(res, 8)) str = MapGRFStringID(indspec->grf_prop.grffile->grfid, GB(GetRegister(0x100), 0, 16));
res = GB(res, 0, 4); res = GB(res, 0, 4);
switch(res) { switch (res) {
default: NOT_REACHED(); default: NOT_REACHED();
case 0x0: break; // Do nothing, but show the custom message if any case 0x0: break; // Do nothing, but show the custom message if any
case 0x1: div = 1; break; // Halve industry production. If production reaches the quarter of the default, the industry is closed instead. case 0x1: div = 1; break; // Halve industry production. If production reaches the quarter of the default, the industry is closed instead.

View File

@ -824,7 +824,7 @@ void SettingEntry::Init(byte level, bool last_field)
/** Recursively close all folds of sub-pages */ /** Recursively close all folds of sub-pages */
void SettingEntry::FoldAll() void SettingEntry::FoldAll()
{ {
switch(this->flags & SEF_KIND_MASK) { switch (this->flags & SEF_KIND_MASK) {
case SEF_SETTING_KIND: case SEF_SETTING_KIND:
break; break;
@ -940,7 +940,7 @@ uint SettingEntry::Draw(GameSettings *settings_ptr, int base_x, int base_y, int
x += LEVEL_WIDTH; x += LEVEL_WIDTH;
} }
switch(this->flags & SEF_KIND_MASK) { switch (this->flags & SEF_KIND_MASK) {
case SEF_SETTING_KIND: case SEF_SETTING_KIND:
if (cur_row >= first_row) { if (cur_row >= first_row) {
DrawSetting(settings_ptr, this->d.entry.setting, x, y, max_x, this->flags & SEF_BUTTONS_MASK); DrawSetting(settings_ptr, this->d.entry.setting, x, y, max_x, this->flags & SEF_BUTTONS_MASK);

View File

@ -439,7 +439,7 @@ static void HeightMapSineTransform(height_t h_min, height_t h_max)
/* Transform height into 0..1 space */ /* Transform height into 0..1 space */
fheight = (double)(*h - h_min) / (double)(h_max - h_min); fheight = (double)(*h - h_min) / (double)(h_max - h_min);
/* Apply sine transform depending on landscape type */ /* Apply sine transform depending on landscape type */
switch(_settings_game.game_creation.landscape) { switch (_settings_game.game_creation.landscape) {
case LT_TOYLAND: case LT_TOYLAND:
case LT_TEMPERATE: case LT_TEMPERATE:
/* Move and scale 0..1 into -1..+1 */ /* Move and scale 0..1 into -1..+1 */

View File

@ -618,7 +618,7 @@ public:
virtual void DrawWidget(const Rect &r, int widget) const virtual void DrawWidget(const Rect &r, int widget) const
{ {
switch(widget) { switch (widget) {
case TDW_SORTNAME: case TDW_SORTNAME:
if (this->towns.SortType() == 0) this->DrawSortButtonState(widget, this->towns.IsDescSortOrder() ? SBS_DOWN : SBS_UP); if (this->towns.SortType() == 0) this->DrawSortButtonState(widget, this->towns.IsDescSortOrder() ? SBS_DOWN : SBS_UP);
break; break;

View File

@ -502,7 +502,7 @@ inline void WindowQuickdrawSubdriver::BlitToView(int left, int top, int right, i
{ {
switch (device_depth) { switch (device_depth) {
case 32: case 32:
switch(buffer_depth) { switch (buffer_depth) {
case 32: case 32:
Blit32ToView32(left, top, right, bottom); Blit32ToView32(left, top, right, bottom);
break; break;