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

@ -156,7 +156,7 @@ SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout)
#else
end = SDL_GetTicks() + timeout;
while ((retval = SDL_SemTryWait(sem)) == SDL_MUTEX_TIMEDOUT) {
if ((Sint32)(SDL_GetTicks() - end) >= 0) {
if (SDL_TICKS_PASSED(SDL_GetTicks(), end)) {
break;
}
SDL_Delay(1);