From c1a3455ce403bdf5fa0d982664603cbcdadbea78 Mon Sep 17 00:00:00 2001 From: Brian Phlipot Date: Mon, 8 Aug 2022 19:42:01 -0600 Subject: [PATCH] Explicitly create RStrings to avoid MSVC compiler errors. --- src/CourseUtil.cpp | 2 +- src/NotesWriterSSC.cpp | 2 +- src/SongUtil.cpp | 2 +- src/ThemeManager.cpp | 2 +- src/UnlockManager.cpp | 14 +++++++------- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/CourseUtil.cpp b/src/CourseUtil.cpp index b8cb51dd7d..1cc2af8a7a 100644 --- a/src/CourseUtil.cpp +++ b/src/CourseUtil.cpp @@ -209,7 +209,7 @@ void CourseUtil::SortByMostRecentlyPlayedForMachine( std::vector &vpCou for (Course const * c: vpCoursesInOut) { int iNumTimesPlayed = pProfile->GetCourseNumTimesPlayed( c ); - RString val = iNumTimesPlayed ? pProfile->GetCourseLastPlayedDateTime(c).GetString() : "9999999999999"; + RString val = iNumTimesPlayed ? pProfile->GetCourseLastPlayedDateTime(c).GetString() : RString("9999999999999"); course_sort_val[c] = val; } diff --git a/src/NotesWriterSSC.cpp b/src/NotesWriterSSC.cpp index d7a05ea89d..41219158e9 100644 --- a/src/NotesWriterSSC.cpp +++ b/src/NotesWriterSSC.cpp @@ -55,7 +55,7 @@ struct TimingTagWriter { { Write( row, ssprintf( "%.6f=%.6f=%hd", a, b, c) ); } void Init( const RString sTag ) { m_sNext = "#" + sTag + ":"; } - void Finish( ) { m_pvsLines->push_back( ( m_sNext != "," ? m_sNext : "" ) + ";" ); } + void Finish( ) { m_pvsLines->push_back( ( m_sNext != "," ? m_sNext : RString("") ) + ";" ); } }; diff --git a/src/SongUtil.cpp b/src/SongUtil.cpp index 06e4014992..ba26e00428 100644 --- a/src/SongUtil.cpp +++ b/src/SongUtil.cpp @@ -720,7 +720,7 @@ void SongUtil::SortByMostRecentlyPlayedForMachine( std::vector &vpSongsIn for (Song const *s : vpSongsInOut) { int iNumTimesPlayed = pProfile->GetSongNumTimesPlayed( s ); - RString val = iNumTimesPlayed ? pProfile->GetSongLastPlayedDateTime(s).GetString() : "0"; + RString val = iNumTimesPlayed ? pProfile->GetSongLastPlayedDateTime(s).GetString() : RString("0"); g_mapSongSortVal[s] = val; } diff --git a/src/ThemeManager.cpp b/src/ThemeManager.cpp index 813e046fc5..04c7296e18 100644 --- a/src/ThemeManager.cpp +++ b/src/ThemeManager.cpp @@ -92,7 +92,7 @@ public: { return GetValue(); } - RString const & curLanguage = (THEME && THEME->IsThemeLoaded() ? THEME->GetCurLanguage() : "current"); + RString const & curLanguage = (THEME && THEME->IsThemeLoaded() ? THEME->GetCurLanguage() : RString("current")); LOG->Warn("Missing translation for %s in the %s language.", m_sName.c_str(), curLanguage.c_str()); return m_sName; } diff --git a/src/UnlockManager.cpp b/src/UnlockManager.cpp index f78767af3d..27f647f985 100644 --- a/src/UnlockManager.cpp +++ b/src/UnlockManager.cpp @@ -417,20 +417,20 @@ RString UnlockEntry::GetDescription() const default: FAIL_M(ssprintf("Invalid UnlockRewardType: %i", m_Type)); case UnlockRewardType_Song: - return pSong ? pSong->GetDisplayFullTitle() : ""; + return pSong ? pSong->GetDisplayFullTitle() : RString(""); case UnlockRewardType_Steps: { StepsType st = GAMEMAN->GetHowToPlayStyleForGame( GAMESTATE->m_pCurGame )->m_StepsType; // TODO: Is this the best thing we can do here? - return (pSong ? pSong->GetDisplayFullTitle() : "") + ", " + CustomDifficultyToLocalizedString( GetCustomDifficulty(st, m_dc, CourseType_Invalid) ); + return (pSong ? pSong->GetDisplayFullTitle() : RString("")) + ", " + CustomDifficultyToLocalizedString( GetCustomDifficulty(st, m_dc, CourseType_Invalid) ); } case UnlockRewardType_Steps_Type: { - RString ret = (pSong ? pSong->GetDisplayFullTitle() : ""); + RString ret = (pSong ? pSong->GetDisplayFullTitle() : RString("")); ret += "," + CustomDifficultyToLocalizedString( GetCustomDifficulty(m_StepsType, m_dc, CourseType_Invalid) ); return ret + "," + StringConversion::ToString(m_StepsType); // yeah, bit strange. } case UnlockRewardType_Course: - return m_Course.IsValid() ? m_Course.ToCourse()->GetDisplayFullTitle() : ""; + return m_Course.IsValid() ? m_Course.ToCourse()->GetDisplayFullTitle() : RString(""); case UnlockRewardType_Modifier: return CommonMetrics::LocalizeOptionItem( GetModifier(), false ); } @@ -446,9 +446,9 @@ RString UnlockEntry::GetBannerFile() const case UnlockRewardType_Song: case UnlockRewardType_Steps: case UnlockRewardType_Steps_Type: - return pSong ? pSong->GetBannerPath() : ""; + return pSong ? pSong->GetBannerPath() : RString(""); case UnlockRewardType_Course: - return m_Course.ToCourse() ? m_Course.ToCourse()->GetBannerPath() : ""; + return m_Course.ToCourse() ? m_Course.ToCourse()->GetBannerPath() : RString(""); case UnlockRewardType_Modifier: return ""; } @@ -464,7 +464,7 @@ RString UnlockEntry::GetBackgroundFile() const case UnlockRewardType_Song: case UnlockRewardType_Steps: case UnlockRewardType_Steps_Type: - return pSong ? pSong->GetBackgroundPath() : ""; + return pSong ? pSong->GetBackgroundPath() : RString(""); case UnlockRewardType_Course: return ""; case UnlockRewardType_Modifier: