Sort Includes Alphabetically (#666)

* Consistent tabs in makefile

* Update clang format to fix broken config settings

* Use new clang format settings to sort includes

* Minor python script warning fixes

* Fix a woopsy
This commit is contained in:
Ryan Myers
2025-07-04 14:43:05 -04:00
committed by GitHub
parent de74b2634f
commit 278112886b
56 changed files with 417 additions and 425 deletions
+3 -3
View File
@@ -13,11 +13,11 @@ AlignAfterOpenBracket: Align
AlignOperands: true
BreakBeforeTernaryOperators: true
BreakBeforeBinaryOperators: None
AllowShortBlocksOnASingleLine: true
AllowShortBlocksOnASingleLine: Always
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AlignEscapedNewlines: Left
AlignTrailingComments: true
SortIncludes: false
SortIncludes: CaseInsensitive
+15 -15
View File
@@ -46,7 +46,7 @@ endif
# Common build print status function
define print
@$(PRINT) "$(GREEN)$(1) $(YELLOW)$(2)$(GREEN) -> $(BLUE)$(3)$(NO_COL)\n"
@$(PRINT) "$(GREEN)$(1) $(YELLOW)$(2)$(GREEN) -> $(BLUE)$(3)$(NO_COL)\n"
endef
# Directories
@@ -56,7 +56,7 @@ SRC_DIR = src
LIBULTRA_DIR = libultra
ASM_DIRS = asm asm/data asm/assets asm/nonmatchings
HASM_DIRS = $(SRC_DIR)/hasm $(LIBULTRA_DIR)/src/os $(LIBULTRA_DIR)/src/gu $(LIBULTRA_DIR)/src/libc
LIBULTRA_SRC_DIRS = $(LIBULTRA_DIR) $(LIBULTRA_DIR)/src $(LIBULTRA_DIR)/src/audio $(LIBULTRA_DIR)/src/audio/mips1
LIBULTRA_SRC_DIRS = $(LIBULTRA_DIR) $(LIBULTRA_DIR)/src $(LIBULTRA_DIR)/src/audio $(LIBULTRA_DIR)/src/audio/mips1
LIBULTRA_SRC_DIRS += $(LIBULTRA_DIR)/src/debug $(LIBULTRA_DIR)/src/gu $(LIBULTRA_DIR)/src/io
LIBULTRA_SRC_DIRS += $(LIBULTRA_DIR)/src/libc $(LIBULTRA_DIR)/src/os $(LIBULTRA_DIR)/src/sc
@@ -105,17 +105,17 @@ find-command = $(shell which $(1) 2>/dev/null)
# Tools
ifeq ($(shell type mips-linux-gnu-ld >/dev/null 2>/dev/null; echo $$?), 0)
CROSS := mips-linux-gnu-
CROSS := mips-linux-gnu-
else ifeq ($(shell type mips64-linux-gnu-ld >/dev/null 2>/dev/null; echo $$?), 0)
CROSS := mips64-linux-gnu-
CROSS := mips64-linux-gnu-
else ifeq ($(shell type mips64-elf-ld >/dev/null 2>/dev/null; echo $$?), 0)
CROSS := mips64-elf-
CROSS := mips64-elf-
else
# No binutil packages were found, so we have to download the source & build it.
ifeq ($(wildcard $(TOOLS_DIR)/binutils/.*),)
DUMMY != $(TOOLS_DIR)/get-binutils.sh >&2 || echo FAIL
endif
CROSS := $(TOOLS_DIR)/binutils/mips64-elf-
DUMMY != $(TOOLS_DIR)/get-binutils.sh >&2 || echo FAIL
endif
CROSS := $(TOOLS_DIR)/binutils/mips64-elf-
endif
AS = $(CROSS)as
@@ -149,7 +149,7 @@ ifeq ($(NON_MATCHING),1)
C_STANDARD := -std=gnu99
else
MATCHDEFS += ANTI_TAMPER=1
# Override compiler choice on matching builds.
# Override compiler choice on matching builds.
COMPILER := ido
C_STANDARD := -std=gnu90
endif
@@ -181,7 +181,7 @@ ASM_DEFINES += --defsym BOOT_$(BOOT_CIC)=1
C_DEFINES += -DCIC_ID=$(BOOT_CIC)
INCLUDE_CFLAGS = -I . -I include -I include/libc -I include/PR -I include/sys -I $(BIN_DIRS) -I $(SRC_DIR) -I $(LIBULTRA_DIR)
INCLUDE_CFLAGS += -I $(LIBULTRA_DIR)/src/gu -I $(LIBULTRA_DIR)/src/libc -I $(LIBULTRA_DIR)/src/io -I $(LIBULTRA_DIR)/src/sc
INCLUDE_CFLAGS += -I $(LIBULTRA_DIR)/src/gu -I $(LIBULTRA_DIR)/src/libc -I $(LIBULTRA_DIR)/src/io -I $(LIBULTRA_DIR)/src/sc
INCLUDE_CFLAGS += -I $(LIBULTRA_DIR)/src/audio -I $(LIBULTRA_DIR)/src/os
ASFLAGS = -march=vr4300 -32 -G0 $(ASM_DEFINES) $(INCLUDE_CFLAGS)
@@ -189,9 +189,9 @@ OBJCOPYFLAGS = -O binary
# Pad to 12MB if matching, otherwise build to a necessary minimum of 1.004MB
ifeq ($(NON_MATCHING),1)
OBJCOPYFLAGS += --pad-to=0x101000 --gap-fill=0xFF
OBJCOPYFLAGS += --pad-to=0x101000 --gap-fill=0xFF
else
OBJCOPYFLAGS += --pad-to=0xC00000 --gap-fill=0xFF
OBJCOPYFLAGS += --pad-to=0xC00000 --gap-fill=0xFF
endif
@@ -281,7 +281,7 @@ ifeq ($(COMPILER),gcc)
endif
$(GCC_SAFE_FILES): CC := $(CROSS)gcc
$(GCC_SAFE_FILES): CC_WARNINGS :=
$(GCC_SAFE_FILES): CC_WARNINGS :=
$(GCC_SAFE_FILES): MIPSISET := -mips3
$(GCC_SAFE_FILES): OPT_FLAGS := -Os
$(GCC_SAFE_FILES): CFLAGS := -DNDEBUG -DAVOID_UB -DNON_MATCHING $(INCLUDE_CFLAGS) $(C_DEFINES) \
@@ -361,7 +361,7 @@ clean_src:
clean_assets:
rm -rf $(ASM_DIRS)
rm -rf $(BIN_DIRS)
cleanall:
rm -rf $(BUILD_DIR)
@@ -442,7 +442,7 @@ $(BUILD_DIR)/$(LIBULTRA_DIR)/src/libc/ll.c.o: $(LIBULTRA_DIR)/src/libc/ll.c | bu
$(BUILD_DIR)/%.s.o: %.s | build_assets
$(call print,Assembling:,$<,$@)
$(V)$(AS) $(ASFLAGS) -MD $(BUILD_DIR)/$*.d -o $@ $<
$(V)$(AS) $(ASFLAGS) -MD $(BUILD_DIR)/$*.d -o $@ $<
# Specifically override the header file from what splat extracted to be replaced by what we have in the hasm folder
$(BUILD_DIR)/asm/header.s.o: src/hasm/header.s | build_assets
+3 -3
View File
@@ -4,10 +4,10 @@
regions=('pal' 'jpn' 'us' 'pal' 'us')
versions=('v77' 'v79' 'v80' 'v80' 'v77')
for i in ${!regions[@]}; do
for i in "${!regions[@]}"; do
region=${regions[$i]}
version=${versions[$i]}
echo "Compiling $region.$version"
make REGION=$region VERSION=$version cleanextract && make assets REGION=$region VERSION=$version -j12
if [[ $(sha1sum -c --quiet ver/verification/dkr.$region.$version.sha1) = "" ]]; then echo "$region.$version OK"; else echo "Failed $region.$version"; exit 1; fi
make REGION="$region" VERSION="$version" cleanextract && make assets REGION="$region" VERSION="$version" -j12
if [[ $(sha1sum -c --quiet ver/verification/dkr."$region"."$version".sha1) = "" ]]; then echo "$region.$version OK"; else echo "Failed $region.$version"; exit 1; fi
done
+2 -2
View File
@@ -9,7 +9,7 @@ shopt -s globstar
if (( $# > 0 )); then
echo "Formatting file(s) $*"
echo "Running clang-format..."
clang-format-11 ${FORMAT_OPTS} "$@"
clang-format ${FORMAT_OPTS} "$@"
echo "Running clang-tidy..."
clang-tidy ${TIDY_OPTS} "$@" -- ${COMPILER_OPTS} &> /dev/null
echo "Adding missing final new lines..."
@@ -22,7 +22,7 @@ echo "Formatting C files. This will take a bit"
echo "Running clang-format..."
clang-format ${FORMAT_OPTS} src/**/*.c
echo "Running clang-tidy..."
#clang-tidy ${TIDY_OPTS} src/**/*.c -- ${COMPILER_OPTS} &> /dev/null
clang-tidy ${TIDY_OPTS} src/**/*.c -- ${COMPILER_OPTS} &> /dev/null
echo "Adding missing final new lines..."
find src/ -type f -name "*.c" -exec sed -i -e '$a\' {} \;
echo "Done formatting all files."
+2 -2
View File
@@ -4,5 +4,5 @@
mkdir -p m2cfiles
ASMFILE=$(find asm -type f -name "*$1.s")
echo '#include "../ctx.c"\n' > m2cfiles/$1.c
.venv/bin/python3 tools/m2c/m2c.py --target mips-ido-c --pointer-style right --context ctx.c -f $1 $ASMFILE >> m2cfiles/$1.c
printf '#include "../ctx.c"\n' > m2cfiles/"$1".c
.venv/bin/python3 tools/m2c/m2c.py --target mips-ido-c --pointer-style right --context ctx.c -f "$1" "$ASMFILE" >> m2cfiles/"$1".c
+2 -2
View File
@@ -1,10 +1,10 @@
#include "asset_loading.h"
#include "common.h"
#include "macros.h"
#include "ultra64.h"
#include "gzip.h"
#include "macros.h"
#include "memory.h"
#include "ultra64.h"
/************ .bss ************/
+3 -3
View File
@@ -1,14 +1,14 @@
#include "audio.h"
#include "memory.h"
#include "types.h"
#include "asset_enums.h"
#include "asset_loading.h"
#include "audio_spatial.h"
#include "audiomgr.h"
#include "audiosfx.h"
#include "audio_spatial.h"
#include "sched.h"
#include "libultra/src/audio/seqchannel.h"
#include "sched.h"
#include "types.h"
/************ .data ************/
+7 -7
View File
@@ -1,15 +1,15 @@
#include "audio_spatial.h"
#include "types.h"
#include "macros.h"
#include "audio_vehicle.h"
#include "memory.h"
#include "audio.h"
#include "textures_sprites.h"
#include "objects.h"
#include "audio_vehicle.h"
#include "audiosfx.h"
#include "tracks.h"
#include "macros.h"
#include "math_util.h"
#include "memory.h"
#include "menu.h"
#include "objects.h"
#include "textures_sprites.h"
#include "tracks.h"
#include "types.h"
#define MAX_AUDIO_POINTS 40
#define MAX_AUDIO_LINES 7
+7 -7
View File
@@ -1,17 +1,17 @@
#include "audio_vehicle.h"
#include "types.h"
#include "macros.h"
#include "asset_loading.h"
#include "audio_spatial.h"
#include "audiosfx.h"
#include "objects.h"
#include "joypad.h"
#include "racer.h"
#include "PR/libaudio.h"
#include "game_ui.h"
#include "joypad.h"
#include "macros.h"
#include "math_util.h"
#include "objects.h"
#include "PR/libaudio.h"
#include "printf.h"
#include "asset_loading.h"
#include "racer.h"
#include "types.h"
/************ .data ************/
+5 -5
View File
@@ -1,13 +1,13 @@
#include "audiomgr.h"
#include "memory.h"
#include "video.h"
#include "math_util.h"
#include "asset_loading.h"
#include "common.h"
#include "math_util.h"
#include "memory.h"
#include "objects.h"
#include "PR/abi.h"
#include "common.h"
#include "stacks.h"
#include "rcp_dkr.h"
#include "stacks.h"
#include "video.h"
/**** type define's for structures unique to audiomgr ****/
typedef union {
+3 -3
View File
@@ -1,10 +1,10 @@
#include "audiosfx.h"
#include "memory.h"
#include "video.h"
#include "math_util.h"
#include "asset_loading.h"
#include "math_util.h"
#include "memory.h"
#include "objects.h"
#include "PR/libaudio.h"
#include "video.h"
#define SOUND_PARAM_DURATION(m) (m->velocityMax * 33333)
#define SOUND_PARAM_NEXT_SOUND(m) (m->velocityMin + (m->keyMin & 0xC0) * 4)
+4 -4
View File
@@ -1,13 +1,13 @@
#include "borders.h"
#include "camera.h"
#include "types.h"
#include "macros.h"
#include "structs.h"
#include "f3ddkr.h"
#include "video.h"
#include "game.h"
#include "game_ui.h"
#include "macros.h"
#include "structs.h"
#include "types.h"
#include "video.h"
/**
* Renders the black borders that separate each viewport during multiplayer.
+5 -5
View File
@@ -1,16 +1,16 @@
#include "camera.h"
#include "audio.h"
#include "objects.h"
#include "game.h"
#include "tracks.h"
#include "video.h"
#include "libultra/src/libc/rmonPrintf.h"
#include "math_util.h"
#include "weather.h"
#include "menu.h"
#include "objects.h"
#include "PRinternal/piint.h"
#include "PRinternal/viint.h"
#include "textures_sprites.h"
#include "menu.h"
#include "tracks.h"
#include "video.h"
#include "weather.h"
#define CAMERA_MODEL_STACK_SIZE 5
+7 -8
View File
@@ -1,15 +1,14 @@
#include "fade_transition.h"
#include "types.h"
#include "macros.h"
#include "f3ddkr.h"
#include "asset_enums.h"
#include "memory.h"
#include "video.h"
#include "textures_sprites.h"
#include "math_util.h"
#include "PRinternal/viint.h"
#include "camera.h"
#include "f3ddkr.h"
#include "macros.h"
#include "math_util.h"
#include "memory.h"
#include "PRinternal/viint.h"
#include "textures_sprites.h"
#include "types.h"
#include "video.h"
/************ .data ************/
+4 -4
View File
@@ -1,11 +1,11 @@
#include "font.h"
#include "menu.h"
#include "textures_sprites.h"
#include "asset_loading.h"
#include "camera.h"
#include "common.h"
#include "video.h"
#include "asset_loading.h"
#include "memory.h"
#include "menu.h"
#include "textures_sprites.h"
#include "video.h"
/************ .data ************/
+18 -18
View File
@@ -1,29 +1,29 @@
#include "game.h"
#include "memory.h"
#include "types.h"
#include "macros.h"
#include "structs.h"
#include "asset_enums.h"
#include "asset_loading.h"
#include "menu.h"
#include "video.h"
#include "set_rsp_segment.h"
#include "weather.h"
#include "audio.h"
#include "objects.h"
#include "camera.h"
#include "save_data.h"
#include "rcp_dkr.h"
#include "audiosfx.h"
#include "lights.h"
#include "textures_sprites.h"
#include "audio_spatial.h"
#include "tracks.h"
#include "racer.h"
#include "joypad.h"
#include "audiosfx.h"
#include "camera.h"
#include "common.h"
#include "joypad.h"
#include "lights.h"
#include "macros.h"
#include "memory.h"
#include "menu.h"
#include "objects.h"
#include "racer.h"
#include "rcp_dkr.h"
#include "save_data.h"
#include "set_rsp_segment.h"
#include "structs.h"
#include "textures_sprites.h"
#include "thread3_main.h"
#include "tracks.h"
#include "types.h"
#include "video.h"
#include "weather.h"
/************ .data ************/
+7 -7
View File
@@ -1,15 +1,15 @@
#include "game_text.h"
#include "asset_loading.h"
#include "camera.h"
#include "common.h"
#include "menu.h"
#include "objects.h"
#include "racer.h"
#include "game.h"
#include "joypad.h"
#include "PRinternal/viint.h"
#include "asset_loading.h"
#include "thread3_main.h"
#include "memory.h"
#include "camera.h"
#include "menu.h"
#include "objects.h"
#include "PRinternal/viint.h"
#include "racer.h"
#include "thread3_main.h"
/************ .data ************/
+22 -22
View File
@@ -1,28 +1,28 @@
#include "game_ui.h"
#include "common.h"
#include "types.h"
#include "macros.h"
#include "structs.h"
#include "f3ddkr.h"
#include "camera.h"
#include "game.h"
#include "audio.h"
#include "textures_sprites.h"
#include "racer.h"
#include "math_util.h"
#include "objects.h"
#include "game_text.h"
#include "object_models.h"
#include "tracks.h"
#include "rcp_dkr.h"
#include "audiosfx.h"
#include "printf.h"
#include "audio_spatial.h"
#include "joypad.h"
#include "PRinternal/viint.h"
#include "asset_loading.h"
#include "thread3_main.h"
#include "audio.h"
#include "audio_spatial.h"
#include "audiosfx.h"
#include "camera.h"
#include "common.h"
#include "f3ddkr.h"
#include "game.h"
#include "game_text.h"
#include "joypad.h"
#include "macros.h"
#include "math_util.h"
#include "menu.h"
#include "object_models.h"
#include "objects.h"
#include "PRinternal/viint.h"
#include "printf.h"
#include "racer.h"
#include "rcp_dkr.h"
#include "structs.h"
#include "textures_sprites.h"
#include "thread3_main.h"
#include "tracks.h"
#include "types.h"
/************ .data ************/
+1 -1
View File
@@ -1,7 +1,7 @@
#include "gzip.h"
#include "asset_loading.h"
#include "PR/os_libc.h"
#include "memory.h"
#include "PR/os_libc.h"
/************ .data ************/
+1 -1
View File
@@ -1,8 +1,8 @@
#include "collision.h"
#include "types.h"
#include "macros.h"
#include "textures_sprites.h"
#include "types.h"
/*******************************/

Some files were not shown because too many files have changed in this diff Show More