Pointer as bool (libsdl-org#7214)

This commit is contained in:
Sylvain
2023-11-09 22:29:15 +01:00
committed by Sam Lantinga
parent 23db971681
commit d8600f717e
371 changed files with 2448 additions and 2442 deletions

View File

@@ -92,7 +92,7 @@ void SDL_DestroyCondition_generic(SDL_Condition *_cond)
int SDL_SignalCondition_generic(SDL_Condition *_cond)
{
SDL_cond_generic *cond = (SDL_cond_generic *)_cond;
if (cond == NULL) {
if (!cond) {
return SDL_InvalidParamError("cond");
}
@@ -116,7 +116,7 @@ int SDL_SignalCondition_generic(SDL_Condition *_cond)
int SDL_BroadcastCondition_generic(SDL_Condition *_cond)
{
SDL_cond_generic *cond = (SDL_cond_generic *)_cond;
if (cond == NULL) {
if (!cond) {
return SDL_InvalidParamError("cond");
}
@@ -172,7 +172,7 @@ int SDL_WaitConditionTimeoutNS_generic(SDL_Condition *_cond, SDL_Mutex *mutex, S
SDL_cond_generic *cond = (SDL_cond_generic *)_cond;
int retval;
if (cond == NULL) {
if (!cond) {
return SDL_InvalidParamError("cond");
}

View File

@@ -87,7 +87,7 @@ int SDL_TryLockMutex(SDL_Mutex *mutex)
{
int retval = 0;
#ifndef SDL_THREADS_DISABLED
if (mutex != NULL) {
if (mutex) {
SDL_threadID this_thread = SDL_ThreadID();
if (mutex->owner == this_thread) {
++mutex->recursive;

View File

@@ -66,7 +66,7 @@ SDL_Semaphore *SDL_CreateSemaphore(Uint32 initial_value)
SDL_Semaphore *sem;
sem = (SDL_Semaphore *)SDL_malloc(sizeof(*sem));
if (sem == NULL) {
if (!sem) {
SDL_OutOfMemory();
return NULL;
}
@@ -108,7 +108,7 @@ int SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS)
{
int retval;
if (sem == NULL) {
if (!sem) {
return SDL_InvalidParamError("sem");
}
@@ -156,7 +156,7 @@ Uint32 SDL_GetSemaphoreValue(SDL_Semaphore *sem)
int SDL_PostSemaphore(SDL_Semaphore *sem)
{
if (sem == NULL) {
if (!sem) {
return SDL_InvalidParamError("sem");
}