From 49c4d028a5418f94bda84fb62632350fea6a7ffa Mon Sep 17 00:00:00 2001 From: dhewg Date: Thu, 28 Jun 2012 12:49:24 +0200 Subject: [PATCH] s/LittleLong/LittleInt/ to match the return type --- neo/MayaImport/maya_main.cpp | 6 +++--- neo/framework/File.cpp | 8 ++++---- neo/framework/FileSystem.cpp | 4 ++-- neo/framework/Session.cpp | 2 +- neo/framework/Unzip.cpp | 2 +- neo/framework/UsercmdGen.cpp | 2 +- neo/idlib/Dict.cpp | 4 ++-- neo/idlib/Lib.cpp | 2 +- neo/idlib/Lib.h | 2 +- neo/idlib/hashing/MD5.cpp | 4 ++-- neo/renderer/Cinematic.cpp | 2 +- neo/renderer/Image_files.cpp | 24 +++++++++++------------ neo/renderer/Image_load.cpp | 38 ++++++++++++++++++------------------ neo/renderer/Model_md3.cpp | 8 ++++---- neo/sound/snd_wavefile.cpp | 16 +++++++-------- 15 files changed, 62 insertions(+), 62 deletions(-) diff --git a/neo/MayaImport/maya_main.cpp b/neo/MayaImport/maya_main.cpp index d3d2488b..9f186be7 100644 --- a/neo/MayaImport/maya_main.cpp +++ b/neo/MayaImport/maya_main.cpp @@ -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); diff --git a/neo/framework/File.cpp b/neo/framework/File.cpp index c1ceb01f..0475267c 100644 --- a/neo/framework/File.cpp +++ b/neo/framework/File.cpp @@ -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 ) ); } diff --git a/neo/framework/FileSystem.cpp b/neo/framework/FileSystem.cpp index 451922cb..9a31c35b 100644 --- a/neo/framework/FileSystem.cpp +++ b/neo/framework/FileSystem.cpp @@ -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 ); diff --git a/neo/framework/Session.cpp b/neo/framework/Session.cpp index 14bf290e..b900652f 100644 --- a/neo/framework/Session.cpp +++ b/neo/framework/Session.cpp @@ -2755,7 +2755,7 @@ void idSessionLocal::RunGameTic() { } else { cmd = logCmd.cmd; cmd.ByteSwap(); - logCmd.consistencyHash = LittleLong( logCmd.consistencyHash ); + logCmd.consistencyHash = LittleInt( logCmd.consistencyHash ); } } diff --git a/neo/framework/Unzip.cpp b/neo/framework/Unzip.cpp index 54d2e37d..09e7742c 100644 --- a/neo/framework/Unzip.cpp +++ b/neo/framework/Unzip.cpp @@ -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; /* diff --git a/neo/framework/UsercmdGen.cpp b/neo/framework/UsercmdGen.cpp index f0d090bf..f1b213f7 100644 --- a/neo/framework/UsercmdGen.cpp +++ b/neo/framework/UsercmdGen.cpp @@ -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 ); } /* diff --git a/neo/idlib/Dict.cpp b/neo/idlib/Dict.cpp index b1039ccc..384d9c16 100644 --- a/neo/idlib/Dict.cpp +++ b/neo/idlib/Dict.cpp @@ -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 ); diff --git a/neo/idlib/Lib.cpp b/neo/idlib/Lib.cpp index edec12db..ed7ad122 100644 --- a/neo/idlib/Lib.cpp +++ b/neo/idlib/Lib.cpp @@ -439,7 +439,7 @@ int BigLong( int l ) { return SDL_SwapBE32(l); } -int LittleLong( int l ) { +int LittleInt( int l ) { return SDL_SwapLE32(l); } diff --git a/neo/idlib/Lib.h b/neo/idlib/Lib.h index ce7ecefe..6ede1602 100644 --- a/neo/idlib/Lib.h +++ b/neo/idlib/Lib.h @@ -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 ); diff --git a/neo/idlib/hashing/MD5.cpp b/neo/idlib/hashing/MD5.cpp index f2d503f1..de9f855d 100644 --- a/neo/idlib/hashing/MD5.cpp +++ b/neo/idlib/hashing/MD5.cpp @@ -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 ); diff --git a/neo/renderer/Cinematic.cpp b/neo/renderer/Cinematic.cpp index b0dc92f4..d0b54031 100644 --- a/neo/renderer/Cinematic.cpp +++ b/neo/renderer/Cinematic.cpp @@ -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)); } /* diff --git a/neo/renderer/Image_files.cpp b/neo/renderer/Image_files.cpp index c374a9c1..36aa0777 100644 --- a/neo/renderer/Image_files.cpp +++ b/neo/renderer/Image_files.cpp @@ -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 ) ); diff --git a/neo/renderer/Image_load.cpp b/neo/renderer/Image_load.cpp index 408f11a5..3ff9ec6f 100644 --- a/neo/renderer/Image_load.cpp +++ b/neo/renderer/Image_load.cpp @@ -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 ); diff --git a/neo/renderer/Model_md3.cpp b/neo/renderer/Model_md3.cpp index 91336c27..9970adee 100644 --- a/neo/renderer/Model_md3.cpp +++ b/neo/renderer/Model_md3.cpp @@ -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); diff --git a/neo/sound/snd_wavefile.cpp b/neo/sound/snd_wavefile.cpp index 4013a983..556b1e52 100644 --- a/neo/sound/snd_wavefile.cpp +++ b/neo/sound/snd_wavefile.cpp @@ -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(); }