From b2f9c8fba94afb293deb025581e21bda7f4a745f Mon Sep 17 00:00:00 2001 From: Stenzek Date: Mon, 10 Aug 2026 20:09:59 +1000 Subject: [PATCH] Misc: Fix deprecated implicit conversion of fstring->string_view --- src/common/error.h | 12 ++++++------ src/common/log.h | 4 ++-- src/common/progress_callback.h | 2 +- src/common/small_string.h | 8 ++++---- src/core/achievements.cpp | 4 ++-- src/core/cheats.cpp | 6 +++--- src/core/game_database.cpp | 2 +- src/core/system.cpp | 2 +- src/updater/updater_progress_callback.h | 2 +- src/util/cue_parser.cpp | 2 +- src/util/gpu_device.h | 12 ++++++------ src/util/gpu_texture.h | 4 ++-- src/util/postprocessing_shader_slang.cpp | 4 ++-- 13 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/common/error.h b/src/common/error.h index bc88d2c1e..b36d8a60e 100644 --- a/src/common/error.h +++ b/src/common/error.h @@ -87,7 +87,7 @@ public: template void SetStringFmt(fmt::format_string fmt, T&&... args) { - SetStringFmtArgs(fmt, fmt::make_format_args(args...)); + SetStringFmtArgs(fmt.get(), fmt::make_format_args(args...)); } void AddPrefix(std::string_view prefix); @@ -95,7 +95,7 @@ public: template void AddPrefixFmt(fmt::format_string fmt, T&&... args) { - AddPrefixFmtArgs(fmt, fmt::make_format_args(args...)); + AddPrefixFmtArgs(fmt.get(), fmt::make_format_args(args...)); } void AddSuffix(std::string_view suffix); @@ -103,7 +103,7 @@ public: template void AddSuffixFmt(fmt::format_string fmt, T&&... args) { - AddSuffixFmtArgs(fmt, fmt::make_format_args(args...)); + AddSuffixFmtArgs(fmt.get(), fmt::make_format_args(args...)); } /// Sets a formatted message. @@ -111,7 +111,7 @@ public: static void SetStringFmt(Error* errptr, fmt::format_string fmt, T&&... args) { if (errptr) - errptr->SetStringFmtArgs(fmt, fmt::make_format_args(args...)); + errptr->SetStringFmtArgs(fmt.get(), fmt::make_format_args(args...)); } static void AddPrefix(Error* errptr, std::string_view prefix); @@ -120,7 +120,7 @@ public: static void AddPrefixFmt(Error* errptr, fmt::format_string fmt, T&&... args) { if (errptr) - errptr->AddPrefixFmtArgs(fmt, fmt::make_format_args(args...)); + errptr->AddPrefixFmtArgs(fmt.get(), fmt::make_format_args(args...)); } static void AddSuffix(Error* errptr, std::string_view prefix); @@ -129,7 +129,7 @@ public: static void AddSuffixFmt(Error* errptr, fmt::format_string fmt, T&&... args) { if (errptr) - errptr->AddSuffixFmtArgs(fmt, fmt::make_format_args(args...)); + errptr->AddSuffixFmtArgs(fmt.get(), fmt::make_format_args(args...)); } Error& operator=(const Error& e); diff --git a/src/common/log.h b/src/common/log.h index c7cb59470..6d811caed 100644 --- a/src/common/log.h +++ b/src/common/log.h @@ -142,14 +142,14 @@ void WriteFuncNameFmtArgs(MessageCategory cat, const char* function_name, fmt::s template ALWAYS_INLINE void Write(MessageCategory cat, fmt::format_string fmt, T&&... args) { - WriteFmtArgs(cat, fmt, fmt::make_format_args(args...)); + WriteFmtArgs(cat, fmt.get(), fmt::make_format_args(args...)); } template ALWAYS_INLINE void WriteFuncName(MessageCategory cat, const char* function_name, fmt::format_string fmt, T&&... args) { - WriteFuncNameFmtArgs(cat, function_name, fmt, fmt::make_format_args(args...)); + WriteFuncNameFmtArgs(cat, function_name, fmt.get(), fmt::make_format_args(args...)); } } // namespace Log diff --git a/src/common/progress_callback.h b/src/common/progress_callback.h index dc05162ae..732cf74c1 100644 --- a/src/common/progress_callback.h +++ b/src/common/progress_callback.h @@ -16,7 +16,7 @@ void from(fmt::format_string fmt, T&&... args) \ { \ TinyString str; \ - fmt::vformat_to(std::back_inserter(str), fmt, fmt::make_format_args(args...)); \ + fmt::vformat_to(std::back_inserter(str), fmt.get(), fmt::make_format_args(args...)); \ to(str.view()); \ } diff --git a/src/common/small_string.h b/src/common/small_string.h index eb1106329..fb1ab198a 100644 --- a/src/common/small_string.h +++ b/src/common/small_string.h @@ -416,7 +416,7 @@ template ALWAYS_INLINE SmallStackString SmallStackString::from_format(fmt::format_string fmt, T&&... args) { SmallStackString ret; - fmt::vformat_to(std::back_inserter(ret), fmt, fmt::make_format_args(args...)); + fmt::vformat_to(std::back_inserter(ret), fmt.get(), fmt::make_format_args(args...)); return ret; } @@ -436,14 +436,14 @@ using LargeString = SmallStackString<512>; template ALWAYS_INLINE void SmallStringBase::append_format(fmt::format_string fmt, T&&... args) { - fmt::vformat_to(std::back_inserter(*this), fmt, fmt::make_format_args(args...)); + fmt::vformat_to(std::back_inserter(*this), fmt.get(), fmt::make_format_args(args...)); } template ALWAYS_INLINE void SmallStringBase::prepend_format(fmt::format_string fmt, T&&... args) { TinyString str; - fmt::vformat_to(std::back_inserter(str), fmt, fmt::make_format_args(args...)); + fmt::vformat_to(std::back_inserter(str), fmt.get(), fmt::make_format_args(args...)); prepend(str); } @@ -451,7 +451,7 @@ template ALWAYS_INLINE void SmallStringBase::format(fmt::format_string fmt, T&&... args) { clear(); - fmt::vformat_to(std::back_inserter(*this), fmt, fmt::make_format_args(args...)); + fmt::vformat_to(std::back_inserter(*this), fmt.get(), fmt::make_format_args(args...)); } #ifdef _MSC_VER diff --git a/src/core/achievements.cpp b/src/core/achievements.cpp index 9cf95ba9b..0ec391f90 100644 --- a/src/core/achievements.cpp +++ b/src/core/achievements.cpp @@ -344,7 +344,7 @@ template void Achievements::ReportFmtError(fmt::format_string fmt, T&&... args) { TinyString str; - fmt::vformat_to(std::back_inserter(str), fmt, fmt::make_format_args(args...)); + fmt::vformat_to(std::back_inserter(str), fmt.get(), fmt::make_format_args(args...)); ReportError(str); } @@ -352,7 +352,7 @@ template void Achievements::ReportRCError(int err, fmt::format_string fmt, T&&... args) { TinyString str; - fmt::vformat_to(std::back_inserter(str), fmt, fmt::make_format_args(args...)); + fmt::vformat_to(std::back_inserter(str), fmt.get(), fmt::make_format_args(args...)); str.append_format("{} ({})", rc_error_str(err), err); ReportError(str); } diff --git a/src/core/cheats.cpp b/src/core/cheats.cpp index faf136428..1e2aa82bb 100644 --- a/src/core/cheats.cpp +++ b/src/core/cheats.cpp @@ -83,13 +83,13 @@ public: { if (!stop_on_error) { - Log::WriteFmtArgs(Log::PackCategory(Log::Channel::Cheats, Log::Level::Warning, Log::Color::StrongOrange), fmt, - fmt::make_format_args(args...)); + Log::WriteFmtArgs(Log::PackCategory(Log::Channel::Cheats, Log::Level::Warning, Log::Color::StrongOrange), + fmt.get(), fmt::make_format_args(args...)); return true; } if (error) - error->SetString(fmt::vformat(fmt, fmt::make_format_args(args...))); + error->SetString(fmt::vformat(fmt.get(), fmt::make_format_args(args...))); return false; } diff --git a/src/core/game_database.cpp b/src/core/game_database.cpp index ff5abaea3..24663b4cd 100644 --- a/src/core/game_database.cpp +++ b/src/core/game_database.cpp @@ -572,7 +572,7 @@ void GameDatabase::Entry::ApplySettings(Settings& settings, bool display_osd_mes }; const auto append_message_fmt = [&messages](fmt::format_string fmt, T&&... args) { messages.append(" \u2022 "); - messages.append_vformat(fmt, fmt::make_format_args(args...)); + messages.append_vformat(fmt.get(), fmt::make_format_args(args...)); messages.append('\n'); }; diff --git a/src/core/system.cpp b/src/core/system.cpp index 8c9ddbcfb..06e64d068 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -4829,7 +4829,7 @@ void System::WarnAboutUnsafeSettings() }; const auto append_format = [&messages](fmt::format_string fmt, T&&... args) { messages.append(" \u2022 "); - messages.append_vformat(fmt, fmt::make_format_args(args...)); + messages.append_vformat(fmt.get(), fmt::make_format_args(args...)); messages.append('\n'); }; const auto has_trait = [](GameDatabase::Trait trait) { diff --git a/src/updater/updater_progress_callback.h b/src/updater/updater_progress_callback.h index 45a08d133..65c2f97f4 100644 --- a/src/updater/updater_progress_callback.h +++ b/src/updater/updater_progress_callback.h @@ -24,7 +24,7 @@ public: void from(fmt::format_string fmt, T&&... args) \ { \ TinyString str; \ - fmt::vformat_to(std::back_inserter(str), fmt, fmt::make_format_args(args...)); \ + fmt::vformat_to(std::back_inserter(str), fmt.get(), fmt::make_format_args(args...)); \ to(str.view()); \ } diff --git a/src/util/cue_parser.cpp b/src/util/cue_parser.cpp index 651eec629..5c21a2718 100644 --- a/src/util/cue_parser.cpp +++ b/src/util/cue_parser.cpp @@ -23,7 +23,7 @@ template static void SetError(u32 line_number, Error* error, fmt::format_string fmt, T&&... args) { SmallString str; - str.vformat(fmt, fmt::make_format_args(args...)); + str.vformat(fmt.get(), fmt::make_format_args(args...)); ERROR_LOG("Cue parse error at line {}: {}", line_number, str); Error::SetStringFmt(error, "Cue parse error at line {}: {}", line_number, str); diff --git a/src/util/gpu_device.h b/src/util/gpu_device.h index ff588f71b..fa85ecec6 100644 --- a/src/util/gpu_device.h +++ b/src/util/gpu_device.h @@ -90,7 +90,7 @@ public: template void SetDebugName(fmt::format_string fmt, T&&... args) { - SetDebugName(TinyString::from_vformat(fmt, fmt::make_format_args(args...))); + SetDebugName(TinyString::from_vformat(fmt.get(), fmt::make_format_args(args...))); } #endif @@ -113,7 +113,7 @@ public: template void SetDebugName(fmt::format_string fmt, T&&... args) { - SetDebugName(TinyString::from_vformat(fmt, fmt::make_format_args(args...))); + SetDebugName(TinyString::from_vformat(fmt.get(), fmt::make_format_args(args...))); } #endif @@ -411,7 +411,7 @@ public: template void SetDebugName(fmt::format_string fmt, T&&... args) { - SetDebugName(TinyString::from_vformat(fmt, fmt::make_format_args(args...))); + SetDebugName(TinyString::from_vformat(fmt.get(), fmt::make_format_args(args...))); } #endif }; @@ -778,12 +778,12 @@ public: template void PushDebugGroup(fmt::format_string fmt, T&&... args) { - PushDebugGroup(TinyString::from_vformat(fmt, fmt::make_format_args(args...))); + PushDebugGroup(TinyString::from_vformat(fmt.get(), fmt::make_format_args(args...))); } template void InsertDebugMessage(fmt::format_string fmt, T&&... args) { - InsertDebugMessage(TinyString::from_vformat(fmt, fmt::make_format_args(args...))); + InsertDebugMessage(TinyString::from_vformat(fmt.get(), fmt::make_format_args(args...))); } #endif @@ -1004,7 +1004,7 @@ struct GLAutoPop GLAutoPop(fmt::format_string fmt, T&&... args) { if (g_gpu_device->IsDebugDevice()) [[unlikely]] - g_gpu_device->PushDebugGroup(SmallString::from_vformat(fmt, fmt::make_format_args(args...))); + g_gpu_device->PushDebugGroup(SmallString::from_vformat(fmt.get(), fmt::make_format_args(args...))); } ~GLAutoPop() diff --git a/src/util/gpu_texture.h b/src/util/gpu_texture.h index e30acd0be..d4319d189 100644 --- a/src/util/gpu_texture.h +++ b/src/util/gpu_texture.h @@ -156,7 +156,7 @@ public: template void SetDebugName(fmt::format_string fmt, T&&... args) { - SetDebugName(TinyString::from_vformat(fmt, fmt::make_format_args(args...))); + SetDebugName(TinyString::from_vformat(fmt.get(), fmt::make_format_args(args...))); } #endif @@ -232,7 +232,7 @@ public: template void SetDebugName(fmt::format_string fmt, T&&... args) { - SetDebugName(TinyString::from_vformat(fmt, fmt::make_format_args(args...))); + SetDebugName(TinyString::from_vformat(fmt.get(), fmt::make_format_args(args...))); } #endif diff --git a/src/util/postprocessing_shader_slang.cpp b/src/util/postprocessing_shader_slang.cpp index 743690d14..4671ced1e 100644 --- a/src/util/postprocessing_shader_slang.cpp +++ b/src/util/postprocessing_shader_slang.cpp @@ -499,14 +499,14 @@ std::string_view PostProcessing::StripCommentsAndWhitespace(std::string_view lin template inline void PostProcessing::SlangShaderPreprocessor::Write(fmt::format_string fmt, T&&... args) { - fmt::vformat_to(std::back_inserter(m_shader_code[m_current_stage]), fmt, fmt::make_format_args(args...)); + fmt::vformat_to(std::back_inserter(m_shader_code[m_current_stage]), fmt.get(), fmt::make_format_args(args...)); } template inline void PostProcessing::SlangShaderPreprocessor::SetError(fmt::format_string fmt, T&&... args) { std::string msg = fmt::format("{}:{}: {}", GetCurrentFilename(), m_current_line_number, - fmt::vformat(fmt, fmt::make_format_args(args...))); + fmt::vformat(fmt.get(), fmt::make_format_args(args...))); ERROR_LOG(msg); Error::SetString(m_error, std::move(msg)); }