From 8c973db737e1d74ff7bf07580bb5ed309fe49e64 Mon Sep 17 00:00:00 2001 From: Maschell Date: Sun, 29 Mar 2026 12:42:20 +0200 Subject: [PATCH] Fix compiling with debug logs --- source/ShellCommands.cpp | 2 +- source/hooks.cpp | 6 +++--- source/utils/utils.cpp | 2 +- source/utils/utils.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/source/ShellCommands.cpp b/source/ShellCommands.cpp index db2d1b3..e3cafb3 100644 --- a/source/ShellCommands.cpp +++ b/source/ShellCommands.cpp @@ -607,7 +607,7 @@ namespace ShellCommands { const auto &hookList = plugin.getPluginLinkInformation().getHookDataList(); OSReport("WUPS Hooks: %d\n", hookList.size()); for (const auto &hook : hookList) { - OSReport("\t- %p - %s\n", hook.getFunctionPointer(), hookNameToString(hook.getType()).c_str()); + OSReport("\t- %p - %s\n", hook.getFunctionPointer(), hookNameToString(hook.getType())); } OSReport("\n"); const auto &buttonCombos = plugin.GetButtonComboData(); diff --git a/source/hooks.cpp b/source/hooks.cpp index cf73d32..b2e4784 100644 --- a/source/hooks.cpp +++ b/source/hooks.cpp @@ -22,7 +22,7 @@ void CallHook(const std::vector &plugins, const wups_loader_hoo } void CallHook(const std::vector &plugins, const wups_loader_hook_type_t hook_type, const std::function &pred) { - DEBUG_FUNCTION_LINE_VERBOSE("Calling hook of type %s [%d]", hookNameToString(hook.getType()).c_str(), hook_type); + DEBUG_FUNCTION_LINE_VERBOSE("Calling hook of type %s [%d]", hookNameToString(hook_type), hook_type); for (const auto &plugin : plugins) { if (pred(plugin)) { CallHook(plugin, hook_type); @@ -36,7 +36,7 @@ void CallHook(const PluginContainer &plugin, const wups_loader_hook_type_t hook_ } for (const auto &hook : plugin.getPluginLinkInformation().getHookDataList()) { if (hook.getType() == hook_type) { - DEBUG_FUNCTION_LINE_VERBOSE("Calling hook of type %s for plugin %s [%d]", hookNameToString(hook.getType()).c_str(), plugin.getMetaInformation().getName().c_str(), hook_type); + DEBUG_FUNCTION_LINE_VERBOSE("Calling hook of type %s for plugin %s [%d]", hookNameToString(hook.getType()), plugin.getMetaInformation().getName().c_str(), hook_type); void *func_ptr = hook.getFunctionPointer(); if (func_ptr != nullptr) { switch (hook_type) { @@ -141,7 +141,7 @@ void CallHook(const PluginContainer &plugin, const wups_loader_hook_type_t hook_ } default: { DEBUG_FUNCTION_LINE_ERR("######################################"); - DEBUG_FUNCTION_LINE_ERR("Hook is not implemented %s [%d]", hookNameToString(hook_type).c_str(), hook_type); + DEBUG_FUNCTION_LINE_ERR("Hook is not implemented %s [%d]", hookNameToString(hook_type), hook_type); DEBUG_FUNCTION_LINE_ERR("######################################"); } } diff --git a/source/utils/utils.cpp b/source/utils/utils.cpp index 32304f5..df47220 100644 --- a/source/utils/utils.cpp +++ b/source/utils/utils.cpp @@ -285,7 +285,7 @@ void PrintCapturedStackTrace(const std::span trace) { DEBUG_FUNCTION_LINE_INFO("└────────────────────────────────────────────────────────────┘"); } -std::string hookNameToString(const wups_loader_hook_type_t type) { +const char *hookNameToString(const wups_loader_hook_type_t type) { switch (type) { case WUPS_LOADER_HOOK_INIT_WUT_MALLOC: return "WUPS_LOADER_HOOK_INIT_WUT_MALLOC"; diff --git a/source/utils/utils.h b/source/utils/utils.h index d86b641..9e76fc1 100644 --- a/source/utils/utils.h +++ b/source/utils/utils.h @@ -171,4 +171,4 @@ std::string getModuleAndSymbolName(uint32_t addr); void PrintCapturedStackTrace(std::span trace); -std::string hookNameToString(wups_loader_hook_type_t type); \ No newline at end of file +const char *hookNameToString(wups_loader_hook_type_t type); \ No newline at end of file