diff --git a/src/AnnouncerManager.cpp b/src/AnnouncerManager.cpp index ee20dc427e..dd87860a59 100644 --- a/src/AnnouncerManager.cpp +++ b/src/AnnouncerManager.cpp @@ -37,7 +37,7 @@ void AnnouncerManager::GetAnnouncerNames( vector& AddTo ) // strip out the empty announcer folder for( int i=AddTo.size()-1; i>=0; i-- ) - if( !stricmp( AddTo[i], EMPTY_ANNOUNCER_NAME ) ) + if( !AddTo[i].EqualsNoCase( EMPTY_ANNOUNCER_NAME ) ) AddTo.erase(AddTo.begin()+i, AddTo.begin()+i+1 ); } @@ -49,7 +49,7 @@ bool AnnouncerManager::DoesAnnouncerExist( RString sAnnouncerName ) vector asAnnouncerNames; GetAnnouncerNames( asAnnouncerNames ); for( unsigned i=0; i asStyles; diff --git a/src/InputMapper.cpp b/src/InputMapper.cpp index 90e65ae879..6707cf8408 100644 --- a/src/InputMapper.cpp +++ b/src/InputMapper.cpp @@ -948,7 +948,7 @@ MultiPlayer InputMapper::InputDeviceToMultiPlayer( InputDevice id ) GameButton InputScheme::ButtonNameToIndex( const RString &sButtonName ) const { for( GameButton gb=(GameButton) 0; gb asSkinNames; GetAllNoteSkinNamesForGame( GAMESTATE->m_pCurGame, asSkinNames ); for( unsigned i=0; i &Bla } // handle the data - if( 0==stricmp(sValueName,"FILE") ) + if( sValueName.EqualsNoCase("FILE") ) out.m_sMusicFile = sParams[1]; - else if( 0==stricmp(sValueName,"TITLE") ) + else if( sValueName.EqualsNoCase("TITLE") ) { NotesLoader::GetMainAndSubTitlesFromFullTitle( sParams[1], out.m_sMainTitle, out.m_sSubTitle ); @@ -460,22 +460,22 @@ bool DWILoader::LoadFromDir( const RString &sPath_, Song &out, set &Bla ConvertString( out.m_sSubTitle, "utf-8,english" ); } - else if( 0==stricmp(sValueName,"ARTIST") ) + else if( sValueName.EqualsNoCase("ARTIST") ) { out.m_sArtist = sParams[1]; ConvertString( out.m_sArtist, "utf-8,english" ); } - else if( 0==stricmp(sValueName,"GENRE") ) + else if( sValueName.EqualsNoCase("GENRE") ) { out.m_sGenre = sParams[1]; ConvertString( out.m_sGenre, "utf-8,english" ); } - else if( 0==stricmp(sValueName,"CDTITLE") ) + else if( sValueName.EqualsNoCase("CDTITLE") ) out.m_sCDTitleFile = sParams[1]; - else if( 0==stricmp(sValueName,"BPM") ) + else if( sValueName.EqualsNoCase("BPM") ) { const float fBPM = StringToFloat( sParams[1] ); @@ -491,7 +491,7 @@ bool DWILoader::LoadFromDir( const RString &sPath_, Song &out, set &Bla NoteRowToBeat(0), fBPM ); } } - else if( 0==stricmp(sValueName,"DISPLAYBPM") ) + else if( sValueName.EqualsNoCase("DISPLAYBPM") ) { // #DISPLAYBPM:[xxx..xxx]|[xxx]|[*]; int iMin, iMax; @@ -515,17 +515,17 @@ bool DWILoader::LoadFromDir( const RString &sPath_, Song &out, set &Bla } } - else if( 0==stricmp(sValueName,"GAP") ) + else if( sValueName.EqualsNoCase("GAP") ) // the units of GAP is 1/1000 second out.m_Timing.m_fBeat0OffsetInSeconds = -StringToInt( sParams[1] ) / 1000.0f; - else if( 0==stricmp(sValueName,"SAMPLESTART") ) + else if( sValueName.EqualsNoCase("SAMPLESTART") ) out.m_fMusicSampleStartSeconds = ParseBrokenDWITimestamp(sParams[1], sParams[2], sParams[3]); - else if( 0==stricmp(sValueName,"SAMPLELENGTH") ) + else if( sValueName.EqualsNoCase("SAMPLELENGTH") ) out.m_fMusicSampleLengthSeconds = ParseBrokenDWITimestamp(sParams[1], sParams[2], sParams[3]); - else if( 0==stricmp(sValueName,"FREEZE") ) + else if( sValueName.EqualsNoCase("FREEZE") ) { vector arrayFreezeExpressions; split( sParams[1], ",", arrayFreezeExpressions ); @@ -547,7 +547,7 @@ bool DWILoader::LoadFromDir( const RString &sPath_, Song &out, set &Bla } } - else if( 0==stricmp(sValueName,"CHANGEBPM") || 0==stricmp(sValueName,"BPMCHANGE") ) + else if( sValueName.EqualsNoCase("CHANGEBPM") || sValueName.EqualsNoCase("BPMCHANGE") ) { vector arrayBPMChangeExpressions; split( sParams[1], ",", arrayBPMChangeExpressions ); @@ -577,10 +577,10 @@ bool DWILoader::LoadFromDir( const RString &sPath_, Song &out, set &Bla } } - else if( 0==stricmp(sValueName,"SINGLE") || - 0==stricmp(sValueName,"DOUBLE") || - 0==stricmp(sValueName,"COUPLE") || - 0==stricmp(sValueName,"SOLO") ) + else if( sValueName.EqualsNoCase("SINGLE") || + sValueName.EqualsNoCase("DOUBLE") || + sValueName.EqualsNoCase("COUPLE") || + sValueName.EqualsNoCase("SOLO") ) { Steps* pNewNotes = new Steps; LoadFromDWITokens( @@ -597,8 +597,8 @@ bool DWILoader::LoadFromDir( const RString &sPath_, Song &out, set &Bla else delete pNewNotes; } - else if( 0==stricmp(sValueName,"DISPLAYTITLE") || - 0==stricmp(sValueName,"DISPLAYARTIST") ) + else if( sValueName.EqualsNoCase("DISPLAYTITLE") || + sValueName.EqualsNoCase("DISPLAYARTIST") ) { /* We don't want to support these tags. However, we don't want * to pick up images used here as song images (eg. banners). */ diff --git a/src/NotesLoaderJson.cpp b/src/NotesLoaderJson.cpp index ba7e6647f1..0d44550d97 100644 --- a/src/NotesLoaderJson.cpp +++ b/src/NotesLoaderJson.cpp @@ -143,9 +143,9 @@ static void Deserialize( Song &out, const Json::Value &root ) out.m_fMusicSampleStartSeconds = (float)root["SampleStart"].asDouble(); out.m_fMusicSampleLengthSeconds = (float)root["SampleLength"].asDouble(); RString sSelectable = root["Selectable"].asString(); - if( !stricmp(sSelectable,"YES") ) + if( sSelectable.EqualsNoCase("YES") ) out.m_SelectionDisplay = out.SHOW_ALWAYS; - else if(!stricmp(sSelectable,"NO")) + else if( sSelectable.EqualsNoCase("NO") ) out.m_SelectionDisplay = out.SHOW_NEVER; out.m_fFirstBeat = (float)root["FirstBeat"].asDouble(); diff --git a/src/NotesLoaderKSF.cpp b/src/NotesLoaderKSF.cpp index 4cfaaf0001..a5530b3359 100644 --- a/src/NotesLoaderKSF.cpp +++ b/src/NotesLoaderKSF.cpp @@ -286,12 +286,12 @@ static void LoadTags( const RString &str, Song &out ) split( str, " - ", asBits, false ); // Ignore the difficulty, since we get that elsewhere. if( asBits.size() == 3 && ( - !stricmp(asBits[2], "double") || - !stricmp(asBits[2], "easy") || - !stricmp(asBits[2], "normal") || - !stricmp(asBits[2], "hard") || - !stricmp(asBits[2], "crazy") || - !stricmp(asBits[2], "nightmare")) + asBits[2].EqualsNoCase("double") || + asBits[2].EqualsNoCase("easy") || + asBits[2].EqualsNoCase("normal") || + asBits[2].EqualsNoCase("hard") || + asBits[2].EqualsNoCase("crazy") || + asBits[2].EqualsNoCase("nightmare")) ) { asBits.erase( asBits.begin()+2, asBits.begin()+3 ); diff --git a/src/NotesLoaderSM.cpp b/src/NotesLoaderSM.cpp index 4a2bf428f7..b8099a1e01 100644 --- a/src/NotesLoaderSM.cpp +++ b/src/NotesLoaderSM.cpp @@ -596,18 +596,18 @@ bool SMLoader::LoadFromSMFile( const RString &sPath, Song &out, bool bFromCache else if( sValueName=="SELECTABLE" ) { - if(!stricmp(sParams[1],"YES")) + if(sParams[1].EqualsNoCase("YES")) out.m_SelectionDisplay = out.SHOW_ALWAYS; - else if(!stricmp(sParams[1],"NO")) + else if(sParams[1].EqualsNoCase("NO")) out.m_SelectionDisplay = out.SHOW_NEVER; // ROULETTE from 3.9. It was removed since UnlockManager can serve // the same purpose somehow. This, of course, assumes you're using // unlocks. -aj - else if(!stricmp(sParams[1],"ROULETTE")) + else if(sParams[1].EqualsNoCase("ROULETTE")) out.m_SelectionDisplay = out.SHOW_ALWAYS; /* The following two cases are just fixes to make sure simfiles that * used 3.9+ features are not excluded here */ - else if(!stricmp(sParams[1],"ES") || !stricmp(sParams[1],"OMES")) + else if(sParams[1].EqualsNoCase("ES") || sParams[1].EqualsNoCase("OMES")) out.m_SelectionDisplay = out.SHOW_ALWAYS; else if( StringToInt(sParams[1]) > 0 ) out.m_SelectionDisplay = out.SHOW_ALWAYS; diff --git a/src/NotesLoaderSMA.cpp b/src/NotesLoaderSMA.cpp index 824a526e41..dbb0089494 100644 --- a/src/NotesLoaderSMA.cpp +++ b/src/NotesLoaderSMA.cpp @@ -244,18 +244,18 @@ bool SMALoader::LoadFromSMAFile( const RString &sPath, Song &out ) else if( sValueName=="SELECTABLE" ) { - if(!stricmp(sParams[1],"YES")) + if(sParams[1].EqualsNoCase("YES")) out.m_SelectionDisplay = out.SHOW_ALWAYS; - else if(!stricmp(sParams[1],"NO")) + else if(sParams[1].EqualsNoCase("NO")) out.m_SelectionDisplay = out.SHOW_NEVER; // ROULETTE from 3.9. It was removed since UnlockManager can serve // the same purpose somehow. This, of course, assumes you're using // unlocks. -aj - else if(!stricmp(sParams[1],"ROULETTE")) + else if(sParams[1].EqualsNoCase("ROULETTE")) out.m_SelectionDisplay = out.SHOW_ALWAYS; /* The following two cases are just fixes to make sure simfiles that * used 3.9+ features are not excluded here */ - else if(!stricmp(sParams[1],"ES") || !stricmp(sParams[1],"OMES")) + else if(sParams[1].EqualsNoCase("ES") || sParams[1].EqualsNoCase("OMES")) out.m_SelectionDisplay = out.SHOW_ALWAYS; else if( StringToInt(sParams[1]) > 0 ) out.m_SelectionDisplay = out.SHOW_ALWAYS; diff --git a/src/NotesLoaderSSC.cpp b/src/NotesLoaderSSC.cpp index 3ae4b3a0d4..4e511c844a 100644 --- a/src/NotesLoaderSSC.cpp +++ b/src/NotesLoaderSSC.cpp @@ -276,16 +276,16 @@ bool SSCLoader::LoadFromSSCFile( const RString &sPath, Song &out, bool bFromCach else if( sValueName=="SELECTABLE" ) { - if(!stricmp(sParams[1],"YES")) + if(sParams[1].EqualsNoCase("YES")) out.m_SelectionDisplay = out.SHOW_ALWAYS; - else if(!stricmp(sParams[1],"NO")) + else if(sParams[1].EqualsNoCase("NO")) out.m_SelectionDisplay = out.SHOW_NEVER; // ROULETTE from 3.9 is no longer in use. - else if(!stricmp(sParams[1],"ROULETTE")) + else if(sParams[1].EqualsNoCase("ROULETTE")) out.m_SelectionDisplay = out.SHOW_ALWAYS; /* The following two cases are just fixes to make sure simfiles that * used 3.9+ features are not excluded here */ - else if(!stricmp(sParams[1],"ES") || !stricmp(sParams[1],"OMES")) + else if(sParams[1].EqualsNoCase("ES") || sParams[1].EqualsNoCase("OMES")) out.m_SelectionDisplay = out.SHOW_ALWAYS; else if( StringToInt(sParams[1]) > 0 ) out.m_SelectionDisplay = out.SHOW_ALWAYS; diff --git a/src/ScreenOptionsMasterPrefs.cpp b/src/ScreenOptionsMasterPrefs.cpp index 347ecf041d..6ef345ceaf 100644 --- a/src/ScreenOptionsMasterPrefs.cpp +++ b/src/ScreenOptionsMasterPrefs.cpp @@ -181,7 +181,7 @@ static void GameSel( int &sel, bool ToSel, const ConfOption *pConfOption ) sel = 0; for(unsigned i = 0; i < choices.size(); ++i) - if( !stricmp(choices[i], sCurGameName) ) + if( !choices[i].EqualsNoCase(sCurGameName) ) sel = i; } else { vector aGames; @@ -222,12 +222,12 @@ static void Language( int &sel, bool ToSel, const ConfOption *pConfOption ) { sel = -1; for( unsigned i=0; sel == -1 && i < vs.size(); ++i ) - if( !stricmp(vs[i], THEME->GetCurLanguage()) ) + if( !vs[i].EqualsNoCase(THEME->GetCurLanguage()) ) sel = i; // If the current language doesn't exist, we'll show BASE_LANGUAGE, so select that. for( unsigned i=0; sel == -1 && i < vs.size(); ++i ) - if( !stricmp(vs[i], SpecialFiles::BASE_LANGUAGE) ) + if( !vs[i].EqualsNoCase(SpecialFiles::BASE_LANGUAGE) ) sel = i; if( sel == -1 ) @@ -276,7 +276,7 @@ static void RequestedTheme( int &sel, bool ToSel, const ConfOption *pConfOption { sel = 0; for( unsigned i=1; im_sTheme.Get()) ) + if( !vsThemeNames[i].EqualsNoCase(PREFSMAN->m_sTheme.Get()) ) sel = i; } else @@ -302,7 +302,7 @@ static void Announcer( int &sel, bool ToSel, const ConfOption *pConfOption ) { sel = 0; for( unsigned i=1; iGetCurAnnouncerName()) ) + if( !choices[i].EqualsNoCase(ANNOUNCER->GetCurAnnouncerName()) ) sel = i; } else @@ -329,7 +329,7 @@ static void DefaultNoteSkin( int &sel, bool ToSel, const ConfOption *pConfOption po.FromString( PREFSMAN->m_sDefaultModifiers ); sel = 0; for( unsigned i=0; i < choices.size(); i++ ) - if( !stricmp(choices[i], po.m_sNoteSkin) ) + if( !choices[i].EqualsNoCase(po.m_sNoteSkin) ) sel = i; } else diff --git a/src/Song.cpp b/src/Song.cpp index 5743eb9199..2bc3df3d64 100644 --- a/src/Song.cpp +++ b/src/Song.cpp @@ -611,13 +611,13 @@ void Song::TidyUpData() // Skip any image that we've already classified - if( HasBanner() && stricmp(m_sBannerFile, arrayImages[i])==0 ) + if( HasBanner() && m_sBannerFile.EqualsNoCase(arrayImages[i]) ) continue; // skip - if( HasBackground() && stricmp(m_sBackgroundFile, arrayImages[i])==0 ) + if( HasBackground() && m_sBackgroundFile.EqualsNoCase(arrayImages[i]) ) continue; // skip - if( HasCDTitle() && stricmp(m_sCDTitleFile, arrayImages[i])==0 ) + if( HasCDTitle() && m_sCDTitleFile.EqualsNoCase(arrayImages[i]) ) continue; // skip // todo: add checks for Jacket, Disc, and CDImage -aj diff --git a/src/SongManager.cpp b/src/SongManager.cpp index fe4bb51cd2..e91b1c4d41 100644 --- a/src/SongManager.cpp +++ b/src/SongManager.cpp @@ -879,7 +879,7 @@ void SongManager::InitRandomAttacks() continue; } - if( stricmp(sType,"ATTACK") != 0 ) + if( !sType.EqualsNoCase("ATTACK") ) { LOG->Warn( "Got \"%s:%s\" tag with wrong declaration", sType.c_str(), sAttack.c_str() ); continue; diff --git a/src/global.h b/src/global.h index 19a6d3c76b..b90f6c86c7 100644 --- a/src/global.h +++ b/src/global.h @@ -192,13 +192,6 @@ typedef StdString::CStdString RString; #include "RageException.h" -#if !defined(WIN32) -/** @brief Define stricmp to be strcasecmp. */ -#define stricmp strcasecmp -/** @brief Define strnicmp to be strncasecmp. */ -#define strnicmp strncasecmp -#endif - /* Define a few functions if necessary */ #include