Tweaks any enums that use uint_max values so that they have hard types to avoid any compiler kerfluffles with C++11 value narrowing, specifically pertaining to clang.

This commit is contained in:
Areloch 2016-10-17 01:00:12 -05:00
parent 3038e53856
commit 121d65215e
15 changed files with 25 additions and 15 deletions

View file

@ -36,7 +36,12 @@ class BitStream;
struct Move struct Move
{ {
enum { ChecksumBits = 16, ChecksumMask = ((1<<ChecksumBits)-1), ChecksumMismatch = U32(-1) }; enum : U32
{
ChecksumBits = 16,
ChecksumMask = ((1<<ChecksumBits)-1),
ChecksumMismatch = U32(-1)
};
// packed storage rep, set in clamp // packed storage rep, set in clamp
S32 px, py, pz; S32 px, py, pz;

View file

@ -151,7 +151,7 @@ enum SceneObjectTypes
/// @} /// @}
}; };
enum SceneObjectTypeMasks enum SceneObjectTypeMasks : U32
{ {
STATIC_COLLISION_TYPEMASK = (StaticShapeObjectType | STATIC_COLLISION_TYPEMASK = (StaticShapeObjectType |
EntityObjectType), EntityObjectType),

View file

@ -441,7 +441,7 @@ public:
/// @see addGroup, endGroup /// @see addGroup, endGroup
/// @see addGroup, endGroup /// @see addGroup, endGroup
/// @see addDeprecatedField /// @see addDeprecatedField
enum ACRFieldTypes enum ACRFieldTypes : U32
{ {
/// The first custom field type... all fields /// The first custom field type... all fields
/// types greater or equal to this one are not /// types greater or equal to this one are not

View file

@ -61,7 +61,7 @@ typedef U32 SimObjectId;
/// The RootGroupId is assigned to gRootGroup, in which most SimObjects /// The RootGroupId is assigned to gRootGroup, in which most SimObjects
/// are addded as child members. See simManager.cc for details, particularly /// are addded as child members. See simManager.cc for details, particularly
/// Sim::initRoot() and following. /// Sim::initRoot() and following.
enum SimObjectsConstants enum SimObjectsConstants : U32
{ {
DataBlockObjectIdFirst = 3, DataBlockObjectIdFirst = 3,
DataBlockObjectIdBitSize = 14, DataBlockObjectIdBitSize = 14,

View file

@ -33,7 +33,7 @@
class FileStream : public Stream class FileStream : public Stream
{ {
public: public:
enum enum : U32
{ {
BUFFER_SIZE = 8 * 1024, // this can be changed to anything appropriate [in k] BUFFER_SIZE = 8 * 1024, // this can be changed to anything appropriate [in k]
BUFFER_INVALID = 0xffffffff // file offsets must all be less than this BUFFER_INVALID = 0xffffffff // file offsets must all be less than this

View file

@ -148,7 +148,8 @@ public:
/// Set the TTL for the last item we entered... /// Set the TTL for the last item we entered...
/// ///
/// Primitives default to lasting one frame (ie, ttl=0) /// Primitives default to lasting one frame (ie, ttl=0)
enum { enum : U32
{
DD_INFINITE = U32_MAX DD_INFINITE = U32_MAX
}; };
// How long should this primitive be draw for, 0 = one frame, DD_INFINITE = draw forever // How long should this primitive be draw for, 0 = one frame, DD_INFINITE = draw forever

View file

@ -48,7 +48,8 @@ class GuiTextListCtrl : public GuiArrayCtrl
UP = 0, UP = 0,
DOWN = 1 DOWN = 1
}; };
enum { enum : U32
{
InvalidId = 0xFFFFFFFF InvalidId = 0xFFFFFFFF
}; };
Vector<S32> mColumnOffsets; Vector<S32> mColumnOffsets;

View file

@ -125,7 +125,7 @@ class BoxBase
NUM_PLANES NUM_PLANES
}; };
enum PlaneMasks enum PlaneMasks : U32
{ {
PlaneMaskLeft = ( 1 << LeftPlane ), PlaneMaskLeft = ( 1 << LeftPlane ),
PlaneMaskRight = ( 1 << RightPlane ), PlaneMaskRight = ( 1 << RightPlane ),

View file

@ -118,7 +118,7 @@ struct FrustumData : public PolyhedronData
}; };
/// Used to mask out planes for testing. /// Used to mask out planes for testing.
enum enum : U32
{ {
PlaneMaskLeft = ( 1 << PlaneLeft ), PlaneMaskLeft = ( 1 << PlaneLeft ),
PlaneMaskRight = ( 1 << PlaneRight ), PlaneMaskRight = ( 1 << PlaneRight ),

View file

@ -53,7 +53,8 @@ void * gMemMutex = NULL;
#undef new #undef new
#endif #endif
enum MemConstants { enum MemConstants : U32
{
Allocated = BIT(0), Allocated = BIT(0),
Array = BIT(1), Array = BIT(1),
DebugFlag = BIT(2), DebugFlag = BIT(2),

View file

@ -49,7 +49,8 @@ class Path : public SimGroup
typedef SimGroup Parent; typedef SimGroup Parent;
public: public:
enum { enum : U32
{
NoPathIndex = 0xFFFFFFFF NoPathIndex = 0xFFFFFFFF
}; };

View file

@ -65,7 +65,7 @@ class SceneZoneSpaceManager
/// of time. /// of time.
typedef Signal< void( SceneZoneSpaceManager* ) > ZoningChangedSignal; typedef Signal< void( SceneZoneSpaceManager* ) > ZoningChangedSignal;
enum enum : U32
{ {
/// Zone ID of the exterior zone. /// Zone ID of the exterior zone.
RootZoneId = 0, RootZoneId = 0,

View file

@ -73,7 +73,7 @@ class SFXSoundscape
FlagUnique = BIT( 1 ), ///< No other instance of this ambience on stack. FlagUnique = BIT( 1 ), ///< No other instance of this ambience on stack.
}; };
enum DirtyBits enum DirtyBits : U32
{ {
AmbienceDirty = BIT( 0 ), ///< Associated ambience has changed. AmbienceDirty = BIT( 0 ), ///< Associated ambience has changed.
AllDirty = 0xFFFFFFFF AllDirty = 0xFFFFFFFF

View file

@ -44,7 +44,8 @@ class NetStringTable
friend class RemoteCommandEvent; friend class RemoteCommandEvent;
#endif #endif
enum Constants { enum Constants : U32
{
InitialSize = 16, InitialSize = 16,
InvalidEntry = 0xFFFFFFFF, InvalidEntry = 0xFFFFFFFF,
HashTableSize = 2128, HashTableSize = 2128,

View file

@ -27,7 +27,7 @@
#include "terrain/terrData.h" #include "terrain/terrData.h"
#endif #endif
enum TerrConstants enum TerrConstants : U32
{ {
MaxClipPlanes = 8, ///< left, right, top, bottom - don't need far tho... MaxClipPlanes = 8, ///< left, right, top, bottom - don't need far tho...
//MaxTerrainMaterials = 256, //MaxTerrainMaterials = 256,