From ae7b14887b076ecf1daf66ff210f86c911556926 Mon Sep 17 00:00:00 2001 From: Pokechu22 Date: Tue, 11 Oct 2022 20:10:32 -0700 Subject: [PATCH] Remove varargs support from LOG_VULKAN_ERROR Nothing currently uses it. It could theoretically be replaced with fmt support, but I don't think the LOG_VULKAN_ERROR macro is that useful and it'd be better to replace it with regular logging instead. --- Source/Core/VideoBackends/Vulkan/VulkanLoader.cpp | 13 +++---------- Source/Core/VideoBackends/Vulkan/VulkanLoader.h | 6 +++--- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/Source/Core/VideoBackends/Vulkan/VulkanLoader.cpp b/Source/Core/VideoBackends/Vulkan/VulkanLoader.cpp index 6b1f688e78..c554f07314 100644 --- a/Source/Core/VideoBackends/Vulkan/VulkanLoader.cpp +++ b/Source/Core/VideoBackends/Vulkan/VulkanLoader.cpp @@ -205,17 +205,10 @@ const char* VkResultToString(VkResult res) } void LogVulkanResult(Common::Log::LogLevel level, const char* func_name, VkResult res, - const char* msg, ...) + const char* msg) { - std::va_list ap; - va_start(ap, msg); - std::string real_msg = StringFromFormatV(msg, ap); - va_end(ap); - - real_msg = fmt::format("({}) {} ({}: {})", func_name, real_msg, static_cast(res), - VkResultToString(res)); - - GENERIC_LOG_FMT(Common::Log::LogType::VIDEO, level, "{}", real_msg); + GENERIC_LOG_FMT(Common::Log::LogType::VIDEO, level, "({}) {} ({}: {})", func_name, msg, + static_cast(res), VkResultToString(res)); } } // namespace Vulkan diff --git a/Source/Core/VideoBackends/Vulkan/VulkanLoader.h b/Source/Core/VideoBackends/Vulkan/VulkanLoader.h index c20ea698d3..2d6843953b 100644 --- a/Source/Core/VideoBackends/Vulkan/VulkanLoader.h +++ b/Source/Core/VideoBackends/Vulkan/VulkanLoader.h @@ -48,9 +48,9 @@ void UnloadVulkanLibrary(); const char* VkResultToString(VkResult res); void LogVulkanResult(Common::Log::LogLevel level, const char* func_name, VkResult res, - const char* msg, ...); + const char* msg); -#define LOG_VULKAN_ERROR(res, ...) \ - LogVulkanResult(Common::Log::LogLevel::LERROR, __func__, res __VA_OPT__(, ) __VA_ARGS__) +#define LOG_VULKAN_ERROR(res, msg) \ + LogVulkanResult(Common::Log::LogLevel::LERROR, __func__, res, msg) } // namespace Vulkan