Added a macro SDL_TICKS_PASSED() to correctly compare two 32-bit tick values.

Went through the code and used the macro and fixed a couple places that were using incorrect timestamp comparisons.
This commit is contained in:
Sam Lantinga 2013-10-20 20:42:55 -07:00
parent 84561c952a
commit 367ffcc3af
12 changed files with 23 additions and 21 deletions

View file

@ -443,7 +443,7 @@ SDL_WaitEventTimeout(SDL_Event * event, int timeout)
/* Polling and no events, just return */
return 0;
}
if (timeout > 0 && ((int) (SDL_GetTicks() - expiration) >= 0)) {
if (timeout > 0 && SDL_TICKS_PASSED(SDL_GetTicks(), expiration)) {
/* Timeout expired and no events */
return 0;
}