Static cvars incorrectly checking against wrong size on 64

On 64-bit arch these checks are incorrect. the 0xFFFFFFFF is effectively UINT32_MAX rather than the pointer size. Changing to the unsigned integral pointer maximum seems like a better idea.

Fixes the warning, and corrects the code.
This commit is contained in:
Ensiform 2017-07-30 22:30:25 -05:00
parent e5b3c697d2
commit 29786cf420

View file

@ -366,7 +366,7 @@ ID_INLINE void idCVar::Init( const char* name, const char* value, int flags, con
this->integerValue = 0;
this->floatValue = 0.0f;
this->internalVar = this;
if( staticVars != ( idCVar* )0xFFFFFFFF )
if( staticVars != ( idCVar* )UINTPTR_MAX )
{
this->next = staticVars;
staticVars = this;
@ -379,13 +379,13 @@ ID_INLINE void idCVar::Init( const char* name, const char* value, int flags, con
ID_INLINE void idCVar::RegisterStaticVars()
{
if( staticVars != ( idCVar* )0xFFFFFFFF )
if( staticVars != ( idCVar* )UINTPTR_MAX )
{
for( idCVar* cvar = staticVars; cvar; cvar = cvar->next )
{
cvarSystem->Register( cvar );
}
staticVars = ( idCVar* )0xFFFFFFFF;
staticVars = ( idCVar* )UINTPTR_MAX;
}
}