summaryrefslogtreecommitdiff
path: root/station_gui.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-11-13 13:43:55 +0000
committertron <tron@openttd.org>2005-11-13 13:43:55 +0000
commit81e5b16d7178f0ee5584201cb2f6c8e36742354f (patch)
tree385ce09aff7cf19e072a627e83e91fe8a5f3fb3b /station_gui.c
parentd97f56b4e2b6159e696128932da28b89a13a30e0 (diff)
downloadopenttd-81e5b16d7178f0ee5584201cb2f6c8e36742354f.tar.xz
(svn r3172) static, const
Diffstat (limited to 'station_gui.c')
-rw-r--r--station_gui.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/station_gui.c b/station_gui.c
index 568416bbe..2244386a4 100644
--- a/station_gui.c
+++ b/station_gui.c
@@ -164,10 +164,8 @@ static void PlayerStationsWndProc(Window *w, WindowEvent *e)
{
byte p = 0;
- Station *st;
- int x,xb = 2;
+ int xb = 2;
int y = 16; // offset from top of widget
- int j;
if (w->vscroll.count == 0) { // player has no stations
DrawString(xb, y, STR_304A_NONE, 0);
@@ -178,7 +176,9 @@ static void PlayerStationsWndProc(Window *w, WindowEvent *e)
assert(i < _num_station_sort[owner]); // at least one station must exist
while (i < _num_station_sort[owner]) { // do until max number of stations of owner
- st = GetStation(_station_sort[i].index);
+ const Station* st = GetStation(_station_sort[i].index);
+ uint j;
+ int x;
assert(st->xy && st->owner == owner);
@@ -211,7 +211,8 @@ static void PlayerStationsWndProc(Window *w, WindowEvent *e)
{
const PlayerID owner = w->window_number;
- Station *st;
+ const Station* st;
+
id_v += (owner == 0) ? 0 : _num_station_sort[owner - 1]; // first element in list
if (id_v >= _num_station_sort[owner]) { return;} // click out of station bound
@@ -310,17 +311,13 @@ static const Widget _station_view_widgets[] = {
static void DrawStationViewWindow(Window *w)
{
- Station *st;
- int i;
- int num;
+ StationID station_id = w->window_number;
+ const Station* st = GetStation(station_id);
+ uint i;
+ uint num;
int x,y;
int pos;
StringID str;
- StationID station_id;
-
- station_id = w->window_number;
-
- st = GetStation(station_id);
num = 1;
for(i=0; i!=NUM_CARGO; i++) {