From 47137cefb72d3b3d3bc6fdefc7a4b103429f6d46 Mon Sep 17 00:00:00 2001 From: tron Date: Sun, 23 Oct 2005 13:04:44 +0000 Subject: (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 --- main_gui.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'main_gui.c') 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); } -- cgit v1.2.3-70-g09d2