summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-01-03 08:33:04 +0000
committertron <tron@openttd.org>2005-01-03 08:33:04 +0000
commit09dd8053a9a123648a949d38345592586b000903 (patch)
treece80abbcab7f45455ca8b88fcca9752d7ad893eb
parentae336f146daa2fb3b43112cc6bd4db987347ca28 (diff)
downloadopenttd-09dd8053a9a123648a949d38345592586b000903.tar.xz
(svn r1328) Turn loop with explicit terminator element into loop using endof()
-rw-r--r--station_cmd.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/station_cmd.c b/station_cmd.c
index 53d21947b..c1f543814 100644
--- a/station_cmd.c
+++ b/station_cmd.c
@@ -170,14 +170,12 @@ static int CountMapSquareAround(uint tile, byte type, byte min, byte max) {
TILE_XY(-6,1), 1, 1, 1, 1, 1, 1,
TILE_XY(-6,1), 1, 1, 1, 1, 1, 1,
TILE_XY(-6,1), 1, 1, 1, 1, 1, 1,
- 0,
};
- int j;
- const TileIndexDiff *p = _count_square_table;
+ const TileIndexDiff *p;
int num = 0;
- while ( (j=*p++) != 0 ) {
- tile = TILE_MASK(tile + j);
+ for (p = _count_square_table; p != endof(_count_square_table); ++p) {
+ tile = TILE_MASK(tile + *p);
if (IS_TILETYPE(tile, type) && _map5[tile] >= min && _map5[tile] <= max)
num++;