style(hook): clippy -D warnings clean on default + fifa17 features
Modernize manual nul-terminated byte strings to C-string literals (c"...") at all Win32 GetModuleHandleA/GetProcAddress/getaddrinfo call sites (byte-identical), drop two redundant SOL_SOCKET-as-i32 casts, remove a needless return in the fifa17 install path, and add a # Safety section to DllMain. Scope the FIFA-23-path dead-code/unused-import lints (unused only under the fifa17 feature, stripped by the linker) with a documented crate-level cfg_attr allow. Cross-verified: both the default and fifa17 builds now pass clippy -D warnings and compile; probe and capture_baseline still build.
This commit is contained in:
@@ -313,12 +313,12 @@ unsafe fn read_u16(ptr: usize) -> Option<u16> {
|
||||
/// Resolve CardsDLL's runtime base, or 0. Tries the exact loaded name; the ToolHelp
|
||||
/// fallback (name-contains "CardsDLL") lives in the spec — add it if EA ever renames.
|
||||
unsafe fn resolve_cards_base() -> usize {
|
||||
let h = GetModuleHandleA(b"CardsDLL_Win64_retail.dll\0".as_ptr());
|
||||
let h = GetModuleHandleA(c"CardsDLL_Win64_retail.dll".as_ptr().cast());
|
||||
if !h.is_null() {
|
||||
return h as usize;
|
||||
}
|
||||
// Also try the short form some tooling reports.
|
||||
let h2 = GetModuleHandleA(b"CardsDLL.dll\0".as_ptr());
|
||||
let h2 = GetModuleHandleA(c"CardsDLL.dll".as_ptr().cast());
|
||||
if !h2.is_null() {
|
||||
return h2 as usize;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user