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

(cherry picked from commit 5750bcb174)
This commit is contained in:
Sam Lantinga
2022-11-30 12:51:59 -08:00
parent 5c4bc807f7
commit b8d85c6939
764 changed files with 50598 additions and 54407 deletions

View File

@@ -16,12 +16,11 @@
#include "SDL_main.h"
#ifdef main
# undef main
#undef main
#endif /* main */
/* Pop up an out of memory message, returns to Windows */
static BOOL
OutOfMemory(void)
static BOOL OutOfMemory(void)
{
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Fatal Error", "Out of memory - aborting", NULL);
return FALSE;
@@ -29,16 +28,15 @@ OutOfMemory(void)
#if defined(_MSC_VER)
/* The VC++ compiler needs main/wmain defined */
# define console_ansi_main main
# if UNICODE
# define console_wmain wmain
# endif
#define console_ansi_main main
#if UNICODE
#define console_wmain wmain
#endif
#endif
/* Gets the arguments with GetCommandLine, converts them to argc and argv
and calls SDL_main */
static int
main_getcmdline(void)
static int main_getcmdline(void)
{
LPWSTR *argvw;
char **argv;
@@ -91,17 +89,14 @@ main_getcmdline(void)
}
/* This is where execution begins [console apps, ansi] */
int
console_ansi_main(int argc, char *argv[])
int console_ansi_main(int argc, char *argv[])
{
return main_getcmdline();
}
#if UNICODE
/* This is where execution begins [console apps, unicode] */
int
console_wmain(int argc, wchar_t *wargv[], wchar_t *wenvp)
int console_wmain(int argc, wchar_t *wargv[], wchar_t *wenvp)
{
return main_getcmdline();
}