diff options
author | memchr <[email protected]> | 2023-09-20 07:26:20 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2023-09-20 08:26:20 +0100 |
commit | 6594b50e57935dd66930ccd35dba7a1b4131399d (patch) | |
tree | 17d4fa7aabf0e447c7171346c5b851c999093149 /src/debug/HyprDebugOverlay.cpp | |
parent | d8d0cd75c2db16a14086e1d5119ed937a60c701e (diff) | |
download | Hyprland-6594b50e57935dd66930ccd35dba7a1b4131399d.tar.gz Hyprland-6594b50e57935dd66930ccd35dba7a1b4131399d.zip |
logging/format: use std::format_string to catch formatting string errors at compile time (#3377)
* fix(log): use constexpr format string
* deprecate getFormat
Diffstat (limited to 'src/debug/HyprDebugOverlay.cpp')
-rw-r--r-- | src/debug/HyprDebugOverlay.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/debug/HyprDebugOverlay.cpp b/src/debug/HyprDebugOverlay.cpp index 4eb14cef..741f6e18 100644 --- a/src/debug/HyprDebugOverlay.cpp +++ b/src/debug/HyprDebugOverlay.cpp @@ -132,7 +132,7 @@ int CHyprMonitorDebugOverlay::draw(int offset) { yOffset += 17; cairo_move_to(g_pDebugOverlay->m_pCairo, 0, yOffset); - text = getFormat("{} FPS", (int)FPS); + text = std::format("{} FPS", (int)FPS); cairo_show_text(g_pDebugOverlay->m_pCairo, text.c_str()); cairo_text_extents(g_pDebugOverlay->m_pCairo, text.c_str(), &cairoExtents); if (cairoExtents.width > maxX) @@ -143,7 +143,7 @@ int CHyprMonitorDebugOverlay::draw(int offset) { yOffset += 11; cairo_move_to(g_pDebugOverlay->m_pCairo, 0, yOffset); - text = getFormat("Avg Frametime: {:.2f}ms (var {:.2f}ms)", avgFrametime, varFrametime); + text = std::format("Avg Frametime: {:.2f}ms (var {:.2f}ms)", avgFrametime, varFrametime); cairo_show_text(g_pDebugOverlay->m_pCairo, text.c_str()); cairo_text_extents(g_pDebugOverlay->m_pCairo, text.c_str(), &cairoExtents); if (cairoExtents.width > maxX) @@ -151,7 +151,7 @@ int CHyprMonitorDebugOverlay::draw(int offset) { yOffset += 11; cairo_move_to(g_pDebugOverlay->m_pCairo, 0, yOffset); - text = getFormat("Avg Rendertime: {:.2f}ms (var {:.2f}ms)", avgRenderTime, varRenderTime); + text = std::format("Avg Rendertime: {:.2f}ms (var {:.2f}ms)", avgRenderTime, varRenderTime); cairo_show_text(g_pDebugOverlay->m_pCairo, text.c_str()); cairo_text_extents(g_pDebugOverlay->m_pCairo, text.c_str(), &cairoExtents); if (cairoExtents.width > maxX) @@ -159,7 +159,7 @@ int CHyprMonitorDebugOverlay::draw(int offset) { yOffset += 11; cairo_move_to(g_pDebugOverlay->m_pCairo, 0, yOffset); - text = getFormat("Avg Rendertime (No Overlay): {:.2f}ms (var {:.2f}ms)", avgRenderTimeNoOverlay, varRenderTimeNoOverlay); + text = std::format("Avg Rendertime (No Overlay): {:.2f}ms (var {:.2f}ms)", avgRenderTimeNoOverlay, varRenderTimeNoOverlay); cairo_show_text(g_pDebugOverlay->m_pCairo, text.c_str()); cairo_text_extents(g_pDebugOverlay->m_pCairo, text.c_str(), &cairoExtents); if (cairoExtents.width > maxX) @@ -167,7 +167,7 @@ int CHyprMonitorDebugOverlay::draw(int offset) { yOffset += 11; cairo_move_to(g_pDebugOverlay->m_pCairo, 0, yOffset); - text = getFormat("Avg Anim Tick: {:.2f}ms (var {:.2f}ms) ({:.2f} TPS)", avgAnimMgrTick, varAnimMgrTick, 1.0 / (avgAnimMgrTick / 1000.0)); + text = std::format("Avg Anim Tick: {:.2f}ms (var {:.2f}ms) ({:.2f} TPS)", avgAnimMgrTick, varAnimMgrTick, 1.0 / (avgAnimMgrTick / 1000.0)); cairo_show_text(g_pDebugOverlay->m_pCairo, text.c_str()); cairo_text_extents(g_pDebugOverlay->m_pCairo, text.c_str(), &cairoExtents); if (cairoExtents.width > maxX) |