From ba158aa3ffede4d9b7267258c2b41f10bd84e60b Mon Sep 17 00:00:00 2001 From: phosit Date: Thu, 3 Sep 2026 15:33:30 +0200 Subject: [PATCH] Use fmt::format for LOGWARNING The format string can be checked at compile time. It will be easier to transition to `std::format`. --- source/graphics/ColladaManager.cpp | 2 +- source/graphics/Color.cpp | 9 +++---- source/graphics/MapGenerator.cpp | 2 +- source/graphics/MapReader.cpp | 10 ++++---- source/graphics/ModelAbstract.cpp | 5 ++-- source/graphics/ObjectBase.cpp | 10 ++++++-- source/graphics/ParticleEmitterType.cpp | 2 +- source/graphics/TerrainProperties.cpp | 2 +- source/graphics/TerrainTextureManager.cpp | 2 +- source/gui/CGUI.cpp | 16 ++++++++++--- source/gui/GUIStringConversions.cpp | 24 ++++++++++++------- source/gui/ObjectBases/IGUIObject.cpp | 5 +++- source/gui/ObjectTypes/CChart.cpp | 5 +++- source/gui/Scripting/JSInterface_CGUISize.cpp | 6 ++++- source/gui/SettingTypes/MouseEventMask.cpp | 4 ++-- source/lobby/XmppClient.cpp | 9 ++++--- source/network/tests/test_StunClient.h | 2 +- source/ps/CLogger.h | 3 ++- source/ps/CStrIntern.cpp | 4 ++-- source/ps/DllLoader.cpp | 2 +- source/ps/GameSetup/GameSetup.cpp | 6 ++--- source/ps/Hotkey.cpp | 2 +- source/ps/Mod.cpp | 3 ++- source/ps/Replay.cpp | 7 ++++-- source/ps/SavedGame.cpp | 2 +- source/ps/VideoMode.cpp | 11 +++++---- source/ps/VisualReplay.cpp | 2 +- source/renderer/PatchRData.cpp | 5 +++- source/renderer/PostprocManager.cpp | 8 +++---- source/renderer/Renderer.cpp | 5 ++-- source/renderer/RenderingOptions.cpp | 2 +- source/renderer/backend/gl/Device.cpp | 4 ++-- source/renderer/backend/vulkan/Device.cpp | 4 ++-- source/scriptinterface/Interface.cpp | 2 +- source/simulation2/Simulation2.cpp | 11 ++++++--- .../components/CCmpCinemaManager.cpp | 6 ++--- .../components/CCmpRangeManager.cpp | 19 +++++++++++---- source/simulation2/helpers/CinemaPath.cpp | 12 ++++++---- source/simulation2/helpers/Pathfinding.cpp | 4 ++-- source/simulation2/system/ParamNode.cpp | 4 ++-- source/simulation2/system/TurnManager.cpp | 2 +- source/soundmanager/scripting/SoundGroup.cpp | 5 +++- 42 files changed, 160 insertions(+), 90 deletions(-) diff --git a/source/graphics/ColladaManager.cpp b/source/graphics/ColladaManager.cpp index 8df53e7916..7fbcd9c0a7 100644 --- a/source/graphics/ColladaManager.cpp +++ b/source/graphics/ColladaManager.cpp @@ -52,7 +52,7 @@ namespace if (severity == LOG_INFO) LOGMESSAGE("{}: {}", path->string8(), text); else if (severity == LOG_WARNING) - LOGWARNING("%s: %s", path->string8(), text); + LOGWARNING("{}: {}", path->string8(), text); else LOGERROR("%s: %s", path->string8(), text); } diff --git a/source/graphics/Color.cpp b/source/graphics/Color.cpp index 00b6206d05..eb3b36630d 100644 --- a/source/graphics/Color.cpp +++ b/source/graphics/Color.cpp @@ -110,24 +110,25 @@ bool CColor::ParseString(const CStr8& value, int defaultAlpha) stream >> values[i]; if ((stream.rdstate() & std::stringstream::failbit) != 0) { - LOGWARNING("Unable to parse CColor parameters. Your input: '%s'", value.c_str()); + LOGWARNING("Unable to parse CColor parameters. Your input: '{}'", value); return false; } if (values[i] < 0 || values[i] > 255) { - LOGWARNING("Invalid value (<0 or >255) when parsing CColor parameters. Your input: '%s'", value.c_str()); + LOGWARNING("Invalid value (<0 or >255) when parsing CColor parameters. Your input: '{}'", + value); return false; } } if (i < 3) { - LOGWARNING("Not enough parameters when parsing as CColor. Your input: '%s'", value.c_str()); + LOGWARNING("Not enough parameters when parsing as CColor. Your input: '{}'", value); return false; } if (!stream.eof()) { - LOGWARNING("Too many parameters when parsing as CColor. Your input: '%s'", value.c_str()); + LOGWARNING("Too many parameters when parsing as CColor. Your input: '{}'", value); return false; } diff --git a/source/graphics/MapGenerator.cpp b/source/graphics/MapGenerator.cpp index cb41f92fbe..83e4ee7976 100644 --- a/source/graphics/MapGenerator.cpp +++ b/source/graphics/MapGenerator.cpp @@ -434,7 +434,7 @@ Script::StructuredClone RunMapGenerationScript(const StopToken stopToken, std::a if (tempProgress < currentProgress) { LOGWARNING("The random map script tried to reduce the loading progress from " - "%d to %d.", currentProgress, tempProgress); + "{} to {}.", currentProgress, tempProgress); return; } progress.store(tempProgress); diff --git a/source/graphics/MapReader.cpp b/source/graphics/MapReader.cpp index 0defc459e9..25d26afd9f 100644 --- a/source/graphics/MapReader.cpp +++ b/source/graphics/MapReader.cpp @@ -971,7 +971,7 @@ void CXMLReader::ReadPaths(XMBElement parent) CCinemaPath path(pathData, positionSpline, targetSpline); if (path.Empty()) { - LOGWARNING("Path with name '%s' is empty", pathName.ToUTF8()); + LOGWARNING("Path with name '{}' is empty", pathName.ToUTF8()); return; } @@ -980,10 +980,10 @@ void CXMLReader::ReadPaths(XMBElement parent) if (!cmpCinemaManager->HasPath(pathName)) cmpCinemaManager->AddPath(path); else - LOGWARNING("Path with name '%s' already exists", pathName.ToUTF8()); + LOGWARNING("Path with name '{}' already exists", pathName.ToUTF8()); } else - LOGWARNING("Invalid path child with name '%s'", element.GetText()); + LOGWARNING("Invalid path child with name '{}'", element.GetText()); } } @@ -1519,7 +1519,7 @@ int CMapReader::ParseEnvironment() const auto getEnvironmentProperty = [&](JS::HandleValue val, const char* prop, auto&& out) { if (!Script::GetProperty(rq, val, prop, std::forward(out))) - LOGWARNING("CMapReader::ParseEnvironment() failed to get '%s' property", prop); + LOGWARNING("CMapReader::ParseEnvironment() failed to get '{}' property", prop); }; JS::RootedValue envObj(rq.cx); @@ -1618,7 +1618,7 @@ int CMapReader::ParseCamera() const auto getCameraProperty = [&](JS::HandleValue val, const char* prop, auto&& out) { if (!Script::GetProperty(rq, val, prop, std::forward(out))) - LOGWARNING("CMapReader::ParseCamera() failed to get '%s' property", prop); + LOGWARNING("CMapReader::ParseCamera() failed to get '{}' property", prop); }; JS::RootedValue cameraObj(rq.cx); diff --git a/source/graphics/ModelAbstract.cpp b/source/graphics/ModelAbstract.cpp index e451906618..c764399dcb 100644 --- a/source/graphics/ModelAbstract.cpp +++ b/source/graphics/ModelAbstract.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2025 Wildfire Games. +/* Copyright (C) 2026 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -67,7 +67,8 @@ void CModelAbstract::CalcSelectionBox() default: { m_SelectionBox.SetEmpty(); - //LOGWARNING("[ModelAbstract] Unrecognized selection shape type: %ld", m_CustomSelectionShape->m_Type); + // LOGWARNING("[ModelAbstract] Unrecognized selection shape type: {}", + // m_CustomSelectionShape->m_Type); debug_warn("[ModelAbstract] Unrecognized selection shape type"); } break; diff --git a/source/graphics/ObjectBase.cpp b/source/graphics/ObjectBase.cpp index b753d0fd6c..a18b39f4f3 100644 --- a/source/graphics/ObjectBase.cpp +++ b/source/graphics/ObjectBase.cpp @@ -915,7 +915,10 @@ bool CActorDef::Load(const VfsPath& pathname) else if (attr.Name == at_file) { if (attr.Value.empty()) - LOGWARNING("Empty actor file specified (file %s)", pathname.string8()); + { + LOGWARNING("Empty actor file specified (file {})", + pathname.string8()); + } file = attr.Value; } else if (attr.Name == at_inline) @@ -949,7 +952,10 @@ bool CActorDef::Load(const VfsPath& pathname) else { if (actor.GetChildNodes().size() > 0) - LOGWARNING("Actor definition refers to file but has children elements, they will be ignored (file %s)", pathname.string8()); + { + LOGWARNING("Actor definition refers to file but has children elements, they " + "will be ignored (file {})", pathname.string8()); + } // Open up an external file to load. // Don't crash hard when failures happen, but log them and continue diff --git a/source/graphics/ParticleEmitterType.cpp b/source/graphics/ParticleEmitterType.cpp index 656f50e7f6..49bab8843b 100644 --- a/source/graphics/ParticleEmitterType.cpp +++ b/source/graphics/ParticleEmitterType.cpp @@ -362,7 +362,7 @@ int CParticleEmitterType::GetVariableID(const std::string& name) if (name == "color.r") return VAR_COLOR_R; if (name == "color.g") return VAR_COLOR_G; if (name == "color.b") return VAR_COLOR_B; - LOGWARNING("Particle sets unknown variable '%s'", name.c_str()); + LOGWARNING("Particle sets unknown variable '{}'", name); return -1; } diff --git a/source/graphics/TerrainProperties.cpp b/source/graphics/TerrainProperties.cpp index 7ee58ca2ba..d890d43505 100644 --- a/source/graphics/TerrainProperties.cpp +++ b/source/graphics/TerrainProperties.cpp @@ -86,7 +86,7 @@ CTerrainPropertiesPtr CTerrainProperties::FromXML(const CTerrainPropertiesPtr& p } else { - LOGWARNING("TerrainProperties: Loading %s: Unexpected node %s\n", + LOGWARNING("TerrainProperties: Loading {}: Unexpected node {}\n", pathname.string8(), XeroFile.GetElementString(child.GetNodeName())); // Keep reading - typos shouldn't be showstoppers diff --git a/source/graphics/TerrainTextureManager.cpp b/source/graphics/TerrainTextureManager.cpp index 7a59134882..665a59b02a 100644 --- a/source/graphics/TerrainTextureManager.cpp +++ b/source/graphics/TerrainTextureManager.cpp @@ -82,7 +82,7 @@ CTerrainTextureEntry* CTerrainTextureManager::FindTexture(const CStr& tag_) if (textureEntry->GetTag() == tag) return textureEntry.get(); - LOGWARNING("CTerrainTextureManager: Couldn't find terrain %s using fallback texture", tag.c_str()); + LOGWARNING("CTerrainTextureManager: Couldn't find terrain {} using fallback texture", tag); // If the texture is not found, return a default texture. // This is a fallback texture, so it should not be used in the editor. diff --git a/source/gui/CGUI.cpp b/source/gui/CGUI.cpp index 29d998dd19..ef2099741e 100644 --- a/source/gui/CGUI.cpp +++ b/source/gui/CGUI.cpp @@ -871,7 +871,11 @@ void CGUI::Xeromyces_ReadObject(const XMBData& xmb, XMBElement element, IGUIObje if (!filename.empty()) { if (!directory.empty()) - LOGWARNING("GUI: Include element found with file name (%s) and directory name (%s). Only the file will be processed.", utf8_from_wstring(filename), utf8_from_wstring(directory)); + { + LOGWARNING("GUI: Include element found with file name ({}) and directory " + "name ({}). Only the file will be processed.", + utf8_from_wstring(filename), utf8_from_wstring(directory)); + } Paths.insert(filename); @@ -1048,7 +1052,10 @@ void CGUI::Xeromyces_ReadSprite(const XMBData& xmb, XMBElement element) CStr name = element.GetAttributes().GetNamedItem(xmb.GetAttributeID("name")); if (m_Sprites.find(name) != m_Sprites.end()) - LOGWARNING("GUI sprite name '%s' used more than once; first definition will be discarded", name.c_str()); + { + LOGWARNING("GUI sprite name '{}' used more than once; first definition will be discarded", + name); + } // shared_ptr to link the effect to every image, faster than copy. std::shared_ptr effects; @@ -1337,7 +1344,10 @@ void CGUI::Xeromyces_ReadIcon(const XMBData& xmb, XMBElement element) void CGUI::ReportMissingIcon(const CStr& name) const { if (m_MissingIconsReported.insert(name).second) - LOGWARNING("Trying to use an icon, imgleft or imgright-tag with an undefined icon (\"%s\").", name); + { + LOGWARNING("Trying to use an icon, imgleft or imgright-tag with an undefined icon (\"{}\").", + name); + } } void CGUI::Xeromyces_ReadTooltip(const XMBData& xmb, XMBElement element) diff --git a/source/gui/GUIStringConversions.cpp b/source/gui/GUIStringConversions.cpp index cfdd4440da..1409bcbead 100644 --- a/source/gui/GUIStringConversions.cpp +++ b/source/gui/GUIStringConversions.cpp @@ -82,20 +82,22 @@ bool CGUI::ParseString(const CGUI*, const CStrW& Value, CRect& Output) { if (stream.eof()) { - LOGWARNING("Too few CRect parameters (min %i). Your input: '%s'", NUM_COORDS, Value.ToUTF8().c_str()); + LOGWARNING("Too few CRect parameters (min {}). Your input: '{}'", NUM_COORDS, + Value.ToUTF8()); return false; } stream >> coords[i]; if ((stream.rdstate() & std::wstringstream::failbit) != 0) { - LOGWARNING("Unable to parse CRect parameters. Your input: '%s'", Value.ToUTF8().c_str()); + LOGWARNING("Unable to parse CRect parameters. Your input: '{}'", Value.ToUTF8()); return false; } } if (!stream.eof()) { - LOGWARNING("Too many CRect parameters (max %i). Your input: '%s'", NUM_COORDS, Value.ToUTF8().c_str()); + LOGWARNING("Too many CRect parameters (max {}). Your input: '{}'", NUM_COORDS, + Value.ToUTF8()); return false; } @@ -129,13 +131,14 @@ bool CGUI::ParseString(const CGUI*, const CStrW& Value, CSize2D& Output { if (stream.eof()) { - LOGWARNING("Too few CSize2D parameters (min %i). Your input: '%s'", NUM_COORDS, Value.ToUTF8().c_str()); + LOGWARNING("Too few CSize2D parameters (min {}). Your input: '{}'", NUM_COORDS, + Value.ToUTF8()); return false; } stream >> coords[i]; if ((stream.rdstate() & std::wstringstream::failbit) != 0) { - LOGWARNING("Unable to parse CSize2D parameters. Your input: '%s'", Value.ToUTF8().c_str()); + LOGWARNING("Unable to parse CSize2D parameters. Your input: '{}'", Value.ToUTF8()); return false; } } @@ -145,7 +148,8 @@ bool CGUI::ParseString(const CGUI*, const CStrW& Value, CSize2D& Output if (!stream.eof()) { - LOGWARNING("Too many CSize2D parameters (max %i). Your input: '%s'", NUM_COORDS, Value.ToUTF8().c_str()); + LOGWARNING("Too many CSize2D parameters (max {}). Your input: '{}'", NUM_COORDS, + Value.ToUTF8()); return false; } @@ -164,13 +168,14 @@ bool CGUI::ParseString(const CGUI*, const CStrW& Value, CVector2D& Ou { if (stream.eof()) { - LOGWARNING("Too few CVector2D parameters (min %i). Your input: '%s'", NUM_COORDS, Value.ToUTF8().c_str()); + LOGWARNING("Too few CVector2D parameters (min {}). Your input: '{}'", NUM_COORDS, + Value.ToUTF8()); return false; } stream >> coords[i]; if ((stream.rdstate() & std::wstringstream::failbit) != 0) { - LOGWARNING("Unable to parse CVector2D parameters. Your input: '%s'", Value.ToUTF8().c_str()); + LOGWARNING("Unable to parse CVector2D parameters. Your input: '{}'", Value.ToUTF8()); return false; } } @@ -180,7 +185,8 @@ bool CGUI::ParseString(const CGUI*, const CStrW& Value, CVector2D& Ou if (!stream.eof()) { - LOGWARNING("Too many CVector2D parameters (max %i). Your input: '%s'", NUM_COORDS, Value.ToUTF8().c_str()); + LOGWARNING("Too many CVector2D parameters (max {}). Your input: '{}'", NUM_COORDS, + Value.ToUTF8()); return false; } diff --git a/source/gui/ObjectBases/IGUIObject.cpp b/source/gui/ObjectBases/IGUIObject.cpp index 094ffff23f..01bf20a875 100644 --- a/source/gui/ObjectBases/IGUIObject.cpp +++ b/source/gui/ObjectBases/IGUIObject.cpp @@ -300,7 +300,10 @@ bool IGUIObject::ApplyStyle(const CStr& StyleName) if (SettingExists(p.first)) m_Settings.at(p.first)->FromString(p.second, true); else if (StyleName != "default") - LOGWARNING("GUI object has no setting \"%s\", but the style \"%s\" defines it", p.first, StyleName.c_str()); + { + LOGWARNING("GUI object has no setting \"{}\", but the style \"{}\" defines it", + p.first, StyleName); + } } return true; } diff --git a/source/gui/ObjectTypes/CChart.cpp b/source/gui/ObjectTypes/CChart.cpp index ee703cca7e..378f26307e 100644 --- a/source/gui/ObjectTypes/CChart.cpp +++ b/source/gui/ObjectTypes/CChart.cpp @@ -145,7 +145,10 @@ void CChart::UpdateSeries() CChartData& data = m_Series[i]; if (i < m_SeriesColor->m_Items.size() && !data.m_Color.ParseString(m_pGUI, m_SeriesColor->m_Items[i].GetOriginalString().ToUTF8(), 0)) - LOGWARNING("GUI: Error parsing 'series_color' (\"%s\")", utf8_from_wstring(m_SeriesColor->m_Items[i].GetOriginalString())); + { + LOGWARNING("GUI: Error parsing 'series_color' (\"{}\")", + utf8_from_wstring(m_SeriesColor->m_Items[i].GetOriginalString())); + } data.m_Points = m_SeriesSetting->m_Series[i]; } diff --git a/source/gui/Scripting/JSInterface_CGUISize.cpp b/source/gui/Scripting/JSInterface_CGUISize.cpp index d7a872b3e6..7597c324fe 100644 --- a/source/gui/Scripting/JSInterface_CGUISize.cpp +++ b/source/gui/Scripting/JSInterface_CGUISize.cpp @@ -195,7 +195,11 @@ bool CGUISimpleSetting::DoFromJSVal(const Script::Request& rq, JS::Han } if (JS_InstanceOf(rq.cx, obj, &JSI_GUISize::JSI_class, nullptr)) - ONCE(LOGWARNING("Assigning an GUISize to CGUISize is deprecated. Please use the object.size = {left:number, top:number, right:number, bottom:number} format instead. This support will be removed in a future version.")); + { + ONCE(LOGWARNING("Assigning an GUISize to CGUISize is deprecated. Please use the object.size = " + "{{left:number, top:number, right:number, bottom:number}} format instead. This support " + "will be removed in a future version.")); + } bool atLeastOnePropertySet{false}; CRect pixel{}; diff --git a/source/gui/SettingTypes/MouseEventMask.cpp b/source/gui/SettingTypes/MouseEventMask.cpp index d2c5f44047..09ac53b359 100644 --- a/source/gui/SettingTypes/MouseEventMask.cpp +++ b/source/gui/SettingTypes/MouseEventMask.cpp @@ -103,7 +103,7 @@ public: status = g_VFS->LoadFile(sourcePath, shapeFile, size); if (status != INFO::OK) { - LOGWARNING("Mouse event mask texture not found ('%s')", spec); + LOGWARNING("Mouse event mask texture not found ('{}')", spec); return nullptr; } Tex tex; @@ -188,6 +188,6 @@ bool CGUIMouseEventMask::DoFromString(const CStrW& Value) LOGERROR("Could not create shape for: %s", spec); } else - LOGWARNING("Unknown clickable shape: %s", spec); + LOGWARNING("Unknown clickable shape: {}", spec); return false; } diff --git a/source/lobby/XmppClient.cpp b/source/lobby/XmppClient.cpp index 688f50a85a..7a276c23da 100644 --- a/source/lobby/XmppClient.cpp +++ b/source/lobby/XmppClient.cpp @@ -1015,7 +1015,8 @@ bool XmppClient::Impl::handleIq(const gloox::IQ& iq) { if (iq.from().full() != m_xpartamuppId) { - LOGWARNING("XmppClient: Received game list response from unexpected sender: %s", iq.from().full()); + LOGWARNING("XmppClient: Received game list response from unexpected sender: {}", + iq.from().full()); return true; } @@ -1030,7 +1031,8 @@ bool XmppClient::Impl::handleIq(const gloox::IQ& iq) { if (iq.from().full() != m_echelonId) { - LOGWARNING("XmppClient: Received board list response from unexpected sender: %s", iq.from().full()); + LOGWARNING("XmppClient: Received board list response from unexpected sender: {}", + iq.from().full()); return true; } @@ -1061,7 +1063,8 @@ bool XmppClient::Impl::handleIq(const gloox::IQ& iq) { if (iq.from().full() != m_echelonId) { - LOGWARNING("XmppClient: Received profile response from unexpected sender: %s", iq.from().full()); + LOGWARNING("XmppClient: Received profile response from unexpected sender: {}", + iq.from().full()); return true; } diff --git a/source/network/tests/test_StunClient.h b/source/network/tests/test_StunClient.h index e56b7aa1d1..6eabeb7529 100644 --- a/source/network/tests/test_StunClient.h +++ b/source/network/tests/test_StunClient.h @@ -75,7 +75,7 @@ public: ENetAddress addr { ENET_HOST_ANY, ENET_PORT_ANY }; ENetHost* host = enet_host_create(&addr, 1, 1, 0, 0); StunClient::FindPublicIP(*host, ip, port); - LOGWARNING("%s %i", ip.c_str(), port); + LOGWARNING("{} {}", ip, port); CConfigDB::Shutdown(); } }; diff --git a/source/ps/CLogger.h b/source/ps/CLogger.h index c8344a6ec5..3eecac259d 100644 --- a/source/ps/CLogger.h +++ b/source/ps/CLogger.h @@ -38,7 +38,8 @@ extern CLogger* g_Logger; fmt::format(FMT_STRING(fmtstring), ## __VA_ARGS__).c_str(), false) #define LOGMESSAGERENDER(fmtstring, ...) g_Logger->WriteMessage( \ fmt::format(FMT_STRING(fmtstring), ## __VA_ARGS__).c_str(), true) -#define LOGWARNING(...) g_Logger->WriteWarning(fmt::sprintf(__VA_ARGS__).c_str()) +#define LOGWARNING(fmtstring, ...) g_Logger->WriteWarning( \ + fmt::format(FMT_STRING(fmtstring), ## __VA_ARGS__).c_str()) #define LOGERROR(...) g_Logger->WriteError (fmt::sprintf(__VA_ARGS__).c_str()) /** diff --git a/source/ps/CStrIntern.cpp b/source/ps/CStrIntern.cpp index 39d8f25384..eeee2a35ad 100644 --- a/source/ps/CStrIntern.cpp +++ b/source/ps/CStrIntern.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2025 Wildfire Games. +/* Copyright (C) 2026 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -33,7 +33,7 @@ public: CStrInternInternals(const char* str, size_t len) : data(str, str+len), hash(fnv_hash(str, len)) { -// LOGWARNING("New interned string '%s'", data.c_str()); +// LOGWARNING("New interned string '{}'", data); } CStrInternInternals(const CStrInternInternals& b) = default; diff --git a/source/ps/DllLoader.cpp b/source/ps/DllLoader.cpp index 7553f5f08f..5ce356a65b 100644 --- a/source/ps/DllLoader.cpp +++ b/source/ps/DllLoader.cpp @@ -205,7 +205,7 @@ void DllLoader::LogLoadError(const char* errors) LOGMESSAGE("DllLoader: {}", errors); break; case CLogger::Warning: - LOGWARNING("DllLoader: %s", errors); + LOGWARNING("DllLoader: {}", errors); break; case CLogger::Error: LOGERROR("DllLoader: %s", errors); diff --git a/source/ps/GameSetup/GameSetup.cpp b/source/ps/GameSetup/GameSetup.cpp index 8d5fb95d15..eef58c88e3 100644 --- a/source/ps/GameSetup/GameSetup.cpp +++ b/source/ps/GameSetup/GameSetup.cpp @@ -435,16 +435,16 @@ static void FixLocales() for (size_t i = 0; i < ARRAY_SIZE(LocaleEnvVars); i++) { if (char* envval = getenv(LocaleEnvVars[i])) - LOGWARNING(" %s=\"%s\"", LocaleEnvVars[i], envval); + LOGWARNING(" {}=\"{}\"", LocaleEnvVars[i], envval); else - LOGWARNING(" %s=\"(unset)\"", LocaleEnvVars[i]); + LOGWARNING(" {}=\"(unset)\"", LocaleEnvVars[i]); } // We should set LC_ALL since it overrides LANG if (setenv("LC_ALL", std::locale::classic().name().c_str(), 1)) debug_warn(L"Invalid locale settings, and unable to set LC_ALL env variable."); else - LOGWARNING("Setting LC_ALL env variable to: %s", getenv("LC_ALL")); + LOGWARNING("Setting LC_ALL env variable to: {}", getenv("LC_ALL")); } } #else diff --git a/source/ps/Hotkey.cpp b/source/ps/Hotkey.cpp index 3062a8dd8d..a6b6d17fee 100644 --- a/source/ps/Hotkey.cpp +++ b/source/ps/Hotkey.cpp @@ -119,7 +119,7 @@ static void LoadConfigBindings(CConfigDB& configDB) SDL_Scancode scancode = FindScancode(it->c_str()); if (!scancode) { - LOGWARNING("Hotkey mapping used invalid key '%s'", hotkey.c_str()); + LOGWARNING("Hotkey mapping used invalid key '{}'", hotkey); continue; } diff --git a/source/ps/Mod.cpp b/source/ps/Mod.cpp index a6a7feeaf5..f0d52b9c2c 100644 --- a/source/ps/Mod.cpp +++ b/source/ps/Mod.cpp @@ -99,7 +99,8 @@ bool LoadModJSON(const PIVFS& vfs, OsPath modsPath, OsPath mod, std::string& tex else { // Print a warning - we'll keep trying, which could have adverse effects. - LOGWARNING("Could not write external mod.json for zipped mod '%s'. The mod should be reinstalled.", mod.string8()); + LOGWARNING("Could not write external mod.json for zipped mod '{}'. The mod should be " + "reinstalled.", mod.string8()); } return true; } diff --git a/source/ps/Replay.cpp b/source/ps/Replay.cpp index 9247662190..c1b5e21389 100644 --- a/source/ps/Replay.cpp +++ b/source/ps/Replay.cpp @@ -186,8 +186,11 @@ void CheckReplayMods(const std::vector& replayMods) for (const Mod::ModData& data : replayMods) replayData.push_back(&data); if (!Mod::AreModsPlayCompatible(g_Mods.GetEnabledModsData(), replayData)) - LOGWARNING("Incompatible replay mods detected.\nThe mods of the replay are:\n%s\nThese mods are enabled:\n%s", - ModListToString(replayData), ModListToString(g_Mods.GetEnabledModsData())); + { + LOGWARNING("Incompatible replay mods detected.\nThe mods of the replay are:\n{}\n" + "These mods are enabled:\n{}", ModListToString(replayData), + ModListToString(g_Mods.GetEnabledModsData())); + } } } // anonymous namespace diff --git a/source/ps/SavedGame.cpp b/source/ps/SavedGame.cpp index 8750602906..23998e3b3c 100644 --- a/source/ps/SavedGame.cpp +++ b/source/ps/SavedGame.cpp @@ -306,7 +306,7 @@ JS::Value SavedGames::GetSavedGames(const Script::Interface& scriptInterface) if (!archiveReader) { // Triggered by e.g. the file being open in another program - LOGWARNING("Failed to read saved game '%s'", realPath.string8()); + LOGWARNING("Failed to read saved game '{}'", realPath.string8()); continue; // skip this file } diff --git a/source/ps/VideoMode.cpp b/source/ps/VideoMode.cpp index 4a6757af7f..e76858f999 100644 --- a/source/ps/VideoMode.cpp +++ b/source/ps/VideoMode.cpp @@ -380,7 +380,10 @@ bool CVideoMode::SetVideoMode(int w, int h, int bpp, bool fullscreen) else if (forceGLProfile == "core") profile = SDL_GL_CONTEXT_PROFILE_CORE; else if (forceGLProfile != "compatibility") - LOGWARNING("Unknown force GL profile '%s', compatibility profile is used", forceGLProfile.c_str()); + { + LOGWARNING("Unknown force GL profile '{}', compatibility profile is used", + forceGLProfile); + } if (forceGLMajorVersion < 1 || forceGLMinorVersion < 0) { @@ -434,7 +437,7 @@ bool CVideoMode::SetVideoMode(int w, int h, int bpp, bool fullscreen) setenv("MVK_CONFIG_LOG_LEVEL", "2", 1); if (SDL_Vulkan_LoadLibrary(fullPathToVulkanLibrary.c_str()) != 0) { - LOGWARNING("Failed to load %s.", fullPathToVulkanLibrary.c_str()); + LOGWARNING("Failed to load {}.", fullPathToVulkanLibrary); DowngradeBackendSettingAfterCreationFailure(); return SetVideoMode(w, h, bpp, fullscreen); } @@ -449,7 +452,7 @@ bool CVideoMode::SetVideoMode(int w, int h, int bpp, bool fullscreen) // SDL might fail to create a window in case of missing a Vulkan driver. if (m_Backend == Renderer::Backend::Backend::VULKAN) { - LOGWARNING("Failed to create a Vulkan window: %s", SDL_GetError()); + LOGWARNING("Failed to create a Vulkan window: {}", SDL_GetError()); DowngradeBackendSettingAfterCreationFailure(); return SetVideoMode(w, h, bpp, fullscreen); } @@ -458,7 +461,7 @@ bool CVideoMode::SetVideoMode(int w, int h, int bpp, bool fullscreen) if (fullscreen) { LOGWARNING("Failed to set the video mode to fullscreen for the chosen resolution " - "%dx%d:%d (\"%hs\"), falling back to windowed mode", + "{}x{}:{} (\"{}\"), falling back to windowed mode", w, h, bpp, SDL_GetError()); // Using default size for the window for now, as the attempted setting // could be as large, or larger than the screen size. diff --git a/source/ps/VisualReplay.cpp b/source/ps/VisualReplay.cpp index e3a0a71554..cec124e341 100644 --- a/source/ps/VisualReplay.cpp +++ b/source/ps/VisualReplay.cpp @@ -388,7 +388,7 @@ JS::Value VisualReplay::LoadReplayData(const Script::Interface& scriptInterface, if (type != "start") { - LOGWARNING("The replay %s doesn't begin with 'start'!", replayFile.string8().c_str()); + LOGWARNING("The replay {} doesn't begin with 'start'!", replayFile.string8()); SAFE_DELETE(replayStream); return JS::NullValue(); } diff --git a/source/renderer/PatchRData.cpp b/source/renderer/PatchRData.cpp index c90bb2c90d..7687dd3566 100644 --- a/source/renderer/PatchRData.cpp +++ b/source/renderer/PatchRData.cpp @@ -1141,7 +1141,10 @@ void CPatchRData::RenderBlends( // TODO: move enabling blend to XML. const CStrIntern shaderEffect = bestTex->GetMaterial().GetShaderEffect(materialPass); if (shaderEffect != str_terrain_base && shaderEffect != str_terrain_base_reflections && shaderEffect != str_terrain_base_wireframe) - ONCE(LOGWARNING("Shader effect '%s' doesn't support semi-transparent terrain rendering.", shaderEffect.c_str())); + { + ONCE(LOGWARNING("Shader effect '{}' doesn't support semi-transparent terrain " + "rendering.", shaderEffect.string())); + } layer.m_ShaderTech = g_Renderer.GetShaderManager().LoadEffect([](const CStrIntern shaderEffect) { if (shaderEffect == str_terrain_base) diff --git a/source/renderer/PostprocManager.cpp b/source/renderer/PostprocManager.cpp index 7ede6592aa..778664d405 100644 --- a/source/renderer/PostprocManager.cpp +++ b/source/renderer/PostprocManager.cpp @@ -201,14 +201,14 @@ void CPostprocManager::InitializePBR() if (m_Device->IsFramebufferFormatSupported(Renderer::Backend::Format::R32G32B32A32_SFLOAT)) m_FramebufferColorFormat = Renderer::Backend::Format::R32G32B32A32_SFLOAT; else - LOGWARNING("%s is unsupported", framebufferFormatName); + LOGWARNING("{} is unsupported", framebufferFormatName); } else if (framebufferFormatName == "r11g11b10") { if (m_Device->IsFramebufferFormatSupported(Renderer::Backend::Format::B10G11R11_UFLOAT)) m_FramebufferColorFormat = Renderer::Backend::Format::B10G11R11_UFLOAT; else - LOGWARNING("%s is unsupported", framebufferFormatName); + LOGWARNING("{} is unsupported", framebufferFormatName); } if (m_Device->GetCapabilities().computeShaders) @@ -887,7 +887,7 @@ void CPostprocManager::UpdateAntiAliasingTechnique() std::end(m_AllowedSampleCounts)) { m_MultisampleCount = std::min(4u, m_Device->GetCapabilities().maxSampleCount); - LOGWARNING("Wrong MSAA sample count: %s.", m_AAName.EscapeToPrintableASCII().c_str()); + LOGWARNING("Wrong MSAA sample count: {}.", m_AAName.EscapeToPrintableASCII()); } m_UsingMultisampleBuffer = true; CreateMultisampleBuffer(); @@ -1085,7 +1085,7 @@ void CPostprocManager::RecalculateSize(const uint32_t width, const uint32_t heig m_Scale = g_ConfigDB.Get("renderer.scale", m_Scale); if (m_Scale < 0.25f || m_Scale > 2.0f) { - LOGWARNING("Invalid renderer scale: %0.2f", m_Scale); + LOGWARNING("Invalid renderer scale: {:0.2f}", m_Scale); m_Scale = 1.0f; } m_UnscaledWidth = width; diff --git a/source/renderer/Renderer.cpp b/source/renderer/Renderer.cpp index 51c3b88c83..6c15d18c0b 100644 --- a/source/renderer/Renderer.cpp +++ b/source/renderer/Renderer.cpp @@ -856,7 +856,8 @@ void CRenderer::RenderBigScreenShot(const bool needsPresent) const int tileHeight{g_ConfigDB.Get("screenshot.tileheight", 256)}; if (tiles <= 0 || tileWidth <= 0 || tileHeight <= 0 || tileWidth * tiles % 4 != 0 || tileHeight * tiles % 4 != 0) { - LOGWARNING("Invalid big screenshot size: tiles=%d tileWidth=%d tileHeight=%d", tiles, tileWidth, tileHeight); + LOGWARNING("Invalid big screenshot size: tiles={} tileWidth={} tileHeight={}", tiles, + tileWidth, tileHeight); return; } @@ -864,7 +865,7 @@ void CRenderer::RenderBigScreenShot(const bool needsPresent) { LOGWARNING( "The window size is too small for a big screenshot, increase the" - " window size %dx%d or decrease the tile size %dx%d", + " window size {}x{} or decrease the tile size {}x{}", g_VideoMode.GetWindowWidth(), g_VideoMode.GetWindowHeight(), tileWidth, tileHeight); return; } diff --git a/source/renderer/RenderingOptions.cpp b/source/renderer/RenderingOptions.cpp index 033e69735b..5978149d97 100644 --- a/source/renderer/RenderingOptions.cpp +++ b/source/renderer/RenderingOptions.cpp @@ -71,7 +71,7 @@ RenderDebugMode RenderDebugModeEnum::FromString(const CStr8& name) if (name == str_RENDER_DEBUG_MODE_CUSTOM.c_str()) return RenderDebugMode::CUSTOM; - LOGWARNING("Unknown render debug mode %s", name.c_str()); + LOGWARNING("Unknown render debug mode {}", name); return RenderDebugMode::NONE; } diff --git a/source/renderer/backend/gl/Device.cpp b/source/renderer/backend/gl/Device.cpp index 8feb808f11..41baa038c4 100644 --- a/source/renderer/backend/gl/Device.cpp +++ b/source/renderer/backend/gl/Device.cpp @@ -205,8 +205,8 @@ void GLAD_API_PTR OnDebugMessage( } else { - LOGWARNING( - "OpenGL | %s: %s source: %s id %u: %s\n", debugSeverity.c_str(), debugType.c_str(), debugSource.c_str(), id, message); + LOGWARNING( "OpenGL | {}: {} source: {} id {}: {}\n", debugSeverity, debugType, + debugSource, id, message); } } diff --git a/source/renderer/backend/vulkan/Device.cpp b/source/renderer/backend/vulkan/Device.cpp index 3375377b7a..c57a748592 100644 --- a/source/renderer/backend/vulkan/Device.cpp +++ b/source/renderer/backend/vulkan/Device.cpp @@ -169,7 +169,7 @@ VKAPI_ATTR VkBool32 VKAPI_CALL DebugCallback( return (hideRule.flags & messageType) && message.find(hideRule.pattern) != std::string_view::npos; }); if (it == std::end(hideRules)) - LOGWARNING("Vulkan: %s", callbackData->pMessage); + LOGWARNING("Vulkan: {}", callbackData->pMessage); else if (!it->skip) LOGMESSAGE("Vulkan: {}", callbackData->pMessage); } @@ -403,7 +403,7 @@ std::unique_ptr CDevice::Create(SDL_Window* window) return availableDevice.index == static_cast(deviceIndexOverride); }); if (chosenDeviceIt == device->m_AvailablePhysicalDevices.end()) - LOGWARNING("Device with override index %d not found.", deviceIndexOverride); + LOGWARNING("Device with override index {} not found.", deviceIndexOverride); } if (chosenDeviceIt == device->m_AvailablePhysicalDevices.end()) { diff --git a/source/scriptinterface/Interface.cpp b/source/scriptinterface/Interface.cpp index 168764c535..8dfd16fa5d 100644 --- a/source/scriptinterface/Interface.cpp +++ b/source/scriptinterface/Interface.cpp @@ -196,7 +196,7 @@ bool warn(JSContext* cx, unsigned int argc, JS::Value* vp) std::wstring str; if (!Script::FromJSVal(rq, args[0], str)) return false; - LOGWARNING("%s", utf8_from_wstring(str)); + LOGWARNING("{}", utf8_from_wstring(str)); args.rval().setUndefined(); return true; } diff --git a/source/simulation2/Simulation2.cpp b/source/simulation2/Simulation2.cpp index 4b9dc9c15b..a2ab6a0c93 100644 --- a/source/simulation2/Simulation2.cpp +++ b/source/simulation2/Simulation2.cpp @@ -361,7 +361,10 @@ void CSimulation2Impl::InitRNGSeedSimulation() Script::Request rq(m_ComponentManager.GetScriptInterface()); if (!Script::HasProperty(rq, m_MapSettings, "Seed") || !Script::GetProperty(rq, m_MapSettings, "Seed", seed)) - LOGWARNING("CSimulation2Impl::InitRNGSeedSimulation: No seed value specified - using %d", seed); + { + LOGWARNING("CSimulation2Impl::InitRNGSeedSimulation: No seed value specified - using {}", + seed); + } m_ComponentManager.SetRNGSeed(seed); } @@ -372,7 +375,9 @@ void CSimulation2Impl::InitRNGSeedAI() Script::Request rq(m_ComponentManager.GetScriptInterface()); if (!Script::HasProperty(rq, m_MapSettings, "AISeed") || !Script::GetProperty(rq, m_MapSettings, "AISeed", seed)) - LOGWARNING("CSimulation2Impl::InitRNGSeedAI: No seed value specified - using %d", seed); + { + LOGWARNING("CSimulation2Impl::InitRNGSeedAI: No seed value specified - using {}", seed); + } CmpPtr cmpAIManager(m_SimContext, SYSTEM_ENTITY); if (cmpAIManager) @@ -640,7 +645,7 @@ void CSimulation2Impl::DumpState() if (!DirectoryExists(m_OOSLogPath)) { - LOGWARNING("OOS-log directory %s was deleted, creating it again.", m_OOSLogPath.string8().c_str()); + LOGWARNING("OOS-log directory {} was deleted, creating it again.", m_OOSLogPath.string8()); CreateDirectories(m_OOSLogPath, 0700); } diff --git a/source/simulation2/components/CCmpCinemaManager.cpp b/source/simulation2/components/CCmpCinemaManager.cpp index f6193d779e..541fd64e84 100644 --- a/source/simulation2/components/CCmpCinemaManager.cpp +++ b/source/simulation2/components/CCmpCinemaManager.cpp @@ -143,7 +143,7 @@ public: { if (m_Paths.find(path.GetName()) != m_Paths.end()) { - LOGWARNING("Cinema path with name '%s' already exists", path.GetName().ToUTF8()); + LOGWARNING("Cinema path with name '{}' already exists", path.GetName().ToUTF8()); return; } m_Paths[path.GetName()] = path; @@ -153,7 +153,7 @@ public: { if (!HasPath(name)) { - LOGWARNING("Cinema path with name '%s' doesn't exist", name.ToUTF8()); + LOGWARNING("Cinema path with name '{}' doesn't exist", name.ToUTF8()); return; } m_PathQueue.remove_if([name](const CCinemaPath& path) { return path.GetName() == name; }); @@ -179,7 +179,7 @@ public: { if (!HasPath(name)) { - LOGWARNING("Cinema path with name '%s' doesn't exist", name.ToUTF8()); + LOGWARNING("Cinema path with name '{}' doesn't exist", name.ToUTF8()); return; } m_PathQueue.push_back(m_Paths[name]); diff --git a/source/simulation2/components/CCmpRangeManager.cpp b/source/simulation2/components/CCmpRangeManager.cpp index 89f53c065d..89ad96b510 100644 --- a/source/simulation2/components/CCmpRangeManager.cpp +++ b/source/simulation2/components/CCmpRangeManager.cpp @@ -1618,12 +1618,18 @@ public: { // Min range must be non-negative. if (minRange < entity_pos_t::Zero()) - LOGWARNING("CCmpRangeManager: Invalid min range %f in query for entity %u", minRange.ToDouble(), source); + { + LOGWARNING("CCmpRangeManager: Invalid min range {:f} in query for entity {}", + minRange.ToDouble(), source); + } // Max range must be non-negative, or else ALWAYS_IN_RANGE. // TODO add NEVER_IN_RANGE. if (maxRange < entity_pos_t::Zero() && maxRange != ALWAYS_IN_RANGE) - LOGWARNING("CCmpRangeManager: Invalid max range %f in query for entity %u", maxRange.ToDouble(), source); + { + LOGWARNING("CCmpRangeManager: Invalid max range {:f} in query for entity {}", + maxRange.ToDouble(), source); + } CmpPtr cmpOwnership(GetSimContext(), source); @@ -1663,7 +1669,7 @@ public: q.ownersMask |= CalcOwnerMask(owners[i]); if (q.ownersMask == 0) - LOGWARNING("CCmpRangeManager: No owners in query for entity %u", source); + LOGWARNING("CCmpRangeManager: No owners in query for entity {}", source); q.interface = requiredInterface; q.flagsMask = flagsMask; @@ -1826,7 +1832,7 @@ public: if (identifier == "injured") return FlagMasks::Injured; - LOGWARNING("CCmpRangeManager: Invalid flag identifier %s", identifier.c_str()); + LOGWARNING("CCmpRangeManager: Invalid flag identifier {}", identifier); return FlagMasks::None; } @@ -1841,7 +1847,10 @@ public: std::uint8_t flag = GetEntityFlagMask(identifier); if (flag == FlagMasks::None) - LOGWARNING("CCmpRangeManager: Invalid flag identifier %s for entity %u", identifier.c_str(), ent); + { + LOGWARNING("CCmpRangeManager: Invalid flag identifier {} for entity {}", identifier, + ent); + } else it->second.SetFlag(flag, value); } diff --git a/source/simulation2/helpers/CinemaPath.cpp b/source/simulation2/helpers/CinemaPath.cpp index 51f6b35567..ab79ef8975 100644 --- a/source/simulation2/helpers/CinemaPath.cpp +++ b/source/simulation2/helpers/CinemaPath.cpp @@ -57,7 +57,7 @@ CCinemaPath::CCinemaPath(const CCinemaData& data, const TNSpline& spline, const DistModePtr = &CCinemaPath::EaseOutIn; else { - LOGWARNING("Cinematic mode not found for '%s'", data.m_Mode.ToUTF8().c_str()); + LOGWARNING("Cinematic mode not found for '{}'", data.m_Mode.ToUTF8()); DistModePtr = &CCinemaPath::EaseInOut; } @@ -73,13 +73,14 @@ CCinemaPath::CCinemaPath(const CCinemaData& data, const TNSpline& spline, const DistStylePtr = &CCinemaPath::EaseSine; else { - LOGWARNING("Cinematic style not found for '%s'", data.m_Style.ToUTF8().c_str()); + LOGWARNING("Cinematic style not found for '{}'", data.m_Style.ToUTF8()); DistStylePtr = &CCinemaPath::EaseDefault; } if (m_Timescale <= fixed::FromInt(0)) { - LOGWARNING("Invalid cinema path timescale specified: %f. It must be greater than 0.", m_Timescale.ToFloat()); + LOGWARNING("Invalid cinema path timescale specified: {:f}. It must be greater than 0.", + m_Timescale.ToFloat()); m_Timescale = fixed::FromInt(1); } } @@ -117,7 +118,10 @@ const CStrW& CCinemaPath::GetName() const void CCinemaPath::SetTimescale(fixed scale) { if (scale <= fixed::FromInt(0)) - LOGWARNING("Invalid cinema path timescale specified: %f. It must be greater than 0.", scale.ToFloat()); + { + LOGWARNING("Invalid cinema path timescale specified: {:f}. It must be greater than 0.", + scale.ToFloat()); + } else m_Timescale = scale; } diff --git a/source/simulation2/helpers/Pathfinding.cpp b/source/simulation2/helpers/Pathfinding.cpp index 6b11d6ea5c..659ddd3cf7 100644 --- a/source/simulation2/helpers/Pathfinding.cpp +++ b/source/simulation2/helpers/Pathfinding.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2025 Wildfire Games. +/* Copyright (C) 2026 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -166,7 +166,7 @@ PathfinderPassability::PathfinderPassability(pass_class_t mask, const CParamNode // If clearance isn't an integer number of navcells then we'll // probably get weird behaviour when expanding the navcell grid // by clearance, vs expanding static obstructions by clearance - LOGWARNING("Pathfinder passability class has clearance %f, should be multiple of %f", + LOGWARNING("Pathfinder passability class has clearance {:f}, should be multiple of {:f}", m_Clearance.ToFloat(), Pathfinding::NAVCELL_SIZE.ToFloat()); }*/ } diff --git a/source/simulation2/system/ParamNode.cpp b/source/simulation2/system/ParamNode.cpp index 8be12dfa4c..90ef45ffad 100644 --- a/source/simulation2/system/ParamNode.cpp +++ b/source/simulation2/system/ParamNode.cpp @@ -140,7 +140,7 @@ void CParamNode::ApplyLayer(const XMBData& xmb, const XMBElement& element, const else if (attr.Value == "mul_round") op = MUL_ROUND; else - LOGWARNING("Invalid op '%ls'", attr.Value); + LOGWARNING("Invalid op '{}'", attr.Value); } } for (XMBAttribute attr : element.GetAttributes()) @@ -174,7 +174,7 @@ void CParamNode::ApplyLayer(const XMBData& xmb, const XMBElement& element, const sourceIdentifier ? (" in '" + utf8_from_wstring(sourceIdentifier) + "'") : ""}; LOGWARNING("[ParamNode] Could not remove token " - "'%s' from node '%s'%s; not present in " + "'{}' from node '{}'{}; not present in " "list nor inherited (possible typo?)", std::string_view{newToken}.substr(1), name, identifier); diff --git a/source/simulation2/system/TurnManager.cpp b/source/simulation2/system/TurnManager.cpp index ab833958ba..84ace36bf0 100644 --- a/source/simulation2/system/TurnManager.cpp +++ b/source/simulation2/system/TurnManager.cpp @@ -226,7 +226,7 @@ void CTurnManager::AddCommand(int client, int player, JS::HandleValue data, turn // which is possible when cheats are enabled. Report & ignore. // It seems a bad idea to error out too badly here: // nefarious clients could try and send broken commands to DOS. - LOGWARNING("Received command for invalid turn %i (current turn is %i)", turn, m_CurrentTurn); + LOGWARNING("Received command for invalid turn {} (current turn is {})", turn, m_CurrentTurn); return; } diff --git a/source/soundmanager/scripting/SoundGroup.cpp b/source/soundmanager/scripting/SoundGroup.cpp index be22c4cadb..e56847aab8 100644 --- a/source/soundmanager/scripting/SoundGroup.cpp +++ b/source/soundmanager/scripting/SoundGroup.cpp @@ -232,7 +232,10 @@ void CSoundGroup::UploadPropertiesAndPlay([[maybe_unused]] size_t index, itemRollOff = 0; if (sndData->IsStereo()) - LOGWARNING("OpenAL: stereo sounds can't be positioned: %s", sndData->GetFileName().string8()); + { + LOGWARNING("OpenAL: stereo sounds can't be positioned: {}", + sndData->GetFileName().string8()); + } hSound->SetLocation(CVector3D(itemDist * sin(offset), 0, -itemDist * cos(offset))); hSound->SetRollOff(itemRollOff, m_MinDist, m_MaxDist);