Skip to content

Commit cd22458

Browse files
committed
[GEN] Fix type declaration scope issues for Generals build (#484)
1 parent 6a6fd9d commit cd22458

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+245
-134
lines changed

Generals/Code/GameEngine/Include/GameLogic/PartitionManager.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,8 @@ class PartitionData : public MemoryPoolObject
515515

516516
inline Int wasSeenByAnyPlayers() const ///<check if a player in the game has seen the object but is now looking at fogged version.
517517
{
518-
for (Int i=0; i<MAX_PLAYER_COUNT; i++)
518+
Int i=0;
519+
for (; i<MAX_PLAYER_COUNT; i++)
519520
if (m_everSeenByPlayer[i] && m_shroudedness[i] == OBJECTSHROUD_FOGGED)
520521
return i;
521522
return i;

Generals/Code/GameEngine/Source/Common/INI/INI.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,8 @@ static INIBlockParse findBlockParse(const char* token)
316316
//-------------------------------------------------------------------------------------------------
317317
static INIFieldParseProc findFieldParse(const FieldParse* parseTable, const char* token, int& offset, const void*& userData)
318318
{
319-
for (const FieldParse* parse = parseTable; parse->token; ++parse)
319+
const FieldParse* parse = parseTable;
320+
for (; parse->token; ++parse)
320321
{
321322
if (strcmp( parse->token, token ) == 0)
322323
{

Generals/Code/GameEngine/Source/Common/MessageStream.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ GameMessageArgumentDataType GameMessage::getArgumentDataType( Int argIndex )
104104
return ARGUMENTDATATYPE_UNKNOWN;
105105
}
106106
int i=0;
107-
for (GameMessageArgument *a = m_argList; a && (i < argIndex); a=a->m_next, ++i );
107+
GameMessageArgument *a = m_argList;
108+
for (; a && (i < argIndex); a=a->m_next, ++i );
108109

109110
if (a != NULL)
110111
{

Generals/Code/GameEngine/Source/Common/RTS/Player.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1698,7 +1698,8 @@ void Player::setUnitsShouldHunt(Bool unitsShouldHunt, CommandSourceType source)
16981698
//=============================================================================
16991699
void Player::killPlayer(void)
17001700
{
1701-
for (PlayerTeamList::iterator it = m_playerTeamPrototypes.begin(); it != m_playerTeamPrototypes.end(); ++it) {
1701+
PlayerTeamList::iterator it = m_playerTeamPrototypes.begin();
1702+
for (; it != m_playerTeamPrototypes.end(); ++it) {
17021703
for (DLINK_ITERATOR<Team> iter = (*it)->iterate_TeamInstanceList(); !iter.done(); iter.advance()) {
17031704
Team *team = iter.cur();
17041705
if (!team) {

Generals/Code/GameEngine/Source/Common/System/GameMemory.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1655,7 +1655,8 @@ void* MemoryPool::allocateBlockDoNotZeroImplementation(DECLARE_LITERALSTRING_ARG
16551655
{
16561656
// hmm... the current 'free' blob has nothing available. look and see if there
16571657
// are any other existing blobs with freespace.
1658-
for (MemoryPoolBlob *blob = m_firstBlob; blob != NULL; blob = blob->getNextInList())
1658+
MemoryPoolBlob *blob = m_firstBlob;
1659+
for (; blob != NULL; blob = blob->getNextInList())
16591660
{
16601661
if (blob->hasAnyFreeBlocks())
16611662
break;
@@ -2687,7 +2688,8 @@ MemoryPool *MemoryPoolFactory::createMemoryPool(const char *poolName, Int alloca
26872688
*/
26882689
MemoryPool *MemoryPoolFactory::findMemoryPool(const char *poolName)
26892690
{
2690-
for (MemoryPool *pool = m_firstPoolInFactory; pool; pool = pool->getNextPoolInList())
2691+
MemoryPool *pool = m_firstPoolInFactory;
2692+
for (; pool; pool = pool->getNextPoolInList())
26912693
{
26922694
if (!strcmp(poolName, pool->getPoolName()))
26932695
{
@@ -3149,7 +3151,8 @@ void MemoryPoolFactory::debugMemoryReport(Int flags, Int startCheckpoint, Int en
31493151
DEBUG_LOG(("------------------------------------------\n"));
31503152
DEBUG_LOG(("Begin Pool Overflow Report\n"));
31513153
DEBUG_LOG(("------------------------------------------\n"));
3152-
for (MemoryPool *pool = m_firstPoolInFactory; pool; pool = pool->getNextPoolInList())
3154+
MemoryPool *pool = m_firstPoolInFactory;
3155+
for (; pool; pool = pool->getNextPoolInList())
31533156
{
31543157
if (pool->getPeakBlockCount() > pool->getInitialBlockCount())
31553158
{

Generals/Code/GameEngine/Source/Common/System/Radar.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,8 @@ void Radar::createEvent( const Coord3D *world, RadarEventType type, Real seconds
10101010

10111011
// lookup the colors we are to used based on the event
10121012
RGBAColorInt color[ 2 ];
1013-
for( Int i = 0; radarColorLookupTable[ i ].event != RADAR_EVENT_INVALID; ++i )
1013+
Int i = 0;
1014+
for( ; radarColorLookupTable[ i ].event != RADAR_EVENT_INVALID; ++i )
10141015
{
10151016

10161017
if( radarColorLookupTable[ i ].event == type )

Generals/Code/GameEngine/Source/Common/System/StackDump.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,8 @@ void DumpExceptionInfo( unsigned int u, EXCEPTION_POINTERS* e_info )
559559
/*
560560
** Match the exception type with the error string and print it out
561561
*/
562-
for ( int i=0 ; _codes[i] != 0xffffffff ; i++ )
562+
int i=0;
563+
for ( ; _codes[i] != 0xffffffff ; i++ )
563564
{
564565
if ( _codes[i] == e_info->ExceptionRecord->ExceptionCode )
565566
{

Generals/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1169,7 +1169,8 @@ void ThingTemplate::initForLTA(const AsciiString& name)
11691169

11701170
char buffer[1024];
11711171
strncpy(buffer, name.str(), sizeof(buffer));
1172-
for (int i=0; buffer[i]; i++) {
1172+
int i=0;
1173+
for (; buffer[i]; i++) {
11731174
if (buffer[i] == '/') {
11741175
i++;
11751176
break;

Generals/Code/GameEngine/Source/Common/UserPreferences.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,8 @@ Bool LadderPreferences::loadProfile( Int profileID )
807807
continue;
808808

809809
p.port = atoi( ptr + 1 );
810-
for (Int i=0; i<strlen(ptr); ++i)
810+
Int i=0;
811+
for (; i<strlen(ptr); ++i)
811812
{
812813
ladName.removeLastChar();
813814
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3093,8 +3093,8 @@ void ControlBar::updateRadarAttackGlow ( void )
30933093
}
30943094
void ControlBar::initSpecialPowershortcutBar( Player *player)
30953095
{
3096-
3097-
for( Int i = 0; i < MAX_SPECIAL_POWER_SHORTCUTS; ++i )
3096+
Int i = 0;
3097+
for( ; i < MAX_SPECIAL_POWER_SHORTCUTS; ++i )
30983098
{
30993099
m_specialPowerShortcutButtonParents[i] = NULL;
31003100
m_specialPowerShortcutButtons[i] = NULL;

0 commit comments

Comments
 (0)