From 3a20f5b67ff32cc3663e0ccd72941e666e8756a4 Mon Sep 17 00:00:00 2001 From: Lukas Rusak Date: Tue, 27 Jun 2023 11:21:50 -0700 Subject: [PATCH 1/4] CGUIWindowHome: use AnnouncementFlagToString when logging Signed-off-by: Lukas Rusak --- xbmc/windows/GUIWindowHome.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xbmc/windows/GUIWindowHome.cpp b/xbmc/windows/GUIWindowHome.cpp index c42e073c48ced..abc6cfc94d5a0 100644 --- a/xbmc/windows/GUIWindowHome.cpp +++ b/xbmc/windows/GUIWindowHome.cpp @@ -78,7 +78,8 @@ void CGUIWindowHome::Announce(ANNOUNCEMENT::AnnouncementFlag flag, { int ra_flag = 0; - CLog::Log(LOGDEBUG, LOGANNOUNCE, "GOT ANNOUNCEMENT, type: {}, from {}, message {}", flag, sender, message); + CLog::Log(LOGDEBUG, LOGANNOUNCE, "GOT ANNOUNCEMENT, type: {}, from {}, message {}", + AnnouncementFlagToString(flag), sender, message); // we are only interested in library changes if ((flag & (ANNOUNCEMENT::VideoLibrary | ANNOUNCEMENT::AudioLibrary)) == 0) From c82006b575b78efbb3f5aff40a159b90f245ea9d Mon Sep 17 00:00:00 2001 From: Lukas Rusak Date: Tue, 27 Jun 2023 11:22:32 -0700 Subject: [PATCH 2/4] CGUIColorButtonControl: use explicit cast to UTILS::COLOR::Color when formatting Signed-off-by: Lukas Rusak --- xbmc/guilib/GUIColorButtonControl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xbmc/guilib/GUIColorButtonControl.cpp b/xbmc/guilib/GUIColorButtonControl.cpp index 940834cb68852..67597d7ab504b 100644 --- a/xbmc/guilib/GUIColorButtonControl.cpp +++ b/xbmc/guilib/GUIColorButtonControl.cpp @@ -188,7 +188,8 @@ void CGUIColorButtonControl::RenderInfoText() void CGUIColorButtonControl::ProcessInfoText(unsigned int currentTime) { CRect labelRenderRect = m_labelInfo.GetRenderRect(); - bool changed = m_labelInfo.SetText(StringUtils::Format("#{:08X}", m_imgBoxColor)); + bool changed = m_labelInfo.SetText( + StringUtils::Format("#{:08X}", static_cast(m_imgBoxColor))); // Set Label X position based on image mask control position float textWidth = m_labelInfo.GetTextWidth() + 2 * m_labelInfo.GetLabelInfo().offsetX; float textPosX = m_imgColorMask->GetXPosition() - textWidth; From e4b1aa8450fabfb41379953c8ccec0a512421531 Mon Sep 17 00:00:00 2001 From: Lukas Rusak Date: Tue, 27 Jun 2023 11:24:02 -0700 Subject: [PATCH 3/4] CLog: allow using fmt::enums::format_as for explicit enum conversion when using libfmt>=10 Signed-off-by: Lukas Rusak --- xbmc/utils/log.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xbmc/utils/log.h b/xbmc/utils/log.h index 9fc4aae36813e..adf46905a86c6 100644 --- a/xbmc/utils/log.h +++ b/xbmc/utils/log.h @@ -46,6 +46,10 @@ class dist_sink; } // namespace sinks } // namespace spdlog +#if FMT_VERSION >= 100000 +using fmt::enums::format_as; +#endif + class CLog : public ISettingsHandler, public ISettingCallback { public: From 26c164a28cfd18ceef7a1f2bbba5bf8a4a5a750c Mon Sep 17 00:00:00 2001 From: Lukas Rusak Date: Tue, 27 Jun 2023 11:24:34 -0700 Subject: [PATCH 4/4] CLog: add formatter for std::atomic for explicit atomic conversion when using libfmt>=10 Signed-off-by: Lukas Rusak --- xbmc/utils/log.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xbmc/utils/log.h b/xbmc/utils/log.h index adf46905a86c6..1c42c888cb655 100644 --- a/xbmc/utils/log.h +++ b/xbmc/utils/log.h @@ -48,6 +48,14 @@ class dist_sink; #if FMT_VERSION >= 100000 using fmt::enums::format_as; + +namespace fmt +{ +template +struct formatter, Char> : formatter +{ +}; +} // namespace fmt #endif class CLog : public ISettingsHandler, public ISettingCallback