mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-18 18:58:27 +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:
parent
5c4bc807f7
commit
b8d85c6939
764 changed files with 50598 additions and 54407 deletions
32
build-scripts/clang-format-src.sh
Executable file
32
build-scripts/clang-format-src.sh
Executable file
|
@ -0,0 +1,32 @@
|
|||
#!/bin/sh
|
||||
|
||||
cd "$(dirname $0)/../src"
|
||||
|
||||
echo "Running clang-format in $(pwd)"
|
||||
|
||||
find . -regex '.*\.[chm]p*' -exec clang-format -i {} \;
|
||||
|
||||
# Revert third-party code
|
||||
git checkout \
|
||||
events/imKStoUCS.* \
|
||||
hidapi \
|
||||
joystick/controller_type.c \
|
||||
joystick/controller_type.h \
|
||||
joystick/hidapi/steam/controller_constants.h \
|
||||
joystick/hidapi/steam/controller_structs.h \
|
||||
libm \
|
||||
stdlib/SDL_malloc.c \
|
||||
stdlib/SDL_qsort.c \
|
||||
stdlib/SDL_strtokr.c \
|
||||
video/arm \
|
||||
video/khronos \
|
||||
video/x11/edid-parse.c \
|
||||
video/yuv2rgb
|
||||
clang-format -i hidapi/SDL_hidapi.c
|
||||
|
||||
# Revert generated code
|
||||
git checkout dynapi/SDL_dynapi_overrides.h
|
||||
git checkout dynapi/SDL_dynapi_procs.h
|
||||
git checkout render/metal/SDL_shaders_metal_*.h
|
||||
|
||||
echo "clang-format complete!"
|
Loading…
Add table
Add a link
Reference in a new issue