mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-06-02 18:07:40 +00:00
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:
parent
14b902faca
commit
5750bcb174
781 changed files with 51659 additions and 55763 deletions
|
@ -32,12 +32,15 @@ quit(int rc)
|
|||
static const char *
|
||||
getprioritystr(SDL_ThreadPriority priority)
|
||||
{
|
||||
switch(priority)
|
||||
{
|
||||
case SDL_THREAD_PRIORITY_LOW: return "SDL_THREAD_PRIORITY_LOW";
|
||||
case SDL_THREAD_PRIORITY_NORMAL: return "SDL_THREAD_PRIORITY_NORMAL";
|
||||
case SDL_THREAD_PRIORITY_HIGH: return "SDL_THREAD_PRIORITY_HIGH";
|
||||
case SDL_THREAD_PRIORITY_TIME_CRITICAL: return "SDL_THREAD_PRIORITY_TIME_CRITICAL";
|
||||
switch (priority) {
|
||||
case SDL_THREAD_PRIORITY_LOW:
|
||||
return "SDL_THREAD_PRIORITY_LOW";
|
||||
case SDL_THREAD_PRIORITY_NORMAL:
|
||||
return "SDL_THREAD_PRIORITY_NORMAL";
|
||||
case SDL_THREAD_PRIORITY_HIGH:
|
||||
return "SDL_THREAD_PRIORITY_HIGH";
|
||||
case SDL_THREAD_PRIORITY_TIME_CRITICAL:
|
||||
return "SDL_THREAD_PRIORITY_TIME_CRITICAL";
|
||||
}
|
||||
|
||||
return "???";
|
||||
|
@ -50,9 +53,9 @@ ThreadFunc(void *data)
|
|||
|
||||
SDL_TLSSet(tls, "baby thread", NULL);
|
||||
SDL_Log("Started thread %s: My thread id is %lu, thread data = %s\n",
|
||||
(char *) data, SDL_ThreadID(), (const char *)SDL_TLSGet(tls));
|
||||
(char *)data, SDL_ThreadID(), (const char *)SDL_TLSGet(tls));
|
||||
while (alive) {
|
||||
SDL_Log("Thread '%s' is alive!\n", (char *) data);
|
||||
SDL_Log("Thread '%s' is alive!\n", (char *)data);
|
||||
|
||||
if (testprio) {
|
||||
SDL_Log("SDL_SetThreadPriority(%s):%d\n", getprioritystr(prio), SDL_SetThreadPriority(prio));
|
||||
|
@ -63,7 +66,7 @@ ThreadFunc(void *data)
|
|||
|
||||
SDL_Delay(1 * 1000);
|
||||
}
|
||||
SDL_Log("Thread '%s' exiting!\n", (char *) data);
|
||||
SDL_Log("Thread '%s' exiting!\n", (char *)data);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -76,8 +79,7 @@ killed(int sig)
|
|||
quit(0);
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int arg = 1;
|
||||
SDL_Thread *thread;
|
||||
|
@ -131,8 +133,8 @@ main(int argc, char *argv[])
|
|||
}
|
||||
raise(SIGTERM);
|
||||
|
||||
SDL_Quit(); /* Never reached */
|
||||
return 0; /* Never reached */
|
||||
SDL_Quit(); /* Never reached */
|
||||
return 0; /* Never reached */
|
||||
}
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue