s/LittleLong/LittleInt/ to match the return type

This commit is contained in:
dhewg 2012-06-28 12:49:24 +02:00
parent 0eb604c436
commit 49c4d028a5
15 changed files with 62 additions and 62 deletions

View file

@ -2918,7 +2918,7 @@ void idMayaExport::ConvertToMD3( void ) {
pinmodel = (md3Header_t *)buffer;
version = LittleLong (pinmodel->version);
version = LittleInt (pinmodel->version);
if (version != MD3_VERSION) {
common->Printf( "R_LoadMD3: %s has wrong version (%i should be %i)\n",
mod_name, version, MD3_VERSION);
@ -2926,11 +2926,11 @@ void idMayaExport::ConvertToMD3( void ) {
}
mod->type = MOD_MESH;
size = LittleLong(pinmodel->ofsEnd);
size = LittleInt(pinmodel->ofsEnd);
mod->dataSize += size;
mod->md3[lod] = ri.Hunk_Alloc( size );
memcpy (mod->md3[lod], buffer, LittleLong(pinmodel->ofsEnd) );
memcpy (mod->md3[lod], buffer, LittleInt(pinmodel->ofsEnd) );
LL(mod->md3[lod]->ident);
LL(mod->md3[lod]->version);

View file

@ -310,7 +310,7 @@ int idFile::WriteFloatString( const char *fmt, ... ) {
*/
int idFile::ReadInt( int &value ) {
int result = Read( &value, sizeof( value ) );
value = LittleLong(value);
value = LittleInt(value);
return result;
}
@ -321,7 +321,7 @@ int idFile::ReadInt( int &value ) {
*/
int idFile::ReadUnsignedInt( unsigned int &value ) {
int result = Read( &value, sizeof( value ) );
value = LittleLong(value);
value = LittleInt(value);
return result;
}
@ -466,7 +466,7 @@ int idFile::ReadMat3( idMat3 &mat ) {
=================
*/
int idFile::WriteInt( const int value ) {
int v = LittleLong(value);
int v = LittleInt(value);
return Write( &v, sizeof( v ) );
}
@ -476,7 +476,7 @@ int idFile::WriteInt( const int value ) {
=================
*/
int idFile::WriteUnsignedInt( const unsigned int value ) {
unsigned int v = LittleLong(value);
unsigned int v = LittleInt(value);
return Write( &v, sizeof( v ) );
}

View file

@ -1350,7 +1350,7 @@ pack_t *idFileSystemLocal::LoadZipFile( const char *zipfile ) {
break;
}
if ( file_info.uncompressed_size > 0 ) {
fs_headerLongs[fs_numHeaderLongs++] = LittleLong( file_info.crc );
fs_headerLongs[fs_numHeaderLongs++] = LittleInt( file_info.crc );
}
hash = HashFileName( filename_inzip );
buildBuffer[i].name = filename_inzip;
@ -1389,7 +1389,7 @@ pack_t *idFileSystemLocal::LoadZipFile( const char *zipfile ) {
}
pack->checksum = MD4_BlockChecksum( fs_headerLongs, 4 * fs_numHeaderLongs );
pack->checksum = LittleLong( pack->checksum );
pack->checksum = LittleInt( pack->checksum );
Mem_Free( fs_headerLongs );

View file

@ -2755,7 +2755,7 @@ void idSessionLocal::RunGameTic() {
} else {
cmd = logCmd.cmd;
cmd.ByteSwap();
logCmd.consistencyHash = LittleLong( logCmd.consistencyHash );
logCmd.consistencyHash = LittleInt( logCmd.consistencyHash );
}
}

View file

@ -1136,7 +1136,7 @@ static int unzlocal_getLong (FILE *fin, uLong *pX)
if (fread( &v, sizeof(v), 1, fin ) != 1)
return UNZ_ERRNO;
*pX = LittleLong( v);
*pX = LittleInt( v);
return UNZ_OK;
/*

View file

@ -44,7 +44,7 @@ void usercmd_t::ByteSwap( void ) {
angles[0] = LittleShort( angles[0] );
angles[1] = LittleShort( angles[1] );
angles[2] = LittleShort( angles[2] );
sequence = LittleLong( sequence );
sequence = LittleInt( sequence );
}
/*

View file

@ -573,7 +573,7 @@ idDict::WriteToFileHandle
================
*/
void idDict::WriteToFileHandle( idFile *f ) const {
int c = LittleLong( args.Num() );
int c = LittleInt( args.Num() );
f->Write( &c, sizeof( c ) );
for ( int i = 0; i < args.Num(); i++ ) { // don't loop on the swapped count use the original
WriteString( args[i].GetKey().c_str(), f );
@ -615,7 +615,7 @@ void idDict::ReadFromFileHandle( idFile *f ) {
Clear();
f->Read( &c, sizeof( c ) );
c = LittleLong( c );
c = LittleInt( c );
for ( int i = 0; i < c; i++ ) {
key = ReadString( f );
val = ReadString( f );

View file

@ -439,7 +439,7 @@ int BigLong( int l ) {
return SDL_SwapBE32(l);
}
int LittleLong( int l ) {
int LittleInt( int l ) {
return SDL_SwapLE32(l);
}

View file

@ -107,7 +107,7 @@ void UnpackColor( const dword color, idVec4 &unpackedColor );
short BigShort( short l );
short LittleShort( short l );
int BigLong( int l );
int LittleLong( int l );
int LittleInt( int l );
float BigFloat( float l );
float LittleFloat( float l );
void BigRevBytes( void *bp, int elsize, int elcount );

View file

@ -245,8 +245,8 @@ void MD5_Final( MD5_CTX *ctx, unsigned char digest[16] ) {
unsigned int val0 = ctx->bits[0];
unsigned int val1 = ctx->bits[1];
((unsigned int *) ctx->in)[14] = LittleLong( val0 );
((unsigned int *) ctx->in)[15] = LittleLong( val1 );
((unsigned int *) ctx->in)[14] = LittleInt( val0 );
((unsigned int *) ctx->in)[15] = LittleInt( val1 );
MD5_Transform( ctx->state, (unsigned int *) ctx->in );
memcpy( digest, ctx->state, 16 );

View file

@ -958,7 +958,7 @@ unsigned int idCinematicLocal::yuv_to_rgb24( int y, int u, int v ) {
if (r<0) r = 0; if (g<0) g = 0; if (b<0) b = 0;
if (r > 255) r = 255; if (g > 255) g = 255; if (b > 255) b = 255;
return LittleLong((r)+(g<<8)+(b<<16));
return LittleInt((r)+(g<<8)+(b<<16));
}
/*

View file

@ -234,33 +234,33 @@ static void LoadBMP( const char *name, byte **pic, int *width, int *height, ID_T
bmpHeader.id[0] = *buf_p++;
bmpHeader.id[1] = *buf_p++;
bmpHeader.fileSize = LittleLong( * ( int * ) buf_p );
bmpHeader.fileSize = LittleInt( * ( int * ) buf_p );
buf_p += 4;
bmpHeader.reserved0 = LittleLong( * ( int * ) buf_p );
bmpHeader.reserved0 = LittleInt( * ( int * ) buf_p );
buf_p += 4;
bmpHeader.bitmapDataOffset = LittleLong( * ( int * ) buf_p );
bmpHeader.bitmapDataOffset = LittleInt( * ( int * ) buf_p );
buf_p += 4;
bmpHeader.bitmapHeaderSize = LittleLong( * ( int * ) buf_p );
bmpHeader.bitmapHeaderSize = LittleInt( * ( int * ) buf_p );
buf_p += 4;
bmpHeader.width = LittleLong( * ( int * ) buf_p );
bmpHeader.width = LittleInt( * ( int * ) buf_p );
buf_p += 4;
bmpHeader.height = LittleLong( * ( int * ) buf_p );
bmpHeader.height = LittleInt( * ( int * ) buf_p );
buf_p += 4;
bmpHeader.planes = LittleShort( * ( short * ) buf_p );
buf_p += 2;
bmpHeader.bitsPerPixel = LittleShort( * ( short * ) buf_p );
buf_p += 2;
bmpHeader.compression = LittleLong( * ( int * ) buf_p );
bmpHeader.compression = LittleInt( * ( int * ) buf_p );
buf_p += 4;
bmpHeader.bitmapDataSize = LittleLong( * ( int * ) buf_p );
bmpHeader.bitmapDataSize = LittleInt( * ( int * ) buf_p );
buf_p += 4;
bmpHeader.hRes = LittleLong( * ( int * ) buf_p );
bmpHeader.hRes = LittleInt( * ( int * ) buf_p );
buf_p += 4;
bmpHeader.vRes = LittleLong( * ( int * ) buf_p );
bmpHeader.vRes = LittleInt( * ( int * ) buf_p );
buf_p += 4;
bmpHeader.colors = LittleLong( * ( int * ) buf_p );
bmpHeader.colors = LittleInt( * ( int * ) buf_p );
buf_p += 4;
bmpHeader.importantColors = LittleLong( * ( int * ) buf_p );
bmpHeader.importantColors = LittleInt( * ( int * ) buf_p );
buf_p += 4;
memcpy( bmpHeader.palette, buf_p, sizeof( bmpHeader.palette ) );

View file

@ -1400,9 +1400,9 @@ bool idImage::CheckPrecompressedImage( bool fullLoad ) {
fileSystem->CloseFile( f );
unsigned int magic = LittleLong( *(unsigned int *)data );
unsigned int magic = LittleInt( *(unsigned int *)data );
ddsFileHeader_t *_header = (ddsFileHeader_t *)(data + 4);
int ddspf_dwFlags = LittleLong( _header->ddspf.dwFlags );
int ddspf_dwFlags = LittleInt( _header->ddspf.dwFlags );
if ( magic != DDS_MAKEFOURCC('D', 'D', 'S', ' ')) {
common->Printf( "CheckPrecompressedImage( %s ): magic != 'DDS '\n", imgName.c_str() );
@ -1438,24 +1438,24 @@ void idImage::UploadPrecompressedImage( byte *data, int len ) {
ddsFileHeader_t *header = (ddsFileHeader_t *)(data + 4);
// ( not byte swapping dwReserved1 dwReserved2 )
header->dwSize = LittleLong( header->dwSize );
header->dwFlags = LittleLong( header->dwFlags );
header->dwHeight = LittleLong( header->dwHeight );
header->dwWidth = LittleLong( header->dwWidth );
header->dwPitchOrLinearSize = LittleLong( header->dwPitchOrLinearSize );
header->dwDepth = LittleLong( header->dwDepth );
header->dwMipMapCount = LittleLong( header->dwMipMapCount );
header->dwCaps1 = LittleLong( header->dwCaps1 );
header->dwCaps2 = LittleLong( header->dwCaps2 );
header->dwSize = LittleInt( header->dwSize );
header->dwFlags = LittleInt( header->dwFlags );
header->dwHeight = LittleInt( header->dwHeight );
header->dwWidth = LittleInt( header->dwWidth );
header->dwPitchOrLinearSize = LittleInt( header->dwPitchOrLinearSize );
header->dwDepth = LittleInt( header->dwDepth );
header->dwMipMapCount = LittleInt( header->dwMipMapCount );
header->dwCaps1 = LittleInt( header->dwCaps1 );
header->dwCaps2 = LittleInt( header->dwCaps2 );
header->ddspf.dwSize = LittleLong( header->ddspf.dwSize );
header->ddspf.dwFlags = LittleLong( header->ddspf.dwFlags );
header->ddspf.dwFourCC = LittleLong( header->ddspf.dwFourCC );
header->ddspf.dwRGBBitCount = LittleLong( header->ddspf.dwRGBBitCount );
header->ddspf.dwRBitMask = LittleLong( header->ddspf.dwRBitMask );
header->ddspf.dwGBitMask = LittleLong( header->ddspf.dwGBitMask );
header->ddspf.dwBBitMask = LittleLong( header->ddspf.dwBBitMask );
header->ddspf.dwABitMask = LittleLong( header->ddspf.dwABitMask );
header->ddspf.dwSize = LittleInt( header->ddspf.dwSize );
header->ddspf.dwFlags = LittleInt( header->ddspf.dwFlags );
header->ddspf.dwFourCC = LittleInt( header->ddspf.dwFourCC );
header->ddspf.dwRGBBitCount = LittleInt( header->ddspf.dwRGBBitCount );
header->ddspf.dwRBitMask = LittleInt( header->ddspf.dwRBitMask );
header->ddspf.dwGBitMask = LittleInt( header->ddspf.dwGBitMask );
header->ddspf.dwBBitMask = LittleInt( header->ddspf.dwBBitMask );
header->ddspf.dwABitMask = LittleInt( header->ddspf.dwABitMask );
// generate the texture number
qglGenTextures( 1, &texnum );

View file

@ -38,7 +38,7 @@ If you have questions concerning this license or the applicable additional terms
***********************************************************************/
#define LL(x) x=LittleLong(x)
#define LL(x) x=LittleInt(x)
/*
=================
@ -69,7 +69,7 @@ void idRenderModelMD3::InitFromFile( const char *fileName ) {
pinmodel = (md3Header_t *)buffer;
version = LittleLong (pinmodel->version);
version = LittleInt (pinmodel->version);
if (version != MD3_VERSION) {
fileSystem->FreeFile( buffer );
common->Warning( "InitFromFile: %s has wrong version (%i should be %i)",
@ -77,11 +77,11 @@ void idRenderModelMD3::InitFromFile( const char *fileName ) {
return;
}
size = LittleLong(pinmodel->ofsEnd);
size = LittleInt(pinmodel->ofsEnd);
dataSize += size;
md3 = (md3Header_t *)Mem_Alloc( size );
memcpy (md3, buffer, LittleLong(pinmodel->ofsEnd) );
memcpy (md3, buffer, LittleInt(pinmodel->ofsEnd) );
LL(md3->ident);
LL(md3->version);

View file

@ -152,9 +152,9 @@ int idWaveFile::ReadMMIO( void ) {
mhmmio->Read( &mckRiff, 12 );
assert( !isOgg );
mckRiff.ckid = LittleLong( mckRiff.ckid );
mckRiff.cksize = LittleLong( mckRiff.cksize );
mckRiff.fccType = LittleLong( mckRiff.fccType );
mckRiff.ckid = LittleInt( mckRiff.ckid );
mckRiff.cksize = LittleInt( mckRiff.cksize );
mckRiff.fccType = LittleInt( mckRiff.fccType );
mckRiff.dwDataOffset = 12;
// Check to make sure this is a valid wave file
@ -169,8 +169,8 @@ int idWaveFile::ReadMMIO( void ) {
return -1;
}
assert( !isOgg );
ckIn.ckid = LittleLong( ckIn.ckid );
ckIn.cksize = LittleLong( ckIn.cksize );
ckIn.ckid = LittleInt( ckIn.ckid );
ckIn.cksize = LittleInt( ckIn.cksize );
ckIn.dwDataOffset += ckIn.cksize-8;
} while (ckIn.ckid != mmioFOURCC('f', 'm', 't', ' '));
@ -187,8 +187,8 @@ int idWaveFile::ReadMMIO( void ) {
assert( !isOgg );
pcmWaveFormat.wf.wFormatTag = LittleShort( pcmWaveFormat.wf.wFormatTag );
pcmWaveFormat.wf.nChannels = LittleShort( pcmWaveFormat.wf.nChannels );
pcmWaveFormat.wf.nSamplesPerSec = LittleLong( pcmWaveFormat.wf.nSamplesPerSec );
pcmWaveFormat.wf.nAvgBytesPerSec = LittleLong( pcmWaveFormat.wf.nAvgBytesPerSec );
pcmWaveFormat.wf.nSamplesPerSec = LittleInt( pcmWaveFormat.wf.nSamplesPerSec );
pcmWaveFormat.wf.nAvgBytesPerSec = LittleInt( pcmWaveFormat.wf.nAvgBytesPerSec );
pcmWaveFormat.wf.nBlockAlign = LittleShort( pcmWaveFormat.wf.nBlockAlign );
pcmWaveFormat.wBitsPerSample = LittleShort( pcmWaveFormat.wBitsPerSample );
@ -250,7 +250,7 @@ int idWaveFile::ResetFile( void ) {
mhmmio->Read( &mck.cksize, 4 );
assert( !isOgg );
mck.cksize = LittleLong( mck.cksize );
mck.cksize = LittleInt( mck.cksize );
mseekBase = mhmmio->Tell();
}