mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-11-12 05:18:40 +00:00
thread: code style
This commit is contained in:
@@ -44,7 +44,7 @@ SDL_sem *
|
||||
SDL_CreateSemaphore(Uint32 initial_value)
|
||||
{
|
||||
SDL_sem *sem = (SDL_sem *) SDL_malloc(sizeof(SDL_sem));
|
||||
if (sem) {
|
||||
if (sem != NULL) {
|
||||
if (sem_init(&sem->sem, 0, initial_value) < 0) {
|
||||
SDL_SetError("sem_init() failed");
|
||||
SDL_free(sem);
|
||||
@@ -59,7 +59,7 @@ SDL_CreateSemaphore(Uint32 initial_value)
|
||||
void
|
||||
SDL_DestroySemaphore(SDL_sem * sem)
|
||||
{
|
||||
if (sem) {
|
||||
if (sem != NULL) {
|
||||
sem_destroy(&sem->sem);
|
||||
SDL_free(sem);
|
||||
}
|
||||
@@ -179,7 +179,7 @@ SDL_SemValue(SDL_sem * sem)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (!sem) {
|
||||
if (sem == NULL) {
|
||||
SDL_InvalidParamError("sem");
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user