summaryrefslogtreecommitdiff
path: root/graph_gui.c
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2006-12-04 13:46:03 +0000
committerrubidium <rubidium@openttd.org>2006-12-04 13:46:03 +0000
commitc1220546c4f9aa6f1d820aac0b38c0e24dd11bb9 (patch)
treeff3ed6156af7a65ae49ead114c7f736d5826790b /graph_gui.c
parent301d392b2c1fcdf6ad75c1cbebc0fa6f3c8db7aa (diff)
downloadopenttd-c1220546c4f9aa6f1d820aac0b38c0e24dd11bb9.tar.xz
(svn r7355) -Codechange: replace 'for (i = 0; w->widget[i].type != WWT_TYPE; i++)'-type for loops with 'for (i = 0; i < w->widget_count; i++)'-type for loops
Diffstat (limited to 'graph_gui.c')
-rw-r--r--graph_gui.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/graph_gui.c b/graph_gui.c
index fde5f50bc..eedeb949d 100644
--- a/graph_gui.c
+++ b/graph_gui.c
@@ -224,9 +224,9 @@ static void GraphLegendWndProc(Window *w, WindowEvent *e)
switch (e->event) {
case WE_CREATE: {
- int i;
- for (i = 0; w->widget[i + 3].type != WWT_LAST; i++) {
- if (!HASBIT(_legend_excludebits, i)) LowerWindowWidget(w, i + 3);
+ uint i;
+ for (i = 3; i < w->widget_count; i++) {
+ if (!HASBIT(_legend_excludebits, i - 3)) LowerWindowWidget(w, i);
}
break;
}
@@ -705,9 +705,9 @@ static void CargoPaymentRatesWndProc(Window *w, WindowEvent *e)
{
switch (e->event) {
case WE_CREATE: {
- int i;
- for (i = 0; w->widget[i + 3].type != WWT_LAST; i++) {
- if (!HASBIT(_legend_cargobits, i)) LowerWindowWidget(w, i + 3);
+ uint i;
+ for (i = 3; i < w->widget_count; i++) {
+ if (!HASBIT(_legend_cargobits, i - 3)) LowerWindowWidget(w, i);
}
break;
}