(svn r12368) -Codechange: use explicit body for loops and conditions and remove -Wno-empty-body from the configure script

This commit is contained in:
smatz
2008-03-15 13:21:31 +00:00
parent 5db7288ea9
commit bfae49aeb2
7 changed files with 15 additions and 21 deletions

View File

@@ -179,7 +179,7 @@ static void NewGRFAddDlgWndProc(Window *w, WindowEvent *e)
const GRFConfig *c;
uint i = (e->we.click.pt.y - w->widget[ANGRFW_GRF_LIST].top) / 10 + w->vscroll.pos;
for (c = _all_grfs; c != NULL && i > 0; c = c->next, i--);
for (c = _all_grfs; c != NULL && i > 0; c = c->next, i--) {}
WP(w, newgrf_add_d).sel = c;
SetWindowDirty(w);
break;
@@ -304,7 +304,7 @@ static void SetupNewGRFWindow(Window *w)
const GRFConfig *c;
int i;
for (c = *WP(w, newgrf_d).list, i = 0; c != NULL; c = c->next, i++);
for (c = *WP(w, newgrf_d).list, i = 0; c != NULL; c = c->next, i++) {}
w->vscroll.cap = (w->widget[SNGRFS_FILE_LIST].bottom - w->widget[SNGRFS_FILE_LIST].top) / 14 + 1;
SetVScrollCount(w, i);
@@ -327,9 +327,9 @@ static void NewGRFConfirmationCallback(Window *w, bool confirmed)
ReloadNewGRFData();
/* Show new, updated list */
for (c = *nd->list; c != NULL && c != nd->sel; c = c->next, i++);
for (c = *nd->list; c != NULL && c != nd->sel; c = c->next, i++) {}
CopyGRFConfigList(nd->list, *nd->orig_list, false);
for (c = *nd->list; c != NULL && i > 0; c = c->next, i--);
for (c = *nd->list; c != NULL && i > 0; c = c->next, i--) {}
nd->sel = c;
SetWindowDirty(w);
@@ -474,7 +474,7 @@ static void NewGRFWndProc(Window *w, WindowEvent *e)
GRFConfig *c;
uint i = (e->we.click.pt.y - w->widget[SNGRFS_FILE_LIST].top) / 14 + w->vscroll.pos;
for (c = *WP(w, newgrf_d).list; c != NULL && i > 0; c = c->next, i--);
for (c = *WP(w, newgrf_d).list; c != NULL && i > 0; c = c->next, i--) {}
WP(w, newgrf_d).sel = c;
SetWindowDirty(w);