From f7abff5f963cddfdd134ac52ffd8e72e3ed88f0c Mon Sep 17 00:00:00 2001 From: tron Date: Mon, 14 Nov 2005 19:48:04 +0000 Subject: (svn r3181) -Bracing -Indentation -Whitespace -DeMorgan's Law -Test with NULL or 0 for non-booleans -'\0' instead of 0 for chars -Remove redundantly redundant comments (like DoFoo(); // Do foo) -Join multiple short lines with a single statement -Split single lines with multiple statements -Avoid assignments in if --- dock_gui.c | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'dock_gui.c') diff --git a/dock_gui.c b/dock_gui.c index a1e14b726..0c6c97a24 100644 --- a/dock_gui.c +++ b/dock_gui.c @@ -222,35 +222,39 @@ void ShowBuildDocksToolbar(void) static void BuildDockStationWndProc(Window *w, WindowEvent *e) { - int rad; - - switch(e->event) { + switch (e->event) { case WE_PAINT: { - if (WP(w,def_d).close) - return; + int rad; + + if (WP(w,def_d).close) return; w->click_state = (1<<3) << _station_show_coverage; DrawWindowWidgets(w); rad = (_patches.modified_catchment) ? CA_DOCK : 4; - if (_station_show_coverage) SetTileSelectBigSize(-rad, -rad, 2 * rad, 2 * rad); - else SetTileSelectBigSize(0, 0, 0, 0); + if (_station_show_coverage) { + SetTileSelectBigSize(-rad, -rad, 2 * rad, 2 * rad); + } else { + SetTileSelectBigSize(0, 0, 0, 0); + } DrawStringCentered(74, 17, STR_3066_COVERAGE_AREA_HIGHLIGHT, 0); DrawStationCoverageAreaText(4, 50, (uint)-1, rad); - } break; + break; + } - case WE_CLICK: { - switch(e->click.widget) { - case 3: case 4: - _station_show_coverage = e->click.widget - 3; - SndPlayFx(SND_15_BEEP); - SetWindowDirty(w); - break; + case WE_CLICK: + switch (e->click.widget) { + case 3: + case 4: + _station_show_coverage = e->click.widget - 3; + SndPlayFx(SND_15_BEEP); + SetWindowDirty(w); + break; } - } break; + break; - case WE_MOUSELOOP: { + case WE_MOUSELOOP: if (WP(w,def_d).close) { DeleteWindow(w); return; @@ -258,11 +262,9 @@ static void BuildDockStationWndProc(Window *w, WindowEvent *e) CheckRedrawStationCoverage(w); break; - } case WE_DESTROY: - if (!WP(w,def_d).close) - ResetObjectToPlace(); + if (!WP(w,def_d).close) ResetObjectToPlace(); break; } } @@ -324,13 +326,11 @@ static void BuildDocksDepotWndProc(Window *w, WindowEvent *e) } break; case WE_MOUSELOOP: - if (WP(w,def_d).close) - DeleteWindow(w); + if (WP(w,def_d).close) DeleteWindow(w); break; case WE_DESTROY: - if (!WP(w,def_d).close) - ResetObjectToPlace(); + if (!WP(w,def_d).close) ResetObjectToPlace(); break; } } -- cgit v1.2.3-54-g00ecf