diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -535,9 +535,9 @@ static void SetupStringsForDepotWindow(W case VEH_TRAIN: w->widget[DEPOT_WIDGET_CAPTION].data = STR_8800_TRAIN_DEPOT; w->widget[DEPOT_WIDGET_STOP_ALL].tooltips = STR_MASS_STOP_DEPOT_TRAIN_TIP; - w->widget[DEPOT_WIDGET_START_ALL].tooltips= STR_MASS_START_DEPOT_TRAIN_TIP; + w->widget[DEPOT_WIDGET_START_ALL].tooltips= STR_MASS_START_DEPOT_TRAIN_TIP; w->widget[DEPOT_WIDGET_SELL].tooltips = STR_8841_DRAG_TRAIN_VEHICLE_TO_HERE; - w->widget[DEPOT_WIDGET_SELL_ALL].tooltips = STR_DEPOT_SELL_ALL_BUTTON_TRAIN_TIP; + w->widget[DEPOT_WIDGET_SELL_ALL].tooltips = STR_DEPOT_SELL_ALL_BUTTON_TRAIN_TIP; w->widget[DEPOT_WIDGET_MATRIX].tooltips = STR_883F_TRAINS_CLICK_ON_TRAIN_FOR; w->widget[DEPOT_WIDGET_BUILD].data = STR_8815_NEW_VEHICLES; @@ -559,9 +559,9 @@ static void SetupStringsForDepotWindow(W case VEH_ROAD: w->widget[DEPOT_WIDGET_CAPTION].data = STR_9003_ROAD_VEHICLE_DEPOT; w->widget[DEPOT_WIDGET_STOP_ALL].tooltips = STR_MASS_STOP_DEPOT_ROADVEH_TIP; - w->widget[DEPOT_WIDGET_START_ALL].tooltips= STR_MASS_START_DEPOT_ROADVEH_TIP; + w->widget[DEPOT_WIDGET_START_ALL].tooltips= STR_MASS_START_DEPOT_ROADVEH_TIP; w->widget[DEPOT_WIDGET_SELL].tooltips = STR_9024_DRAG_ROAD_VEHICLE_TO_HERE; - w->widget[DEPOT_WIDGET_SELL_ALL].tooltips = STR_DEPOT_SELL_ALL_BUTTON_ROADVEH_TIP; + w->widget[DEPOT_WIDGET_SELL_ALL].tooltips = STR_DEPOT_SELL_ALL_BUTTON_ROADVEH_TIP; w->widget[DEPOT_WIDGET_MATRIX].tooltips = STR_9022_VEHICLES_CLICK_ON_VEHICLE; w->widget[DEPOT_WIDGET_BUILD].data = STR_9004_NEW_VEHICLES; @@ -583,9 +583,9 @@ static void SetupStringsForDepotWindow(W case VEH_SHIP: w->widget[DEPOT_WIDGET_CAPTION].data = STR_9803_SHIP_DEPOT; w->widget[DEPOT_WIDGET_STOP_ALL].tooltips = STR_MASS_STOP_DEPOT_SHIP_TIP; - w->widget[DEPOT_WIDGET_START_ALL].tooltips= STR_MASS_START_DEPOT_SHIP_TIP; + w->widget[DEPOT_WIDGET_START_ALL].tooltips= STR_MASS_START_DEPOT_SHIP_TIP; w->widget[DEPOT_WIDGET_SELL].tooltips = STR_9821_DRAG_SHIP_TO_HERE_TO_SELL; - w->widget[DEPOT_WIDGET_SELL_ALL].tooltips = STR_DEPOT_SELL_ALL_BUTTON_SHIP_TIP; + w->widget[DEPOT_WIDGET_SELL_ALL].tooltips = STR_DEPOT_SELL_ALL_BUTTON_SHIP_TIP; w->widget[DEPOT_WIDGET_MATRIX].tooltips = STR_981F_SHIPS_CLICK_ON_SHIP_FOR; w->widget[DEPOT_WIDGET_BUILD].data = STR_9804_NEW_SHIPS; @@ -607,9 +607,9 @@ static void SetupStringsForDepotWindow(W case VEH_AIRCRAFT: w->widget[DEPOT_WIDGET_CAPTION].data = STR_A002_AIRCRAFT_HANGAR; w->widget[DEPOT_WIDGET_STOP_ALL].tooltips = STR_MASS_STOP_HANGAR_TIP; - w->widget[DEPOT_WIDGET_START_ALL].tooltips= STR_MASS_START_HANGAR_TIP; + w->widget[DEPOT_WIDGET_START_ALL].tooltips= STR_MASS_START_HANGAR_TIP; w->widget[DEPOT_WIDGET_SELL].tooltips = STR_A023_DRAG_AIRCRAFT_TO_HERE_TO; - w->widget[DEPOT_WIDGET_SELL_ALL].tooltips = STR_DEPOT_SELL_ALL_BUTTON_AIRCRAFT_TIP; + w->widget[DEPOT_WIDGET_SELL_ALL].tooltips = STR_DEPOT_SELL_ALL_BUTTON_AIRCRAFT_TIP; w->widget[DEPOT_WIDGET_MATRIX].tooltips = STR_A021_AIRCRAFT_CLICK_ON_AIRCRAFT; w->widget[DEPOT_WIDGET_BUILD].data = STR_A003_NEW_AIRCRAFT; diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -392,7 +392,7 @@ static void IndustryViewWndProc(Window * case 6: i = GetIndustry(w->window_number); ScrollMainWindowToTile(i->xy + TileDiffXY(1, 1)); - } break; + } break; } break; diff --git a/src/main_gui.cpp b/src/main_gui.cpp --- a/src/main_gui.cpp +++ b/src/main_gui.cpp @@ -89,7 +89,7 @@ void HandleOnEditText(const char *str) } else { NetworkServer_HandleChat(NETWORK_ACTION_GIVE_MONEY, DESTTYPE_TEAM, id, msg, NETWORK_SERVER_INDEX); } - } break; + } break; #endif /* ENABLE_NETWORK */ default: NOT_REACHED(); } diff --git a/src/map.cpp b/src/map.cpp --- a/src/map.cpp +++ b/src/map.cpp @@ -48,12 +48,12 @@ void AllocateMap(uint size_x, uint size_ free(_me); _m = CallocT(_map_size); - _me = CallocT(_map_size); + _me = CallocT(_map_size); - /* XXX @todo handle memory shortage more gracefully - * Maybe some attemps could be made to try with smaller maps down to 64x64 - * Maybe check for available memory before doing the calls, after all, we know how big - * the map is */ + /* XXX @todo handle memory shortage more gracefully + * Maybe some attemps could be made to try with smaller maps down to 64x64 + * Maybe check for available memory before doing the calls, after all, we know how big + * the map is */ if ((_m == NULL) || (_me == NULL)) error("Failed to allocate memory for the map"); } diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -277,7 +277,7 @@ static void AboutWindowProc(Window *w, W DoDrawStringCentered(210, w->height - 25, "Website: http://www.openttd.org", 16); DrawStringCentered(210, w->height - 15, STR_00BA_COPYRIGHT_OPENTTD, 0); - } break; + } break; case WE_MOUSELOOP: // Timer to scroll the text and adjust the new top if (WP(w, scroller_d).counter++ % 3 == 0) { WP(w, scroller_d).height--; diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp --- a/src/network/network_client.cpp +++ b/src/network/network_client.cpp @@ -523,7 +523,7 @@ DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER if (_network_join_kbytes_total == 0) return NETWORK_RECV_STATUS_MALFORMED_PACKET; _network_join_status = NETWORK_JOIN_STATUS_DOWNLOADING; - InvalidateWindow(WC_NETWORK_STATUS_WINDOW, 0); + InvalidateWindow(WC_NETWORK_STATUS_WINDOW, 0); // The first packet does not contain any more data return NETWORK_RECV_STATUS_OKAY; diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -385,7 +385,7 @@ static void NetworkGameWindowWndProc(Win y += 10; } - } break; + } break; case WE_CLICK: nd->field = e->we.click.widget; @@ -452,7 +452,7 @@ static void NetworkGameWindowWndProc(Win if (nd->server != NULL) ShowNewGRFSettings(false, false, false, &nd->server->info.grfconfig); break; - } break; + } break; case WE_DROPDOWN_SELECT: /* we have selected a dropdown item in the list */ switch (e->we.dropdown.button) { @@ -644,7 +644,7 @@ static void NetworkStartServerWindowWndP if (y >= w->vscroll.cap * NSSWND_ROWSIZE + NSSWND_START) break; } - } break; + } break; case WE_CLICK: nd->field = e->we.click.widget; @@ -914,7 +914,7 @@ static void NetworkLobbyWindowWndProc(Wi SetDParamStr(0, _network_player_info[nd->company].players); DrawStringTruncated(x, y, STR_NETWORK_PLAYERS, 2, trunc_width); // players } - } break; + } break; case WE_CLICK: switch (e->we.click.widget) { @@ -929,7 +929,7 @@ static void NetworkLobbyWindowWndProc(Wi id_v += w->vscroll.pos; nd->company = (id_v >= nd->server->info.companies_on) ? INVALID_PLAYER : NetworkLobbyFindCompanyIndex(id_v); SetWindowDirty(w); - } break; + } break; case 7: /* Join company */ if (nd->company != (byte)-1) { _network_playas = nd->company; @@ -948,7 +948,7 @@ static void NetworkLobbyWindowWndProc(Wi NetworkTCPQueryServer(_network_last_host, _network_last_port); // company info NetworkUDPQueryServer(_network_last_host, _network_last_port); // general data break; - } break; + } break; case WE_MESSAGE: SetWindowDirty(w); @@ -1265,7 +1265,7 @@ static void ClientListPopupWndProc(Windo DoDrawString(_clientlist_action[i], 4, y, colour); } - } break; + } break; case WE_POPUPMENU_SELECT: { // We selected an action @@ -1275,7 +1275,7 @@ static void ClientListPopupWndProc(Windo HandleClientListPopupClick(index, WP(w,menu_d).main_button); DeleteWindowById(WC_TOOLBAR_MENU, 0); - } break; + } break; case WE_POPUPMENU_OVER: { // Our mouse hoovers over an action? Select it! @@ -1327,7 +1327,7 @@ static void ClientListWndProc(Window *w, y += CLNWND_ROWSIZE; } - } break; + } break; case WE_CLICK: // Show the popup with option @@ -1420,7 +1420,7 @@ static void NetworkJoinStatusWindowWndPr /* Draw nice progress bar :) */ DrawFrameRect(20, 18, (int)((w->width - 20) * progress / 100), 28, 10, FR_NONE); - } break; + } break; case WE_CLICK: switch (e->we.click.widget) { diff --git a/src/network/network_udp.cpp b/src/network/network_udp.cpp --- a/src/network/network_udp.cpp +++ b/src/network/network_udp.cpp @@ -240,7 +240,7 @@ DEF_UDP_RECEIVE_COMMAND(Server, PACKET_U /* The name could be an empty string, if so take the filename */ ttd_strlcpy(name, (in_reply[i]->name != NULL && !StrEmpty(in_reply[i]->name)) ? in_reply[i]->name : in_reply[i]->filename, sizeof(name)); - this->Send_GRFIdentifier(&packet, in_reply[i]); + this->Send_GRFIdentifier(&packet, in_reply[i]); packet.Send_string(name); } diff --git a/src/newgrf.cpp b/src/newgrf.cpp --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -1372,7 +1372,7 @@ static bool TownHouseChangeInfo(uint hid case 0x17: // Four random colours to use FOR_EACH_OBJECT { uint j; - for (j = 0; j < 4; j++) housespec[i]->random_colour[j] = grf_load_byte(&buf); + for (j = 0; j < 4; j++) housespec[i]->random_colour[j] = grf_load_byte(&buf); } break; diff --git a/src/order_gui.cpp b/src/order_gui.cpp --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -478,7 +478,7 @@ static void OrdersWndProc(Window *w, Win if (sel == WP(w,order_d).sel) sel = -1; WP(w,order_d).sel = sel; SetWindowDirty(w); - } break; + } break; case ORDER_WIDGET_SKIP: OrderClick_Skip(w, v); diff --git a/src/os2.cpp b/src/os2.cpp --- a/src/os2.cpp +++ b/src/os2.cpp @@ -222,7 +222,7 @@ bool InsertTextBufferClipboard(Textbuf * void CSleep(int milliseconds) { #ifndef __INNOTEK_LIBC__ - delay(milliseconds); + delay(milliseconds); #else usleep(milliseconds * 1000); #endif diff --git a/src/road_gui.cpp b/src/road_gui.cpp --- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -227,7 +227,7 @@ static void BuildRoadToolbWndProc(Window case WE_CLICK: { if (e->we.click.widget >= 3) _build_road_button_proc[e->we.click.widget - 3](w); - } break; + } break; case WE_KEYPRESS: switch (e->we.keypress.keycode) { @@ -411,7 +411,7 @@ static void BuildRoadDepotWndProc(Window SetWindowDirty(w); break; } - } break; + } break; case WE_MOUSELOOP: if (WP(w, def_d).close) DeleteWindow(w); diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -115,7 +115,7 @@ static void GameOptionsWndProc(Window *w DrawWindowWidgets(w); DrawString(20, 175, STR_OPTIONS_FULLSCREEN, 0); // fullscreen - } break; + } break; case WE_CLICK: switch (e->we.click.widget) { @@ -498,7 +498,7 @@ static void GameDifficultyWndProc(Window SetDifficultyLevel(3, &_opt_mod_temp); // set difficulty level to custom LowerWindowWidget(w, _opt_mod_temp.diff_level + 3); SetWindowDirty(w); - } break; + } break; case 3: case 4: case 5: case 6: /* Easy / Medium / Hard / Custom */ // temporarily change difficulty level RaiseWindowWidget(w, _opt_mod_temp.diff_level + 3); diff --git a/src/strings.cpp b/src/strings.cpp --- a/src/strings.cpp +++ b/src/strings.cpp @@ -421,7 +421,7 @@ static int DeterminePluralForm(int32 n) * Used in: * Latvian */ case 3: - return n%10 == 1 && n%100 != 11 ? 0 : n != 0 ? 1 : 2; + return n % 10 == 1 && n % 100 != 11 ? 0 : n != 0 ? 1 : 2; /* Three forms, special case for one and two * Used in: @@ -433,25 +433,25 @@ static int DeterminePluralForm(int32 n) * Used in: * Lithuanian */ case 5: - return n%10 == 1 && n%100 != 11 ? 0 : n%10 >= 2 && (n%100<10 || n%100 >= 20) ? 1 : 2; + return n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2; /* Three forms, special cases for numbers ending in 1 and 2, 3, 4, except those ending in 1[1-4] * Used in: * Croatian, Czech, Russian, Slovak, Ukrainian */ case 6: - return n%10 == 1 && n%100 != 11 ? 0 : n%10 >= 2 && n%10 <= 4 && (n%100<10 || n%100 >= 20) ? 1 : 2; + return n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2; /* Three forms, special case for one and some numbers ending in 2, 3, or 4 * Used in: * Polish */ case 7: - return n == 1 ? 0 : n%10 >= 2 && n%10 <= 4 && (n%100<10 || n%100 >= 20) ? 1 : 2; + return n == 1 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2; /* Four forms, special case for one and all numbers ending in 02, 03, or 04 * Used in: * Slovenian */ case 8: - return n%100 == 1 ? 0 : n%100 == 2 ? 1 : n%100 == 3 || n%100 == 4 ? 2 : 3; + return n % 100 == 1 ? 0 : n % 100 == 2 ? 1 : n % 100 == 3 || n % 100 == 4 ? 2 : 3; } } diff --git a/src/texteff.cpp b/src/texteff.cpp --- a/src/texteff.cpp +++ b/src/texteff.cpp @@ -246,7 +246,7 @@ void DrawTextMessage() /* Paint the messages starting with the lowest at the bottom */ for (uint y = 13; count-- != 0; y += 13) { DoDrawString(_textmsg_list[count].message, _textmsg_box.x + 3, _screen.height - _textmsg_box.y - y + 1, _textmsg_list[count].color); - } + } /* Make sure the data is updated next flush */ _video_driver->make_dirty(x, y, width, height); diff --git a/src/train_gui.cpp b/src/train_gui.cpp --- a/src/train_gui.cpp +++ b/src/train_gui.cpp @@ -234,7 +234,7 @@ static void TrainViewWndProc(Window *w, DrawSprite(v->vehstatus & VS_STOPPED ? SPR_FLAG_VEH_STOPPED : SPR_FLAG_VEH_RUNNING, PAL_NONE, 2, w->widget[5].top + 1); DrawStringCenteredTruncated(w->widget[5].left + 8, w->widget[5].right, w->widget[5].top + 1, str, 0); DrawWindowViewport(w); - } break; + } break; case WE_CLICK: { int wid = e->we.click.widget; diff --git a/src/vehicle.cpp b/src/vehicle.cpp --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -2223,7 +2223,7 @@ void VehicleEnterDepot(Vehicle *v) } SetDParam(0, v->unitnumber); - AddNewsItem(string, NEWS_FLAGS(NM_SMALL, NF_VIEWPORT|NF_VEHICLE, NT_ADVICE, 0), v->index, 0); + AddNewsItem(string, NEWS_FLAGS(NM_SMALL, NF_VIEWPORT|NF_VEHICLE, NT_ADVICE, 0), v->index, 0); } } } diff --git a/src/vehicle.h b/src/vehicle.h --- a/src/vehicle.h +++ b/src/vehicle.h @@ -408,7 +408,7 @@ int32 MaybeReplaceVehicle(Vehicle *v, bo /* Flags to add to p2 for goto depot commands */ /* Note: bits 8-10 are used for VLW flags */ enum { - DEPOT_SERVICE = (1 << 0), // The vehicle will leave the depot right after arrival (serivce only) + DEPOT_SERVICE = (1 << 0), // The vehicle will leave the depot right after arrival (serivce only) DEPOT_MASS_SEND = (1 << 1), // Tells that it's a mass send to depot command (type in VLW flag) DEPOT_DONT_CANCEL = (1 << 2), // Don't cancel current goto depot command if any DEPOT_LOCATE_HANGAR = (1 << 3), // Find another airport if the target one lacks a hangar diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -358,7 +358,7 @@ static void VehicleRefitWndProc(Window * DrawString(2, w->widget[5].top + 1, STR_9840_NEW_CAPACITY_COST_OF_REFIT, 0); } } - } break; + } break; case WE_CLICK: switch (e->we.click.widget) { @@ -922,7 +922,7 @@ static void CreateVehicleListWindow(Wind vl->l.flags = VL_REBUILD | (vl->_sorting->order ? VL_DESC : VL_NONE); vl->l.sort_type = vl->_sorting->criteria; vl->sort_list = NULL; - vl->l.resort_timer = DAY_TICKS * PERIODIC_RESORT_DAYS; // Set up resort timer + vl->l.resort_timer = DAY_TICKS * PERIODIC_RESORT_DAYS; // Set up resort timer } static void DrawSmallOrderList(const Vehicle *v, int x, int y) @@ -1140,7 +1140,7 @@ void PlayerVehWndProc(Window *w, WindowE DoCommandP(0, GB(w->window_number, 16, 16), (w->window_number & VLW_MASK) | (1 << 6) | (e->we.click.widget == VLW_WIDGET_START_ALL ? (1 << 5) : 0) | vl->vehicle_type, NULL, CMD_MASS_START_STOP); break; } - } break; + } break; case WE_DROPDOWN_SELECT: /* we have selected a dropdown item in the list */ switch (e->we.dropdown.button) { diff --git a/src/win32.cpp b/src/win32.cpp --- a/src/win32.cpp +++ b/src/win32.cpp @@ -418,7 +418,7 @@ static INT_PTR CALLBACK CrashDialogFunc( EnableWindow(GetDlgItem(wnd, 14), FALSE); SetCursor(LoadCursor(NULL, IDC_ARROW)); MessageBox(wnd, _T("Crash report submitted. Thank you."), _T("Crash Report"), MB_ICONINFORMATION); - } break; + } break; #endif /* Disabled crash-submit procedures */ case 15: /* Expand window to show crash-message */ _expanded ^= 1; diff --git a/src/window.cpp b/src/window.cpp --- a/src/window.cpp +++ b/src/window.cpp @@ -823,7 +823,7 @@ static Window *LocalAllocateWindowDesc(c case WDP_ALIGN_TBR: { /* Align the right side with the top toolbar */ w = FindWindowById(WC_MAIN_TOOLBAR, 0); pt.x = (w->left + w->width) - desc->width; - } break; + } break; case WDP_ALIGN_TBL: /* Align the left side with the top toolbar */ pt.x = FindWindowById(WC_MAIN_TOOLBAR, 0)->left; break;