thread: code style

This commit is contained in:
pionere
2022-11-29 17:30:03 +01:00
committed by Sam Lantinga
parent 38c281fbc0
commit 461a38ff1a
12 changed files with 35 additions and 38 deletions

View File

@@ -96,7 +96,7 @@ SDL_CreateCond_cv(void)
static void
SDL_DestroyCond_cv(SDL_cond * cond)
{
if (cond) {
if (cond != NULL) {
/* There are no kernel allocated resources */
SDL_free(cond);
}

View File

@@ -74,7 +74,7 @@ SDL_CreateMutex_srw(void)
static void
SDL_DestroyMutex_srw(SDL_mutex * mutex)
{
if (mutex) {
if (mutex != NULL) {
/* There are no kernel allocated resources */
SDL_free(mutex);
}
@@ -176,7 +176,7 @@ SDL_CreateMutex_cs(void)
/* Allocate mutex memory */
mutex = (SDL_mutex_cs *) SDL_malloc(sizeof(*mutex));
if (mutex) {
if (mutex != NULL) {
/* Initialize */
/* On SMP systems, a non-zero spin count generally helps performance */
#if __WINRT__
@@ -195,7 +195,7 @@ static void
SDL_DestroyMutex_cs(SDL_mutex * mutex_)
{
SDL_mutex_cs *mutex = (SDL_mutex_cs *)mutex_;
if (mutex) {
if (mutex != NULL) {
DeleteCriticalSection(&mutex->cs);
SDL_free(mutex);
}

View File

@@ -96,7 +96,7 @@ SDL_CreateSemaphore_atom(Uint32 initial_value)
SDL_sem_atom *sem;
sem = (SDL_sem_atom *) SDL_malloc(sizeof(*sem));
if (sem) {
if (sem != NULL) {
sem->count = initial_value;
} else {
SDL_OutOfMemory();
@@ -107,7 +107,7 @@ SDL_CreateSemaphore_atom(Uint32 initial_value)
static void
SDL_DestroySemaphore_atom(SDL_sem * sem)
{
if (sem) {
if (sem != NULL) {
SDL_free(sem);
}
}
@@ -269,7 +269,7 @@ SDL_CreateSemaphore_kern(Uint32 initial_value)
/* Allocate sem memory */
sem = (SDL_sem_kern *) SDL_malloc(sizeof(*sem));
if (sem) {
if (sem != NULL) {
/* Create the semaphore, with max value 32K */
#if __WINRT__
sem->id = CreateSemaphoreEx(NULL, initial_value, 32 * 1024, NULL, 0, SEMAPHORE_ALL_ACCESS);
@@ -293,7 +293,7 @@ static void
SDL_DestroySemaphore_kern(SDL_sem * _sem)
{
SDL_sem_kern *sem = (SDL_sem_kern *)_sem;
if (sem) {
if (sem != NULL) {
if (sem->id) {
CloseHandle(sem->id);
sem->id = 0;