summaryrefslogtreecommitdiff
path: root/src/vehicle_gui.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2007-03-21 13:19:01 +0000
committerpeter1138 <peter1138@openttd.org>2007-03-21 13:19:01 +0000
commit93fe91cc8c1f38678dfb7cef6ede77c56ab36c1b (patch)
treee15177888ccaf427ebf30cc793b6da2908c47a8f /src/vehicle_gui.cpp
parent7e00fdac9070368b0838685c5f8e422dc92f25ca (diff)
downloadopenttd-93fe91cc8c1f38678dfb7cef6ede77c56ab36c1b.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.cpp5
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;
}