From 24339524c5af259d8a035e4931363c4db294dc83 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Mon, 10 Mar 2025 09:12:40 -0700
Subject: [PATCH] Use sized types when fixing undefined behavior
---
src/video/windows/SDL_windowsevents.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c
index 94997c151bc69..46f33f3a85fa0 100644
--- a/src/video/windows/SDL_windowsevents.c
+++ b/src/video/windows/SDL_windowsevents.c
@@ -1640,7 +1640,7 @@ LRESULT CALLBACK WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara
POINT cursorPos;
GetCursorPos(&cursorPos);
ScreenToClient(hwnd, &cursorPos);
- PostMessage(hwnd, WM_MOUSEMOVE, 0, cursorPos.x | (((unsigned int)((short)cursorPos.y)) << 16));
+ PostMessage(hwnd, WM_MOUSEMOVE, 0, cursorPos.x | (((Uint32)((Sint16)cursorPos.y)) << 16));
}
} break;