Skip to content

Commit 6b1bccd

Browse files
authored
fix: Fix assertion format argument for non-trivial types (#2606)
1 parent 20d6cc0 commit 6b1bccd

4 files changed

Lines changed: 6 additions & 10 deletions

File tree

Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1477,7 +1477,7 @@ const WeaponTemplate *WeaponStore::findWeaponTemplate( const AsciiString& name )
14771477
if (name.compareNoCase("None") == 0)
14781478
return nullptr;
14791479
const WeaponTemplate * wt = findWeaponTemplatePrivate( TheNameKeyGenerator->nameToKey( name ) );
1480-
DEBUG_ASSERTCRASH(wt != nullptr, ("Weapon %s not found!",name));
1480+
DEBUG_ASSERTCRASH(wt != nullptr, ("Weapon %s not found!", name.str()));
14811481
return wt;
14821482
}
14831483

Generals/Code/Tools/WorldBuilder/src/GlobalLightOptions.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,18 +141,16 @@ void GlobalLightOptions::applyAngle(Int lightIndex)
141141
static void SpitLights()
142142
{
143143
#ifdef DEBUG_LOGGING
144-
CString lightstrings[100];
145144
DEBUG_LOG(("GlobalLighting\n"));
146145
Int redA, greenA, blueA;
147146
Int redD, greenD, blueD;
148147
Real x, y, z;
149-
CString times[4];
150-
CString lights[3];
148+
const char* times[4];
151149
times[0] = "Morning";
152150
times[1] = "Afternoon";
153151
times[2] = "Evening";
154152
times[3] = "Night";
155-
153+
const char* lights[3];
156154
lights[0] = "";
157155
lights[1] = "2";
158156
lights[2] = "3";

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1623,7 +1623,7 @@ const WeaponTemplate *WeaponStore::findWeaponTemplate( const AsciiString& name )
16231623
if (name.compareNoCase("None") == 0)
16241624
return nullptr;
16251625
const WeaponTemplate * wt = findWeaponTemplatePrivate( TheNameKeyGenerator->nameToKey( name ) );
1626-
DEBUG_ASSERTCRASH(wt != nullptr, ("Weapon %s not found!",name));
1626+
DEBUG_ASSERTCRASH(wt != nullptr, ("Weapon %s not found!", name.str()));
16271627
return wt;
16281628
}
16291629

GeneralsMD/Code/Tools/WorldBuilder/src/GlobalLightOptions.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,18 +141,16 @@ void GlobalLightOptions::applyAngle(Int lightIndex)
141141
static void SpitLights()
142142
{
143143
#ifdef DEBUG_LOGGING
144-
CString lightstrings[100];
145144
DEBUG_LOG(("GlobalLighting\n"));
146145
Int redA, greenA, blueA;
147146
Int redD, greenD, blueD;
148147
Real x, y, z;
149-
CString times[4];
150-
CString lights[3];
148+
const char* times[4];
151149
times[0] = "Morning";
152150
times[1] = "Afternoon";
153151
times[2] = "Evening";
154152
times[3] = "Night";
155-
153+
const char* lights[3];
156154
lights[0] = "";
157155
lights[1] = "2";
158156
lights[2] = "3";

0 commit comments

Comments
 (0)