diff options
author | peter1138 <peter1138@openttd.org> | 2007-03-21 13:19:01 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2007-03-21 13:19:01 +0000 |
commit | d7f56f1550ad463c6584595675dbebf745c30a78 (patch) | |
tree | e15177888ccaf427ebf30cc793b6da2908c47a8f /src/vehicle_gui.cpp | |
parent | a9651a8b8f1e9b1f6524721a43e58a2339fc8d61 (diff) | |
download | openttd-d7f56f1550ad463c6584595675dbebf745c30a78.tar.xz |
(svn r9388) -Codechange: variable scope and type, and standardify all CargoID loops.
Diffstat (limited to 'src/vehicle_gui.cpp')
-rw-r--r-- | src/vehicle_gui.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index d93544167..14c5583e5 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -209,7 +209,7 @@ static RefitList *BuildRefitList(const Vehicle *v) if (u->cargo_cap == 0) continue; /* Loop through all cargos in the refit mask */ - for (CargoID cid = 0; cid != NUM_CARGO && num_lines < max_lines; cid++) { + for (CargoID cid = 0; cid < NUM_CARGO && num_lines < max_lines; cid++) { /* Skip cargo type if it's not listed */ if (!HASBIT(cmask, cid)) continue; @@ -616,14 +616,13 @@ static int CDECL VehicleCargoSorter(const void *a, const void *b) AcceptedCargo cargoa; AcceptedCargo cargob; int r = 0; - int i; memset(cargoa, 0, sizeof(cargoa)); memset(cargob, 0, sizeof(cargob)); for (v = va; v != NULL; v = v->next) cargoa[v->cargo_type] += v->cargo_cap; for (v = vb; v != NULL; v = v->next) cargob[v->cargo_type] += v->cargo_cap; - for (i = 0; i < NUM_CARGO; i++) { + for (CargoID i = 0; i < NUM_CARGO; i++) { r = cargoa[i] - cargob[i]; if (r != 0) break; } |