diff --git a/src/Course.cpp b/src/Course.cpp index 3dbd02ed67..5c515e7c94 100644 --- a/src/Course.cpp +++ b/src/Course.cpp @@ -519,8 +519,8 @@ bool Course::GetTrailUnsorted( StepsType st, CourseDifficulty cd, Trail &trail ) if( e->iChooseIndex < int(vSongAndSteps.size()) ) { resolved.pSong = vpSongs[e->iChooseIndex]; - const vector &vpSongs = mapSongToSteps[resolved.pSong]; - resolved.pSteps = vpSongs[ RandomInt(vpSongs.size()) ]; + const vector &mappedSongs = mapSongToSteps[resolved.pSong]; + resolved.pSteps = mappedSongs[ RandomInt(mappedSongs.size()) ]; } else { diff --git a/src/ModIconRow.cpp b/src/ModIconRow.cpp index 996b0da158..39286362a0 100644 --- a/src/ModIconRow.cpp +++ b/src/ModIconRow.cpp @@ -155,15 +155,15 @@ void ModIconRow::SetFromGameState() continue; // skip // search for a vacant spot - for( int i=iPerferredCol; isecond.type == TapNote::hold_head ) { - int iStartRow = prev->first; + int localStartRow = prev->first; const TapNote &tn = prev->second; - if( iStartRow + tn.iDuration >= iEndRow ) + if( localStartRow + tn.iDuration >= iEndRow ) end = prev; } } diff --git a/src/NotesLoaderBMS.cpp b/src/NotesLoaderBMS.cpp index acd4dabf37..4832fa78da 100644 --- a/src/NotesLoaderBMS.cpp +++ b/src/NotesLoaderBMS.cpp @@ -476,9 +476,9 @@ static bool LoadFromBMSFile( const RString &sPath, const NameToData_t &mapNameTo if( sNoteId != "00" ) { vTapNotes.push_back( TAP_ORIGINAL_TAP ); - map::const_iterator it = idToKeySoundIndex.find( sNoteId ); - if( it != idToKeySoundIndex.end() ) - vTapNotes.back().iKeysoundIndex = it->second; + map::const_iterator rInt = idToKeySoundIndex.find( sNoteId ); + if( rInt != idToKeySoundIndex.end() ) + vTapNotes.back().iKeysoundIndex = rInt->second; } else { @@ -762,28 +762,28 @@ static void ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Measur continue; // this is keysound file name. Looks like "#WAV1A" - RString sData = it->second; + RString nData = it->second; RString sWavID = sName.Right(2); /* Due to bugs in some programs, many BMS files have a "WAV" extension * on files in the BMS for files that actually have some other extension. * Do a search. Don't do a wildcard search; if sData is "song.wav", * we might also have "song.png", which we shouldn't match. */ - if( !IsAFile(out.GetSongDir()+sData) ) + if( !IsAFile(out.GetSongDir()+nData) ) { const char *exts[] = { "oga", "ogg", "wav", "mp3", NULL }; // XXX: stop duplicating these everywhere for( unsigned i = 0; exts[i] != NULL; ++i ) { - RString fn = SetExtension( sData, exts[i] ); + RString fn = SetExtension( nData, exts[i] ); if( IsAFile(out.GetSongDir()+fn) ) { - sData = fn; + nData = fn; break; } } } - if( !IsAFile(out.GetSongDir()+sData) ) - LOG->UserLog( "Song file", out.GetSongDir(), "references key \"%s\" that can't be found", sData.c_str() ); + if( !IsAFile(out.GetSongDir()+nData) ) + LOG->UserLog( "Song file", out.GetSongDir(), "references key \"%s\" that can't be found", nData.c_str() ); sWavID.MakeUpper(); // HACK: undo the MakeLower() out.m_vsKeysoundFile.push_back( sData ); @@ -807,11 +807,11 @@ static void ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Measur float fBeatsPerMeasure = GetBeatsPerMeasure( mapMeasureToTimeSig, iMeasureNo, sigAdjustmentsOut ); int iRowsPerMeasure = BeatToNoteRow( fBeatsPerMeasure ); - RString sData = it->second; - int totalPairs = sData.size() / 2; + RString nData = it->second; + int totalPairs = nData.size() / 2; for( int i = 0; i < totalPairs; ++i ) { - RString sPair = sData.substr( i*2, 2 ); + RString sPair = nData.substr( i*2, 2 ); int iVal = 0; if( sscanf( sPair, "%x", &iVal ) == 0 || iVal == 0 ) diff --git a/src/NotesLoaderMidi.cpp b/src/NotesLoaderMidi.cpp index 96f5375e1e..fb8dfbe298 100644 --- a/src/NotesLoaderMidi.cpp +++ b/src/NotesLoaderMidi.cpp @@ -750,9 +750,9 @@ static bool LoadFromMidi( const RString &sPath, Song &songOut ) if( uVelocity == 0 ) midiEventType = note_off; - MidiEvent event = { count, midiEventType }; + MidiEvent mEvent = { count, midiEventType }; //float fBeat = NoteRowToBeat( MidiCountToNoteRow(count) ); - vMidiEvent[uNoteNumber].push_back( event ); + vMidiEvent[uNoteNumber].push_back( mEvent ); } break; default: @@ -850,13 +850,13 @@ skip_track: // hold note ending on the same row as a tap note. NoteData::TrackMap::iterator begin, end; noteData.GetTapNoteRangeInclusive( nnt, MidiCountToNoteRow(count), MidiCountToNoteRow(count), begin, end, true ); - for( NoteData::TrackMap::iterator iter = begin; iter != end; iter++ ) + for( NoteData::TrackMap::iterator lIter = begin; lIter != end; lIter++ ) { // if( gd == expert && fBeat >= 27*4-2 && nnt == green ) // LOG->Trace( "shortening hold at %f, length %d", fBeat, length ); - ASSERT( iter->second.type == TapNote::hold_head ); - iter->second.iDuration = MidiCountToNoteRow(count) - iter->first - 2; + ASSERT( lIter->second.type == TapNote::hold_head ); + lIter->second.iDuration = MidiCountToNoteRow(count) - lIter->first - 2; } noteData.SetTapNote( nnt, MidiCountToNoteRow(count), tn ); diff --git a/src/NotesLoaderPMS.cpp b/src/NotesLoaderPMS.cpp index 1b9f7a68d6..32555f71d0 100644 --- a/src/NotesLoaderPMS.cpp +++ b/src/NotesLoaderPMS.cpp @@ -408,9 +408,9 @@ static bool LoadFromPMSFile( const RString &sPath, const NameToData_t &mapNameTo if( sNoteId != "00" ) { vTapNotes.push_back( TAP_ORIGINAL_TAP ); - map::const_iterator it = idToKeySoundIndex.find( sNoteId ); - if( it != idToKeySoundIndex.end() ) - vTapNotes.back().iKeysoundIndex = it->second; + map::const_iterator rInt = idToKeySoundIndex.find( sNoteId ); + if( rInt != idToKeySoundIndex.end() ) + vTapNotes.back().iKeysoundIndex = rInt->second; } else { @@ -609,31 +609,31 @@ static void ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Measur continue; // this is keysound file name. Looks like "#WAV1A" - RString sData = it->second; + RString nData = it->second; RString sWavID = sName.Right(2); /* Due to bugs in some programs, many PMS files have a "WAV" extension * on files in the PMS for files that actually have some other extension. * Do a search. Don't do a wildcard search; if sData is "song.wav", * we might also have "song.png", which we shouldn't match. */ - if( !IsAFile(out.GetSongDir()+sData) ) + if( !IsAFile(out.GetSongDir()+nData) ) { const char *exts[] = { "oga", "ogg", "wav", "mp3", NULL }; // XXX: stop duplicating these everywhere for( unsigned i = 0; exts[i] != NULL; ++i ) { - RString fn = SetExtension( sData, exts[i] ); + RString fn = SetExtension( nData, exts[i] ); if( IsAFile(out.GetSongDir()+fn) ) { - sData = fn; + nData = fn; break; } } } - if( !IsAFile(out.GetSongDir()+sData) ) - LOG->UserLog( "Song file", out.GetSongDir(), "references key \"%s\" that can't be found", sData.c_str() ); + if( !IsAFile(out.GetSongDir()+nData) ) + LOG->UserLog( "Song file", out.GetSongDir(), "references key \"%s\" that can't be found", nData.c_str() ); sWavID.MakeUpper(); // HACK: undo the MakeLower() - out.m_vsKeysoundFile.push_back( sData ); + out.m_vsKeysoundFile.push_back( nData ); idToKeySoundIndexOut[ sWavID ] = out.m_vsKeysoundFile.size()-1; LOG->Trace( "Inserting keysound index %u '%s'", unsigned(out.m_vsKeysoundFile.size()-1), sWavID.c_str() ); } @@ -654,11 +654,11 @@ static void ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Measur float fBeatsPerMeasure = GetBeatsPerMeasure( mapMeasureToTimeSig, iMeasureNo, sigAdjustmentsOut ); int iRowsPerMeasure = BeatToNoteRow( fBeatsPerMeasure ); - RString sData = it->second; - int totalPairs = sData.size() / 2; + RString nData = it->second; + int totalPairs = nData.size() / 2; for( int i = 0; i < totalPairs; ++i ) { - RString sPair = sData.substr( i*2, 2 ); + RString sPair = nData.substr( i*2, 2 ); int iVal = 0; if( sscanf( sPair, "%x", &iVal ) == 0 || iVal == 0 ) @@ -738,7 +738,7 @@ static void ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Measur { // XXX: offset int iBPMNo; - sscanf( sData, "%x", &iBPMNo ); // data is in hexadecimal + sscanf( nData, "%x", &iBPMNo ); // data is in hexadecimal RString sBPM; RString sTagToLookFor = ssprintf( "#bpm%02x", iBPMNo ); diff --git a/src/NotesLoaderSM.cpp b/src/NotesLoaderSM.cpp index 9b3b3e9ff8..768222430f 100644 --- a/src/NotesLoaderSM.cpp +++ b/src/NotesLoaderSM.cpp @@ -413,9 +413,9 @@ void SMLoader::LoadTimingFromSMFile( const MsdFile &msd, TimingData &out ) if(arrayWarpsFromNegativeBPMs.size() > 0) { // zomg we already have some warps... - for( unsigned i=0; im_Def.m_vEnabledForPlayers.find(pn) != m_pHand->m_Def.m_vEnabledForPlayers.end(); + bRowEnabled = m_pHand->m_Def.m_vEnabledForPlayers.find(pn) != m_pHand->m_Def.m_vEnabledForPlayers.end(); if( !m_pHand->m_Def.m_bOneChoiceForAllPlayers ) { diff --git a/src/OptionsList.cpp b/src/OptionsList.cpp index 1a09c1378e..1a85dd7e53 100644 --- a/src/OptionsList.cpp +++ b/src/OptionsList.cpp @@ -146,9 +146,9 @@ void OptionListRow::SetUnderlines( const vector &aSelections, const Option else if( pTarget->m_Def.m_selectType == SELECT_MULTIPLE ) { const vector &bTargetSelections = m_pOptions->m_bSelections.find(sDest)->second; - for( unsigned i=0; iBroadcast( msg ); + Message lMsg("OptionsListQuickChange"); + lMsg.SetParam( "Player", pn ); + lMsg.SetParam( "Direction", iDir ); + MESSAGEMAN->Broadcast( lMsg ); } } return; @@ -426,9 +426,9 @@ void OptionsList::Input( const InputEventPlus &input ) wrap( m_iMenuStackSelection, pHandler->m_Def.m_vsChoices.size()+1 ); // +1 for exit row PositionCursor(); - Message msg("OptionsListLeft"); - msg.SetParam( "Player", input.pn ); - MESSAGEMAN->Broadcast( msg ); + Message lMsg("OptionsListLeft"); + lMsg.SetParam( "Player", input.pn ); + MESSAGEMAN->Broadcast( lMsg ); return; } else if( input.MenuI == GAME_BUTTON_RIGHT ) @@ -447,9 +447,9 @@ void OptionsList::Input( const InputEventPlus &input ) wrap( m_iMenuStackSelection, pHandler->m_Def.m_vsChoices.size()+1 ); // +1 for exit row PositionCursor(); - Message msg("OptionsListRight"); - msg.SetParam( "Player", input.pn ); - MESSAGEMAN->Broadcast( msg ); + Message lMsg("OptionsListRight"); + lMsg.SetParam( "Player", input.pn ); + MESSAGEMAN->Broadcast( lMsg ); return; } else if( input.MenuI == GAME_BUTTON_START ) diff --git a/src/Player.cpp b/src/Player.cpp index 47a70ce28d..b93d373e80 100644 --- a/src/Player.cpp +++ b/src/Player.cpp @@ -2810,16 +2810,16 @@ void Player::CrossedRows( int iLastRowCrossed, const RageTimer &now ) int iNumHoldsMissedThisRow = 0; // start at r-1 so that we consider holds whose end rows are equal to the checkpoint row - NoteData::all_tracks_iterator iter = m_NoteData.GetTapNoteRangeAllTracks( r-1, r, true ); - for( ; !iter.IsAtEnd(); ++iter ) + NoteData::all_tracks_iterator nIter = m_NoteData.GetTapNoteRangeAllTracks( r-1, r, true ); + for( ; !nIter.IsAtEnd(); ++nIter ) { - TapNote &tn = *iter; + TapNote &tn = *nIter; if( tn.type != TapNote::hold_head ) continue; - int iStartRow = iter.Row(); + int iStartRow = nIter.Row(); int iEndRow = iStartRow + tn.iDuration; - int iTrack = iter.Track(); + int iTrack = nIter.Track(); // "the first row after the hold head that lands on a beat" int iFirstCheckpointOfHold = ((iStartRow+iCheckpointFrequencyRows)/iCheckpointFrequencyRows) * iCheckpointFrequencyRows; diff --git a/src/RageMath.cpp b/src/RageMath.cpp index cdeeced8d0..317e8fe50a 100644 --- a/src/RageMath.cpp +++ b/src/RageMath.cpp @@ -575,8 +575,8 @@ float RageFastSin( float x ) bInited = true; for( unsigned i=0; i::const_iterator iter = find( m_vpCourses.begin(), m_vpCourses.end(), GAMESTATE->m_pCurCourse ); if( iter != m_vpCourses.end() ) { - int iIndex = iter - m_vpCourses.begin(); + iIndex = iter - m_vpCourses.begin(); this->MoveRowAbsolute( GAMESTATE->m_MasterPlayerNumber, 1 + iIndex ); } } diff --git a/src/ScreenOptionsManageEditSteps.cpp b/src/ScreenOptionsManageEditSteps.cpp index 7fc0b1f7de..10043777ad 100644 --- a/src/ScreenOptionsManageEditSteps.cpp +++ b/src/ScreenOptionsManageEditSteps.cpp @@ -110,7 +110,7 @@ void ScreenOptionsManageEditSteps::BeginScreen() vector::const_iterator iter = find( m_vpSteps.begin(), m_vpSteps.end(), GAMESTATE->m_pCurSteps[PLAYER_1] ); if( iter != m_vpSteps.end() ) { - int iIndex = iter - m_vpSteps.begin(); + iIndex = iter - m_vpSteps.begin(); this->MoveRowAbsolute( PLAYER_1, 1 + iIndex ); } } diff --git a/src/ScreenOptionsMemoryCard.cpp b/src/ScreenOptionsMemoryCard.cpp index 02e1ed832b..a3f265febf 100644 --- a/src/ScreenOptionsMemoryCard.cpp +++ b/src/ScreenOptionsMemoryCard.cpp @@ -197,8 +197,9 @@ void ScreenOptionsMemoryCard::ProcessMenuStart( const InputEventPlus &input ) const vector &v = m_CurrentUsbStorageDevices; if( iCurRow < int(v.size()) ) // a card { - const vector &v = m_CurrentUsbStorageDevices; - const UsbStorageDevice &dev = v[iCurRow]; + // Why is this statement in twice? Doubt it would change right after the if. -Wolfman2000 + const vector &vUSB = m_CurrentUsbStorageDevices; + const UsbStorageDevice &dev = vUSB[iCurRow]; MEMCARDMAN->m_sEditorMemoryCardOsMountPoint.Set( dev.sOsMountDir ); /* The destination screen must UnmountCard. XXX: brittle */ diff --git a/src/XmlFileUtil.cpp b/src/XmlFileUtil.cpp index 0fb328f9d5..df65416143 100644 --- a/src/XmlFileUtil.cpp +++ b/src/XmlFileUtil.cpp @@ -669,21 +669,21 @@ namespace continue; } - RString sName; - LuaHelpers::Pop( L, sName ); - NodeNamesToAdd.push_back( sName ); + RString nName; + LuaHelpers::Pop( L, nName ); + NodeNamesToAdd.push_back( nName ); NodesToAdd.push_back( LuaReference() ); NodesToAdd.back().SetFromStack( L ); continue; } - RString sName; - LuaHelpers::Pop( L, sName ); + RString nName; + LuaHelpers::Pop( L, nName ); // Otherwise, add an attribute. XNodeLuaValue *pValue = new XNodeLuaValue; pValue->SetValueFromStack( L ); - pNode->AppendAttrFrom( sName, pValue ); + pNode->AppendAttrFrom( nName, pValue ); } lua_pop( L, 1 ); diff --git a/src/arch/InputHandler/InputHandler_MacOSX_HID.cpp b/src/arch/InputHandler/InputHandler_MacOSX_HID.cpp index dd8b9dc9ab..e79a40ac9a 100644 --- a/src/arch/InputHandler/InputHandler_MacOSX_HID.cpp +++ b/src/arch/InputHandler/InputHandler_MacOSX_HID.cpp @@ -425,10 +425,10 @@ wchar_t InputHandler_MacOSX_HID::DeviceButtonToChar( DeviceButton button, bool b if( KeyLayout ) { UInt32 keyboardType = LMGetKbdType(); - UInt32 modifiers = bUseCurrentKeyModifiers ? GetCurrentKeyModifiers() : 0; + UInt32 nModifiers = bUseCurrentKeyModifiers ? GetCurrentKeyModifiers() : 0; UniChar unicodeInputString[4]; UniCharCount length; - OSStatus status = UCKeyTranslate( *KeyLayout, iMacVirtualKey, kUCKeyActionDown, modifiers, + OSStatus status = UCKeyTranslate( *KeyLayout, iMacVirtualKey, kUCKeyActionDown, nModifiers, keyboardType, 0, &iDeadKeyState, ARRAYLEN(unicodeInputString), &length, unicodeInputString ); diff --git a/src/arch/MovieTexture/MovieTexture_Theora.cpp b/src/arch/MovieTexture/MovieTexture_Theora.cpp index fe4fe86638..b39abb6ede 100644 --- a/src/arch/MovieTexture/MovieTexture_Theora.cpp +++ b/src/arch/MovieTexture/MovieTexture_Theora.cpp @@ -193,10 +193,10 @@ RString MovieDecoder_Theora::ProcessHeaders() while(1) { ogg_packet op; - int ret = ogg_stream_packetpeek( &m_OggStream, &op ); - if( ret == 0 ) + int ret2 = ogg_stream_packetpeek( &m_OggStream, &op ); + if( ret2 == 0 ) break; - if( ret < 0 ) + if( ret2 < 0 ) return ssprintf( "error opening %s: error parsing Theora stream headers", m_File.GetPath().c_str() ); if( !theora_packet_isheader(&op) ) @@ -208,8 +208,8 @@ RString MovieDecoder_Theora::ProcessHeaders() return RString(); } - ret = theora_decode_header( &m_TheoraInfo, &m_TheoraComment, &op); - if( ret < 0 && ret != OC_NEWPACKET ) + ret2 = theora_decode_header( &m_TheoraInfo, &m_TheoraComment, &op); + if( ret2 < 0 && ret2 != OC_NEWPACKET ) return ssprintf( "error opening %s: error parsing Theora stream headers", m_File.GetPath().c_str() ); ogg_stream_packetout( &m_OggStream, NULL );