From 6df6d871aae09fb15b689154605d96378691d3ac Mon Sep 17 00:00:00 2001 From: Maschell Date: Fri, 11 Feb 2022 22:18:15 +0100 Subject: [PATCH] Include cleanup, fix compiling with latest wut, --- Dockerfile | 2 +- source/common/plugin_defines.h | 2 +- source/globals.cpp | 10 +++++----- source/hooks.cpp | 8 ++++++-- source/hooks.h | 2 +- source/patcher/hooks_patcher_static.cpp | 7 +++---- source/plugin/FunctionData.h | 1 - source/plugin/HookData.h | 3 +-- source/plugin/PluginInformationFactory.cpp | 4 +--- source/utils/ConfigUtils.cpp | 6 ++++-- source/utils/StorageUtils.h | 2 +- 11 files changed, 24 insertions(+), 23 deletions(-) diff --git a/Dockerfile b/Dockerfile index 755954d..d04d77f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM wiiuenv/devkitppc:20211229 +FROM wiiuenv/devkitppc:20220211 COPY --from=wiiuenv/wiiumodulesystem:20220127 /artifacts $DEVKITPRO COPY --from=wiiuenv/wiiupluginsystem:20220123 /artifacts $DEVKITPRO diff --git a/source/common/plugin_defines.h b/source/common/plugin_defines.h index c108993..5ab5722 100644 --- a/source/common/plugin_defines.h +++ b/source/common/plugin_defines.h @@ -24,7 +24,7 @@ #include #include -#include +#include #ifdef __cplusplus extern "C" { diff --git a/source/globals.cpp b/source/globals.cpp index fd1a1b2..2e85b20 100644 --- a/source/globals.cpp +++ b/source/globals.cpp @@ -7,9 +7,9 @@ plugin_information_on_reload_t gLinkOnReload __attribute__((section(".data"))); module_information_t *gModuleData __attribute__((section(".data"))) = nullptr; relocation_trampoline_entry_t *gTrampolineData __attribute__((section(".data"))) = nullptr; -uint32_t gPluginDataHeapSize = 0; -uint32_t gPluginInformationHeapSize = 0; -uint32_t gTrampolineDataSize = 0; +uint32_t gPluginDataHeapSize __attribute__((section(".data"))) = 0; +uint32_t gPluginInformationHeapSize __attribute__((section(".data"))) = 0; +uint32_t gTrampolineDataSize __attribute__((section(".data"))) = 0; -StoredBuffer storedTVBuffer{}; -StoredBuffer storedDRCBuffer{}; +StoredBuffer storedTVBuffer __attribute__((section(".data"))) = {}; +StoredBuffer storedDRCBuffer __attribute__((section(".data"))) = {}; diff --git a/source/hooks.cpp b/source/hooks.cpp index 930620d..e8d4862 100644 --- a/source/hooks.cpp +++ b/source/hooks.cpp @@ -88,13 +88,17 @@ void CallHookEx(plugin_information_t *pluginInformation, wups_loader_hook_type_t hook_type == WUPS_LOADER_HOOK_CONFIG_CLOSED || hook_type == WUPS_LOADER_HOOK_RELEASE_FOREGROUND || hook_type == WUPS_LOADER_HOOK_ACQUIRED_FOREGROUND) { - ((void (*)())((uint32_t *) func_ptr))(); + // clang-format off + ((void(*)())((uint32_t *) func_ptr))(); + // clang-format on } else if (hook_type == WUPS_LOADER_HOOK_INIT_STORAGE) { wups_loader_init_storage_args_t args; args.open_storage_ptr = &StorageUtils::OpenStorage; args.close_storage_ptr = &StorageUtils::CloseStorage; args.plugin_id = plugin_data->meta.storageId; - ((void (*)(wups_loader_init_storage_args_t))((uint32_t *) func_ptr))(args); + // clang-format off + ((void(*)(wups_loader_init_storage_args_t))((uint32_t *) func_ptr))(args); + // clang-format on } else { DEBUG_FUNCTION_LINE("######################################"); DEBUG_FUNCTION_LINE("Hook is not implemented %s [%d]", hook_names[hook_type], hook_type); diff --git a/source/hooks.h b/source/hooks.h index 69b72d0..3272fd1 100644 --- a/source/hooks.h +++ b/source/hooks.h @@ -1,7 +1,7 @@ #pragma once #include "common/plugin_defines.h" -#include +#include void CallHook(plugin_information_t *pluginInformation, wups_loader_hook_type_t hook_type); diff --git a/source/patcher/hooks_patcher_static.cpp b/source/patcher/hooks_patcher_static.cpp index d86eac4..88f0ee0 100644 --- a/source/patcher/hooks_patcher_static.cpp +++ b/source/patcher/hooks_patcher_static.cpp @@ -3,7 +3,6 @@ #include #include #include -#include #include "../globals.h" #include "../hooks.h" @@ -102,9 +101,9 @@ DECL_FUNCTION(void, WPADRead, WPADChan chan, WPADStatusProController *data) { } } - -#define KiReport ((void (*)(const char *, ...)) 0xfff0ad0c) - +// clang-format off +#define KiReport ((void(*)(const char *, ...)) 0xfff0ad0c) +// clang-format on #pragma GCC push_options #pragma GCC optimize("O0") diff --git a/source/plugin/FunctionData.h b/source/plugin/FunctionData.h index 87c57dd..31b0adb 100644 --- a/source/plugin/FunctionData.h +++ b/source/plugin/FunctionData.h @@ -18,7 +18,6 @@ #include #include -#include class FunctionData { diff --git a/source/plugin/HookData.h b/source/plugin/HookData.h index a9d3286..fceb0f9 100644 --- a/source/plugin/HookData.h +++ b/source/plugin/HookData.h @@ -18,8 +18,7 @@ #pragma once #include -#include - +#include class HookData { public: diff --git a/source/plugin/PluginInformationFactory.cpp b/source/plugin/PluginInformationFactory.cpp index 67174c5..03d1ffb 100644 --- a/source/plugin/PluginInformationFactory.cpp +++ b/source/plugin/PluginInformationFactory.cpp @@ -18,14 +18,12 @@ #include "PluginInformationFactory.h" #include "../utils/ElfUtils.h" #include "../utils/utils.h" -#include "PluginData.h" #include -#include #include #include #include #include -#include +#include using namespace ELFIO; diff --git a/source/utils/ConfigUtils.cpp b/source/utils/ConfigUtils.cpp index f95bc51..f15a046 100644 --- a/source/utils/ConfigUtils.cpp +++ b/source/utils/ConfigUtils.cpp @@ -167,7 +167,7 @@ void ConfigUtils::displayMenu() { VPADStatus vpad_data{}; VPADReadError vpad_error; KPADStatus kpad_data{}; - int32_t kpad_error; + KPADError kpad_error; while (true) { buttonsTriggered = 0; @@ -565,7 +565,9 @@ void ConfigUtils::displayMenu() { if (hook_data->func_pointer == nullptr) { break; } - ((void (*)())((uint32_t *) hook_data->func_pointer))(); + // clang-format off + ((void(*)())((uint32_t *) hook_data->func_pointer))(); + // clang-format on break; } } diff --git a/source/utils/StorageUtils.h b/source/utils/StorageUtils.h index 3d2b0e5..26c199c 100644 --- a/source/utils/StorageUtils.h +++ b/source/utils/StorageUtils.h @@ -1,6 +1,6 @@ #pragma once -#include +#include class StorageUtils { public: