changeset 14631:ab96327d6391 draft

(svn r19208) -Codechange: fix a gcc warning
author yexo <yexo@openttd.org>
date Mon, 22 Feb 2010 16:32:50 +0000
parents f72341b623a3
children a13fe04c7234
files src/newgrf_airporttiles.cpp
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/newgrf_airporttiles.cpp
+++ b/src/newgrf_airporttiles.cpp
@@ -41,7 +41,9 @@
  */
 /* static */ const AirportTileSpec *AirportTileSpec::Get(StationGfx gfx)
 {
-	assert((size_t)gfx < lengthof(AirportTileSpec::tiles));
+	/* should be assert(gfx < lengthof(tiles)), but that gives compiler warnings
+	 * since it's always true if the following holds: */
+	assert_compile(MAX_UVALUE(StationGfx) + 1 == lengthof(tiles));
 	return &AirportTileSpec::tiles[gfx];
 }
 
@@ -88,7 +90,6 @@
  */
 StationGfx GetTranslatedAirportTileID(StationGfx gfx)
 {
-	assert((size_t)gfx < NUM_AIRPORTTILES);
 	const AirportTileSpec *it = AirportTileSpec::Get(gfx);
 	return it->grf_prop.override == INVALID_AIRPORTTILE ? gfx : it->grf_prop.override;
 }