Browse Source

Merge pull request #368 from zrax/format_errors

Fix several C-style string format parameter errors detected via vararg-template voodoo
Adam Johnson 11 years ago
parent
commit
b6d7584e55
  1. 2
      Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleEngine.cpp
  2. 1
      Sources/Plasma/FeatureLib/pfPython/cyAvatar.h
  3. 2
      Sources/Plasma/PubUtilLib/plGImage/plFont.cpp
  4. 11
      Sources/Plasma/PubUtilLib/plGImage/plMipmap.cpp
  5. 2
      Sources/Plasma/PubUtilLib/plScene/plSceneNode.cpp
  6. 4
      Sources/Plasma/PubUtilLib/plStatGather/plAutoProfile.cpp
  7. 2
      Sources/Tools/MaxPlasmaMtls/Materials/plAnimStealthNode.cpp

2
Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleEngine.cpp

@ -156,7 +156,7 @@ bool pfConsoleEngine::PrintCmdHelp( char *name, void (*PrintFn)( const char *
PrintFn(" Subgroups:"); PrintFn(" Subgroups:");
for( subGrp = group->GetFirstSubGroup(); subGrp != nil; subGrp = subGrp->GetNext() ) for( subGrp = group->GetFirstSubGroup(); subGrp != nil; subGrp = subGrp->GetNext() )
{ {
PrintFn(plString::Format(" %s", subGrp).c_str()); PrintFn(plString::Format(" %s", subGrp->GetName()).c_str());
} }
PrintFn(" Commands:"); PrintFn(" Commands:");
for( cmd = group->GetFirstCommand(); cmd != nil; cmd = cmd->GetNext() ) for( cmd = group->GetFirstCommand(); cmd != nil; cmd = cmd->GetNext() )

1
Sources/Plasma/FeatureLib/pfPython/cyAvatar.h

@ -50,6 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// //
#include <string> #include <string>
#include "hsTemplates.h" #include "hsTemplates.h"
#include "plFileSystem.h"
#include "pnKeyedObject/plKey.h" #include "pnKeyedObject/plKey.h"
#include "pyGlueHelpers.h" #include "pyGlueHelpers.h"

2
Sources/Plasma/PubUtilLib/plGImage/plFont.cpp

@ -493,7 +493,7 @@ void plFont::IRenderString( plMipmap *mip, uint16_t x, uint16_t y, const wcha
break; break;
} }
// Are we a uint16_t breaker? // Are we a word breaker?
if( IIsWordBreaker( (char)(string[ i ]) ) ) if( IIsWordBreaker( (char)(string[ i ]) ) )
{ {
if (string[i] == '.') // we might have an ellipsis here if (string[i] == '.') // we might have an ellipsis here

11
Sources/Plasma/PubUtilLib/plGImage/plMipmap.cpp

@ -2177,10 +2177,13 @@ void plMipmap::IReportLeaks()
for( record = fRecords; record != nil; ) for( record = fRecords; record != nil; )
{ {
size = record->fHeight * record->fRowBytes; size = record->fHeight * record->fRowBytes;
if( size >= 1024 ) if (size >= 1024) {
sprintf( msg, "%s, %4.1f kB: \t%dx%d, %d levels, %d bpr", record->fKeyName, size / 1024.f, record->fWidth, record->fHeight, record->fNumLevels, record->fRowBytes ); sprintf(msg, "%s, %4.1f kB: \t%dx%d, %d levels, %d bpr", record->fKeyName.c_str(),
else size / 1024.f, record->fWidth, record->fHeight, record->fNumLevels, record->fRowBytes);
sprintf( msg, "%s, %u bytes: \t%dx%d, %d levels, %d bpr", record->fKeyName, size, record->fWidth, record->fHeight, record->fNumLevels, record->fRowBytes ); } else {
sprintf(msg, "%s, %u bytes: \t%dx%d, %d levels, %d bpr", record->fKeyName.c_str(),
size, record->fWidth, record->fHeight, record->fNumLevels, record->fRowBytes);
}
if( record->fCompressionType != kDirectXCompression ) if( record->fCompressionType != kDirectXCompression )
sprintf( m2, " UType: %d", record->fUncompressedInfo.fType ); sprintf( m2, " UType: %d", record->fUncompressedInfo.fType );

2
Sources/Plasma/PubUtilLib/plScene/plSceneNode.cpp

@ -331,7 +331,7 @@ void plSceneNode::IRemovePhysical(plPhysical* p)
{ {
char buf[256]; char buf[256];
sprintf(buf, "Trying to remove physical %s from scenenode %s,\nbut it's actually in %s", sprintf(buf, "Trying to remove physical %s from scenenode %s,\nbut it's actually in %s",
p->GetKeyName(), GetKeyName(), oldNodeKey->GetName()); p->GetKeyName().c_str(), GetKeyName().c_str(), oldNodeKey->GetName().c_str());
hsAssert(0, buf); hsAssert(0, buf);
} }
} }

4
Sources/Plasma/PubUtilLib/plStatGather/plAutoProfile.cpp

@ -216,8 +216,8 @@ void plAutoProfileImp::INextProfile()
plMipmap mipmap; plMipmap mipmap;
if (plClient::GetInstance()->GetPipeline()->CaptureScreen(&mipmap)) if (plClient::GetInstance()->GetPipeline()->CaptureScreen(&mipmap))
{ {
plString fileName = plString::Format("%S%s_%s.jpg", plString fileName = plString::Format("%s\\%s_%s.jpg",
plProfileManagerFull::Instance().GetProfilePath(), plProfileManagerFull::Instance().GetProfilePath().AsString().c_str(),
ageName, fLastSpawnPointName.c_str()); ageName, fLastSpawnPointName.c_str());
plJPEG::Instance().SetWriteQuality(100); plJPEG::Instance().SetWriteQuality(100);

2
Sources/Tools/MaxPlasmaMtls/Materials/plAnimStealthNode.cpp

@ -277,7 +277,7 @@ void plAnimStealthNode::SetNodeName( const char *parentName )
if( node != nil ) if( node != nil )
{ {
char name[ 512 ], newName[ 512 ]; char name[ 512 ], newName[ 512 ];
sprintf( name, "%s : %s", parentName, GetSegmentName() ); sprintf(name, "%s : %s", parentName, GetSegmentName().c_str());
if( GetCOREInterface()->GetINodeByName( name ) != nil ) if( GetCOREInterface()->GetINodeByName( name ) != nil )
{ {

Loading…
Cancel
Save