From faefbae830a8e8d1d1595dc317f2b49ffc19bb6f Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Wed, 12 Aug 2026 18:25:35 +0200 Subject: [PATCH] =?UTF-8?q?fix(pf-presenter):=20spell=20MAKEINTRESOURCE(1)?= =?UTF-8?q?=20as=20ptr::without=5Fprovenance=20=E2=80=94=20clippy=201.96's?= =?UTF-8?q?=20manual=5Fdangling=5Fptr=20reads=20the=20integer-ordinal=20ca?= =?UTF-8?q?st=20as=20a=20dangling=20pointer=20and=20fails=20the=20Windows?= =?UTF-8?q?=20-D=20warnings=20gate=20(masked=20on=20main=20by=20the=20clie?= =?UTF-8?q?nt=20bins=20failing=20to=20build=20first)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/pf-presenter/src/win32.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/crates/pf-presenter/src/win32.rs b/crates/pf-presenter/src/win32.rs index d017f0cb..c7bdc149 100644 --- a/crates/pf-presenter/src/win32.rs +++ b/crates/pf-presenter/src/win32.rs @@ -63,7 +63,17 @@ pub(crate) fn stamp_window_icon(window: &sdl3::video::Window) { let module = GetModuleHandleW(std::ptr::null()); for (which, metric) in [(ICON_SMALL, SM_CXSMICON), (ICON_BIG, SM_CXICON)] { let px = GetSystemMetrics(metric); - let icon = LoadImageW(module, 1 as *const u16, IMAGE_ICON, px, px, LR_DEFAULTCOLOR); + // MAKEINTRESOURCE(1): an integer resource ordinal smuggled through the name + // pointer, never dereferenced — `without_provenance` says exactly that (and + // `1 as *const u16` reads as a dangling pointer to clippy 1.96). + let icon = LoadImageW( + module, + std::ptr::without_provenance(1), + IMAGE_ICON, + px, + px, + LR_DEFAULTCOLOR, + ); if !icon.is_null() { SendMessageW(hwnd, WM_SETICON, which as WPARAM, icon as LPARAM); }