From 6594b50e57935dd66930ccd35dba7a1b4131399d Mon Sep 17 00:00:00 2001 From: memchr <118117622+memchr@users.noreply.github.com> Date: Wed, 20 Sep 2023 07:26:20 +0000 Subject: logging/format: use std::format_string to catch formatting string errors at compile time (#3377) * fix(log): use constexpr format string * deprecate getFormat --- src/config/ConfigManager.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/config/ConfigManager.cpp') diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index a487734d..5cad82ff 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -1097,7 +1097,7 @@ void CConfigManager::updateBlurredLS(const std::string& name, const bool forceBl for (auto& lsl : m->m_aLayerSurfaceLayers) { for (auto& ls : lsl) { if (BYADDRESS) { - if (getFormat("0x{:x}", (uintptr_t)ls.get()) == matchName) + if (std::format("0x{:x}", (uintptr_t)ls.get()) == matchName) ls->forceBlur = forceBlur; } else if (ls->szNamespace == matchName) ls->forceBlur = forceBlur; @@ -1206,7 +1206,7 @@ void CConfigManager::handleSource(const std::string& command, const std::string& if (auto r = glob(absolutePath(rawpath, configCurrentPath).c_str(), GLOB_TILDE, nullptr, glob_buf.get()); r != 0) { parseError = std::format("source= globbing error: {}", r == GLOB_NOMATCH ? "found no match" : GLOB_ABORTED ? "read error" : "out of memory"); - Debug::log(ERR, parseError); + Debug::log(ERR, "{}", parseError); return; } @@ -1942,7 +1942,7 @@ std::vector CConfigManager::getMatchingRules(SLayerSurface* pLS) { for (auto& lr : m_dLayerRules) { if (lr.targetNamespace.find("address:0x") == 0) { - if (getFormat("address:0x{:x}", (uintptr_t)pLS) != lr.targetNamespace) + if (std::format("address:0x{:x}", (uintptr_t)pLS) != lr.targetNamespace) continue; } else { std::regex NSCHECK(lr.targetNamespace); -- cgit v1.2.3