avoid UB (left shift of negative number) in SDL_windowsevents.c

This commit is contained in:
rohlem
2025-03-10 16:23:06 +01:00
committed by Sam Lantinga
parent 9fcca83512
commit f1d16e9b4d
+1 -1
View File
@@ -1640,7 +1640,7 @@ LRESULT CALLBACK WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara
POINT cursorPos; POINT cursorPos;
GetCursorPos(&cursorPos); GetCursorPos(&cursorPos);
ScreenToClient(hwnd, &cursorPos); ScreenToClient(hwnd, &cursorPos);
PostMessage(hwnd, WM_MOUSEMOVE, 0, cursorPos.x | cursorPos.y << 16); PostMessage(hwnd, WM_MOUSEMOVE, 0, cursorPos.x | (((unsigned int)((short)cursorPos.y)) << 16));
} }
} break; } break;