(svn r12875) -Codechange: Use defined const instead of cast magic
authorbelugas
Thu, 24 Apr 2008 18:30:41 +0000
changeset 9049 21f20d9bc849
parent 9048 d2d1c0b4181c
child 9050 72e9db1a3b2d
(svn r12875) -Codechange: Use defined const instead of cast magic
src/station_cmd.cpp
--- a/src/station_cmd.cpp	Thu Apr 24 18:17:53 2008 +0000
+++ b/src/station_cmd.cpp	Thu Apr 24 18:30:41 2008 +0000
@@ -982,7 +982,7 @@
 		if (flags & DC_EXEC) {
 			st = new Station();
 
-			st->town = ClosestTownFromTile(tile_org, (uint)-1);
+			st->town = ClosestTownFromTile(tile_org, UINT_MAX);
 			GenerateStationName(st, tile_org, STATIONNAMING_RAIL);
 
 			if (IsValidPlayer(_current_player)) {
@@ -1406,7 +1406,7 @@
 		if (flags & DC_EXEC) {
 			st = new Station();
 
-			st->town = ClosestTownFromTile(tile, (uint)-1);
+			st->town = ClosestTownFromTile(tile, UINT_MAX);
 			GenerateStationName(st, tile, STATIONNAMING_ROAD);
 
 			if (IsValidPlayer(_current_player)) {
@@ -1541,7 +1541,7 @@
 		/* Rebuild the drive throuhg road stop. As a road stop can only be
 		 * removed by the owner of the roadstop, _current_player is the
 		 * owner of the road stop. */
-		MakeRoadNormal(tile, road_bits, rts, is_towns_road ? ClosestTownFromTile(tile, (uint)-1)->index : 0,
+		MakeRoadNormal(tile, road_bits, rts, is_towns_road ? ClosestTownFromTile(tile, UINT_MAX)->index : 0,
 				is_towns_road ? OWNER_TOWN : _current_player, _current_player, _current_player);
 	}
 
@@ -1831,7 +1831,7 @@
 	if (flags & DC_EXEC) {
 		Station *st = new Station();
 
-		st->town = ClosestTownFromTile(tile, (uint)-1);
+		st->town = ClosestTownFromTile(tile, UINT_MAX);
 		GenerateStationName(st, tile, STATIONNAMING_BUOY);
 
 		if (IsValidPlayer(_current_player)) {
@@ -1991,7 +1991,7 @@
 		if (flags & DC_EXEC) {
 			st = new Station();
 
-			st->town = ClosestTownFromTile(tile, (uint)-1);
+			st->town = ClosestTownFromTile(tile, UINT_MAX);
 			GenerateStationName(st, tile, STATIONNAMING_DOCK);
 
 			if (IsValidPlayer(_current_player)) {
@@ -2830,7 +2830,7 @@
 		return;
 	}
 
-	st->town = ClosestTownFromTile(tile, (uint)-1);
+	st->town = ClosestTownFromTile(tile, UINT_MAX);
 	st->sign.width_1 = 0;
 
 	GenerateStationName(st, tile, STATIONNAMING_OILRIG);