mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-14 22:05:59 +00:00
Include stdbool.h when using Visual Studio 2017+
Also cleaned up some incorrect return values from bool functions.
This commit is contained in:
@@ -119,7 +119,7 @@ static bool SDL_WaitConditionTimeoutNS_cv(SDL_Condition *_cond, SDL_Mutex *_mute
|
||||
mutex->count = 0;
|
||||
mutex->owner = 0;
|
||||
|
||||
result = pSleepConditionVariableSRW(&cond->cond, &mutex->srw, timeout, 0);
|
||||
result = (pSleepConditionVariableSRW(&cond->cond, &mutex->srw, timeout, 0) == TRUE);
|
||||
|
||||
// The mutex is owned by us again, regardless of status of the wait
|
||||
SDL_assert(mutex->count == 0 && mutex->owner == 0);
|
||||
@@ -130,7 +130,7 @@ static bool SDL_WaitConditionTimeoutNS_cv(SDL_Condition *_cond, SDL_Mutex *_mute
|
||||
|
||||
SDL_assert(SDL_mutex_impl_active.Type == SDL_MUTEX_CS);
|
||||
|
||||
result = pSleepConditionVariableCS(&cond->cond, &mutex->cs, timeout);
|
||||
result = (pSleepConditionVariableCS(&cond->cond, &mutex->cs, timeout) == TRUE);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@@ -157,7 +157,7 @@ static void SDL_LockMutex_cs(SDL_Mutex *mutex_) SDL_NO_THREAD_SAFETY_ANALYSIS /
|
||||
static bool SDL_TryLockMutex_cs(SDL_Mutex *mutex_)
|
||||
{
|
||||
SDL_mutex_cs *mutex = (SDL_mutex_cs *)mutex_;
|
||||
return TryEnterCriticalSection(&mutex->cs);
|
||||
return (TryEnterCriticalSection(&mutex->cs) == TRUE);
|
||||
}
|
||||
|
||||
static void SDL_UnlockMutex_cs(SDL_Mutex *mutex_) SDL_NO_THREAD_SAFETY_ANALYSIS // clang doesn't know about NULL mutexes
|
||||
|
Reference in New Issue
Block a user