diff --git a/stepmania/src/NotesLoaderKSF.cpp b/stepmania/src/NotesLoaderKSF.cpp index dfd61b88c9..9044fe9336 100644 --- a/stepmania/src/NotesLoaderKSF.cpp +++ b/stepmania/src/NotesLoaderKSF.cpp @@ -52,7 +52,7 @@ bool KSFLoader::LoadFromKSFFile( const CString &sPath, Notes &out ) for( int t=0; t<13; t++ ) iHoldStartRow[t] = -1; - for( int r=0; r 0 ) // we found a match + if( !arrayPossibleMusic.empty() ) // we found a match out.m_sMusicFile = arrayPossibleMusic[0]; return TRUE; diff --git a/stepmania/src/ScreenSelectGroup.cpp b/stepmania/src/ScreenSelectGroup.cpp index 74466ca0ef..831503b10b 100644 --- a/stepmania/src/ScreenSelectGroup.cpp +++ b/stepmania/src/ScreenSelectGroup.cpp @@ -51,8 +51,8 @@ ScreenSelectGroup::ScreenSelectGroup() LOG->Trace( "ScreenSelectGroup::ScreenSelectGroup()" ); - int i; - + unsigned i; + int j; // The new process by which the group and song lists are formed // is bizarre and complex but yields the end result that songs @@ -69,23 +69,23 @@ ScreenSelectGroup::ScreenSelectGroup() CArray aAllSongs = SONGMAN->m_pSongs; // Filter out Songs that can't be played by the current Style - for( i=aAllSongs.GetSize()-1; i>=0; i-- ) // foreach Song, back to front + for( j=aAllSongs.size()-1; j>=0; j-- ) // foreach Song, back to front { - if( aAllSongs[i]->SongCompleteForStyle(GAMESTATE->GetCurrentStyleDef()) && - aAllSongs[i]->NormallyDisplayed() ) + if( aAllSongs[j]->SongCompleteForStyle(GAMESTATE->GetCurrentStyleDef()) && + aAllSongs[j]->NormallyDisplayed() ) continue; - aAllSongs.RemoveAt( i ); + aAllSongs.RemoveAt( j ); } CStringArray asGroupNames; - for( i=0; im_sGroupName ); } /* Remove duplicate groups. */ SortCStringArray(asGroupNames, true); - for( i=asGroupNames.GetSize()-1; i > 0; --i ) { + for( i=asGroupNames.size()-1; i > 0; --i ) { if( asGroupNames[i] == asGroupNames[i-1] ) asGroupNames.RemoveAt( i ); } @@ -93,11 +93,11 @@ ScreenSelectGroup::ScreenSelectGroup() asGroupNames.insert(asGroupNames.begin(), "ALL MUSIC" ); // Add songs to the MusicList. - for( int j=0; j < asGroupNames.GetSize(); j++ ) /* for each group */ + for( unsigned j=0; j < asGroupNames.size(); j++ ) /* for each group */ { CArray aSongsInGroup; /* find all songs */ - for( i=0; im_sGroupName != asGroupNames[j] ) @@ -146,7 +146,7 @@ ScreenSelectGroup::ScreenSelectGroup() this->AddChild( &m_MusicList ); - for( i=0; i < asGroupNames.GetSize(); ++i ) + for( i=0; i < asGroupNames.size(); ++i ) m_GroupList.AddGroup( asGroupNames[i] ); m_GroupList.DoneAddingGroups(); this->AddChild( &m_GroupList ); diff --git a/stepmania/src/SongSelector.cpp b/stepmania/src/SongSelector.cpp index bc23d9fd6b..713ed77f97 100644 --- a/stepmania/src/SongSelector.cpp +++ b/stepmania/src/SongSelector.cpp @@ -89,26 +89,26 @@ SongSelector::SongSelector() if( GAMESTATE->m_pCurSong ) { - int i; + unsigned i; - for( i=0; im_pCurSong->m_sGroupName == m_sGroups[i] ) m_iSelectedGroup = i; OnGroupChange(); - for( i=0; im_pCurSong == m_pSongs[i] ) m_iSelectedSong = i; OnSongChange(); - for( i=0; iGetCurrentStyleDef() == GAMEMAN->GetStyleDefForStyle(m_Styles[i]) ) m_iSelectedStyle = i; } OnNotesTypeChange(); - for( i=0; im_pCurNotes[PLAYER_1] == m_pNotess[i] ) m_iSelectedNotes = i; OnNotesChange(); @@ -184,25 +184,25 @@ void SongSelector::Right() switch( m_SelectedRow ) { case ROW_GROUP: - if( m_iSelectedGroup == m_sGroups.GetSize()-1 ) // can't go right any further + if( m_iSelectedGroup == m_sGroups.size()-1 ) // can't go right any further return; m_iSelectedGroup++; OnGroupChange(); break; case ROW_SONG: - if( m_iSelectedSong == m_pSongs.GetSize()-1 ) // can't go right any further + if( m_iSelectedSong == m_pSongs.size()-1 ) // can't go right any further return; m_iSelectedSong++; OnSongChange(); break; case ROW_STYLE: - if( m_iSelectedStyle == m_Styles.GetSize()-1 ) // can't go right any further + if( m_iSelectedStyle == m_Styles.size()-1 ) // can't go right any further return; m_iSelectedStyle++; OnNotesTypeChange(); break; case ROW_STEPS: - if( m_iSelectedNotes == m_pNotess.GetSize()-1 ) // can't go right any further + if( m_iSelectedNotes == m_pNotess.size()-1 ) // can't go right any further return; m_iSelectedNotes++; OnNotesChange(); @@ -237,7 +237,7 @@ void SongSelector::ChangeSelectedRow( SelectedRow row ) void SongSelector::OnGroupChange() { - m_iSelectedGroup = clamp( m_iSelectedGroup, 0, m_sGroups.GetSize()-1 ); + m_iSelectedGroup = clamp( m_iSelectedGroup, 0u, m_sGroups.size()-1 ); m_textGroup.SetText( SONGMAN->ShortenGroupName(GetSelectedGroup()) ); @@ -250,7 +250,7 @@ void SongSelector::OnGroupChange() void SongSelector::OnSongChange() { - m_iSelectedSong = clamp( m_iSelectedSong, 0, m_pSongs.GetSize()-1 ); + m_iSelectedSong = clamp( m_iSelectedSong, 0u, m_pSongs.size()-1 ); m_Banner.LoadFromSong( GetSelectedSong() ); m_TextBanner.LoadFromSong( GetSelectedSong() ); @@ -260,7 +260,7 @@ void SongSelector::OnSongChange() void SongSelector::OnNotesTypeChange() { - m_iSelectedStyle = clamp( m_iSelectedStyle, 0, m_Styles.GetSize()-1 ); + m_iSelectedStyle = clamp( m_iSelectedStyle, 0u, m_Styles.size()-1 ); m_textStyle.SetText( GAMEMAN->GetStyleDefForStyle(GetSelectedStyle())->m_szName ); @@ -275,7 +275,7 @@ void SongSelector::OnNotesTypeChange() void SongSelector::OnNotesChange() { - m_iSelectedNotes = clamp( m_iSelectedNotes, 0, m_pNotess.GetSize()-1 ); + m_iSelectedNotes = clamp( m_iSelectedNotes, 0u, m_pNotess.size()-1 ); if( GetSelectedNotes() == NULL ) m_textNotes.SetText( "(NEW)" ); diff --git a/stepmania/src/SongSelector.h b/stepmania/src/SongSelector.h index 6b5598d7d5..410c5bae9b 100644 --- a/stepmania/src/SongSelector.h +++ b/stepmania/src/SongSelector.h @@ -44,11 +44,11 @@ private: SelectedRow m_SelectedRow; CStringArray m_sGroups; - int m_iSelectedGroup; // index into m_sGroups + unsigned m_iSelectedGroup; // index into m_sGroups BitmapText m_textGroup; CArray m_pSongs; - int m_iSelectedSong; // index into m_pSongs + unsigned m_iSelectedSong; // index into m_pSongs Banner m_Banner; TextBanner m_TextBanner; @@ -56,11 +56,11 @@ private: Sprite m_sprArrowRight; CArray m_Styles; - int m_iSelectedStyle; // index into m_Styles + unsigned m_iSelectedStyle; // index into m_Styles BitmapText m_textStyle; CArray m_pNotess; - int m_iSelectedNotes; // index into m_pNotess + unsigned m_iSelectedNotes; // index into m_pNotess BitmapText m_textNotes; RandomSample m_soundChangeMusic;