(svn r3078) Some more stuff, which piled up:

- const, whitespace, indentation, bracing, GB/SB, pointless casts
- use the trinary operator where appropriate
- data types (uint[] -> AcceptedCargo, ...)
- if cascade -> switch
- if (ptr) -> if (ptr != NULL)
- DeMorgan's Law
- Fix some comments
- 0 -> '\0', change magic numbers to symbolic constants
This commit is contained in:
tron
2005-10-23 13:04:44 +00:00
parent 2cc2154ad2
commit 47137cefb7
38 changed files with 442 additions and 453 deletions

View File

@@ -264,7 +264,7 @@ void ShowPlayerStations(PlayerID player)
Window *w;
w = AllocateWindowDescFront(&_player_stations_desc, player);
if (w) {
if (w != NULL) {
w->caption_color = (byte)w->window_number;
w->vscroll.cap = 12;
w->resize.step_height = 10;
@@ -500,13 +500,13 @@ static void StationViewWndProc(Window *w, WindowEvent *e)
}
break;
case WE_ON_EDIT_TEXT: {
case WE_ON_EDIT_TEXT:
if (e->edittext.str[0] != '\0') {
_cmd_text = e->edittext.str;
DoCommandP(0, w->window_number, 0, NULL,
CMD_RENAME_STATION | CMD_MSG(STR_3031_CAN_T_RENAME_STATION));
}
} break;
break;
case WE_DESTROY: {
WindowNumber wno =
@@ -535,7 +535,7 @@ void ShowStationViewWindow(StationID station)
Window *w;
w = AllocateWindowDescFront(&_station_view_desc, station);
if (w) {
if (w != NULL) {
PlayerID owner = GetStation(w->window_number)->owner;
if (owner != OWNER_NONE) w->caption_color = owner;
w->vscroll.cap = 5;