Trivial pointer cast fixes for x86_64

This commit is contained in:
dhewg 2011-12-01 14:17:32 +01:00 committed by Daniel Gibson
parent 66c740b405
commit ba1adc839f
7 changed files with 9 additions and 9 deletions

View file

@ -167,7 +167,7 @@ void idAASLocal::CalculateAreaTravelTimes(void) {
}
}
assert( ( (unsigned int) bytePtr - (unsigned int) areaTravelTimes ) <= numAreaTravelTimes * sizeof( unsigned short ) );
assert( ( ( ptrdiff_t ) bytePtr - ( ptrdiff_t ) areaTravelTimes ) <= numAreaTravelTimes * sizeof( unsigned short ) );
}
/*

View file

@ -167,7 +167,7 @@ void idAASLocal::CalculateAreaTravelTimes(void) {
}
}
assert( ( (unsigned int) bytePtr - (unsigned int) areaTravelTimes ) <= numAreaTravelTimes * sizeof( unsigned short ) );
assert( ( (ptrdiff_t) bytePtr - (ptrdiff_t) areaTravelTimes ) <= numAreaTravelTimes * sizeof( unsigned short ) );
}
/*

View file

@ -2936,7 +2936,7 @@ const char *idMat6::ToString( int precision ) const {
//===============================================================
float idMatX::temp[MATX_MAX_TEMP+4];
float * idMatX::tempPtr = (float *) ( ( (int) idMatX::temp + 15 ) & ~15 );
float * idMatX::tempPtr = (float *) ( ( (intptr_t) idMatX::temp + 15 ) & ~15 );
int idMatX::tempIndex = 0;

View file

@ -2280,7 +2280,7 @@ ID_INLINE void idMatX::SetData( int rows, int columns, float *data ) {
if ( mat != NULL && alloced != -1 ) {
Mem_Free16( mat );
}
assert( ( ( (int) data ) & 15 ) == 0 ); // data must be 16 byte aligned
assert( ( ( (uintptr_t) data ) & 15 ) == 0 ); // data must be 16 byte aligned
mat = data;
alloced = -1;
numRows = rows;

View file

@ -384,7 +384,7 @@ const char *idVec6::ToString( int precision ) const {
//===============================================================
float idVecX::temp[VECX_MAX_TEMP+4];
float * idVecX::tempPtr = (float *) ( ( (int) idVecX::temp + 15 ) & ~15 );
float * idVecX::tempPtr = (float *) ( ( (intptr_t) idVecX::temp + 15 ) & ~15 );
int idVecX::tempIndex = 0;
/*

View file

@ -1757,7 +1757,7 @@ ID_INLINE void idVecX::SetData( int length, float *data ) {
if ( p && ( p < idVecX::tempPtr || p >= idVecX::tempPtr + VECX_MAX_TEMP ) && alloced != -1 ) {
Mem_Free16( p );
}
assert( ( ( (int) data ) & 15 ) == 0 ); // data must be 16 byte aligned
assert( ( ( (uintptr_t) data ) & 15 ) == 0 ); // data must be 16 byte aligned
p = data;
size = length;
alloced = -1;

View file

@ -49,7 +49,7 @@ If you have questions concerning this license or the applicable additional terms
#define ALIGN16( x ) __declspec(align(16)) x
#define PACKED
#define _alloca16( x ) ((void *)((((int)_alloca( (x)+15 )) + 15) & ~15))
#define _alloca16( x ) ((void *)((((uintptr_t)_alloca( (x)+15 )) + 15) & ~15))
#define PATHSEPERATOR_STR "\\"
#define PATHSEPERATOR_CHAR '\\'
@ -84,7 +84,7 @@ If you have questions concerning this license or the applicable additional terms
#endif
#define _alloca alloca
#define _alloca16( x ) ((void *)((((int)alloca( (x)+15 )) + 15) & ~15))
#define _alloca16( x ) ((void *)((((uintptr_t)alloca( (x)+15 )) + 15) & ~15))
#define PATHSEPERATOR_STR "/"
#define PATHSEPERATOR_CHAR '/'
@ -120,7 +120,7 @@ If you have questions concerning this license or the applicable additional terms
#endif
#define _alloca alloca
#define _alloca16( x ) ((void *)((((int)alloca( (x)+15 )) + 15) & ~15))
#define _alloca16( x ) ((void *)((((uintptr_t)alloca( (x)+15 )) + 15) & ~15))
#define ALIGN16( x ) x
#define PACKED __attribute__((packed))