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
parent
21f273ecc7
commit
a9b87ee201
|
@ -1643,7 +1643,14 @@ void WIN_SendWakeupEvent(SDL_VideoDevice *_this, SDL_Window *window)
|
||||||
void WIN_PumpEvents(SDL_VideoDevice *_this)
|
void WIN_PumpEvents(SDL_VideoDevice *_this)
|
||||||
{
|
{
|
||||||
MSG msg;
|
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;
|
DWORD end_ticks = GetTickCount() + 1;
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(pop)
|
||||||
|
#endif
|
||||||
int new_messages = 0;
|
int new_messages = 0;
|
||||||
#if !defined(__XBOXONE__) && !defined(__XBOXSERIES__)
|
#if !defined(__XBOXONE__) && !defined(__XBOXSERIES__)
|
||||||
const Uint8 *keystate;
|
const Uint8 *keystate;
|
||||||
|
|
|
@ -316,10 +316,17 @@ void WIN_SetCursorPos(int x, int y)
|
||||||
SetCursorPos(x, y);
|
SetCursorPos(x, y);
|
||||||
|
|
||||||
/* Flush any mouse motion prior to or associated with this warp */
|
/* 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();
|
SDL_last_warp_time = GetTickCount();
|
||||||
if (!SDL_last_warp_time) {
|
if (!SDL_last_warp_time) {
|
||||||
SDL_last_warp_time = 1;
|
SDL_last_warp_time = 1;
|
||||||
}
|
}
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(pop)
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static int WIN_WarpMouse(SDL_Window *window, float x, float y)
|
static int WIN_WarpMouse(SDL_Window *window, float x, float y)
|
||||||
|
|
Loading…
Reference in New Issue