mirror of
https://github.com/dhewm/dhewm3-sdk.git
synced 2024-11-21 20:21:19 +00:00
From dhewm3: Fix most (according to warnings) remaining 64bit issues in tool code
only the TypeInfo changes are applicable to the SDK
This commit is contained in:
parent
b5c30809b1
commit
37cdb06dce
2 changed files with 19 additions and 2 deletions
|
@ -569,10 +569,18 @@ int idTypeInfoTools::WriteVariable_r( const void *varPtr, const char *varName, c
|
|||
return typeSize;
|
||||
}
|
||||
|
||||
#if D3_SIZEOFPTR == 4
|
||||
const uintptr_t uninitPtr = (uintptr_t)0xcdcdcdcdUL;
|
||||
#elif D3_SIZEOFPTR == 8
|
||||
const uintptr_t uninitPtr = (uintptr_t)0xcdcdcdcdcdcdcdcdULL;
|
||||
#else
|
||||
#error "Unexpected pointer size"
|
||||
#endif
|
||||
|
||||
// if this is a pointer
|
||||
isPointer = 0;
|
||||
for ( i = typeString.Length(); i > 0 && typeString[i - 1] == '*'; i -= 2 ) {
|
||||
if ( varPtr == (void *)0xcdcdcdcd || ( varPtr != NULL && *((unsigned int *)varPtr) == 0xcdcdcdcd ) ) {
|
||||
if ( varPtr == (void*)uninitPtr || ( varPtr != NULL && *((unsigned int *)varPtr) == 0xcdcdcdcd ) ) {
|
||||
common->Warning( "%s%s::%s%s references uninitialized memory", prefix, scope, varName, "" );
|
||||
return typeSize;
|
||||
}
|
||||
|
|
|
@ -570,9 +570,18 @@ int idTypeInfoTools::WriteVariable_r( const void *varPtr, const char *varName, c
|
|||
}
|
||||
|
||||
// if this is a pointer
|
||||
|
||||
#if D3_SIZEOFPTR == 4
|
||||
const uintptr_t uninitPtr = (uintptr_t)0xcdcdcdcdUL;
|
||||
#elif D3_SIZEOFPTR == 8
|
||||
const uintptr_t uninitPtr = (uintptr_t)0xcdcdcdcdcdcdcdcdULL;
|
||||
#else
|
||||
#error "Unexpected pointer size"
|
||||
#endif
|
||||
|
||||
isPointer = 0;
|
||||
for ( i = typeString.Length(); i > 0 && typeString[i - 1] == '*'; i -= 2 ) {
|
||||
if ( varPtr == (void *)0xcdcdcdcd || ( varPtr != NULL && *((unsigned int *)varPtr) == 0xcdcdcdcd ) ) {
|
||||
if ( varPtr == (void*)uninitPtr || ( varPtr != NULL && *((unsigned int *)varPtr) == 0xcdcdcdcd ) ) {
|
||||
common->Warning( "%s%s::%s%s references uninitialized memory", prefix, scope, varName, "" );
|
||||
return typeSize;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue