Merge remote-tracking branch 'smally/platform_type_consistency' into platform-type-consistency

Conflicts:
	Engine/source/platform/platformCPUCount.cpp
This commit is contained in:
Daniel Buckmaster 2014-04-04 13:43:25 +11:00
commit 87d9e245b7
210 changed files with 896 additions and 896 deletions

View file

@ -799,7 +799,7 @@ void BitRender::bitTo8Bit_3(U32 * bits, U32 * eightBits, S32 dim)
#if defined(TORQUE_BIG_ENDIAN)
#define MAX_SHADOW_TEXELS (256 + 4) //256 seems big enough, +4 so we can run off end of buffer.
// slow fake gaussian
int i, j, c;
S32 i, j, c;
U8 tmpLine[3][MAX_SHADOW_TEXELS];
U8 *src0, *src1, *src2;
U8 *s0, *s1, *s2;
@ -809,7 +809,7 @@ void BitRender::bitTo8Bit_3(U32 * bits, U32 * eightBits, S32 dim)
U32 currVal;
U32 sampleVal;
U8 c00, c01, c02, c10, c11, c12, c20, c21, c22;
int openBuf;
S32 openBuf;
src0 = tmpLine[0];
src1 = tmpLine[1];
@ -902,9 +902,9 @@ void BitRender::bitTo8Bit_3(U32 * bits, U32 * eightBits, S32 dim)
sampleVal = 0; //c12; // take end.
else // inner pixel
{
const int wXP = 3; // corners
const int wPP = 4; // plus/NSEW
const int wCP = 4; // center
const S32 wXP = 3; // corners
const S32 wPP = 4; // plus/NSEW
const S32 wCP = 4; // center
sampleVal = (c00+c02+c20+c22)*wXP + (c01+c10+c12+c21)*wPP + c11*wCP;
sampleVal >>= 5; // div by 32 subsamples
}

View file

@ -234,7 +234,7 @@ public:
mWaterMark = FrameAllocator::getWaterMark();
mMemory = reinterpret_cast<T *>( FrameAllocator::alloc( sizeof( T ) * count ) );
for( int i = 0; i < mNumObjectsInMemory; i++ )
for( S32 i = 0; i < mNumObjectsInMemory; i++ )
constructInPlace<T>( &mMemory[i] );
}
@ -242,7 +242,7 @@ public:
~FrameTemp()
{
// Call destructor
for( int i = 0; i < mNumObjectsInMemory; i++ )
for( S32 i = 0; i < mNumObjectsInMemory; i++ )
destructInPlace<T>( &mMemory[i] );
FrameAllocator::setWaterMark( mWaterMark );

View file

@ -55,7 +55,7 @@ bool OggDecoder::_readNextPacket( ogg_packet* packet )
while( 1 )
{
int result = ogg_stream_packetout( &mOggStreamState, packet );
S32 result = ogg_stream_packetout( &mOggStreamState, packet );
if( result == 0 )
{
if( !mOggStream->_requestData() )

View file

@ -169,7 +169,7 @@ bool OggTheoraDecoder::_init()
break;
}
int result = th_decode_headerin( &mTheoraInfo, &mTheoraComment, &mTheoraSetup, &nextPacket );
S32 result = th_decode_headerin( &mTheoraInfo, &mTheoraComment, &mTheoraSetup, &nextPacket );
if( result < 0 )
{
haveTheoraHeader = false;

View file

@ -89,7 +89,7 @@ bool OggVorbisDecoder::_init()
break;
}
int result = vorbis_synthesis_headerin( &mVorbisInfo, &mVorbisComment, &nextPacket );
S32 result = vorbis_synthesis_headerin( &mVorbisInfo, &mVorbisComment, &nextPacket );
if( result != 0 )
{
haveVorbisHeader = false;

View file

@ -438,7 +438,7 @@ void StringBufferManager::updateStats()
request8 = 0;
request16 = 0;
U32 nstrings = strings.size();
for(int i=0; i < nstrings; i++)
for(S32 i=0; i < nstrings; i++)
{
request8 += strings[i]->rc->requestCount8;
request16 += strings[i]->rc->requestCount16;
@ -459,7 +459,7 @@ void StringBufferManager::dumpAllStrings()
U32 nstrings = strings.size();
Con::printf("===== String Manager: All Strings =====");
Con::printf(" utf8 | utf16 | string");
for(int i=0; i < nstrings; i++)
for(S32 i=0; i < nstrings; i++)
{
UTF8* tmp = strings[i]->createCopy8();
strings[i]->rc->requestCount8--;

View file

@ -140,7 +140,7 @@ bool FindMatch::isMatch( const char *exp, const char *str, bool caseSensitive )
bool FindMatch::isMatchMultipleExprs( const char *exps, const char *str, bool caseSensitive )
{
char *tok = 0;
int len = dStrlen(exps);
S32 len = dStrlen(exps);
char *e = new char[len+1];
dStrcpy(e,exps);

View file

@ -97,10 +97,10 @@ nat_toupper( nat_char a )
static int
static S32
compare_right(const nat_char* a, const nat_char* b)
{
int bias = 0;
S32 bias = 0;
/* The longest run of digits wins. That aside, the greatest
value wins, but we can't know that it will until we've scanned
@ -149,11 +149,11 @@ compare_left(const nat_char* a, const nat_char* b)
}
static int strnatcmp0(const nat_char* a, const nat_char* b, int fold_case)
static S32 strnatcmp0(const nat_char* a, const nat_char* b, S32 fold_case)
{
int ai, bi;
S32 ai, bi;
nat_char ca, cb;
int fractional, result;
S32 fractional, result;
ai = bi = 0;
while (1) {
@ -200,13 +200,13 @@ static int strnatcmp0(const nat_char* a, const nat_char* b, int fold_case)
}
int dStrnatcmp(const nat_char* a, const nat_char* b) {
S32 dStrnatcmp(const nat_char* a, const nat_char* b) {
return strnatcmp0(a, b, 0);
}
/* Compare, recognizing numeric string and ignoring case. */
int dStrnatcasecmp(const nat_char* a, const nat_char* b) {
S32 dStrnatcasecmp(const nat_char* a, const nat_char* b) {
return strnatcmp0(a, b, 1);
}
@ -328,12 +328,12 @@ char* dStrcpyl(char *dst, dsize_t dstSize, ...)
}
int dStrcmp( const UTF16 *str1, const UTF16 *str2)
S32 dStrcmp( const UTF16 *str1, const UTF16 *str2)
{
#if defined(TORQUE_OS_WIN) || defined(TORQUE_OS_XBOX) || defined(TORQUE_OS_XENON)
return wcscmp( reinterpret_cast<const wchar_t *>( str1 ), reinterpret_cast<const wchar_t *>( str2 ) );
#else
int ret;
S32 ret;
const UTF16 *a, *b;
a = str1;
b = str2;

View file

@ -52,22 +52,22 @@ inline char *dStrncat(char *dst, const char *src, dsize_t len)
return strncat(dst,src,len);
}
inline int dStrcmp(const char *str1, const char *str2)
inline S32 dStrcmp(const char *str1, const char *str2)
{
return strcmp(str1, str2);
}
inline int dStrncmp(const char *str1, const char *str2, dsize_t len)
inline S32 dStrncmp(const char *str1, const char *str2, dsize_t len)
{
return strncmp(str1, str2, len);
}
inline int dStricmp(const char *str1, const char *str2)
inline S32 dStricmp(const char *str1, const char *str2)
{
return strcasecmp( str1, str2 );
}
inline int dStrnicmp(const char *str1, const char *str2, dsize_t len)
inline S32 dStrnicmp(const char *str1, const char *str2, dsize_t len)
{
return strncasecmp( str1, str2, len );
}
@ -87,22 +87,22 @@ inline dsize_t dStrlen(const char *str)
return strlen(str);
}
inline char *dStrchr(char *str, int c)
inline char *dStrchr(char *str, S32 c)
{
return strchr(str,c);
}
inline const char *dStrchr(const char *str, int c)
inline const char *dStrchr(const char *str, S32 c)
{
return strchr(str,c);
}
inline char *dStrrchr(char *str, int c)
inline char *dStrrchr(char *str, S32 c)
{
return strrchr(str,c);
}
inline const char *dStrrchr(const char *str, int c)
inline const char *dStrrchr(const char *str, S32 c)
{
return strrchr(str,c);
}
@ -198,9 +198,9 @@ extern char *dStrlwr(char *str);
extern char* dStrichr( char* str, char ch );
extern const char* dStrichr( const char* str, char ch );
extern int dStrcmp(const UTF16 *str1, const UTF16 *str2);
extern int dStrnatcmp( const char* str1, const char* str2 );
extern int dStrnatcasecmp( const char* str1, const char* str2 );
extern S32 dStrcmp(const UTF16 *str1, const UTF16 *str2);
extern S32 dStrnatcmp( const char* str1, const char* str2 );
extern S32 dStrnatcasecmp( const char* str1, const char* str2 );
inline bool dAtob(const char *str)
{
@ -219,9 +219,9 @@ char* dStripPath(const char* filename);
// standard I/O functions [defined in platformString.cpp]
extern void dPrintf(const char *format, ...);
extern int dVprintf(const char *format, void *arglist);
extern int dSprintf(char *buffer, U32 bufferSize, const char *format, ...);
extern int dVsprintf(char *buffer, U32 bufferSize, const char *format, void *arglist);
extern int dSscanf(const char *buffer, const char *format, ...);
extern S32 dVprintf(const char *format, void *arglist);
extern S32 dSprintf(char *buffer, U32 bufferSize, const char *format, ...);
extern S32 dVsprintf(char *buffer, U32 bufferSize, const char *format, void *arglist);
extern S32 dSscanf(const char *buffer, const char *format, ...);
#endif

View file

@ -311,7 +311,7 @@ UTF32 oneUTF8toUTF32( const UTF8* codepoint, U32 *unitsWalked)
U8 codeunit;
// check the first byte ( a.k.a. codeunit ) .
unsigned char c = codepoint[0];
U8 c = codepoint[0];
c = c >> 1;
expectedByteCount = sgFirstByteLUT[c];
if(expectedByteCount > 0) // 0 or negative is illegal to start with
@ -469,7 +469,7 @@ U32 oneUTF32toUTF8(const UTF32 codepoint, UTF8 *threeByteCodeunitBuf)
U8 marker = ( ~mask << 1); // 1000 0000
// Process the low order bytes, shifting the codepoint down 6 each pass.
for( int i = bytecount-1; i > 0; i--)
for( S32 i = bytecount-1; i > 0; i--)
{
threeByteCodeunitBuf[i] = marker | (working & mask);
working >>= 6;

View file

@ -308,7 +308,7 @@ bool TagDictionary::match(const char* pattern, const char* str)
//------------------------------------------------------------------------------
static int QSORT_CALLBACK idCompare(const void *in_p1, const void *in_p2)
static S32 QSORT_CALLBACK idCompare(const void *in_p1, const void *in_p2)
{
return *((S32 *) in_p1) - *((S32 *) in_p2);
}

View file

@ -103,7 +103,7 @@ TorqueThreadStaticListHandle _TorqueThreadStaticReg::spawnThreadStaticsInstance(
// Copy mThreadStaticInstances[0] (master copy) into new memory, and
// pass it back.
for( int i = 0; i < getThreadStaticListVector()[0].size(); i++ )
for( S32 i = 0; i < getThreadStaticListVector()[0].size(); i++ )
{
getThreadStaticListVector().last().push_back( getThreadStaticListVector()[0][i]->_createInstance() );
}

View file

@ -174,7 +174,7 @@ inline OutputClass horrible_cast(const InputClass input){
// Cause a compile-time error if in, out and u are not the same size.
// If the compile fails here, it means the compiler has peculiar
// unions which would prevent the cast from working.
typedef int ERROR_CantUseHorrible_cast[sizeof(InputClass)==sizeof(u)
typedef S32 ERROR_CantUseHorrible_cast[sizeof(InputClass)==sizeof(u)
&& sizeof(InputClass)==sizeof(OutputClass) ? 1 : -1];
u.in = input;
return u.out;
@ -270,7 +270,7 @@ struct VoidToDefaultVoid<void> { typedef DefaultVoid type; };
#endif
// The size of a single inheritance member function pointer.
const int SINGLE_MEMFUNCPTR_SIZE = sizeof(void (GenericClass::*)());
const S32 SINGLE_MEMFUNCPTR_SIZE = sizeof(void (GenericClass::*)());
// SimplifyMemFunc< >::Convert()
//
@ -284,7 +284,7 @@ const int SINGLE_MEMFUNCPTR_SIZE = sizeof(void (GenericClass::*)());
// template specialisation, I use full specialisation of a wrapper struct.
// general case -- don't know how to convert it. Force a compile failure
template <int N>
template <S32 N>
struct SimplifyMemFunc {
template <class X, class XFuncType, class GenericMemFuncType>
inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind,
@ -344,11 +344,11 @@ struct SimplifyMemFunc< SINGLE_MEMFUNCPTR_SIZE + sizeof(int) > {
XFuncType func;
struct {
GenericMemFuncType funcaddress; // points to the actual member function
int delta; // #BYTES to be added to the 'this' pointer
S32 delta; // #BYTES to be added to the 'this' pointer
}s;
} u;
// Check that the horrible_cast will work
typedef int ERROR_CantUsehorrible_cast[sizeof(function_to_bind)==sizeof(u.s)? 1 : -1];
typedef S32 ERROR_CantUsehorrible_cast[sizeof(function_to_bind)==sizeof(u.s)? 1 : -1];
u.func = function_to_bind;
bound_func = u.s.funcaddress;
return reinterpret_cast<GenericClass *>(reinterpret_cast<char *>(pthis) + u.s.delta);
@ -367,8 +367,8 @@ struct SimplifyMemFunc< SINGLE_MEMFUNCPTR_SIZE + sizeof(int) > {
// is internally defined as:
struct MicrosoftVirtualMFP {
void (GenericClass::*codeptr)(); // points to the actual member function
int delta; // #bytes to be added to the 'this' pointer
int vtable_index; // or 0 if no virtual inheritance
S32 delta; // #bytes to be added to the 'this' pointer
S32 vtable_index; // or 0 if no virtual inheritance
};
// The CRUCIAL feature of Microsoft/Intel MFPs which we exploit is that the
// m_codeptr member is *always* called, regardless of the values of the other
@ -405,7 +405,7 @@ struct SimplifyMemFunc<SINGLE_MEMFUNCPTR_SIZE + 2*sizeof(int) >
MicrosoftVirtualMFP s;
} u2;
// Check that the horrible_cast<>s will work
typedef int ERROR_CantUsehorrible_cast[sizeof(function_to_bind)==sizeof(u.s)
typedef S32 ERROR_CantUsehorrible_cast[sizeof(function_to_bind)==sizeof(u.s)
&& sizeof(function_to_bind)==sizeof(u.ProbeFunc)
&& sizeof(u2.virtfunc)==sizeof(u2.s) ? 1 : -1];
// Unfortunately, taking the address of a MF prevents it from being inlined, so
@ -477,24 +477,24 @@ struct SimplifyMemFunc<SINGLE_MEMFUNCPTR_SIZE + 3*sizeof(int) >
// is internally defined as:
struct {
GenericMemFuncType m_funcaddress; // points to the actual member function
int delta; // #bytes to be added to the 'this' pointer
int vtordisp; // #bytes to add to 'this' to find the vtable
int vtable_index; // or 0 if no virtual inheritance
S32 delta; // #bytes to be added to the 'this' pointer
S32 vtordisp; // #bytes to add to 'this' to find the vtable
S32 vtable_index; // or 0 if no virtual inheritance
} s;
} u;
// Check that the horrible_cast will work
typedef int ERROR_CantUsehorrible_cast[sizeof(XFuncType)==sizeof(u.s)? 1 : -1];
typedef S32 ERROR_CantUsehorrible_cast[sizeof(XFuncType)==sizeof(u.s)? 1 : -1];
u.func = function_to_bind;
bound_func = u.s.funcaddress;
int virtual_delta = 0;
S32 virtual_delta = 0;
if (u.s.vtable_index) { // Virtual inheritance is used
// First, get to the vtable.
// It is 'vtordisp' bytes from the start of the class.
const int * vtable = *reinterpret_cast<const int *const*>(
const S32 * vtable = *reinterpret_cast<const S32 *const*>(
reinterpret_cast<const char *>(pthis) + u.s.vtordisp );
// 'vtable_index' tells us where in the table we should be looking.
virtual_delta = u.s.vtordisp + *reinterpret_cast<const int *>(
virtual_delta = u.s.vtordisp + *reinterpret_cast<const S32 *>(
reinterpret_cast<const char *>(vtable) + u.s.vtable_index);
}
// The int at 'virtual_delta' gives us the amount to add to 'this'.
@ -777,7 +777,7 @@ public:
// Ensure that there's a compilation failure if function pointers
// and data pointers have different sizes.
// If you get this error, you need to #undef FASTDELEGATE_USESTATICFUNCTIONHACK.
typedef int ERROR_CantUseEvilMethod[sizeof(GenericClass *)==sizeof(function_to_bind) ? 1 : -1];
typedef S32 ERROR_CantUseEvilMethod[sizeof(GenericClass *)==sizeof(function_to_bind) ? 1 : -1];
m_pthis = horrible_cast<GenericClass *>(function_to_bind);
// MSVC, SunC++ and DMC accept the following (non-standard) code:
// m_pthis = static_cast<GenericClass *>(static_cast<void *>(function_to_bind));
@ -792,7 +792,7 @@ public:
// Ensure that there's a compilation failure if function pointers
// and data pointers have different sizes.
// If you get this error, you need to #undef FASTDELEGATE_USESTATICFUNCTIONHACK.
typedef int ERROR_CantUseEvilMethod[sizeof(UnvoidStaticFuncPtr)==sizeof(this) ? 1 : -1];
typedef S32 ERROR_CantUseEvilMethod[sizeof(UnvoidStaticFuncPtr)==sizeof(this) ? 1 : -1];
return horrible_cast<UnvoidStaticFuncPtr>(this);
}
#endif // !defined(FASTDELEGATE_USESTATICFUNCTIONHACK)
@ -906,7 +906,7 @@ public:
// Implicit conversion to "bool" using the safe_bool idiom
private:
typedef struct SafeBoolStruct {
int a_data_pointer_to_this_is_0_on_buggy_compilers;
S32 a_data_pointer_to_this_is_0_on_buggy_compilers;
StaticFunctionPtr m_nonzero;
} UselessTypedef;
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
@ -991,7 +991,7 @@ public:
// Implicit conversion to "bool" using the safe_bool idiom
private:
typedef struct SafeBoolStruct {
int a_data_pointer_to_this_is_0_on_buggy_compilers;
S32 a_data_pointer_to_this_is_0_on_buggy_compilers;
StaticFunctionPtr m_nonzero;
} UselessTypedef;
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
@ -1076,7 +1076,7 @@ public:
// Implicit conversion to "bool" using the safe_bool idiom
private:
typedef struct SafeBoolStruct {
int a_data_pointer_to_this_is_0_on_buggy_compilers;
S32 a_data_pointer_to_this_is_0_on_buggy_compilers;
StaticFunctionPtr m_nonzero;
} UselessTypedef;
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
@ -1161,7 +1161,7 @@ public:
// Implicit conversion to "bool" using the safe_bool idiom
private:
typedef struct SafeBoolStruct {
int a_data_pointer_to_this_is_0_on_buggy_compilers;
S32 a_data_pointer_to_this_is_0_on_buggy_compilers;
StaticFunctionPtr m_nonzero;
} UselessTypedef;
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
@ -1246,7 +1246,7 @@ public:
// Implicit conversion to "bool" using the safe_bool idiom
private:
typedef struct SafeBoolStruct {
int a_data_pointer_to_this_is_0_on_buggy_compilers;
S32 a_data_pointer_to_this_is_0_on_buggy_compilers;
StaticFunctionPtr m_nonzero;
} UselessTypedef;
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
@ -1331,7 +1331,7 @@ public:
// Implicit conversion to "bool" using the safe_bool idiom
private:
typedef struct SafeBoolStruct {
int a_data_pointer_to_this_is_0_on_buggy_compilers;
S32 a_data_pointer_to_this_is_0_on_buggy_compilers;
StaticFunctionPtr m_nonzero;
} UselessTypedef;
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
@ -1416,7 +1416,7 @@ public:
// Implicit conversion to "bool" using the safe_bool idiom
private:
typedef struct SafeBoolStruct {
int a_data_pointer_to_this_is_0_on_buggy_compilers;
S32 a_data_pointer_to_this_is_0_on_buggy_compilers;
StaticFunctionPtr m_nonzero;
} UselessTypedef;
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
@ -1501,7 +1501,7 @@ public:
// Implicit conversion to "bool" using the safe_bool idiom
private:
typedef struct SafeBoolStruct {
int a_data_pointer_to_this_is_0_on_buggy_compilers;
S32 a_data_pointer_to_this_is_0_on_buggy_compilers;
StaticFunctionPtr m_nonzero;
} UselessTypedef;
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
@ -1586,7 +1586,7 @@ public:
// Implicit conversion to "bool" using the safe_bool idiom
private:
typedef struct SafeBoolStruct {
int a_data_pointer_to_this_is_0_on_buggy_compilers;
S32 a_data_pointer_to_this_is_0_on_buggy_compilers;
StaticFunctionPtr m_nonzero;
} UselessTypedef;
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
@ -1671,7 +1671,7 @@ public:
// Implicit conversion to "bool" using the safe_bool idiom
private:
typedef struct SafeBoolStruct {
int a_data_pointer_to_this_is_0_on_buggy_compilers;
S32 a_data_pointer_to_this_is_0_on_buggy_compilers;
StaticFunctionPtr m_nonzero;
} UselessTypedef;
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
@ -1756,7 +1756,7 @@ public:
// Implicit conversion to "bool" using the safe_bool idiom
private:
typedef struct SafeBoolStruct {
int a_data_pointer_to_this_is_0_on_buggy_compilers;
S32 a_data_pointer_to_this_is_0_on_buggy_compilers;
StaticFunctionPtr m_nonzero;
} UselessTypedef;
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
@ -1841,7 +1841,7 @@ public:
// Implicit conversion to "bool" using the safe_bool idiom
private:
typedef struct SafeBoolStruct {
int a_data_pointer_to_this_is_0_on_buggy_compilers;
S32 a_data_pointer_to_this_is_0_on_buggy_compilers;
StaticFunctionPtr m_nonzero;
} UselessTypedef;
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;

View file

@ -55,7 +55,7 @@ public:
}
protected:
int mOffset;
S32 mOffset;
};
#endif // _UTIL_DELEGATE_H_

View file

@ -37,7 +37,7 @@ public:
volatile U8 *u8Mem = reinterpret_cast<U8 *>( memory );
for( int i = 0; i < size >> 2; i++ )
for( S32 i = 0; i < size >> 2; i++ )
{
// g = garbage byte
// Input: [X|Y|Z|g] (rgba)
@ -57,7 +57,7 @@ public:
volatile const U8 *srcU8 = reinterpret_cast<const U8 *>( source );
volatile U8 *dstU8 = reinterpret_cast<U8 *>( destination );
for( int i = 0; i < size >> 2; i++ )
for( S32 i = 0; i < size >> 2; i++ )
{
// g = garbage byte
// Input: [X|Y|Z|g] (rgba)
@ -85,13 +85,13 @@ public:
virtual void ToBuffer( void *destination, const void *source, const dsize_t size ) const
{
AssertFatal( size % 3 == 0, "Bad buffer size for DXT5nm Swizzle" );
const int pixels = size / 3;
const S32 pixels = size / 3;
volatile const U8 *srcU8 = reinterpret_cast<const U8 *>( source );
volatile U8 *dstU8 = reinterpret_cast<U8 *>( destination );
// destination better damn well be the right size
for( int i = 0; i < pixels; i++ )
for( S32 i = 0; i < pixels; i++ )
{
// g = garbage byte
// Input: [X|Y|Z|g] (rgba)

View file

@ -56,7 +56,7 @@ void Path::_split(String name)
idx = name.find('/', 0, String::Right);
if (idx >= pos)
{
int len = idx - pos;
S32 len = idx - pos;
mPath = name.substr(pos,len? len: 1);
mPath = Path::CleanSeparators(mPath);
pos = idx + 1;

View file

@ -126,11 +126,11 @@ inline void Swizzle<T, mapLength>::ToBuffer( void *destination, const void *sour
T *dest = reinterpret_cast<T *>( destination );
const T *src = reinterpret_cast<const T *>( source );
for( int i = 0; i < size / ( mapLength * sizeof( T ) ); i++ )
for( S32 i = 0; i < size / ( mapLength * sizeof( T ) ); i++ )
{
dMemcpy( dest, src, mapLength * sizeof( T ) );
for( int j = 0; j < mapLength; j++ )
for( S32 j = 0; j < mapLength; j++ )
*dest++ = src[mMap[j]];
src += mapLength;

View file

@ -37,7 +37,7 @@ inline void Swizzle<U8, 4>::InPlace( void *memory, const dsize_t size ) const
U8 *src = reinterpret_cast<U8 *>( memory );
// Fast divide by 4 since we are assured a proper size
for( int i = 0; i < size >> 2; i++ )
for( S32 i = 0; i < size >> 2; i++ )
{
BYTESWAP( *dest++, src[mMap[0]] );
BYTESWAP( *dest++, src[mMap[1]] );
@ -57,7 +57,7 @@ inline void Swizzle<U8, 4>::ToBuffer( void *destination, const void *source, con
const U8 *src = reinterpret_cast<const U8 *>( source );
// Fast divide by 4 since we are assured a proper size
for( int i = 0; i < size >> 2; i++ )
for( S32 i = 0; i < size >> 2; i++ )
{
*dest++ = src[mMap[0]];
*dest++ = src[mMap[1]];
@ -80,7 +80,7 @@ inline void Swizzle<U8, 3>::InPlace( void *memory, const dsize_t size ) const
U8 *dest = reinterpret_cast<U8 *>( memory );
U8 *src = reinterpret_cast<U8 *>( memory );
for( int i = 0; i < size /3; i++ )
for( S32 i = 0; i < size /3; i++ )
{
BYTESWAP( *dest++, src[mMap[0]] );
BYTESWAP( *dest++, src[mMap[1]] );
@ -98,7 +98,7 @@ inline void Swizzle<U8, 3>::ToBuffer( void *destination, const void *source, con
U8 *dest = reinterpret_cast<U8 *>( destination );
const U8 *src = reinterpret_cast<const U8 *>( source );
for( int i = 0; i < size / 3; i++ )
for( S32 i = 0; i < size / 3; i++ )
{
*dest++ = src[mMap[0]];
*dest++ = src[mMap[1]];

View file

@ -25,7 +25,7 @@
/// A vector with a compile-time constant size.
template< typename T, int SIZE >
template< typename T, S32 SIZE >
class FixedSizeVector
{
protected:

View file

@ -24,7 +24,7 @@
#include "core/util/tSignal.h"
void SignalBase::DelegateLink::insert(DelegateLink* node, float order)
void SignalBase::DelegateLink::insert(DelegateLink* node, F32 order)
{
// Note: can only legitimately be called on list head
DelegateLink * walk = next;

View file

@ -135,7 +135,7 @@ public:
{
if( del->mDelegate == dlg )
{
for ( int i = 0; i < mTriggerNext.size(); i++ )
for ( S32 i = 0; i < mTriggerNext.size(); i++ )
{
if( mTriggerNext[i] == ptr )
mTriggerNext[i] = ptr->next;

View file

@ -508,7 +508,7 @@ template<class T> inline void Vector<T>::compact()
resize(mElementCount);
}
typedef int (QSORT_CALLBACK *qsort_compare_func)(const void *, const void *);
typedef S32 (QSORT_CALLBACK *qsort_compare_func)(const void *, const void *);
template<class T> inline void Vector<T>::sort(compare_func f)
{
@ -800,7 +800,7 @@ class VectorPtr : public Vector<void *>
const_iterator end() const;
void insert(iterator,const T&);
void insert(int idx) { Parent::insert(idx); }
void insert(S32 idx) { Parent::insert(idx); }
void erase(iterator);
T& front();

View file

@ -72,10 +72,10 @@ CreateUnitTest( TestVector, "Util/Vector" )
TEST( dtorVals[ 9 ] );
}
static S32 QSORT_CALLBACK sortInts( const int* a, const int* b )
static S32 QSORT_CALLBACK sortInts( const S32* a, const S32* b )
{
int av = *a;
int bv = *b;
S32 av = *a;
S32 bv = *b;
if( av < bv )
return -1;
@ -87,7 +87,7 @@ CreateUnitTest( TestVector, "Util/Vector" )
void testSort()
{
Vector< int > v;
Vector< S32 > v;
v.push_back( 0 );
v.push_back( 10 );

View file

@ -216,7 +216,7 @@ String ZipObject::getFileEntry(S32 idx)
const Zip::CentralDir &dir = (*mZipArchive)[idx];
char buffer[1024];
int chars = dSprintf(buffer, sizeof(buffer), "%s\t%d\t%d\t%d\t%08x",
S32 chars = dSprintf(buffer, sizeof(buffer), "%s\t%d\t%d\t%d\t%08x",
dir.mFilename.c_str(), dir.mUncompressedSize, dir.mCompressedSize,
dir.mCompressMethod, dir.mCRC32);
if (chars < sizeof(buffer))

View file

@ -651,7 +651,7 @@ bool MountSystem::unmount(FileSystemRef fs)
// also check that fs is not null each time since its a strong ref
// so it could be nulled during removal.
bool unmounted = false;
for (int i = mMountList.size() - 1; !fs.isNull() && i >= 0; --i)
for (S32 i = mMountList.size() - 1; !fs.isNull() && i >= 0; --i)
{
if (mMountList[i].fileSystem.getPointer() == fs.getPointer())
{