diff --git a/src/AutoKeysounds.cpp b/src/AutoKeysounds.cpp index 8a7fed000c..76d6955598 100644 --- a/src/AutoKeysounds.cpp +++ b/src/AutoKeysounds.cpp @@ -80,11 +80,11 @@ void AutoKeysounds::LoadAutoplaySoundsInto( RageSoundReader_Chain *pChain ) bool bSoundIsGlobal = true; { PlayerNumber pn = GetNextEnabledPlayer((PlayerNumber)-1); - const TapNote &t = tn[pn]; + const TapNote &tap = tn[pn]; pn = GetNextEnabledPlayer(pn); while( pn != PLAYER_INVALID ) { - if( tn[pn].type != TapNote::autoKeysound || tn[pn].iKeysoundIndex != t.iKeysoundIndex ) + if( tn[pn].type != TapNote::autoKeysound || tn[pn].iKeysoundIndex != tap.iKeysoundIndex ) bSoundIsGlobal = false; pn = GetNextEnabledPlayer(pn); } diff --git a/src/BeginnerHelper.cpp b/src/BeginnerHelper.cpp index 2372cd1ca7..1154b0b96c 100644 --- a/src/BeginnerHelper.cpp +++ b/src/BeginnerHelper.cpp @@ -250,9 +250,11 @@ void BeginnerHelper::DrawPrimitives() m_sStepCircle[scd][scde].Draw(); if( DrawCelShaded ) + { FOREACH_PlayerNumber( pn ) // Draw each dancer if( GAMESTATE->IsHumanPlayer(pn) ) m_pDancer[pn]->DrawCelShaded(); + } else { DISPLAY->SetLighting( true ); diff --git a/src/Course.cpp b/src/Course.cpp index 5c515e7c94..50c75ec04f 100644 --- a/src/Course.cpp +++ b/src/Course.cpp @@ -930,8 +930,8 @@ const CourseEntry *Course::FindFixedSong( const Song *pSong ) const FOREACH_CONST( CourseEntry, m_vEntries, e ) { const CourseEntry &entry = *e; - Song *pSong = entry.songID.ToSong(); - if( pSong == pSong ) + Song *lSong = entry.songID.ToSong(); + if( pSong == lSong ) return &entry; } diff --git a/src/Font.cpp b/src/Font.cpp index ca95e58605..d8c7d142eb 100644 --- a/src/Font.cpp +++ b/src/Font.cpp @@ -311,15 +311,15 @@ const glyph &Font::GetGlyph( wchar_t c ) const bool Font::FontCompleteForString( const wstring &str ) const { - map::const_iterator m_pDefault = m_iCharToGlyph.find( FONT_DEFAULT_GLYPH ); - if( m_pDefault == m_iCharToGlyph.end() ) + map::const_iterator mapDefault = m_iCharToGlyph.find( FONT_DEFAULT_GLYPH ); + if( mapDefault == m_iCharToGlyph.end() ) RageException::Throw( "The default glyph is missing from the font \"%s\".", path.c_str() ); for( unsigned i = 0; i < str.size(); ++i ) { // If the glyph for this character is the default glyph, we're incomplete. const glyph &g = GetGlyph( str[i] ); - if( &g == m_pDefault->second ) + if( &g == mapDefault->second ) return false; } return true; @@ -718,8 +718,8 @@ void Font::Load( const RString &sIniPath, RString sChars ) for(unsigned i = 0; i < ImportList.size(); ++i) { - RString path = THEME->GetPathF( "", ImportList[i], true ); - if( path == "" ) + RString fPath = THEME->GetPathF( "", ImportList[i], true ); + if( fPath == "" ) { RString s = ssprintf( "Font \"%s\" imports a font \"%s\" that doesn't exist", sIniPath.c_str(), ImportList[i].c_str() ); Dialog::OK( s ); @@ -727,7 +727,7 @@ void Font::Load( const RString &sIniPath, RString sChars ) } Font subfont; - subfont.Load(path,""); + subfont.Load(fPath,""); MergeFont(subfont); //FONT->UnloadFont(subfont); } diff --git a/src/GameCommand.cpp b/src/GameCommand.cpp index 4083307c14..43783b8b41 100644 --- a/src/GameCommand.cpp +++ b/src/GameCommand.cpp @@ -93,8 +93,8 @@ bool GameCommand::DescribesCurrentMode( PlayerNumber pn ) const if( m_pSteps == NULL && m_dc != Difficulty_Invalid ) { // Why is this checking for all players? - FOREACH_HumanPlayer( pn ) - if( GAMESTATE->m_PreferredDifficulty[pn] != m_dc ) + FOREACH_HumanPlayer( human ) + if( GAMESTATE->m_PreferredDifficulty[human] != m_dc ) return false; } diff --git a/src/GameState.cpp b/src/GameState.cpp index 989e31c234..72fb165a55 100644 --- a/src/GameState.cpp +++ b/src/GameState.cpp @@ -2361,9 +2361,9 @@ public: return 1; } - static int GetCurrentStepsCredits( T* p, lua_State *L ) + static int GetCurrentStepsCredits( T* t, lua_State *L ) { - const Song* pSong = p->m_pCurSong; + const Song* pSong = t->m_pCurSong; if( pSong == NULL ) return 0; diff --git a/src/NoteSkinManager.cpp b/src/NoteSkinManager.cpp index 4607d43529..0ec178b3ab 100644 --- a/src/NoteSkinManager.cpp +++ b/src/NoteSkinManager.cpp @@ -282,22 +282,22 @@ try_again: const NoteSkinData &data = iter->second; RString sPath; // fill this in below - FOREACH_CONST( RString, data.vsDirSearchOrder, iter ) + FOREACH_CONST( RString, data.vsDirSearchOrder, lIter ) { if( sButtonName.empty() ) - sPath = GetPathFromDirAndFile( *iter, sElement ); + sPath = GetPathFromDirAndFile( *lIter, sElement ); else - sPath = GetPathFromDirAndFile( *iter, sButtonName+" "+sElement ); + sPath = GetPathFromDirAndFile( *lIter, sButtonName+" "+sElement ); if( !sPath.empty() ) break; // done searching } if( sPath.empty() ) { - FOREACH_CONST( RString, data.vsDirSearchOrder, iter ) + FOREACH_CONST( RString, data.vsDirSearchOrder, lIter ) { if( !sButtonName.empty() ) - sPath = GetPathFromDirAndFile( *iter, "Fallback "+sElement ); + sPath = GetPathFromDirAndFile( *lIter, "Fallback "+sElement ); if( !sPath.empty() ) break; // done searching } @@ -340,9 +340,9 @@ try_again: GetFileContents( sPath, sNewFileName, true ); RString sRealPath; - FOREACH_CONST( RString, data.vsDirSearchOrder, iter ) + FOREACH_CONST( RString, data.vsDirSearchOrder, lIter ) { - sRealPath = GetPathFromDirAndFile( *iter, sNewFileName ); + sRealPath = GetPathFromDirAndFile( *lIter, sNewFileName ); if( !sRealPath.empty() ) break; // done searching } diff --git a/src/OptionRowHandler.cpp b/src/OptionRowHandler.cpp index 2962f963c3..8010b10d3a 100644 --- a/src/OptionRowHandler.cpp +++ b/src/OptionRowHandler.cpp @@ -149,15 +149,15 @@ public: { // Parse the basic configuration metric. - Commands cmds = ParseCommands( ENTRY(sParam) ); - if( cmds.v.size() < 1 ) + Commands lCmds = ParseCommands( ENTRY(sParam) ); + if( lCmds.v.size() < 1 ) RageException::Throw( "Parse error in \"ScreenOptionsMaster::%s\".", sParam.c_str() ); m_Def.m_bOneChoiceForAllPlayers = false; - const int NumCols = atoi( cmds.v[0].m_vsArgs[0] ); - for( unsigned i=1; i &aSelections, const Option if( pTarget->m_Def.m_selectType == SELECT_ONE ) { int iSelection = m_pOptions->GetOneSelection(sDest); - const OptionRowHandler *pHandler = m_pOptions->m_Rows.find(sDest)->second; - int iDefault = pHandler->GetDefaultOption(); + const OptionRowHandler *lHandler = m_pOptions->m_Rows.find(sDest)->second; + int iDefault = lHandler->GetDefaultOption(); if( iDefault != -1 && iSelection != iDefault ) bSelected |= true; } diff --git a/src/Profile.cpp b/src/Profile.cpp index b3d48827d6..4c12baf2f7 100644 --- a/src/Profile.cpp +++ b/src/Profile.cpp @@ -363,8 +363,8 @@ float Profile::GetSongsActual( StepsType st, Difficulty dc ) const FOREACHM_CONST( StepsID, HighScoresForASteps, hsfas.m_StepsHighScores, j ) { - const StepsID &id = j->first; - Steps* pSteps = id.ToSteps( pSong, true ); + const StepsID &sid = j->first; + Steps* pSteps = sid.ToSteps( pSong, true ); CHECKPOINT_M( ssprintf("Profile::GetSongsActual: song %p, steps %p", pSong, pSteps) ); // If the Steps isn't loaded on the current machine, then we can't @@ -375,7 +375,7 @@ float Profile::GetSongsActual( StepsType st, Difficulty dc ) const if( pSteps->m_StepsType != st ) continue; - CHECKPOINT_M( ssprintf("Profile::GetSongsActual: n %s = %p", id.ToString().c_str(), pSteps) ); + CHECKPOINT_M( ssprintf("Profile::GetSongsActual: n %s = %p", sid.ToString().c_str(), pSteps) ); if( pSteps->GetDifficulty() != dc ) continue; // skip CHECKPOINT; @@ -1303,13 +1303,13 @@ void Profile::LoadGeneralDataFromNode( const XNode* pNode ) if( style->GetName() != "Style" ) continue; - StyleID s; - s.LoadFromNode( style ); + StyleID sID; + sID.LoadFromNode( style ); - if( !s.IsValid() ) + if( !sID.IsValid() ) WARN_AND_CONTINUE; - style->GetTextValue( m_iNumSongsPlayedByStyle[s] ); + style->GetTextValue( m_iNumSongsPlayedByStyle[sID] ); } } } diff --git a/src/ProfileManager.cpp b/src/ProfileManager.cpp index 81f1f40ff9..2418821c60 100644 --- a/src/ProfileManager.cpp +++ b/src/ProfileManager.cpp @@ -489,10 +489,10 @@ bool ProfileManager::DeleteLocalProfile( RString sProfileID ) g_vLocalProfile.erase( i ); // Delete all references to this profileID - FOREACH_CONST( Preference*, m_sDefaultLocalProfileID.m_v, i ) + FOREACH_CONST( Preference*, m_sDefaultLocalProfileID.m_v, j ) { - if( (*i)->Get() == sProfileID ) - (*i)->Set( "" ); + if( (*j)->Get() == sProfileID ) + (*j)->Set( "" ); } return true; } diff --git a/src/RageFileDriverDeflate.cpp b/src/RageFileDriverDeflate.cpp index b0107a1997..8be422efac 100644 --- a/src/RageFileDriverDeflate.cpp +++ b/src/RageFileDriverDeflate.cpp @@ -245,14 +245,14 @@ int RageFileObjDeflate::WriteInternal( const void *pBuffer, size_t iBytes ) if( m_pDeflate->avail_out < sizeof(buf) ) { - int iBytes = sizeof(buf)-m_pDeflate->avail_out; - int iRet = m_pFile->Write( buf, iBytes ); + int lBytes = sizeof(buf)-m_pDeflate->avail_out; + int iRet = m_pFile->Write( buf, lBytes ); if( iRet == -1 ) { SetError( m_pFile->GetError() ); return -1; } - if( iRet < iBytes ) + if( iRet < lBytes ) { SetError( "Partial write" ); return -1; diff --git a/src/RageSoundReader_Chain.cpp b/src/RageSoundReader_Chain.cpp index 29a73c0feb..6b3a1b9ae2 100644 --- a/src/RageSoundReader_Chain.cpp +++ b/src/RageSoundReader_Chain.cpp @@ -33,7 +33,6 @@ RageSoundReader_Chain::~RageSoundReader_Chain() while( !m_apActiveSounds.empty() ) ReleaseSound( m_apActiveSounds.front() ); - map::iterator it; FOREACH( RageSoundReader *, m_apLoadedSounds, it ) delete *it; } @@ -103,7 +102,6 @@ int RageSoundReader_Chain::GetSampleRateInternal() const if( m_apLoadedSounds.empty() ) return m_iPreferredSampleRate; - map::const_iterator it; int iRate = -1; FOREACH_CONST( RageSoundReader *, m_apLoadedSounds, it ) { @@ -120,7 +118,6 @@ void RageSoundReader_Chain::Finish() /* Figure out how many channels we have. All sounds must either have 1 or 2 channels, * which will be converted as needed, or have the same number of channels. */ m_iChannels = 1; - map::iterator it; FOREACH( RageSoundReader *, m_apLoadedSounds, it ) m_iChannels = max( m_iChannels, (*it)->GetNumChannels() ); diff --git a/src/RageSoundReader_MP3.cpp b/src/RageSoundReader_MP3.cpp index 7fc389bc89..7af0a70c9b 100644 --- a/src/RageSoundReader_MP3.cpp +++ b/src/RageSoundReader_MP3.cpp @@ -426,7 +426,7 @@ int RageSoundReader_MP3::do_mad_frame_decode( bool headers_only ) return -1; } - int ret = fill_buffer(); + ret = fill_buffer(); if( ret <= 0 ) return ret; bytes_read += ret; diff --git a/src/RageSoundReader_Merge.cpp b/src/RageSoundReader_Merge.cpp index 78c3e2b93f..f6c25e6a17 100644 --- a/src/RageSoundReader_Merge.cpp +++ b/src/RageSoundReader_Merge.cpp @@ -18,7 +18,6 @@ RageSoundReader_Merge::RageSoundReader_Merge() RageSoundReader_Merge::~RageSoundReader_Merge() { - map::iterator it; FOREACH( RageSoundReader *, m_aSounds, it ) delete *it; } diff --git a/src/RageSurfaceUtils.cpp b/src/RageSurfaceUtils.cpp index d9258633d0..e759d45449 100644 --- a/src/RageSurfaceUtils.cpp +++ b/src/RageSurfaceUtils.cpp @@ -585,8 +585,8 @@ static bool blit_rgba_to_rgba( const RageSurface *src_surf, const RageSurface *d unsigned int opixel = 0; for( int c = 0; c < 4; ++c ) { - int src = (pixel & src_masks[c]) >> src_shifts[c]; - opixel |= lookup[c][src] << dst_shifts[c]; + int lSrc = (pixel & src_masks[c]) >> src_shifts[c]; + opixel |= lookup[c][lSrc] << dst_shifts[c]; } // Store it. diff --git a/src/RageSurfaceUtils_Palettize.cpp b/src/RageSurfaceUtils_Palettize.cpp index 6a0a0aabc2..9103ea6591 100644 --- a/src/RageSurfaceUtils_Palettize.cpp +++ b/src/RageSurfaceUtils_Palettize.cpp @@ -454,7 +454,7 @@ static acolorhist_item *mediancut( acolorhist_item *achv, int colors, int sum, i #ifdef REP_AVERAGE_PIXELS int indx = bv[bi].ind; int clrs = bv[bi].colors; - long r = 0, g = 0, b = 0, a = 0, sum = 0; + long r = 0, g = 0, b = 0, a = 0, lSum = 0; for ( int i = 0; i < clrs; ++i ) { @@ -462,15 +462,15 @@ static acolorhist_item *mediancut( acolorhist_item *achv, int colors, int sum, i g += PAM_GETG( achv[indx + i].acolor ) * achv[indx + i].value; b += PAM_GETB( achv[indx + i].acolor ) * achv[indx + i].value; a += PAM_GETA( achv[indx + i].acolor ) * achv[indx + i].value; - sum += achv[indx + i].value; + lSum += achv[indx + i].value; } - r = r / sum; + r = r / lSum; r = min( r, (long) maxval ); - g = g / sum; + g = g / lSum; g = min( g, (long) maxval ); - b = b / sum; + b = b / lSum; b = min( b, (long) maxval ); - a = a / sum; + a = a / lSum; a = min( a, (long) maxval ); PAM_ASSIGN( acolormap[bi].acolor, (uint8_t)r, (uint8_t)g, (uint8_t)b, (uint8_t)a ); #endif // REP_AVERAGE_PIXELS diff --git a/src/ScreenDebugOverlay.cpp b/src/ScreenDebugOverlay.cpp index f4610870d6..ffe3e4e664 100644 --- a/src/ScreenDebugOverlay.cpp +++ b/src/ScreenDebugOverlay.cpp @@ -273,30 +273,30 @@ void ScreenDebugOverlay::Init() FOREACH_CONST( IDebugLine*, *g_pvpSubscribers, p ) { { - BitmapText *p = new BitmapText; - p->SetName( "ButtonText" ); - p->LoadFromFont( THEME->GetPathF("ScreenDebugOverlay", "line") ); - p->SetHorizAlign( align_right ); - p->SetText( "blah" ); + BitmapText *bt = new BitmapText; + bt->SetName( "ButtonText" ); + bt->LoadFromFont( THEME->GetPathF("ScreenDebugOverlay", "line") ); + bt->SetHorizAlign( align_right ); + bt->SetText( "blah" ); //p->SetShadowLength( 2 ); - LOAD_ALL_COMMANDS( *p ); + LOAD_ALL_COMMANDS( *bt ); // xxx: I shouldn't have to do this: - ON_COMMAND( p ); - m_vptextButton.push_back( p ); - this->AddChild( p ); + ON_COMMAND( bt ); + m_vptextButton.push_back( bt ); + this->AddChild( bt ); } { - BitmapText *p = new BitmapText; - p->SetName( "FunctionText" ); - p->LoadFromFont( THEME->GetPathF("ScreenDebugOverlay", "line") ); - p->SetHorizAlign( align_left ); - p->SetText( "blah" ); + BitmapText *bt = new BitmapText; + bt->SetName( "FunctionText" ); + bt->LoadFromFont( THEME->GetPathF("ScreenDebugOverlay", "line") ); + bt->SetHorizAlign( align_left ); + bt->SetText( "blah" ); //p->SetShadowLength( 2 ); - LOAD_ALL_COMMANDS( *p ); + LOAD_ALL_COMMANDS( *bt ); // xxx: I shouldn't have to do this: - ON_COMMAND( p ); - m_vptextFunction.push_back( p ); - this->AddChild( p ); + ON_COMMAND( bt ); + m_vptextFunction.push_back( bt ); + this->AddChild( bt ); } } @@ -498,7 +498,7 @@ bool ScreenDebugOverlay::OverlayInput( const InputEventPlus &input ) bt.FinishTweening(); // blink 5 times instead of 8 // TODO: make this all metrics instead -aj - for( int i=0; i<5; i++ ) + for( i=0; i<5; i++ ) { bt.SetGlow( RageColor(1,0,0,1) ); bt.Sleep(0.1f); diff --git a/src/ScreenGameplay.cpp b/src/ScreenGameplay.cpp index f1f10c32d3..9bed46df4f 100644 --- a/src/ScreenGameplay.cpp +++ b/src/ScreenGameplay.cpp @@ -1270,8 +1270,6 @@ void ScreenGameplay::LoadLights() { if( asDifficulties[0].CompareNoCase("selected") == 0 ) { - PlayerInfo pi; - // Base lights off current difficulty of active player // Can be either P1 or P2 if they're individual or P1 if both are active FOREACH_EnabledPlayerNumberInfo( m_vPlayerInfo, pi ) @@ -1305,8 +1303,6 @@ void ScreenGameplay::LoadLights() // We've also specified for Player 2 to be based off current difficulty if( asDifficulties[1].CompareNoCase("selected") == 0 && GAMESTATE->GetNumPlayersEnabled() > 1 ) { - PlayerInfo pi; - // Base lights off current difficulty of active player // Only do this for P2 in a two-player situation, since P1 is taken care of above FOREACH_EnabledPlayerNumberInfo( m_vPlayerInfo, pi ) diff --git a/src/ScreenNetSelectBase.cpp b/src/ScreenNetSelectBase.cpp index 8dfd75f7c3..40f9c5c9ac 100644 --- a/src/ScreenNetSelectBase.cpp +++ b/src/ScreenNetSelectBase.cpp @@ -236,15 +236,15 @@ void ColorBitmapText::SetText( const RString& _sText, const RString& _sAlternate RString FirstThree = m_sText.substr( i, 3 ); if( FirstThree.CompareNoCase("|c0") == 0 && iCharsLeft > 8 ) { - ColorChange change; + ColorChange cChange; unsigned int r, g, b; sscanf( m_sText.substr( i, 9 ).c_str(), "|%*c0%2x%2x%2x", &r, &g, &b ); - change.c = RageColor( r/255.f, g/255.f, b/255.f, 1.f ); - change.l = iGlyphsSoFar; + cChange.c = RageColor( r/255.f, g/255.f, b/255.f, 1.f ); + cChange.l = iGlyphsSoFar; if( iGlyphsSoFar == 0 ) - m_vColors[0] = change; + m_vColors[0] = cChange; else - m_vColors.push_back( change ); + m_vColors.push_back( cChange ); i+=8; continue; } diff --git a/src/ScreenTestInput.cpp b/src/ScreenTestInput.cpp index 8ce0e2028d..255aa291d9 100644 --- a/src/ScreenTestInput.cpp +++ b/src/ScreenTestInput.cpp @@ -38,7 +38,6 @@ class InputList: public BitmapText // Update input texts vector asInputs; - DeviceInput di; vector DeviceInputs; INPUTFILTER->GetPressedButtons( DeviceInputs ); FOREACH( DeviceInput, DeviceInputs, di ) diff --git a/src/StatsManager.cpp b/src/StatsManager.cpp index f3cc714ba0..a50ef882bb 100644 --- a/src/StatsManager.cpp +++ b/src/StatsManager.cpp @@ -396,11 +396,11 @@ public: return 1; } - static int GetBestFinalGrade( T* p, lua_State *L ) + static int GetBestFinalGrade( T* t, lua_State *L ) { Grade top_grade = Grade_Failed; StageStats stats; - p->GetFinalEvalStageStats( stats ); + t->GetFinalEvalStageStats( stats ); FOREACH_HumanPlayer( p ) { // If this player failed any stage, then their final grade is an F.