mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-06 03:18:13 +00:00
Fixed warning C28159: Consider using 'GetTickCount64' instead of 'GetTickCount'. Reason: GetTickCount overflows roughly every 49 days. Code that does not take that into account can loop indefinitely. GetTickCount64 operates on 64 bit values and does not have that problem
This commit is contained in:
@@ -1643,7 +1643,14 @@ void WIN_SendWakeupEvent(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
void WIN_PumpEvents(SDL_VideoDevice *_this)
|
||||
{
|
||||
MSG msg;
|
||||
#ifdef _MSC_VER /* We explicitly want to use GetTickCount(), not GetTickCount64() */
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 28159)
|
||||
#endif
|
||||
DWORD end_ticks = GetTickCount() + 1;
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
int new_messages = 0;
|
||||
#if !defined(__XBOXONE__) && !defined(__XBOXSERIES__)
|
||||
const Uint8 *keystate;
|
||||
|
@@ -316,10 +316,17 @@ void WIN_SetCursorPos(int x, int y)
|
||||
SetCursorPos(x, y);
|
||||
|
||||
/* Flush any mouse motion prior to or associated with this warp */
|
||||
#ifdef _MSC_VER /* We explicitly want to use GetTickCount(), not GetTickCount64() */
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 28159)
|
||||
#endif
|
||||
SDL_last_warp_time = GetTickCount();
|
||||
if (!SDL_last_warp_time) {
|
||||
SDL_last_warp_time = 1;
|
||||
}
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
}
|
||||
|
||||
static int WIN_WarpMouse(SDL_Window *window, float x, float y)
|
||||
|
Reference in New Issue
Block a user