From 93fe91cc8c1f38678dfb7cef6ede77c56ab36c1b Mon Sep 17 00:00:00 2001 From: peter1138 Date: Wed, 21 Mar 2007 13:19:01 +0000 Subject: (svn r9388) -Codechange: variable scope and type, and standardify all CargoID loops. --- src/vehicle_gui.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/vehicle_gui.cpp') 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; } -- cgit v1.2.3-54-g00ecf