Update for SDL3 coding style (#6717)

I updated .clang-format and ran clang-format 14 over the src and test directories to standardize the code base.

In general I let clang-format have it's way, and added markup to prevent formatting of code that would break or be completely unreadable if formatted.

The script I ran for the src directory is added as build-scripts/clang-format-src.sh

This fixes:
#6592
#6593
#6594
This commit is contained in:
Sam Lantinga 2022-11-30 12:51:59 -08:00 committed by GitHub
parent 14b902faca
commit 5750bcb174
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
781 changed files with 51659 additions and 55763 deletions

View file

@ -26,7 +26,6 @@
implementation, written by Christopher Tate and Owen Smith. Thanks!
*/
#include "../generic/SDL_syscond_c.h"
/* If two implementations are to be compiled into SDL (the active one
@ -57,7 +56,7 @@ SDL_CreateCond_generic(void)
{
SDL_cond_generic *cond;
cond = (SDL_cond_generic *) SDL_malloc(sizeof(SDL_cond_generic));
cond = (SDL_cond_generic *)SDL_malloc(sizeof(SDL_cond_generic));
if (cond) {
cond->lock = SDL_CreateMutex();
cond->wait_sem = SDL_CreateSemaphore(0);
@ -74,8 +73,7 @@ SDL_CreateCond_generic(void)
}
/* Destroy a condition variable */
void
SDL_DestroyCond_generic(SDL_cond * _cond)
void SDL_DestroyCond_generic(SDL_cond *_cond)
{
SDL_cond_generic *cond = (SDL_cond_generic *)_cond;
if (cond) {
@ -93,8 +91,7 @@ SDL_DestroyCond_generic(SDL_cond * _cond)
}
/* Restart one of the threads that are waiting on the condition variable */
int
SDL_CondSignal_generic(SDL_cond * _cond)
int SDL_CondSignal_generic(SDL_cond *_cond)
{
SDL_cond_generic *cond = (SDL_cond_generic *)_cond;
if (cond == NULL) {
@ -118,8 +115,7 @@ SDL_CondSignal_generic(SDL_cond * _cond)
}
/* Restart all threads that are waiting on the condition variable */
int
SDL_CondBroadcast_generic(SDL_cond * _cond)
int SDL_CondBroadcast_generic(SDL_cond *_cond)
{
SDL_cond_generic *cond = (SDL_cond_generic *)_cond;
if (cond == NULL) {
@ -173,8 +169,7 @@ Thread B:
SDL_CondSignal(cond);
SDL_UnlockMutex(lock);
*/
int
SDL_CondWaitTimeout_generic(SDL_cond * _cond, SDL_mutex * mutex, Uint32 ms)
int SDL_CondWaitTimeout_generic(SDL_cond *_cond, SDL_mutex *mutex, Uint32 ms)
{
SDL_cond_generic *cond = (SDL_cond_generic *)_cond;
int retval;
@ -229,8 +224,7 @@ SDL_CondWaitTimeout_generic(SDL_cond * _cond, SDL_mutex * mutex, Uint32 ms)
}
/* Wait on the condition variable forever */
int
SDL_CondWait_generic(SDL_cond * cond, SDL_mutex * mutex)
int SDL_CondWait_generic(SDL_cond *cond, SDL_mutex *mutex)
{
return SDL_CondWaitTimeout_generic(cond, mutex, SDL_MUTEX_MAXWAIT);
}