adjust to different scoping of variables declared in for loops

This commit is contained in:
Jonathan Gray 2013-04-26 17:35:53 +10:00
parent a765a9a98e
commit 15cc54b440
2 changed files with 10 additions and 5 deletions

View File

@ -4578,7 +4578,8 @@ void S_StartBackgroundTrack( const char *intro, const char *loop, int bCalledByC
{
extern const char *Music_GetLevelSetName(void);
Q_strncpyz(sInfoOnly_CurrentDynamicMusicSet, Music_GetLevelSetName(), sizeof(sInfoOnly_CurrentDynamicMusicSet));
for (int i = eBGRNDTRACK_DATABEGIN; i != eBGRNDTRACK_DATAEND; i++)
int i;
for (i = eBGRNDTRACK_DATABEGIN; i != eBGRNDTRACK_DATAEND; i++)
{
sboolean bOk = qfalse;
LPCSTR psMusicName = Music_GetFileNameForState( (MusicState_e) i);
@ -5213,7 +5214,8 @@ int SND_FreeOldestSound(sfx_t *pButNotThisOne /* = NULL */)
{
// new bit, we can't throw away any sfx_t struct in use by a channel, else the paint code will crash...
//
for (int iChannel=0; iChannel<MAX_CHANNELS; iChannel++)
int iChannel;
for (iChannel=0; iChannel<MAX_CHANNELS; iChannel++)
{
channel_t *ch = & s_channels[iChannel];

View File

@ -590,7 +590,8 @@ static int Thai_ValidTISCode( const byte *psString, int &iThaiBytes )
// thai codes can be up to 3 bytes long, so see how high we can get...
//
for (int i=0; i<3; i++)
int i;
for (i=0; i<3; i++)
{
CodeToTry.sChars[i] = psString[i];
@ -1669,9 +1670,11 @@ void R_ReloadFonts_f(void)
//
vector <sstring_t> vstrFonts;
for (int iFontToFind = 1; iFontToFind < g_iCurrentFontIndex; iFontToFind++)
int iFontToFind;
for (iFontToFind = 1; iFontToFind < g_iCurrentFontIndex; iFontToFind++)
{
for (FontIndexMap_t::iterator it = g_mapFontIndexes.begin(); it != g_mapFontIndexes.end(); ++it)
FontIndexMap_t::iterator it;
for (it = g_mapFontIndexes.begin(); it != g_mapFontIndexes.end(); ++it)
{
if (iFontToFind == (*it).second)
{