From b19d0e0254883d0db9d8f3d01dacd94e0229f9ac Mon Sep 17 00:00:00 2001 From: rubidium Date: Tue, 26 May 2009 11:19:04 +0000 Subject: (svn r16428) -Codechange: use the less bloated SimpleTinyEnumT instead of TinyEnumT if the stuff provided by TinyEnumT but not SimpleTinyEnumT is not used. --- src/newgrf_station.h | 5 +---- src/order_type.h | 6 ++---- src/road_type.h | 3 +-- src/settings_internal.h | 8 ++------ src/town_type.h | 6 ++---- src/track_type.h | 11 ++--------- src/vehicle_type.h | 4 ++-- 7 files changed, 12 insertions(+), 31 deletions(-) (limited to 'src') diff --git a/src/newgrf_station.h b/src/newgrf_station.h index 5bd52891b..fa88c4064 100644 --- a/src/newgrf_station.h +++ b/src/newgrf_station.h @@ -21,10 +21,7 @@ enum StationClassID { STAT_CLASS_WAYP, ///< Waypoint class. STAT_CLASS_MAX = 32, ///< Maximum number of classes. }; - -/** Define basic enum properties */ -template <> struct EnumPropsT : MakeEnumPropsT {}; -typedef TinyEnumT StationClassIDByte; +typedef SimpleTinyEnumT StationClassIDByte; /** Allow incrementing of StationClassID variables */ DECLARE_POSTFIX_INCREMENT(StationClassID); diff --git a/src/order_type.h b/src/order_type.h index 8823e8a41..33e303370 100644 --- a/src/order_type.h +++ b/src/order_type.h @@ -34,10 +34,8 @@ enum OrderType { OT_END }; -/* It needs to be 8bits, because we save and load it as such */ -/** Define basic enum properties */ -template <> struct EnumPropsT : MakeEnumPropsT {}; -typedef TinyEnumT OrderTypeByte; +/** It needs to be 8bits, because we save and load it as such */ +typedef SimpleTinyEnumT OrderTypeByte; /** diff --git a/src/road_type.h b/src/road_type.h index 4554de2d3..a50f91c7c 100644 --- a/src/road_type.h +++ b/src/road_type.h @@ -34,8 +34,7 @@ enum RoadTypes { INVALID_ROADTYPES = 0xFF ///< Invalid roadtypes }; DECLARE_ENUM_AS_BIT_SET(RoadTypes); -template <> struct EnumPropsT : MakeEnumPropsT {}; -typedef TinyEnumT RoadTypesByte; +typedef SimpleTinyEnumT RoadTypesByte; /** diff --git a/src/settings_internal.h b/src/settings_internal.h index 9aaece98f..df3597226 100644 --- a/src/settings_internal.h +++ b/src/settings_internal.h @@ -24,9 +24,7 @@ enum SettingDescTypeLong { SDT_END, /* 10 more possible primitives */ }; - -template <> struct EnumPropsT : MakeEnumPropsT {}; -typedef TinyEnumT SettingDescType; +typedef SimpleTinyEnumT SettingDescType; enum SettingGuiFlagLong { @@ -42,10 +40,8 @@ enum SettingGuiFlagLong { SGF_NEWGAME_ONLY = 1 << 6, ///< this setting cannot be changed in inside a game SGF_END = 1 << 7, }; - DECLARE_ENUM_AS_BIT_SET(SettingGuiFlagLong); -template <> struct EnumPropsT : MakeEnumPropsT {}; -typedef TinyEnumT SettingGuiFlag; +typedef SimpleTinyEnumT SettingGuiFlag; typedef bool OnChange(int32 var); ///< callback prototype on data modification diff --git a/src/town_type.h b/src/town_type.h index a032c8bea..d56b934df 100644 --- a/src/town_type.h +++ b/src/town_type.h @@ -85,10 +85,8 @@ enum TownLayout { NUM_TLS, ///< Number of town layouts }; -/** It needs to be 8bits, because we save and load it as such - * Define basic enum properties */ -template <> struct EnumPropsT : MakeEnumPropsT {}; -typedef TinyEnumT TownLayoutByte; // typedefing-enumification of TownLayout +/** It needs to be 8bits, because we save and load it as such */ +typedef SimpleTinyEnumT TownLayoutByte; // typedefing-enumification of TownLayout enum { MAX_LENGTH_TOWN_NAME_BYTES = 31, ///< The maximum length of a town name in bytes including '\0' diff --git a/src/track_type.h b/src/track_type.h index f344a0a49..6177416f5 100644 --- a/src/track_type.h +++ b/src/track_type.h @@ -52,12 +52,8 @@ enum TrackBits { TRACK_BIT_DEPOT = 0x80U, ///< Bitflag for a depot INVALID_TRACK_BIT = 0xFF ///< Flag for an invalid trackbits value }; - -/** Define basic enum properties */ -template <> struct EnumPropsT : MakeEnumPropsT {}; -typedef TinyEnumT TrackBitsByte; - DECLARE_ENUM_AS_BIT_SET(TrackBits); +typedef SimpleTinyEnumT TrackBitsByte; /** * Enumeration for tracks and directions. @@ -118,11 +114,8 @@ enum TrackdirBits { TRACKDIR_BIT_MASK = 0x3F3F, ///< Bitmask for bit-operations INVALID_TRACKDIR_BIT = 0xFFFF, ///< Flag for an invalid trackdirbit value }; - -/** Define basic enum properties */ -template <> struct EnumPropsT : MakeEnumPropsT {}; -typedef TinyEnumT TrackdirBitsShort; DECLARE_ENUM_AS_BIT_SET(TrackdirBits); +typedef SimpleTinyEnumT TrackdirBitsShort; typedef uint32 TrackStatus; diff --git a/src/vehicle_type.h b/src/vehicle_type.h index 1bba8defa..c642cfcf5 100644 --- a/src/vehicle_type.h +++ b/src/vehicle_type.h @@ -20,8 +20,8 @@ enum VehicleType { VEH_INVALID = 0xFF, }; DECLARE_POSTFIX_INCREMENT(VehicleType); -template <> struct EnumPropsT : MakeEnumPropsT {}; -typedef TinyEnumT VehicleTypeByte; +/** It needs to be 8bits, because we save and load it as such */ +typedef SimpleTinyEnumT VehicleTypeByte; struct Vehicle; struct Train; -- cgit v1.2.3-54-g00ecf