From 1d3f62a09c83aad70d1a79a490339c65bfb7b2eb Mon Sep 17 00:00:00 2001 From: Marco Rubin <20150305+Rubo3@users.noreply.github.com> Date: Thu, 25 Aug 2022 12:15:02 +0200 Subject: [PATCH] Fix ImGui::Text() format strings (#41) * Fix format string --- src/Cafe/HW/Latte/Core/LatteShaderCache.cpp | 6 +++--- src/Cafe/HW/Latte/Renderer/Vulkan/VKRMemoryManager.cpp | 4 ++-- src/Cafe/OS/libs/swkbd/swkbd.cpp | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Cafe/HW/Latte/Core/LatteShaderCache.cpp b/src/Cafe/HW/Latte/Core/LatteShaderCache.cpp index 3bc6699b..b7aedad1 100644 --- a/src/Cafe/HW/Latte/Core/LatteShaderCache.cpp +++ b/src/Cafe/HW/Latte/Core/LatteShaderCache.cpp @@ -432,7 +432,7 @@ void LatteShaderCache_ShowProgress(const std::function & loadUpdateF } ImGui::SetCursorPosX(width - ImGui::CalcTextSize(text.c_str()).x / 2); - ImGui::Text(text.c_str()); + ImGui::Text("%s", text.c_str()); float percentLoaded; if(isPipelines) @@ -446,7 +446,7 @@ void LatteShaderCache_ShowProgress(const std::function & loadUpdateF else text = fmt::format("{}/{} ({}%%)", g_shaderCacheLoaderState.loadedShaderFiles, g_shaderCacheLoaderState.shaderFileCount, (int)(percentLoaded * 100)); ImGui::SetCursorPosX(width - ImGui::CalcTextSize(text.c_str()).x / 2); - ImGui::Text(text.c_str()); + ImGui::Text("%s", text.c_str()); ImGui::End(); } ImGui::PopFont(); @@ -775,4 +775,4 @@ void LatteShaderCache_handleDeprecatedCacheFiles(fs::path pathGeneric, fs::path fs::remove(pathGenericPre1_25_0, ec); } } -} \ No newline at end of file +} diff --git a/src/Cafe/HW/Latte/Renderer/Vulkan/VKRMemoryManager.cpp b/src/Cafe/HW/Latte/Renderer/Vulkan/VKRMemoryManager.cpp index 93021fd8..95a04315 100644 --- a/src/Cafe/HW/Latte/Renderer/Vulkan/VKRMemoryManager.cpp +++ b/src/Cafe/HW/Latte/Renderer/Vulkan/VKRMemoryManager.cpp @@ -531,6 +531,6 @@ void VKRMemoryManager::appendOverlayHeapDebugInfo() uint32 heapSizeMB = (heapSize / 1024 / 1024); uint32 allocatedBytesMB = (allocatedBytes / 1024 / 1024); - ImGui::Text(fmt::format("{0:#08x} Size: {1}MB/{2}MB", itr.first, allocatedBytesMB, heapSizeMB).c_str()); + ImGui::Text("%s", fmt::format("{0:#08x} Size: {1}MB/{2}MB", itr.first, allocatedBytesMB, heapSizeMB).c_str()); } -} \ No newline at end of file +} diff --git a/src/Cafe/OS/libs/swkbd/swkbd.cpp b/src/Cafe/OS/libs/swkbd/swkbd.cpp index 1a09ec58..b7ad80f4 100644 --- a/src/Cafe/OS/libs/swkbd/swkbd.cpp +++ b/src/Cafe/OS/libs/swkbd/swkbd.cpp @@ -390,7 +390,7 @@ void swkbd_render(bool mainWindow) ImGui::PushFont(font); if (ImGui::Begin("Keyboard Input", nullptr, kPopupFlags)) { - ImGui::Text(_utf8WrapperPtr(ICON_FA_KEYBOARD)); + ImGui::Text("%s", _utf8WrapperPtr(ICON_FA_KEYBOARD)); ImGui::SameLine(70); auto text = boost::nowide::narrow(fmt::format(L"{}", swkbdInternalState->formStringBuffer)); @@ -647,4 +647,4 @@ namespace swkbd osLib_addFunction("swkbd", "SwkbdIsNeedCalcSubThreadFont__3RplFv", swkbdExport_SwkbdIsNeedCalcSubThreadFont); osLib_addFunction("swkbd", "SwkbdIsNeedCalcSubThreadPredict__3RplFv", swkbdExport_SwkbdIsNeedCalcSubThreadPredict); } -} \ No newline at end of file +}