mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-29 02:34:23 +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
(cherry picked from commit 5750bcb174)
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user