mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-11-12 05:18:40 +00:00
Cleanup add brace (#6545)
* Add braces after if conditions
* More add braces after if conditions
* Add braces after while() conditions
* Fix compilation because of macro being modified
* Add braces to for loop
* Add braces after if/goto
* Move comments up
* Remove extra () in the 'return ...;' statements
* More remove extra () in the 'return ...;' statements
* More remove extra () in the 'return ...;' statements after merge
* Fix inconsistent patterns are xxx == NULL vs !xxx
* More "{}" for "if() break;" and "if() continue;"
* More "{}" after if() short statement
* More "{}" after "if () return;" statement
* More fix inconsistent patterns are xxx == NULL vs !xxx
* Revert some modificaion on SDL_RLEaccel.c
* SDL_RLEaccel: no short statement
* Cleanup 'if' where the bracket is in a new line
* Cleanup 'while' where the bracket is in a new line
* Cleanup 'for' where the bracket is in a new line
* Cleanup 'else' where the bracket is in a new line
This commit is contained in:
@@ -47,7 +47,7 @@ SDL_CreateCond(void)
|
||||
cond = NULL;
|
||||
}
|
||||
}
|
||||
return (cond);
|
||||
return cond;
|
||||
}
|
||||
|
||||
/* Destroy a condition variable */
|
||||
@@ -66,7 +66,7 @@ SDL_CondSignal(SDL_cond * cond)
|
||||
{
|
||||
int retval;
|
||||
|
||||
if (!cond) {
|
||||
if (cond == NULL) {
|
||||
return SDL_InvalidParamError("cond");
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ SDL_CondBroadcast(SDL_cond * cond)
|
||||
{
|
||||
int retval;
|
||||
|
||||
if (!cond) {
|
||||
if (cond == NULL) {
|
||||
return SDL_InvalidParamError("cond");
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ SDL_CondWaitTimeout(SDL_cond * cond, SDL_mutex * mutex, Uint32 ms)
|
||||
#endif
|
||||
struct timespec abstime;
|
||||
|
||||
if (!cond) {
|
||||
if (cond == NULL) {
|
||||
return SDL_InvalidParamError("cond");
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ SDL_CondWaitTimeout(SDL_cond * cond, SDL_mutex * mutex, Uint32 ms)
|
||||
int
|
||||
SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex)
|
||||
{
|
||||
if (!cond) {
|
||||
if (cond == NULL) {
|
||||
return SDL_InvalidParamError("cond");
|
||||
} else if (pthread_cond_wait(&cond->cond, &mutex->id) != 0) {
|
||||
return SDL_SetError("pthread_cond_wait() failed");
|
||||
|
||||
@@ -63,7 +63,7 @@ SDL_CreateMutex(void)
|
||||
} else {
|
||||
SDL_OutOfMemory();
|
||||
}
|
||||
return (mutex);
|
||||
return mutex;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -70,7 +70,7 @@ SDL_SemTryWait(SDL_sem * sem)
|
||||
{
|
||||
int retval;
|
||||
|
||||
if (!sem) {
|
||||
if (sem == NULL) {
|
||||
return SDL_InvalidParamError("sem");
|
||||
}
|
||||
retval = SDL_MUTEX_TIMEDOUT;
|
||||
@@ -85,7 +85,7 @@ SDL_SemWait(SDL_sem * sem)
|
||||
{
|
||||
int retval;
|
||||
|
||||
if (!sem) {
|
||||
if (sem == NULL) {
|
||||
return SDL_InvalidParamError("sem");
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout)
|
||||
Uint32 end;
|
||||
#endif
|
||||
|
||||
if (!sem) {
|
||||
if (sem == NULL) {
|
||||
return SDL_InvalidParamError("sem");
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@ SDL_SemPost(SDL_sem * sem)
|
||||
{
|
||||
int retval;
|
||||
|
||||
if (!sem) {
|
||||
if (sem == NULL) {
|
||||
return SDL_InvalidParamError("sem");
|
||||
}
|
||||
|
||||
|
||||
@@ -176,7 +176,7 @@ SDL_SYS_SetupThread(const char *name)
|
||||
SDL_threadID
|
||||
SDL_ThreadID(void)
|
||||
{
|
||||
return ((SDL_threadID) pthread_self());
|
||||
return (SDL_threadID)pthread_self();
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
Reference in New Issue
Block a user