Remove implicit conversion operator from RString to const char*

This is required for the RString to std::string migration.

Mostly automated from https://github.com/aeubanks/rewriter/blob/main/c_str.cc, with some manual intervention required for fixing up `a + b.c_str()` to `(a + b).c_str()`.

Added some overloads for some common global functions like sm_crash to reduce the number of changes required here.
This commit is contained in:
Arthur Eubanks
2025-04-26 17:30:36 -07:00
committed by teejusb
parent 6a981ac5f7
commit ecfcb11a00
110 changed files with 458 additions and 426 deletions
+6 -6
View File
@@ -192,7 +192,7 @@ static void GameSel( int &sel, bool ToSel, const ConfOption *pConfOption )
sel = 0;
for(unsigned i = 0; i < choices.size(); ++i)
if( !strcasecmp(choices[i], sCurGameName) )
if( !strcasecmp(choices[i].c_str(), sCurGameName.c_str()) )
sel = i;
} else {
std::vector<const Game*> aGames;
@@ -227,12 +227,12 @@ static void Language( int &sel, bool ToSel, const ConfOption *pConfOption )
{
sel = -1;
for( unsigned i=0; sel == -1 && i < vs.size(); ++i )
if( !strcasecmp(vs[i], THEME->GetCurLanguage()) )
if( !strcasecmp(vs[i].c_str(), THEME->GetCurLanguage().c_str()) )
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( !strcasecmp(vs[i], SpecialFiles::BASE_LANGUAGE) )
if( !strcasecmp(vs[i].c_str(), SpecialFiles::BASE_LANGUAGE.c_str()) )
sel = i;
if( sel == -1 )
@@ -291,7 +291,7 @@ static void RequestedTheme( int &sel, bool ToSel, const ConfOption *pConfOption
{
sel = 0;
for( unsigned i=1; i<vsThemeNames.size(); i++ )
if( !strcasecmp(vsThemeNames[i], PREFSMAN->m_sTheme.Get()) )
if( !strcasecmp(vsThemeNames[i].c_str(), PREFSMAN->m_sTheme.Get().c_str()) )
sel = i;
}
else
@@ -317,7 +317,7 @@ static void Announcer( int &sel, bool ToSel, const ConfOption *pConfOption )
{
sel = 0;
for( unsigned i=1; i<choices.size(); i++ )
if( !strcasecmp(choices[i], ANNOUNCER->GetCurAnnouncerName()) )
if( !strcasecmp(choices[i].c_str(), ANNOUNCER->GetCurAnnouncerName().c_str()) )
sel = i;
}
else
@@ -344,7 +344,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( !strcasecmp(choices[i], po.m_sNoteSkin) )
if( !strcasecmp(choices[i].c_str(), po.m_sNoteSkin.c_str()) )
sel = i;
}
else