Remove longs from game/ and d3xp/

(Except for handling of longs in TypeInfo and win32-only Maya import stuff).

sizeof(long) == sizeof(int) on x86 and win64,
but not on 64bit (x86_64) linux/unix/osx/.. so they should be avoided.
This commit is contained in:
Daniel Gibson 2012-06-22 18:18:51 +02:00
parent 5c08cb0140
commit ce87a8904c
4 changed files with 10 additions and 10 deletions

View file

@ -284,7 +284,7 @@ idClass::FindUninitializedMemory
*/
void idClass::FindUninitializedMemory( void ) {
#ifdef ID_DEBUG_UNINITIALIZED_MEMORY
unsigned long *ptr = ( ( unsigned long * )this ) - 1;
unsigned int *ptr = ( ( unsigned int * )this ) - 1;
int size = *ptr;
assert( ( size & 3 ) == 0 );
size >>= 2;
@ -453,7 +453,7 @@ void * idClass::operator new( size_t s ) {
numobjects++;
#ifdef ID_DEBUG_UNINITIALIZED_MEMORY
unsigned long *ptr = (unsigned long *)p;
unsigned int *ptr = (unsigned int *)p;
int size = s;
assert( ( size & 3 ) == 0 );
size >>= 3;
@ -475,7 +475,7 @@ void * idClass::operator new( size_t s, int, int, char *, int ) {
numobjects++;
#ifdef ID_DEBUG_UNINITIALIZED_MEMORY
unsigned long *ptr = (unsigned long *)p;
unsigned int *ptr = (unsigned int *)p;
int size = s;
assert( ( size & 3 ) == 0 );
size >>= 3;

View file

@ -572,7 +572,7 @@ int idTypeInfoTools::WriteVariable_r( const void *varPtr, const char *varName, c
// 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 long *)varPtr) == 0xcdcdcdcd ) ) {
if ( varPtr == (void *)0xcdcdcdcd || ( varPtr != NULL && *((unsigned int *)varPtr) == 0xcdcdcdcd ) ) {
common->Warning( "%s%s::%s%s references uninitialized memory", prefix, scope, varName, "" );
return typeSize;
}
@ -1138,7 +1138,7 @@ int idTypeInfoTools::WriteVariable_r( const void *varPtr, const char *varName, c
i = 0;
do {
if ( *((unsigned long *)varPtr) == 0xcdcdcdcd ) {
if ( *((unsigned int *)varPtr) == 0xcdcdcdcd ) {
common->Warning( "%s%s::%s%s uses uninitialized memory", prefix, scope, varName, "" );
break;
}

View file

@ -284,7 +284,7 @@ idClass::FindUninitializedMemory
*/
void idClass::FindUninitializedMemory( void ) {
#ifdef ID_DEBUG_UNINITIALIZED_MEMORY
unsigned long *ptr = ( ( unsigned long * )this ) - 1;
unsigned int *ptr = ( ( unsigned int * )this ) - 1;
int size = *ptr;
assert( ( size & 3 ) == 0 );
size >>= 2;
@ -453,7 +453,7 @@ void * idClass::operator new( size_t s ) {
numobjects++;
#ifdef ID_DEBUG_UNINITIALIZED_MEMORY
unsigned long *ptr = (unsigned long *)p;
unsigned int *ptr = (unsigned int *)p;
int size = s;
assert( ( size & 3 ) == 0 );
size >>= 3;
@ -475,7 +475,7 @@ void * idClass::operator new( size_t s, int, int, char *, int ) {
numobjects++;
#ifdef ID_DEBUG_UNINITIALIZED_MEMORY
unsigned long *ptr = (unsigned long *)p;
unsigned int *ptr = (unsigned int *)p;
int size = s;
assert( ( size & 3 ) == 0 );
size >>= 3;

View file

@ -572,7 +572,7 @@ int idTypeInfoTools::WriteVariable_r( const void *varPtr, const char *varName, c
// 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 long *)varPtr) == 0xcdcdcdcd ) ) {
if ( varPtr == (void *)0xcdcdcdcd || ( varPtr != NULL && *((unsigned int *)varPtr) == 0xcdcdcdcd ) ) {
common->Warning( "%s%s::%s%s references uninitialized memory", prefix, scope, varName, "" );
return typeSize;
}
@ -1138,7 +1138,7 @@ int idTypeInfoTools::WriteVariable_r( const void *varPtr, const char *varName, c
i = 0;
do {
if ( *((unsigned long *)varPtr) == 0xcdcdcdcd ) {
if ( *((unsigned int *)varPtr) == 0xcdcdcdcd ) {
common->Warning( "%s%s::%s%s uses uninitialized memory", prefix, scope, varName, "" );
break;
}