(svn r1328) Turn loop with explicit terminator element into loop using endof()
authortron
Mon, 03 Jan 2005 08:33:04 +0000
changeset 847 e0d8d5ef95b9
parent 846 190f5f7adf93
child 848 7bbdaf9c1f2c
(svn r1328) Turn loop with explicit terminator element into loop using endof()
station_cmd.c
--- a/station_cmd.c	Mon Jan 03 00:42:43 2005 +0000
+++ b/station_cmd.c	Mon Jan 03 08:33:04 2005 +0000
@@ -170,14 +170,12 @@
 		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++;