瀏覽代碼

Use sized types when fixing undefined behavior

(cherry picked from commit 24339524c5af259d8a035e4931363c4db294dc83)
Sam Lantinga 5 月之前
父節點
當前提交
9f32fafe21
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/video/windows/SDL_windowsevents.c

+ 1 - 1
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;