diff --git a/stepmania/src/MusicList.cpp b/stepmania/src/MusicList.cpp index 11316147f9..c8f9b6e80c 100644 --- a/stepmania/src/MusicList.cpp +++ b/stepmania/src/MusicList.cpp @@ -60,11 +60,11 @@ void MusicList::AddSongsToGroup(const vector &Songs) CString sTitle = Songs[iIndex]->GetDisplayFullTitle(); // TODO: Move this crop threshold into a theme metric or make automatic based on column width - if( sTitle.GetLength() > 40 ) + if( sTitle.size() > 40 ) sTitle = sTitle.Left( 37 ) + "..."; CString sTrTitle = Songs[iIndex]->GetTranslitFullTitle(); - if( sTrTitle.GetLength() > 40 ) + if( sTrTitle.size() > 40 ) sTrTitle = sTrTitle.Left( 37 ) + "..."; /* If the main title isn't complete for this font, and we have a translit, diff --git a/stepmania/src/NotesLoader.cpp b/stepmania/src/NotesLoader.cpp index 6d9fdfda60..b3adad199f 100644 --- a/stepmania/src/NotesLoader.cpp +++ b/stepmania/src/NotesLoader.cpp @@ -20,7 +20,7 @@ void NotesLoader::GetMainAndSubTitlesFromFullTitle( const CString sFullTitle, CS if( iBeginIndex == -1 ) continue; sMainTitleOut = sFullTitle.Left( iBeginIndex ); - sSubTitleOut = sFullTitle.substr( iBeginIndex+1, sFullTitle.GetLength()-iBeginIndex+1 ); + sSubTitleOut = sFullTitle.substr( iBeginIndex+1, sFullTitle.size()-iBeginIndex+1 ); return; } sMainTitleOut = sFullTitle; diff --git a/stepmania/src/NotesLoaderBMS.cpp b/stepmania/src/NotesLoaderBMS.cpp index 6783f5ada7..56d98df979 100644 --- a/stepmania/src/NotesLoaderBMS.cpp +++ b/stepmania/src/NotesLoaderBMS.cpp @@ -302,7 +302,7 @@ bool BMSLoader::LoadFromBMSFile( const CString &sPath, const NameToData_t &mapNa const CString &sNoteData = it->second; vector vTapNotes; - for( int i=0; i+1: */ -bool DWILoader::Is192( const CString &sStepData, int pos ) +bool DWILoader::Is192( const CString &sStepData, size_t pos ) { while( pos < (int) sStepData.size() ) { @@ -202,7 +202,7 @@ bool DWILoader::LoadFromDWITokens( double fCurrentBeat = 0; double fCurrentIncrementer = 1.0/8 * BEATS_PER_MEASURE; - for( int i=0; i 1 && + if( sOptionText.size() > 1 && isdigit(sOptionText[0]) && - tolower(sOptionText[sOptionText.GetLength()-1]) == 'x') { - return 0; + tolower(sOptionText[sOptionText.size()-1]) == 'x' ) + { + return 0; } for( unsigned i=0; i &AddTo ) const { /* -> 1.00 */ CString s = ssprintf( "%2.2f", m_fScrollSpeed ); - if( s[s.GetLength()-1] == '0' ) { + if( s[s.size()-1] == '0' ) + { /* -> 1.0 */ - s.erase(s.GetLength()-1); // delete last char - if( s[s.GetLength()-1] == '0' ) { + s.erase( s.size()-1 ); // delete last char + if( s[s.size()-1] == '0' ) + { /* -> 1 */ - s.erase(s.GetLength()-2); // delete last 2 chars + s.erase( s.size()-2 ); // delete last 2 chars } } AddTo.push_back( s + "x" ); diff --git a/stepmania/src/RandomSample.cpp b/stepmania/src/RandomSample.cpp index d87c6fb4ce..7c3baca2b2 100644 --- a/stepmania/src/RandomSample.cpp +++ b/stepmania/src/RandomSample.cpp @@ -43,7 +43,7 @@ bool RandomSample::LoadSoundDir( CString sDir, int iMaxToLoad ) * so we'll look for eg. themes\Default\sounds\sDir\*.mp3. Otherwise, * don't, so we'll look for all of the files starting with sDir, * eg. themes\Default\sounds\sDir*.mp3. */ - if(IsADirectory(sDir) && sDir[sDir.GetLength()-1] != "/" ) + if(IsADirectory(sDir) && sDir[sDir.size()-1] != "/" ) sDir += "/"; #else // make sure there's a slash at the end of this path diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index 36d5690cae..061826d6de 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -161,7 +161,7 @@ CString Song::GetCacheFilePath() const * be a cache file. */ const CString &Song::GetSongFilePath() const { - ASSERT ( m_sSongFileName.GetLength() != 0 ); + ASSERT( !m_sSongFileName.empty() ); return m_sSongFileName; } diff --git a/stepmania/src/SongOptions.cpp b/stepmania/src/SongOptions.cpp index 866e64314b..d5afad494c 100644 --- a/stepmania/src/SongOptions.cpp +++ b/stepmania/src/SongOptions.cpp @@ -50,8 +50,8 @@ CString SongOptions::GetString() const if( m_fMusicRate != 1 ) { CString s = ssprintf( "%2.2f", m_fMusicRate ); - if( s[s.GetLength()-1] == '0' ) - s.erase(s.GetLength()-1); + if( s[s.size()-1] == '0' ) + s.erase( s.size()-1 ); sReturn += s + "xMusic, "; } @@ -63,8 +63,8 @@ CString SongOptions::GetString() const default: ASSERT(0); } - if( sReturn.GetLength() > 2 ) - sReturn.erase( sReturn.GetLength()-2 ); // delete the trailing ", " + if( sReturn.size() > 2 ) + sReturn.erase( sReturn.size()-2 ); // delete the trailing ", " return sReturn; } diff --git a/stepmania/src/archutils/Win32/RegistryAccess.cpp b/stepmania/src/archutils/Win32/RegistryAccess.cpp index c2acabf045..5f99e445b2 100644 --- a/stepmania/src/archutils/Win32/RegistryAccess.cpp +++ b/stepmania/src/archutils/Win32/RegistryAccess.cpp @@ -158,7 +158,8 @@ bool RegistryAccess::SetRegValue( const RString &sKey, const RString &sName, con bool bSuccess = true; TCHAR sz[255]; - if (sVal.GetLength() > 254) return FALSE; + if( sVal.size() > 254 ) + return false; strcpy( sz, sVal.c_str() );