summaryrefslogtreecommitdiff
path: root/src/train_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
commitd7f56f1550ad463c6584595675dbebf745c30a78 (patch)
treee15177888ccaf427ebf30cc793b6da2908c47a8f /src/train_gui.cpp
parenta9651a8b8f1e9b1f6524721a43e58a2339fc8d61 (diff)
downloadopenttd-d7f56f1550ad463c6584595675dbebf745c30a78.tar.xz
(svn r9388) -Codechange: variable scope and type, and standardify all CargoID loops.
Diffstat (limited to 'src/train_gui.cpp')
-rw-r--r--src/train_gui.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/train_gui.cpp b/src/train_gui.cpp
index 6abc36c79..130bcfa34 100644
--- a/src/train_gui.cpp
+++ b/src/train_gui.cpp
@@ -371,7 +371,6 @@ static void DrawTrainDetailsWindow(Window *w)
const Vehicle *u;
AcceptedCargo act_cargo;
AcceptedCargo max_cargo;
- uint i;
int num;
int x;
int y;
@@ -380,7 +379,7 @@ static void DrawTrainDetailsWindow(Window *w)
num = 0;
u = v = GetVehicle(w->window_number);
if (det_tab == 3) { // Total cargo tab
- for (i = 0; i < lengthof(act_cargo); i++) {
+ for (CargoID i = 0; i < lengthof(act_cargo); i++) {
act_cargo[i] = 0;
max_cargo[i] = 0;
}
@@ -393,7 +392,7 @@ static void DrawTrainDetailsWindow(Window *w)
/* Set scroll-amount seperately from counting, as to not compute num double
* for more carriages of the same type
*/
- for (i = 0; i != NUM_CARGO; i++) {
+ for (CargoID i = 0; i < NUM_CARGO; i++) {
if (max_cargo[i] > 0) num++; // only count carriages that the train has
}
num++; // needs one more because first line is description string
@@ -492,7 +491,7 @@ static void DrawTrainDetailsWindow(Window *w)
} else {
// draw total cargo tab
DrawString(x, y + 2, STR_013F_TOTAL_CAPACITY_TEXT, 0);
- for (i = 0; i != NUM_CARGO; i++) {
+ for (CargoID i = 0; i < NUM_CARGO; i++) {
if (max_cargo[i] > 0 && --sel < 0 && sel > -w->vscroll.cap) {
y += 14;
SetDParam(0, i); // {CARGO} #1