From b22df17bb536db9f179c10a53af0dba82b01a5e7 Mon Sep 17 00:00:00 2001 From: David Given Date: Wed, 17 Sep 2025 14:28:41 +0200 Subject: [PATCH] Fix some fmt strings. --- src/gui2/abstractsectorview.cc | 4 ++-- src/gui2/build.py | 3 +-- src/gui2/configview.cc | 4 ++-- src/gui2/globals.h | 2 +- src/gui2/summaryview.cc | 6 +++--- 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/gui2/abstractsectorview.cc b/src/gui2/abstractsectorview.cc index d1d38d4d..cf506e02 100644 --- a/src/gui2/abstractsectorview.cc +++ b/src/gui2/abstractsectorview.cc @@ -122,7 +122,7 @@ void AbstractSectorView::drawContent() textSize.x / 2, ImGui::GetCursorPosY() + rowHeight / 2 - textSize.y / 2}); - ImGui::Text("{}", text.c_str()); + ImGui::Text("%s", text.c_str()); } for (unsigned sectorId = minSector; sectorId <= maxSector; @@ -172,7 +172,7 @@ void AbstractSectorView::drawContent() { ImGui::PopFont(); }; - ImGui::SetItemTooltip( + ImGui::SetItemTooltip("%s", fmt::format("Physical: c{}h{}s{}\n" "Logical: c{}h{}s{}\n" "Size: {} bytes\n" diff --git a/src/gui2/build.py b/src/gui2/build.py index 958f2a41..ff9e7c91 100644 --- a/src/gui2/build.py +++ b/src/gui2/build.py @@ -129,8 +129,7 @@ cxxlibrary( cxxlibrary( name="libpl", - srcs=sources_from("dep/pattern-language/lib/source") - + sources_from("dep/pattern-language/cli/source"), + srcs=sources_from("dep/pattern-language/lib/source"), hdrs=( headers_from("dep/pattern-language/lib/include") | headers_from("dep/pattern-language/generators/include") diff --git a/src/gui2/configview.cc b/src/gui2/configview.cc index fcf74b0f..04a656e8 100644 --- a/src/gui2/configview.cc +++ b/src/gui2/configview.cc @@ -44,7 +44,7 @@ static void emitOptions(DynamicSetting& setting, ImGui::TableNextRow(); ImGui::TableNextColumn(); ImGui::AlignTextToFramePadding(); - ImGui::TextWrapped("{}", wolv::util::capitalizeString(it.comment())); + ImGui::TextWrapped("%s", wolv::util::capitalizeString(it.comment()).c_str()); ImGui::TableNextColumn(); ImGui::SetNextItemWidth(-FLT_MIN); @@ -117,7 +117,7 @@ static void emitOptions(DynamicSetting& setting, ImGui::TableNextRow(); ImGui::TableNextColumn(); ImGui::AlignTextToFramePadding(); - ImGui::TextWrapped("{}", comment); + ImGui::TextWrapped("%s", comment.c_str()); ImGui::TableNextColumn(); ImGui::SetNextItemWidth(-FLT_MIN); diff --git a/src/gui2/globals.h b/src/gui2/globals.h index 90b426f2..5a19a3ba 100644 --- a/src/gui2/globals.h +++ b/src/gui2/globals.h @@ -13,7 +13,7 @@ namespace ImGui { static inline void Text(std::string text) { - ImGui::Text("{}", text.c_str()); + ImGui::Text("%s", text.c_str()); } } diff --git a/src/gui2/summaryview.cc b/src/gui2/summaryview.cc index 278e15f4..358cc777 100644 --- a/src/gui2/summaryview.cc +++ b/src/gui2/summaryview.cc @@ -193,7 +193,7 @@ void SummaryView::drawContent() { ImGui::PopFont(); }; - ImGui::SetItemTooltip(tooltip.c_str()); + ImGui::SetItemTooltip("%s", tooltip.c_str()); } } } @@ -299,7 +299,7 @@ void SummaryView::drawContent() { ImGui::PopFont(); }; - ImGui::SetItemTooltip(tooltip.c_str()); + ImGui::SetItemTooltip("%s", tooltip.c_str()); } } } @@ -331,4 +331,4 @@ void SummaryView::drawContent() } } } -} \ No newline at end of file +}