Skip to content

Commit

Permalink
More format warnings removed
Browse files Browse the repository at this point in the history
  • Loading branch information
Miguel Boton committed Nov 26, 2011
1 parent 548809f commit 44bf0c6
Show file tree
Hide file tree
Showing 18 changed files with 44 additions and 44 deletions.
10 changes: 5 additions & 5 deletions neo/cm/CollisionModel_load.cpp
Expand Up @@ -3195,13 +3195,13 @@ idCollisionModelManagerLocal::PrintModelInfo
==================
*/
void idCollisionModelManagerLocal::PrintModelInfo( const cm_model_t *model ) {
common->Printf( "%6i vertices (%i KB)\n", model->numVertices, (model->numVertices * sizeof(cm_vertex_t))>>10 );
common->Printf( "%6i edges (%i KB)\n", model->numEdges, (model->numEdges * sizeof(cm_edge_t))>>10 );
common->Printf( "%6i vertices (%zu KB)\n", model->numVertices, (model->numVertices * sizeof(cm_vertex_t))>>10 );
common->Printf( "%6i edges (%zu KB)\n", model->numEdges, (model->numEdges * sizeof(cm_edge_t))>>10 );
common->Printf( "%6i polygons (%i KB)\n", model->numPolygons, model->polygonMemory>>10 );
common->Printf( "%6i brushes (%i KB)\n", model->numBrushes, model->brushMemory>>10 );
common->Printf( "%6i nodes (%i KB)\n", model->numNodes, (model->numNodes * sizeof(cm_node_t))>>10 );
common->Printf( "%6i polygon refs (%i KB)\n", model->numPolygonRefs, (model->numPolygonRefs * sizeof(cm_polygonRef_t))>>10 );
common->Printf( "%6i brush refs (%i KB)\n", model->numBrushRefs, (model->numBrushRefs * sizeof(cm_brushRef_t))>>10 );
common->Printf( "%6i nodes (%zu KB)\n", model->numNodes, (model->numNodes * sizeof(cm_node_t))>>10 );
common->Printf( "%6i polygon refs (%zu KB)\n", model->numPolygonRefs, (model->numPolygonRefs * sizeof(cm_polygonRef_t))>>10 );
common->Printf( "%6i brush refs (%zu KB)\n", model->numBrushRefs, (model->numBrushRefs * sizeof(cm_brushRef_t))>>10 );
common->Printf( "%6i internal edges\n", model->numInternalEdges );
common->Printf( "%6i sharp edges\n", model->numSharpEdges );
common->Printf( "%6i contained polygons removed\n", model->numRemovedPolys );
Expand Down
2 changes: 1 addition & 1 deletion neo/d3xp/Game_local.cpp
Expand Up @@ -1204,7 +1204,7 @@ bool idGameLocal::NextMap( void ) {
int i;

if ( !g_mapCycle.GetString()[0] ) {
Printf( common->GetLanguageDict()->GetString( "#str_04294" ) );
Printf( "%s", common->GetLanguageDict()->GetString( "#str_04294" ) );
return false;
}
if ( fileSystem->ReadFile( g_mapCycle.GetString(), NULL, NULL ) < 0 ) {
Expand Down
2 changes: 1 addition & 1 deletion neo/d3xp/MultiplayerGame.cpp
Expand Up @@ -1364,7 +1364,7 @@ void idMultiplayerGame::PlayerStats( int clientNum, char *data, const int len )
return;
}

idStr::snPrintf( data, len, "team=%d score=%ld tks=%ld", team, playerState[ clientNum ].fragCount, playerState[ clientNum ].teamFragCount );
idStr::snPrintf( data, len, "team=%d score=%d tks=%d", team, playerState[ clientNum ].fragCount, playerState[ clientNum ].teamFragCount );

return;

Expand Down
6 changes: 3 additions & 3 deletions neo/d3xp/ai/AAS_routing.cpp
Expand Up @@ -327,9 +327,9 @@ void idAASLocal::RoutingStats( void ) const {
gameLocal.Printf( "%6d area cache (%d KB)\n", numAreaCache, totalAreaCacheMemory >> 10 );
gameLocal.Printf( "%6d portal cache (%d KB)\n", numPortalCache, totalPortalCacheMemory >> 10 );
gameLocal.Printf( "%6d total cache (%d KB)\n", numAreaCache + numPortalCache, totalCacheMemory >> 10 );
gameLocal.Printf( "%6d area travel times (%d KB)\n", numAreaTravelTimes, ( numAreaTravelTimes * sizeof( unsigned short ) ) >> 10 );
gameLocal.Printf( "%6d area cache entries (%d KB)\n", areaCacheIndexSize, ( areaCacheIndexSize * sizeof( idRoutingCache * ) ) >> 10 );
gameLocal.Printf( "%6d portal cache entries (%d KB)\n", portalCacheIndexSize, ( portalCacheIndexSize * sizeof( idRoutingCache * ) ) >> 10 );
gameLocal.Printf( "%6d area travel times (%zu KB)\n", numAreaTravelTimes, ( numAreaTravelTimes * sizeof( unsigned short ) ) >> 10 );
gameLocal.Printf( "%6d area cache entries (%zu KB)\n", areaCacheIndexSize, ( areaCacheIndexSize * sizeof( idRoutingCache * ) ) >> 10 );
gameLocal.Printf( "%6d portal cache entries (%zu KB)\n", portalCacheIndexSize, ( portalCacheIndexSize * sizeof( idRoutingCache * ) ) >> 10 );
}

/*
Expand Down
6 changes: 3 additions & 3 deletions neo/d3xp/anim/Anim.cpp
Expand Up @@ -1046,7 +1046,7 @@ void idAnimManager::ListAnims( void ) const {
if ( animptr && *animptr ) {
anim = *animptr;
s = anim->Size();
gameLocal.Printf( "%8d bytes : %2d refs : %s\n", s, anim->NumRefs(), anim->Name() );
gameLocal.Printf( "%8zd bytes : %2d refs : %s\n", s, anim->NumRefs(), anim->Name() );
size += s;
num++;
}
Expand All @@ -1057,8 +1057,8 @@ void idAnimManager::ListAnims( void ) const {
namesize += jointnames[ i ].Size();
}

gameLocal.Printf( "\n%d memory used in %d anims\n", size, num );
gameLocal.Printf( "%d memory used in %d joint names\n", namesize, jointnames.Num() );
gameLocal.Printf( "\n%zu memory used in %d anims\n", size, num );
gameLocal.Printf( "%zu memory used in %d joint names\n", namesize, jointnames.Num() );
}

/*
Expand Down
6 changes: 3 additions & 3 deletions neo/d3xp/gamesys/Event.h
Expand Up @@ -57,7 +57,7 @@ class idEventDef {
unsigned int formatspecIndex;
int returnType;
int numargs;
size_t argsize;
int argsize;
int argOffset[ D_EVENT_MAXARGS ];
int eventnum;
const idEventDef * next;
Expand All @@ -74,7 +74,7 @@ class idEventDef {
char GetReturnType( void ) const;
int GetEventNum( void ) const;
int GetNumArgs( void ) const;
size_t GetArgSize( void ) const;
int GetArgSize( void ) const;
int GetArgOffset( int arg ) const;

static int NumEventCommands( void );
Expand Down Expand Up @@ -186,7 +186,7 @@ ID_INLINE int idEventDef::GetNumArgs( void ) const {
idEventDef::GetArgSize
================
*/
ID_INLINE size_t idEventDef::GetArgSize( void ) const {
ID_INLINE int idEventDef::GetArgSize( void ) const {
return argsize;
}

Expand Down
4 changes: 2 additions & 2 deletions neo/d3xp/gamesys/SysCmds.cpp
Expand Up @@ -87,7 +87,7 @@ void Cmd_EntityList_f( const idCmdArgs &args ) {
size += check->spawnArgs.Allocated();
}

gameLocal.Printf( "...%d entities\n...%d bytes of spawnargs\n", count, size );
gameLocal.Printf( "...%d entities\n...%zu bytes of spawnargs\n", count, size );
}

/*
Expand Down Expand Up @@ -1507,7 +1507,7 @@ static void Cmd_ListAnims_f( const idCmdArgs &args ) {
}
}

gameLocal.Printf( "%d memory used in %d entity animators\n", size, num );
gameLocal.Printf( "%zu memory used in %d entity animators\n", size, num );
}
}

Expand Down
8 changes: 4 additions & 4 deletions neo/d3xp/script/Script_Program.cpp
Expand Up @@ -1320,7 +1320,7 @@ idVarDef *idProgram::AllocDef( idTypeDef *type, const char *name, idVarDef *scop
def->value.bytePtr = &variables[ numVariables ];
numVariables += def->TypeDef()->Size();
if ( numVariables > sizeof( variables ) ) {
throw idCompileError( va( "Exceeded global memory size (%d bytes)", sizeof( variables ) ) );
throw idCompileError( va( "Exceeded global memory size (%zu bytes)", sizeof( variables ) ) );
}

memset( def->value.bytePtr, 0, def->TypeDef()->Size() );
Expand Down Expand Up @@ -1755,13 +1755,13 @@ void idProgram::CompileStats( void ) {

gameLocal.Printf( "\nMemory usage:\n" );
gameLocal.Printf( " Strings: %d, %d bytes\n", fileList.Num(), stringspace );
gameLocal.Printf( " Statements: %d, %d bytes\n", statements.Num(), statements.MemoryUsed() );
gameLocal.Printf( " Statements: %d, %zu bytes\n", statements.Num(), statements.MemoryUsed() );
gameLocal.Printf( " Functions: %d, %d bytes\n", functions.Num(), funcMem );
gameLocal.Printf( " Variables: %d bytes\n", numVariables );
gameLocal.Printf( " Mem used: %d bytes\n", memused );
gameLocal.Printf( " Static data: %d bytes\n", sizeof( idProgram ) );
gameLocal.Printf( " Static data: %zu bytes\n", sizeof( idProgram ) );
gameLocal.Printf( " Allocated: %d bytes\n", memallocated );
gameLocal.Printf( " Thread size: %d bytes\n\n", sizeof( idThread ) );
gameLocal.Printf( " Thread size: %zu bytes\n\n", sizeof( idThread ) );
}

/*
Expand Down
2 changes: 1 addition & 1 deletion neo/framework/Common.cpp
Expand Up @@ -349,7 +349,7 @@ void idCommonLocal::VPrintf( const char *fmt, va_list args ) {
// don't overflow
if ( idStr::vsnPrintf( msg+timeLength, MAX_PRINT_MSG_SIZE-timeLength-1, fmt, args ) < 0 ) {
msg[sizeof(msg)-2] = '\n'; msg[sizeof(msg)-1] = '\0'; // avoid output garbling
Sys_Printf( "idCommon::VPrintf: truncated to %d characters\n", strlen(msg)-1 );
Sys_Printf( "idCommon::VPrintf: truncated to %zu characters\n", strlen(msg)-1 );
}

if ( rd_buffer ) {
Expand Down
2 changes: 1 addition & 1 deletion neo/game/MultiplayerGame.cpp
Expand Up @@ -935,7 +935,7 @@ void idMultiplayerGame::PlayerStats( int clientNum, char *data, const int len )
return;
}

idStr::snPrintf( data, len, "team=%d score=%ld tks=%ld", team, playerState[ clientNum ].fragCount, playerState[ clientNum ].teamFragCount );
idStr::snPrintf( data, len, "team=%d score=%d tks=%d", team, playerState[ clientNum ].fragCount, playerState[ clientNum ].teamFragCount );

return;

Expand Down
6 changes: 3 additions & 3 deletions neo/game/ai/AAS_routing.cpp
Expand Up @@ -327,9 +327,9 @@ void idAASLocal::RoutingStats( void ) const {
gameLocal.Printf( "%6d area cache (%d KB)\n", numAreaCache, totalAreaCacheMemory >> 10 );
gameLocal.Printf( "%6d portal cache (%d KB)\n", numPortalCache, totalPortalCacheMemory >> 10 );
gameLocal.Printf( "%6d total cache (%d KB)\n", numAreaCache + numPortalCache, totalCacheMemory >> 10 );
gameLocal.Printf( "%6d area travel times (%d KB)\n", numAreaTravelTimes, ( numAreaTravelTimes * sizeof( unsigned short ) ) >> 10 );
gameLocal.Printf( "%6d area cache entries (%d KB)\n", areaCacheIndexSize, ( areaCacheIndexSize * sizeof( idRoutingCache * ) ) >> 10 );
gameLocal.Printf( "%6d portal cache entries (%d KB)\n", portalCacheIndexSize, ( portalCacheIndexSize * sizeof( idRoutingCache * ) ) >> 10 );
gameLocal.Printf( "%6d area travel times (%zu KB)\n", numAreaTravelTimes, ( numAreaTravelTimes * sizeof( unsigned short ) ) >> 10 );
gameLocal.Printf( "%6d area cache entries (%zu KB)\n", areaCacheIndexSize, ( areaCacheIndexSize * sizeof( idRoutingCache * ) ) >> 10 );
gameLocal.Printf( "%6d portal cache entries (%zu KB)\n", portalCacheIndexSize, ( portalCacheIndexSize * sizeof( idRoutingCache * ) ) >> 10 );
}

/*
Expand Down
6 changes: 3 additions & 3 deletions neo/game/anim/Anim.cpp
Expand Up @@ -1046,7 +1046,7 @@ void idAnimManager::ListAnims( void ) const {
if ( animptr && *animptr ) {
anim = *animptr;
s = anim->Size();
gameLocal.Printf( "%8d bytes : %2d refs : %s\n", s, anim->NumRefs(), anim->Name() );
gameLocal.Printf( "%8zu bytes : %2d refs : %s\n", s, anim->NumRefs(), anim->Name() );
size += s;
num++;
}
Expand All @@ -1057,8 +1057,8 @@ void idAnimManager::ListAnims( void ) const {
namesize += jointnames[ i ].Size();
}

gameLocal.Printf( "\n%d memory used in %d anims\n", size, num );
gameLocal.Printf( "%d memory used in %d joint names\n", namesize, jointnames.Num() );
gameLocal.Printf( "\n%zu memory used in %d anims\n", size, num );
gameLocal.Printf( "%zu memory used in %d joint names\n", namesize, jointnames.Num() );
}

/*
Expand Down
6 changes: 3 additions & 3 deletions neo/game/gamesys/Event.h
Expand Up @@ -57,7 +57,7 @@ class idEventDef {
unsigned int formatspecIndex;
int returnType;
int numargs;
size_t argsize;
int argsize;
int argOffset[ D_EVENT_MAXARGS ];
int eventnum;
const idEventDef * next;
Expand All @@ -74,7 +74,7 @@ class idEventDef {
char GetReturnType( void ) const;
int GetEventNum( void ) const;
int GetNumArgs( void ) const;
size_t GetArgSize( void ) const;
int GetArgSize( void ) const;
int GetArgOffset( int arg ) const;

static int NumEventCommands( void );
Expand Down Expand Up @@ -183,7 +183,7 @@ ID_INLINE int idEventDef::GetNumArgs( void ) const {
idEventDef::GetArgSize
================
*/
ID_INLINE size_t idEventDef::GetArgSize( void ) const {
ID_INLINE int idEventDef::GetArgSize( void ) const {
return argsize;
}

Expand Down
4 changes: 2 additions & 2 deletions neo/game/gamesys/SysCmds.cpp
Expand Up @@ -87,7 +87,7 @@ void Cmd_EntityList_f( const idCmdArgs &args ) {
size += check->spawnArgs.Allocated();
}

gameLocal.Printf( "...%d entities\n...%d bytes of spawnargs\n", count, size );
gameLocal.Printf( "...%d entities\n...%zu bytes of spawnargs\n", count, size );
}

/*
Expand Down Expand Up @@ -1438,7 +1438,7 @@ static void Cmd_ListAnims_f( const idCmdArgs &args ) {
}
}

gameLocal.Printf( "%d memory used in %d entity animators\n", size, num );
gameLocal.Printf( "%zu memory used in %d entity animators\n", size, num );
}
}

Expand Down
8 changes: 4 additions & 4 deletions neo/game/script/Script_Program.cpp
Expand Up @@ -1320,7 +1320,7 @@ idVarDef *idProgram::AllocDef( idTypeDef *type, const char *name, idVarDef *scop
def->value.bytePtr = &variables[ numVariables ];
numVariables += def->TypeDef()->Size();
if ( numVariables > sizeof( variables ) ) {
throw idCompileError( va( "Exceeded global memory size (%d bytes)", sizeof( variables ) ) );
throw idCompileError( va( "Exceeded global memory size (%zu bytes)", sizeof( variables ) ) );
}

memset( def->value.bytePtr, 0, def->TypeDef()->Size() );
Expand Down Expand Up @@ -1755,13 +1755,13 @@ void idProgram::CompileStats( void ) {

gameLocal.Printf( "\nMemory usage:\n" );
gameLocal.Printf( " Strings: %d, %d bytes\n", fileList.Num(), stringspace );
gameLocal.Printf( " Statements: %d, %d bytes\n", statements.Num(), statements.MemoryUsed() );
gameLocal.Printf( " Statements: %d, %zu bytes\n", statements.Num(), statements.MemoryUsed() );
gameLocal.Printf( " Functions: %d, %d bytes\n", functions.Num(), funcMem );
gameLocal.Printf( " Variables: %d bytes\n", numVariables );
gameLocal.Printf( " Mem used: %d bytes\n", memused );
gameLocal.Printf( " Static data: %d bytes\n", sizeof( idProgram ) );
gameLocal.Printf( " Static data: %zu bytes\n", sizeof( idProgram ) );
gameLocal.Printf( " Allocated: %d bytes\n", memallocated );
gameLocal.Printf( " Thread size: %d bytes\n\n", sizeof( idThread ) );
gameLocal.Printf( " Thread size: %zu bytes\n\n", sizeof( idThread ) );
}

/*
Expand Down
4 changes: 2 additions & 2 deletions neo/idlib/Dict.cpp
Expand Up @@ -645,8 +645,8 @@ idDict::ShowMemoryUsage_f
================
*/
void idDict::ShowMemoryUsage_f( const idCmdArgs &args ) {
idLib::common->Printf( "%5d KB in %d keys\n", globalKeys.Size() >> 10, globalKeys.Num() );
idLib::common->Printf( "%5d KB in %d values\n", globalValues.Size() >> 10, globalValues.Num() );
idLib::common->Printf( "%5zu KB in %d keys\n", globalKeys.Size() >> 10, globalKeys.Num() );
idLib::common->Printf( "%5zu KB in %d values\n", globalValues.Size() >> 10, globalValues.Num() );
}

/*
Expand Down
2 changes: 1 addition & 1 deletion neo/renderer/RenderWorld.cpp
Expand Up @@ -1496,7 +1496,7 @@ void idRenderWorldLocal::GenerateAllInteractions() {
}

common->Printf( "interactionTable size: %i bytes\n", size );
common->Printf( "%i interaction take %i bytes\n", count, count * sizeof( idInteraction ) );
common->Printf( "%i interaction take %zu bytes\n", count, count * sizeof( idInteraction ) );
}

// entities flagged as noDynamicInteractions will no longer make any
Expand Down
4 changes: 2 additions & 2 deletions neo/renderer/tr_trisurf.cpp
Expand Up @@ -227,7 +227,7 @@ R_ShowTriMemory_f
===============
*/
void R_ShowTriSurfMemory_f( const idCmdArgs &args ) {
common->Printf( "%6d kB in %d triangle surfaces\n",
common->Printf( "%6zu kB in %d triangle surfaces\n",
( srfTrianglesAllocator.GetAllocCount() * sizeof( srfTriangles_t ) ) >> 10,
srfTrianglesAllocator.GetAllocCount() );

Expand Down Expand Up @@ -267,7 +267,7 @@ void R_ShowTriSurfMemory_f( const idCmdArgs &args ) {
triDupVertAllocator.GetBaseBlockMemory() >> 10, triDupVertAllocator.GetFreeBlockMemory() >> 10,
triDupVertAllocator.GetNumFreeBlocks(), triDupVertAllocator.GetNumEmptyBaseBlocks() );

common->Printf( "%6d kB total triangle memory\n",
common->Printf( "%6zu kB total triangle memory\n",
( srfTrianglesAllocator.GetAllocCount() * sizeof( srfTriangles_t ) +
triVertexAllocator.GetBaseBlockMemory() +
triIndexAllocator.GetBaseBlockMemory() +
Expand Down

0 comments on commit 44bf0c6

Please sign in to comment.