Skip to content

Commit 68ad9f9

Browse files
committed
[ZH] Fix loop index type for container size comparison warnings (#804)
1 parent e2064f2 commit 68ad9f9

25 files changed

+51
-51
lines changed

GeneralsMD/Code/GameEngine/Source/Common/PartitionSolver.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ void PartitionSolver::solve(void)
7777

7878
Int minSizeForAllData = 0;
7979
Int slotsAllotted = 0;
80-
Int i, j;
80+
size_t i, j;
8181

8282
// first, determine whether there is an actual solution, or we're going to have to fudge it.
8383
for (i = 0; i < m_data.size(); ++i) {

GeneralsMD/Code/GameEngine/Source/Common/RTS/ProductionPrerequisite.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ void ProductionPrerequisite::init()
8080
//=============================================================================
8181
void ProductionPrerequisite::resolveNames()
8282
{
83-
for (Int i = 0; i < m_prereqUnits.size(); i++)
83+
for (size_t i = 0; i < m_prereqUnits.size(); i++)
8484
{
8585

8686
//
@@ -121,7 +121,7 @@ Int ProductionPrerequisite::calcNumPrereqUnitsOwned(const Player *player, Int co
121121
Int ProductionPrerequisite::getAllPossibleBuildFacilityTemplates(const ThingTemplate* tmpls[], Int maxtmpls) const
122122
{
123123
Int count = 0;
124-
for (int i = 0; i < m_prereqUnits.size(); i++)
124+
for (size_t i = 0; i < m_prereqUnits.size(); i++)
125125
{
126126
if (i > 0 && !(m_prereqUnits[i].flags & UNIT_OR_WITH_PREV))
127127
break;
@@ -216,7 +216,7 @@ void ProductionPrerequisite::addUnitPrereq( AsciiString unit, Bool orUnitWithPre
216216
void ProductionPrerequisite::addUnitPrereq( const std::vector<AsciiString>& units )
217217
{
218218
Bool orWithPrevious = false;
219-
for (int i = 0; i < units.size(); ++i)
219+
for (size_t i = 0; i < units.size(); ++i)
220220
{
221221
addUnitPrereq(units[i], orWithPrevious);
222222
orWithPrevious = true;

GeneralsMD/Code/GameEngine/Source/Common/RTS/SpecialPower.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ SpecialPowerStore::~SpecialPowerStore( void )
255255
{
256256

257257
// delete all templates
258-
for( Int i = 0; i < m_specialPowerTemplates.size(); ++i )
258+
for( size_t i = 0; i < m_specialPowerTemplates.size(); ++i )
259259
m_specialPowerTemplates[ i ]->deleteInstance();
260260

261261
// erase the list
@@ -272,7 +272,7 @@ SpecialPowerTemplate* SpecialPowerStore::findSpecialPowerTemplatePrivate( AsciiS
272272
{
273273

274274
// search the template list for matching name
275-
for( Int i = 0; i < m_specialPowerTemplates.size(); ++i )
275+
for( size_t i = 0; i < m_specialPowerTemplates.size(); ++i )
276276
if( m_specialPowerTemplates[ i ]->getName() == name )
277277
return m_specialPowerTemplates[ i ];
278278

@@ -287,7 +287,7 @@ const SpecialPowerTemplate *SpecialPowerStore::findSpecialPowerTemplateByID( Uns
287287
{
288288

289289
// search the template list for matching name
290-
for( Int i = 0; i < m_specialPowerTemplates.size(); ++i )
290+
for( size_t i = 0; i < m_specialPowerTemplates.size(); ++i )
291291
if( m_specialPowerTemplates[ i ]->getID() == id )
292292
return m_specialPowerTemplates[ i ];
293293

GeneralsMD/Code/GameEngine/Source/Common/System/SaveGame/GameState.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ static void findHighFileNumber( AsciiString filename, void *userData )
413413

414414
// strip off the extension at the end of the filename
415415
AsciiString nameOnly = filename;
416-
for( Int count = 0; count < strlen( SAVE_GAME_EXTENSION ); count++ )
416+
for( size_t count = 0; count < strlen( SAVE_GAME_EXTENSION ); count++ )
417417
nameOnly.removeLastChar();
418418

419419
// convert filename (which is only numbers) to a number

GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -3371,7 +3371,7 @@ void ControlBar::populateSpecialPowerShortcut( Player *player)
33713371
//button specifying a vector of sciences in the command button.
33723372
Int bestIndex = -1;
33733373
ScienceType science;
3374-
for( Int scienceIndex = 0; scienceIndex < commandButton->getScienceVec().size(); ++scienceIndex )
3374+
for( size_t scienceIndex = 0; scienceIndex < commandButton->getScienceVec().size(); ++scienceIndex )
33753375
{
33763376
science = commandButton->getScienceVec()[ scienceIndex ];
33773377

GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ void ControlBar::populateCommand( Object *obj )
369369
//button specifying a vector of sciences in the command button.
370370
Int bestIndex = -1;
371371
ScienceType science;
372-
for( Int scienceIndex = 0; scienceIndex < commandButton->getScienceVec().size(); ++scienceIndex )
372+
for( size_t scienceIndex = 0; scienceIndex < commandButton->getScienceVec().size(); ++scienceIndex )
373373
{
374374
science = commandButton->getScienceVec()[ scienceIndex ];
375375

@@ -1237,7 +1237,7 @@ CommandAvailability ControlBar::getCommandAvailability( const CommandButton *com
12371237
if( TheUpgradeCenter->canAffordUpgrade( player, command->getUpgradeTemplate() ) == FALSE )
12381238
return COMMAND_RESTRICTED;//COMMAND_CANT_AFFORD;
12391239

1240-
for( Int i = 0; i < command->getScienceVec().size(); i++ )
1240+
for( size_t i = 0; i < command->getScienceVec().size(); i++ )
12411241
{
12421242
ScienceType st = command->getScienceVec()[ i ];
12431243
if( !player->hasScience( st ) )
@@ -1273,7 +1273,7 @@ CommandAvailability ControlBar::getCommandAvailability( const CommandButton *com
12731273
if( TheUpgradeCenter->canAffordUpgrade( player, command->getUpgradeTemplate() ) == FALSE )
12741274
return COMMAND_RESTRICTED;//COMMAND_CANT_AFFORD;
12751275

1276-
for( Int i = 0; i < command->getScienceVec().size(); i++ )
1276+
for( size_t i = 0; i < command->getScienceVec().size(); i++ )
12771277
{
12781278
ScienceType st = command->getScienceVec()[ i ];
12791279
if( !player->hasScience( st ) )

GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommandProcessing.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ CBCommandStatus ControlBar::processCommandUI( GameWindow *control,
869869

870870
ScienceType st = SCIENCE_INVALID;
871871
Player *player = ThePlayerList->getLocalPlayer();
872-
for(Int i = 0; i < commandButton->getScienceVec().size(); ++i)
872+
for(size_t i = 0; i < commandButton->getScienceVec().size(); ++i)
873873
{
874874
st = commandButton->getScienceVec()[ i ];
875875
if(!player->hasScience(st) && TheScienceStore->playerHasPrereqsForScience(player, st) && TheScienceStore->getSciencePurchaseCost(st) <= player->getSciencePurchasePoints())

GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ void ControlBar::populateBuildTooltipLayout( const CommandButton *commandButton,
270270
{
271271
if( commandButton->getScienceVec().size() > 1 )
272272
{
273-
for(Int j = 0; j < commandButton->getScienceVec().size(); ++j)
273+
for(size_t j = 0; j < commandButton->getScienceVec().size(); ++j)
274274
{
275275
st = commandButton->getScienceVec()[ j ];
276276

@@ -493,7 +493,7 @@ void ControlBar::populateBuildTooltipLayout( const CommandButton *commandButton,
493493
{
494494

495495
//Do we have a prerequisite science?
496-
for( Int i = 0; i < commandButton->getScienceVec().size(); i++ )
496+
for( size_t i = 0; i < commandButton->getScienceVec().size(); i++ )
497497
{
498498
ScienceType st = commandButton->getScienceVec()[ i ];
499499
if( !player->hasScience( st ) )

GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1124,7 +1124,7 @@ void GameClient::preloadAssets( TimeOfDay timeOfDay )
11241124

11251125
GlobalMemoryStatus(&before);
11261126
extern std::vector<AsciiString> debrisModelNamesGlobalHack;
1127-
Int i=0;
1127+
size_t i=0;
11281128
for (; i<debrisModelNamesGlobalHack.size(); ++i)
11291129
{
11301130
TheDisplay->preloadModelAssets(debrisModelNamesGlobalHack[i]);

GeneralsMD/Code/GameEngine/Source/GameClient/MapUtil.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ Bool MapCache::loadUserMaps()
579579
{
580580
AsciiString endingStr;
581581
AsciiString fname = s+1;
582-
for (Int i=0; i<strlen(mapExtension); ++i)
582+
for (size_t i=0; i<strlen(mapExtension); ++i)
583583
fname.removeLastChar();
584584

585585
endingStr.format("%s\\%s%s", fname.str(), fname.str(), mapExtension);

GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4676,7 +4676,7 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
46764676
{
46774677
// cheese festival: do NOT imitate this code. it is for debug purposes only.
46784678
std::vector<AsciiString> v = TheScienceStore->friend_getScienceNames();
4679-
for (int i = 0; i < v.size(); ++i)
4679+
for (size_t i = 0; i < v.size(); ++i)
46804680
{
46814681
ScienceType st = TheScienceStore->getScienceFromInternalName(v[i]);
46824682
if (st != SCIENCE_INVALID && TheScienceStore->isScienceGrantable(st))

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/DumbProjectileBehavior.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ UpdateSleepTime DumbProjectileBehavior::update()
705705
void DumbProjectileBehavior::displayFlightPath()
706706
{
707707
extern void addIcon(const Coord3D *pos, Real width, Int numFramesDuration, RGBColor color);
708-
for( Int pointIndex = 0; pointIndex < m_flightPath.size(); ++pointIndex )
708+
for( size_t pointIndex = 0; pointIndex < m_flightPath.size(); ++pointIndex )
709709
{
710710
addIcon(&m_flightPath[pointIndex], TheGlobalData->m_debugProjectileTileWidth,
711711
TheGlobalData->m_debugProjectileTileDuration,

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/InstantDeathBehavior.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,12 @@ void InstantDeathBehavior::onDie( const DamageInfo *damageInfo )
136136

137137
const InstantDeathBehaviorModuleData* d = getInstantDeathBehaviorModuleData();
138138

139-
Int idx, listSize;
139+
size_t idx, listSize;
140140

141141
listSize = d->m_fx.size();
142142
if (listSize > 0)
143143
{
144-
idx = GameLogicRandomValue(0, listSize-1);
144+
idx = (size_t)GameLogicRandomValue(0, listSize-1);
145145
const FXListVec& v = d->m_fx;
146146
DEBUG_ASSERTCRASH(idx>=0&&idx<v.size(),("bad idx"));
147147
const FXList* fxl = v[idx];
@@ -151,7 +151,7 @@ void InstantDeathBehavior::onDie( const DamageInfo *damageInfo )
151151
listSize = d->m_ocls.size();
152152
if (listSize > 0)
153153
{
154-
idx = GameLogicRandomValue(0, listSize-1);
154+
idx = (size_t)GameLogicRandomValue(0, listSize-1);
155155
const OCLVec& v = d->m_ocls;
156156
DEBUG_ASSERTCRASH(idx>=0&&idx<v.size(),("bad idx"));
157157
const ObjectCreationList* ocl = v[idx];
@@ -161,7 +161,7 @@ void InstantDeathBehavior::onDie( const DamageInfo *damageInfo )
161161
listSize = d->m_weapons.size();
162162
if (listSize > 0)
163163
{
164-
idx = GameLogicRandomValue(0, listSize-1);
164+
idx = (size_t)GameLogicRandomValue(0, listSize-1);
165165
const WeaponTemplateVec& v = d->m_weapons;
166166
DEBUG_ASSERTCRASH(idx>=0&&idx<v.size(),("bad idx"));
167167
const WeaponTemplate* wt = v[idx];

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -2745,7 +2745,7 @@ void LocomotorSet::xferSelfAndCurLocoPtr(Xfer *xfer, Locomotor** loco)
27452745
}
27462746
else
27472747
{
2748-
for (int i = 0; i < m_locomotors.size(); ++i)
2748+
for (size_t i = 0; i < m_locomotors.size(); ++i)
27492749
{
27502750
if (m_locomotors[i]->getTemplateName() == name)
27512751
{
@@ -2763,7 +2763,7 @@ void LocomotorSet::xferSelfAndCurLocoPtr(Xfer *xfer, Locomotor** loco)
27632763
//-------------------------------------------------------------------------------------------------
27642764
void LocomotorSet::clear()
27652765
{
2766-
for (int i = 0; i < m_locomotors.size(); ++i)
2766+
for (size_t i = 0; i < m_locomotors.size(); ++i)
27672767
{
27682768
if (m_locomotors[i])
27692769
m_locomotors[i]->deleteInstance();

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,7 @@ Bool AIUpdateInterface::chooseLocomotorSetExplicit(LocomotorSetType wst)
841841
{
842842
m_locomotorSet.clear();
843843
m_curLocomotor = NULL;
844-
for (Int i = 0; i < set->size(); ++i)
844+
for (size_t i = 0; i < set->size(); ++i)
845845
{
846846
const LocomotorTemplate* lt = set->at(i);
847847
if (lt)

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ class ChinookCombatDropState : public State
657657
}
658658

659659
UnsignedInt now = TheGameLogic->getFrame();
660-
for (Int i = 0; i < m_ropes.size(); ++i)
660+
for (size_t i = 0; i < m_ropes.size(); ++i)
661661
{
662662
if (m_ropes[i].ropeDrawable)
663663
{

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/DockUpdate.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ DockUpdate::DockUpdate( Thing *thing, const ModuleData* moduleData ) : UpdateMod
9696
m_approachPositionReached.resize(DEFAULT_APPROACH_VECTOR_SIZE);
9797
}
9898

99-
for( Int vectorIndex = 0; vectorIndex < m_approachPositions.size(); ++vectorIndex )
99+
for( size_t vectorIndex = 0; vectorIndex < m_approachPositions.size(); ++vectorIndex )
100100
{
101101
// Whatever size we are, init everything.
102102
m_approachPositions[vectorIndex].zero();
@@ -118,7 +118,7 @@ Bool DockUpdate::isClearToApproach( Object const* docker ) const
118118

119119
ObjectID dockerID = docker->getID();
120120

121-
for( Int positionIndex = 0; positionIndex < m_approachPositionOwners.size(); ++positionIndex )
121+
for( size_t positionIndex = 0; positionIndex < m_approachPositionOwners.size(); ++positionIndex )
122122
{
123123
if( m_approachPositionOwners[positionIndex] == INVALID_ID )
124124
{
@@ -315,7 +315,7 @@ void DockUpdate::getExitPosition( Object* docker, Coord3D *position )
315315
void DockUpdate::onApproachReached( Object* docker )
316316
{
317317
ObjectID dockerID = docker->getID();
318-
for( Int positionIndex = 0; positionIndex < m_approachPositionOwners.size(); ++positionIndex )
318+
for( size_t positionIndex = 0; positionIndex < m_approachPositionOwners.size(); ++positionIndex )
319319
{
320320
if( m_approachPositionOwners[positionIndex] == dockerID )
321321
{
@@ -335,7 +335,7 @@ void DockUpdate::onEnterReached( Object* docker )
335335
m_dockerInside = TRUE;
336336

337337
ObjectID dockerID = docker->getID();
338-
for( Int positionIndex = 0; positionIndex < m_approachPositionOwners.size(); ++positionIndex )
338+
for( size_t positionIndex = 0; positionIndex < m_approachPositionOwners.size(); ++positionIndex )
339339
{
340340
if( m_approachPositionOwners[positionIndex] == dockerID )
341341
{
@@ -381,7 +381,7 @@ void DockUpdate::onExitReached( Object* docker )
381381
void DockUpdate::cancelDock( Object* docker )
382382
{
383383
ObjectID dockerID = docker->getID();
384-
for( Int positionIndex = 0; positionIndex < m_approachPositionOwners.size(); ++positionIndex )
384+
for( size_t positionIndex = 0; positionIndex < m_approachPositionOwners.size(); ++positionIndex )
385385
{
386386
if( m_approachPositionOwners[positionIndex] == dockerID )
387387
{
@@ -418,7 +418,7 @@ UpdateSleepTime DockUpdate::update()
418418
if( m_activeDocker == INVALID_ID && !m_dockCrippled )
419419
{
420420
// if setDockCrippled has been called, I will never give enterance permission.
421-
for( Int positionIndex = 0; positionIndex < m_approachPositionReached.size(); ++positionIndex )
421+
for( size_t positionIndex = 0; positionIndex < m_approachPositionReached.size(); ++positionIndex )
422422
{
423423
if( m_approachPositionReached[positionIndex] )
424424
{

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -1515,7 +1515,7 @@ WeaponStore::~WeaponStore()
15151515
{
15161516
deleteAllDelayedDamage();
15171517

1518-
for (Int i = 0; i < m_weaponTemplateVector.size(); i++)
1518+
for (size_t i = 0; i < m_weaponTemplateVector.size(); i++)
15191519
{
15201520
WeaponTemplate* wt = m_weaponTemplateVector[i];
15211521
if (wt)
@@ -1570,7 +1570,7 @@ const WeaponTemplate *WeaponStore::findWeaponTemplate( AsciiString name ) const
15701570
WeaponTemplate *WeaponStore::findWeaponTemplatePrivate( NameKeyType key ) const
15711571
{
15721572
// search weapon list for name
1573-
for (Int i = 0; i < m_weaponTemplateVector.size(); i++)
1573+
for (size_t i = 0; i < m_weaponTemplateVector.size(); i++)
15741574
if( m_weaponTemplateVector[ i ]->getNameKey() == key )
15751575
return m_weaponTemplateVector[i];
15761576

@@ -1639,7 +1639,7 @@ void WeaponStore::deleteAllDelayedDamage()
16391639
void WeaponStore::resetWeaponTemplates( void )
16401640
{
16411641

1642-
for (Int i = 0; i < m_weaponTemplateVector.size(); i++)
1642+
for (size_t i = 0; i < m_weaponTemplateVector.size(); i++)
16431643
{
16441644
WeaponTemplate* wt = m_weaponTemplateVector[i];
16451645
wt->reset();
@@ -1651,7 +1651,7 @@ void WeaponStore::resetWeaponTemplates( void )
16511651
void WeaponStore::reset()
16521652
{
16531653
// clean up any overriddes.
1654-
for (Int i = 0; i < m_weaponTemplateVector.size(); ++i)
1654+
for (size_t i = 0; i < m_weaponTemplateVector.size(); ++i)
16551655
{
16561656
WeaponTemplate *wt = m_weaponTemplateVector[i];
16571657
if (wt->isOverride())
@@ -1688,7 +1688,7 @@ void WeaponStore::postProcessLoad()
16881688
return;
16891689
}
16901690

1691-
for (Int i = 0; i < m_weaponTemplateVector.size(); i++)
1691+
for (size_t i = 0; i < m_weaponTemplateVector.size(); i++)
16921692
{
16931693
WeaponTemplate* wt = m_weaponTemplateVector[i];
16941694
if (wt)

GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ void ScriptActions::doCreateReinforcements(const AsciiString& team, const AsciiS
643643
PartitionSolver partition(vecOfUnits, vecOfTransports, PREFER_FAST_SOLUTION);
644644
partition.solve();
645645
SolutionVec solution = partition.getSolution();
646-
for (int i = 0; i < solution.size(); ++i) {
646+
for (size_t i = 0; i < solution.size(); ++i) {
647647
Object *unit = TheGameLogic->findObjectByID(solution[i].first);
648648
Object *trans = TheGameLogic->findObjectByID(solution[i].second);
649649
if (!unit || !trans) {
@@ -1503,7 +1503,7 @@ void ScriptActions::doLoadAllTransports(const AsciiString& teamName)
15031503
PartitionSolver partition(vecOfUnits, vecOfTransports, PREFER_FAST_SOLUTION);
15041504
partition.solve();
15051505
SolutionVec solution = partition.getSolution();
1506-
for (int i = 0; i < solution.size(); ++i) {
1506+
for (size_t i = 0; i < solution.size(); ++i) {
15071507
Object *unit = TheGameLogic->findObjectByID(solution[i].first);
15081508
Object *trans = TheGameLogic->findObjectByID(solution[i].second);
15091509
if (!unit || !trans) {
@@ -5207,7 +5207,7 @@ void ScriptActions::doMoveUnitTowardsNearest( const AsciiString& unitName, const
52075207
Real closestDist;
52085208
Real dist;
52095209

5210-
for( Int typeIndex = 0; typeIndex < objectTypes->getListSize(); typeIndex++ )
5210+
for( size_t typeIndex = 0; typeIndex < objectTypes->getListSize(); typeIndex++ )
52115211
{
52125212
AsciiString thisTypeName = objectTypes->getNthInList( typeIndex );
52135213
const ThingTemplate *thisType = TheThingFactory->findTemplate( thisTypeName );
@@ -5296,7 +5296,7 @@ void ScriptActions::doMoveTeamTowardsNearest( const AsciiString& teamName, const
52965296
{
52975297
Real closestDist;
52985298
Real dist;
5299-
for( Int typeIndex = 0; typeIndex < objectTypes->getListSize(); typeIndex++ )
5299+
for( size_t typeIndex = 0; typeIndex < objectTypes->getListSize(); typeIndex++ )
53005300
{
53015301
AsciiString thisTypeName = objectTypes->getNthInList( typeIndex );
53025302
const ThingTemplate *thisType = TheThingFactory->findTemplate( thisTypeName );
@@ -5786,7 +5786,7 @@ void ScriptActions::doTeamUseCommandButtonOnNearestObjectType( const AsciiString
57865786
Real closestDist;
57875787
Real dist;
57885788

5789-
for( Int typeIndex = 0; typeIndex < objectTypes->getListSize(); typeIndex++ )
5789+
for( size_t typeIndex = 0; typeIndex < objectTypes->getListSize(); typeIndex++ )
57905790
{
57915791
AsciiString thisTypeName = objectTypes->getNthInList( typeIndex );
57925792
const ThingTemplate *thisType = TheThingFactory->findTemplate( thisTypeName );

GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -6592,7 +6592,7 @@ void ScriptEngine::setPriorityThing( ScriptAction *pAction )
65926592
{
65936593
// Found a list by this name, so we have a bunch of things
65946594

6595-
for( Int typeIndex = 0; typeIndex < types->getListSize(); typeIndex ++ )
6595+
for( size_t typeIndex = 0; typeIndex < types->getListSize(); typeIndex ++ )
65966596
{
65976597
AsciiString thisTypeName = types->getNthInList(typeIndex);
65986598
const ThingTemplate *thisType = TheThingFactory->findTemplate(thisTypeName);

0 commit comments

Comments
 (0)