(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
This commit is contained in:
tron
2005-11-14 19:48:04 +00:00
parent d8b56c123e
commit f7abff5f96
63 changed files with 1984 additions and 2359 deletions

View File

@@ -154,8 +154,9 @@ static const Widget _ask_abandon_game_widgets[] = {
{ WIDGETS_END },
};
static void AskAbandonGameWndProc(Window *w, WindowEvent *e) {
switch(e->event) {
static void AskAbandonGameWndProc(Window* w, WindowEvent* e)
{
switch (e->event) {
case WE_PAINT:
DrawWindowWidgets(w);
#if defined(_WIN32)
@@ -173,7 +174,7 @@ static void AskAbandonGameWndProc(Window *w, WindowEvent *e) {
#else
SetDParam(0, STR_0134_UNIX);
#endif
DrawStringMultiCenter(0x5A, 0x26, STR_00CA_ARE_YOU_SURE_YOU_WANT_TO, 178);
DrawStringMultiCenter(90, 38, STR_00CA_ARE_YOU_SURE_YOU_WANT_TO, 178);
return;
case WE_CLICK:
@@ -217,32 +218,29 @@ static const Widget _ask_quit_game_widgets[] = {
{ WIDGETS_END },
};
static void AskQuitGameWndProc(Window *w, WindowEvent *e) {
switch(e->event) {
case WE_PAINT:
DrawWindowWidgets(w);
DrawStringMultiCenter(0x5A, 0x26,
_game_mode != GM_EDITOR ? STR_0160_ARE_YOU_SURE_YOU_WANT_TO :
STR_029B_ARE_YOU_SURE_YOU_WANT_TO,
178);
return;
case WE_CLICK:
switch(e->click.widget) {
case 3:
DeleteWindow(w);
static void AskQuitGameWndProc(Window* w, WindowEvent* e)
{
switch (e->event) {
case WE_PAINT:
DrawWindowWidgets(w);
DrawStringMultiCenter(
90, 38,
_game_mode != GM_EDITOR ?
STR_0160_ARE_YOU_SURE_YOU_WANT_TO : STR_029B_ARE_YOU_SURE_YOU_WANT_TO,
178
);
break;
case 4:
_switch_mode = SM_MENU;
case WE_CLICK:
switch (e->click.widget) {
case 3: DeleteWindow(w); break;
case 4: _switch_mode = SM_MENU; break;
}
break;
}
break;
case WE_KEYPRESS: /* Return to main menu on pressing 'Enter' */
if (e->keypress.keycode == WKC_RETURN)
_switch_mode = SM_MENU;
break;
case WE_KEYPRESS: /* Return to main menu on pressing 'Enter' */
if (e->keypress.keycode == WKC_RETURN) _switch_mode = SM_MENU;
break;
}
}