mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-04 05:15:21 +00:00
(svn r17131) -Codechange: apply coding style to some switch statements
This commit is contained in:
parent
05a65dcc12
commit
e707c82412
@ -64,7 +64,7 @@
|
||||
|
||||
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_MAIL: return t->act_mail;
|
||||
default: return -1;
|
||||
@ -78,7 +78,7 @@
|
||||
|
||||
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_MAIL: return t->pct_mail_transported;
|
||||
default: return -1;
|
||||
@ -92,7 +92,7 @@
|
||||
|
||||
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_MAIL: return t->max_mail;
|
||||
default: return -1;
|
||||
|
@ -427,7 +427,7 @@ public:
|
||||
|
||||
virtual void OnClick(Point pt, int widget)
|
||||
{
|
||||
switch(widget) {
|
||||
switch (widget) {
|
||||
case GRP_WIDGET_SORT_BY_ORDER: // Flip sorting method ascending/descending
|
||||
this->vehicles.ToggleSortOrder();
|
||||
this->SetDirty();
|
||||
|
@ -2119,7 +2119,7 @@ static void ChangeIndustryProduction(Industry *i, bool monthly)
|
||||
/* Get the custom message if any */
|
||||
if (HasBit(res, 8)) str = MapGRFStringID(indspec->grf_prop.grffile->grfid, GB(GetRegister(0x100), 0, 16));
|
||||
res = GB(res, 0, 4);
|
||||
switch(res) {
|
||||
switch (res) {
|
||||
default: NOT_REACHED();
|
||||
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.
|
||||
|
@ -824,7 +824,7 @@ void SettingEntry::Init(byte level, bool last_field)
|
||||
/** Recursively close all folds of sub-pages */
|
||||
void SettingEntry::FoldAll()
|
||||
{
|
||||
switch(this->flags & SEF_KIND_MASK) {
|
||||
switch (this->flags & SEF_KIND_MASK) {
|
||||
case SEF_SETTING_KIND:
|
||||
break;
|
||||
|
||||
@ -940,7 +940,7 @@ uint SettingEntry::Draw(GameSettings *settings_ptr, int base_x, int base_y, int
|
||||
x += LEVEL_WIDTH;
|
||||
}
|
||||
|
||||
switch(this->flags & SEF_KIND_MASK) {
|
||||
switch (this->flags & SEF_KIND_MASK) {
|
||||
case SEF_SETTING_KIND:
|
||||
if (cur_row >= first_row) {
|
||||
DrawSetting(settings_ptr, this->d.entry.setting, x, y, max_x, this->flags & SEF_BUTTONS_MASK);
|
||||
|
@ -439,7 +439,7 @@ static void HeightMapSineTransform(height_t h_min, height_t h_max)
|
||||
/* Transform height into 0..1 space */
|
||||
fheight = (double)(*h - h_min) / (double)(h_max - h_min);
|
||||
/* Apply sine transform depending on landscape type */
|
||||
switch(_settings_game.game_creation.landscape) {
|
||||
switch (_settings_game.game_creation.landscape) {
|
||||
case LT_TOYLAND:
|
||||
case LT_TEMPERATE:
|
||||
/* Move and scale 0..1 into -1..+1 */
|
||||
|
@ -618,7 +618,7 @@ public:
|
||||
|
||||
virtual void DrawWidget(const Rect &r, int widget) const
|
||||
{
|
||||
switch(widget) {
|
||||
switch (widget) {
|
||||
case TDW_SORTNAME:
|
||||
if (this->towns.SortType() == 0) this->DrawSortButtonState(widget, this->towns.IsDescSortOrder() ? SBS_DOWN : SBS_UP);
|
||||
break;
|
||||
|
@ -502,7 +502,7 @@ inline void WindowQuickdrawSubdriver::BlitToView(int left, int top, int right, i
|
||||
{
|
||||
switch (device_depth) {
|
||||
case 32:
|
||||
switch(buffer_depth) {
|
||||
switch (buffer_depth) {
|
||||
case 32:
|
||||
Blit32ToView32(left, top, right, bottom);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user