fix: resolve all compiler warnings in test-runner and wormkit
Browse files- Remove unused DETACHED_PROCESS constant and unused `output` variable
- Remove unused DDGame import in fire_surrender
- Rename LPSECURITY_ATTRIBUTES to LpSecurityAttributes (camel case)
- Remove unused BOOL type alias in file_isolation
- Prefix unused `esp` with underscore in debug_watchpoint
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
crates/openwa-test-runner/src/main.rs
CHANGED
|
@@ -15,7 +15,6 @@ use std::thread;
|
|
| 15 |
use std::time::{Duration, Instant};
|
| 16 |
|
| 17 |
const CREATE_NO_WINDOW: u32 = 0x0800_0000;
|
| 18 |
-
const DETACHED_PROCESS: u32 = 0x0000_0008;
|
| 19 |
|
| 20 |
// βββ Configuration ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 21 |
|
|
@@ -133,8 +132,6 @@ fn discover_tests(filter: Option<&str>) -> Vec<TestCase> {
|
|
| 133 |
continue; // Skip replays without expected logs
|
| 134 |
}
|
| 135 |
|
| 136 |
-
let output = path.with_extension("log");
|
| 137 |
-
|
| 138 |
// WA.exe runs in the game directory, so replay/log paths must be absolute.
|
| 139 |
// Strip \\?\ UNC prefix that canonicalize adds on Windows β WA.exe can't handle it.
|
| 140 |
let replay_abs = strip_unc(fs::canonicalize(&path).unwrap_or(path.clone()));
|
|
|
|
| 15 |
use std::time::{Duration, Instant};
|
| 16 |
|
| 17 |
const CREATE_NO_WINDOW: u32 = 0x0800_0000;
|
|
|
|
| 18 |
|
| 19 |
// βββ Configuration ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 20 |
|
|
|
|
| 132 |
continue; // Skip replays without expected logs
|
| 133 |
}
|
| 134 |
|
|
|
|
|
|
|
| 135 |
// WA.exe runs in the game directory, so replay/log paths must be absolute.
|
| 136 |
// Strip \\?\ UNC prefix that canonicalize adds on Windows β WA.exe can't handle it.
|
| 137 |
let replay_abs = strip_unc(fs::canonicalize(&path).unwrap_or(path.clone()));
|
crates/openwa-wormkit/src/debug_watchpoint.rs
CHANGED
|
@@ -128,7 +128,7 @@ unsafe extern "system" fn veh_handler(info: *mut EXCEPTION_POINTERS) -> i32 {
|
|
| 128 |
// Walk EBP chain for stack trace
|
| 129 |
let mut trace = heapless::String::<512>::new();
|
| 130 |
let mut ebp = ctx.Ebp;
|
| 131 |
-
let
|
| 132 |
for depth in 0..12 {
|
| 133 |
// Validate EBP: must be in plausible stack range, aligned,
|
| 134 |
// and above ESP (stack grows down)
|
|
|
|
| 128 |
// Walk EBP chain for stack trace
|
| 129 |
let mut trace = heapless::String::<512>::new();
|
| 130 |
let mut ebp = ctx.Ebp;
|
| 131 |
+
let _esp = ctx.Esp;
|
| 132 |
for depth in 0..12 {
|
| 133 |
// Validate EBP: must be in plausible stack range, aligned,
|
| 134 |
// and above ESP (stack grows down)
|
crates/openwa-wormkit/src/replacements/file_isolation.rs
CHANGED
|
@@ -17,14 +17,13 @@ use std::ffi::CStr;
|
|
| 17 |
|
| 18 |
type HANDLE = *mut c_void;
|
| 19 |
type DWORD = u32;
|
| 20 |
-
type
|
| 21 |
-
type LPSECURITY_ATTRIBUTES = *mut c_void;
|
| 22 |
|
| 23 |
type CreateFileAFn = unsafe extern "system" fn(
|
| 24 |
lpFileName: *const u8,
|
| 25 |
dwDesiredAccess: DWORD,
|
| 26 |
dwShareMode: DWORD,
|
| 27 |
-
lpSecurityAttributes:
|
| 28 |
dwCreationDisposition: DWORD,
|
| 29 |
dwFlagsAndAttributes: DWORD,
|
| 30 |
hTemplateFile: HANDLE,
|
|
@@ -56,7 +55,7 @@ unsafe extern "system" fn hook_create_file_a(
|
|
| 56 |
lp_file_name: *const u8,
|
| 57 |
desired_access: DWORD,
|
| 58 |
share_mode: DWORD,
|
| 59 |
-
security_attributes:
|
| 60 |
creation_disposition: DWORD,
|
| 61 |
flags_and_attributes: DWORD,
|
| 62 |
template_file: HANDLE,
|
|
|
|
| 17 |
|
| 18 |
type HANDLE = *mut c_void;
|
| 19 |
type DWORD = u32;
|
| 20 |
+
type LpSecurityAttributes = *mut c_void;
|
|
|
|
| 21 |
|
| 22 |
type CreateFileAFn = unsafe extern "system" fn(
|
| 23 |
lpFileName: *const u8,
|
| 24 |
dwDesiredAccess: DWORD,
|
| 25 |
dwShareMode: DWORD,
|
| 26 |
+
lpSecurityAttributes: LpSecurityAttributes,
|
| 27 |
dwCreationDisposition: DWORD,
|
| 28 |
dwFlagsAndAttributes: DWORD,
|
| 29 |
hTemplateFile: HANDLE,
|
|
|
|
| 55 |
lp_file_name: *const u8,
|
| 56 |
desired_access: DWORD,
|
| 57 |
share_mode: DWORD,
|
| 58 |
+
security_attributes: LpSecurityAttributes,
|
| 59 |
creation_disposition: DWORD,
|
| 60 |
flags_and_attributes: DWORD,
|
| 61 |
template_file: HANDLE,
|
crates/openwa-wormkit/src/replacements/weapon.rs
CHANGED
|
@@ -485,7 +485,6 @@ unsafe fn fire_skip_go(worm: *const CTaskWorm, entry: *const WeaponEntry) {
|
|
| 485 |
/// WormEntry.turn_action_counter_Maybe by 14 (0x0E).
|
| 486 |
unsafe fn fire_surrender(worm: *mut CTaskWorm) {
|
| 487 |
use openwa_core::engine::ddgame::TeamArenaRef;
|
| 488 |
-
use openwa_core::engine::DDGame;
|
| 489 |
|
| 490 |
fire_send_team_message(worm, 0x29);
|
| 491 |
|
|
|
|
| 485 |
/// WormEntry.turn_action_counter_Maybe by 14 (0x0E).
|
| 486 |
unsafe fn fire_surrender(worm: *mut CTaskWorm) {
|
| 487 |
use openwa_core::engine::ddgame::TeamArenaRef;
|
|
|
|
| 488 |
|
| 489 |
fire_send_team_message(worm, 0x29);
|
| 490 |
|