summaryrefslogtreecommitdiff
path: root/main_gui.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-10-23 13:04:44 +0000
committertron <tron@openttd.org>2005-10-23 13:04:44 +0000
commit47137cefb72d3b3d3bc6fdefc7a4b103429f6d46 (patch)
tree7a8d1fbbe0d0d6ee2c8e981c57be6a9003505e97 /main_gui.c
parent2cc2154ad26b96b032df2f4fca0ce1634e6330b2 (diff)
downloadopenttd-47137cefb72d3b3d3bc6fdefc7a4b103429f6d46.tar.xz
(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
Diffstat (limited to 'main_gui.c')
-rw-r--r--main_gui.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/main_gui.c b/main_gui.c
index 6bb72b1c4..c562465f2 100644
--- a/main_gui.c
+++ b/main_gui.c
@@ -152,7 +152,7 @@ typedef void ToolbarButtonProc(Window *w);
static void ToolbarPauseClick(Window *w)
{
- if (_networking && !_network_server) { return;} // only server can pause the game
+ if (_networking && !_network_server) return; // only server can pause the game
if (DoCommandP(0, _pause ? 0 : 1, 0, NULL, CMD_PAUSE))
SndPlayFx(SND_15_BEEP);
@@ -913,8 +913,10 @@ bool DoZoomInOutWindow(int how, Window *w)
// update the toolbar button too
CLRBIT(wt->disabled_state, button);
CLRBIT(wt->disabled_state, button + 1);
- if (vp->zoom == 0) SETBIT(wt->disabled_state, button);
- else if (vp->zoom == 2) SETBIT(wt->disabled_state, button + 1);
+ switch (vp->zoom) {
+ case 0: SETBIT(wt->disabled_state, button); break;
+ case 2: SETBIT(wt->disabled_state, button + 1); break;
+ }
SetWindowDirty(wt);
}