From 6d592d13f20912cebdc63df7ab8dcba1fd03b77b Mon Sep 17 00:00:00 2001 From: apple1417 Date: Wed, 2 Oct 2024 19:16:29 +1300 Subject: [PATCH] update with llvm 19 linting fixups --- src/console.cpp | 1 + src/dllmain.cpp | 2 +- src/loader.cpp | 4 ++++ src/proxy/d3d11.cpp | 1 + src/proxy/dsound.cpp | 1 + src/proxy/none.cpp | 2 ++ src/proxy/xinput1_3.cpp | 2 +- 7 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/console.cpp b/src/console.cpp index a16167f..01d2f79 100644 --- a/src/console.cpp +++ b/src/console.cpp @@ -1,5 +1,6 @@ #include "pch.h" +#include "console.h" #include "version.inl" namespace pluginloader::console { diff --git a/src/dllmain.cpp b/src/dllmain.cpp index 17e36da..47278dc 100644 --- a/src/dllmain.cpp +++ b/src/dllmain.cpp @@ -11,7 +11,7 @@ * @param ul_reason_for_call Reason this is being called. * @return True if loaded successfully, false otherwise. */ -// NOLINTNEXTLINE(readability-identifier-naming) - for `DllMain` +// NOLINTNEXTLINE(misc-use-internal-linkage, readability-identifier-naming) - for `DllMain` BOOL APIENTRY DllMain(HMODULE h_module, DWORD ul_reason_for_call, LPVOID /*unused*/) { switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: diff --git a/src/loader.cpp b/src/loader.cpp index e21fb85..935eb42 100644 --- a/src/loader.cpp +++ b/src/loader.cpp @@ -4,10 +4,14 @@ namespace pluginloader::loader { +namespace { + const constexpr auto PLUGINS_DIR_NAME = "Plugins"; std::vector loaded_modules{}; +} // namespace + void load(HMODULE this_dll) { wchar_t buf[MAX_PATH]; if (GetModuleFileNameW(this_dll, &buf[0], ARRAYSIZE(buf)) == 0) { diff --git a/src/proxy/d3d11.cpp b/src/proxy/d3d11.cpp index ad142e8..5bddf26 100644 --- a/src/proxy/d3d11.cpp +++ b/src/proxy/d3d11.cpp @@ -1,5 +1,6 @@ #include "pch.h" +#include "proxy.h" #include "util.h" // Based on https://github.com/FromDarkHell/BL3DX11Injection/ diff --git a/src/proxy/dsound.cpp b/src/proxy/dsound.cpp index dcc078f..3bac8cf 100644 --- a/src/proxy/dsound.cpp +++ b/src/proxy/dsound.cpp @@ -1,5 +1,6 @@ #include "pch.h" +#include "proxy.h" #include "util.h" namespace pluginloader::proxy { diff --git a/src/proxy/none.cpp b/src/proxy/none.cpp index edd819f..0f013e1 100644 --- a/src/proxy/none.cpp +++ b/src/proxy/none.cpp @@ -1,5 +1,7 @@ #include "pch.h" +#include "proxy.h" + // Empty proxy for dlls where we don't need to forward anything. namespace pluginloader::proxy { diff --git a/src/proxy/xinput1_3.cpp b/src/proxy/xinput1_3.cpp index 7d2c442..2beb72a 100644 --- a/src/proxy/xinput1_3.cpp +++ b/src/proxy/xinput1_3.cpp @@ -1,6 +1,6 @@ #include "pch.h" -#include +#include "proxy.h" #include "util.h" namespace pluginloader::proxy {