From 811ea30321ee0004498a5ef931464df407cad503 Mon Sep 17 00:00:00 2001 From: octorock <79596758+octorock@users.noreply.github.com> Date: Sun, 4 Jul 2021 16:48:34 +0200 Subject: [PATCH] Fix format.sh --- format.sh | 2 +- include/createObject.h | 2 ++ include/cutscene.h | 2 +- include/enemy.h | 2 +- include/game.h | 2 ++ include/gba/eeprom.h | 2 ++ include/gba/flash_internal.h | 2 ++ include/gba/multi_boot.h | 2 ++ include/gba/syscall.h | 2 ++ include/greatFairy.h | 1 + include/main.h | 2 ++ include/random.h | 2 ++ include/script.h | 2 +- src/enemy/moldorm.c | 3 +++ 14 files changed, 24 insertions(+), 4 deletions(-) diff --git a/format.sh b/format.sh index 0c232115..28dc63e0 100755 --- a/format.sh +++ b/format.sh @@ -24,7 +24,7 @@ clang-format ${FORMAT_OPTS} src/**/*.c clang-format ${FORMAT_OPTS} include/**/*.h echo "Running clang-tidy..." clang-tidy ${TIDY_OPTS} src/**/*.c -- ${COMPILER_OPTS} &> /dev/null -clang-format ${FORMAT_OPTS} include/**/*.h +clang-tidy ${TIDY_OPTS} include/**/*.h -- ${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." diff --git a/include/createObject.h b/include/createObject.h index 03f3632e..19efbf38 100644 --- a/include/createObject.h +++ b/include/createObject.h @@ -1,6 +1,8 @@ #ifndef CREATEOBJECT_H #define CREATEOBJECT_H +#include "entity.h" + // maybe a dedicated (create)Effect.h/c void CreateDust(Entity* parent); void CreateDustSmall(Entity* parent); diff --git a/include/cutscene.h b/include/cutscene.h index 70f56665..72d44fef 100644 --- a/include/cutscene.h +++ b/include/cutscene.h @@ -8,7 +8,7 @@ typedef struct { u8 textIndex; u8 filler[11]; u16 pauseTime; - u8 filler[2]; + u8 filler2[2]; s32 targetX; s32 targetY; } CutsceneBehavior; diff --git a/include/enemy.h b/include/enemy.h index cdfdfafe..39317a43 100644 --- a/include/enemy.h +++ b/include/enemy.h @@ -1,5 +1,5 @@ #ifndef ENEMY_H -#define EMEMY_H +#define ENEMY_H #include "global.h" #include "entity.h" diff --git a/include/game.h b/include/game.h index dec15e21..fb9d486b 100644 --- a/include/game.h +++ b/include/game.h @@ -1,6 +1,8 @@ #ifndef GAME_H #define GAME_H +#include "gba/types.h" + u32 CheckIsDungeon(void); #endif // GAME_H diff --git a/include/gba/eeprom.h b/include/gba/eeprom.h index 46c7e35c..5400cace 100644 --- a/include/gba/eeprom.h +++ b/include/gba/eeprom.h @@ -1,6 +1,8 @@ #ifndef GUARD_GBA_EEPROM #define GUARD_GBA_EEPROM +#include "types.h" + // error codes #define EEPROM_OUT_OF_RANGE 0x80ff #define EEPROM_COMPARE_FAILED 0x8000 diff --git a/include/gba/flash_internal.h b/include/gba/flash_internal.h index 09f3f79c..926e19a0 100644 --- a/include/gba/flash_internal.h +++ b/include/gba/flash_internal.h @@ -1,6 +1,8 @@ #ifndef GUARD_GBA_FLASH_INTERNAL_H #define GUARD_GBA_FLASH_INTERNAL_H +#include "types.h" + #define FLASH_BASE ((u8*)0xE000000) #define FLASH_WRITE(addr, data) ((*(vu8*)(FLASH_BASE + (addr))) = (data)) diff --git a/include/gba/multi_boot.h b/include/gba/multi_boot.h index 6aa5a2f6..578a7637 100644 --- a/include/gba/multi_boot.h +++ b/include/gba/multi_boot.h @@ -1,6 +1,8 @@ #ifndef GUARD_GBA_MULTI_BOOT_H #define GUARD_GBA_MULTI_BOOT_H +#include "types.h" + #define MULTIBOOT_NCHILD 3 // Maximum number of slaves #define MULTIBOOT_HEADER_SIZE 0xc0 // Header size #define MULTIBOOT_SEND_SIZE_MIN 0x100 // Minimum transmission size diff --git a/include/gba/syscall.h b/include/gba/syscall.h index 0c07bcbb..eca78eb4 100644 --- a/include/gba/syscall.h +++ b/include/gba/syscall.h @@ -1,6 +1,8 @@ #ifndef GUARD_GBA_SYSCALL_H #define GUARD_GBA_SYSCALL_H +#include "types.h" + #define RESET_EWRAM 0x01 #define RESET_IWRAM 0x02 #define RESET_PALETTE 0x04 diff --git a/include/greatFairy.h b/include/greatFairy.h index 39d3e539..461b83f9 100644 --- a/include/greatFairy.h +++ b/include/greatFairy.h @@ -1,6 +1,7 @@ #ifndef GREATFAIRY_H #define GREATFAIRY_H +#include "entity.h" #include "screen.h" void GreatFairy_InitializeAnimation(Entity*); diff --git a/include/main.h b/include/main.h index 3e8c63eb..679fd35f 100644 --- a/include/main.h +++ b/include/main.h @@ -1,6 +1,8 @@ #ifndef MAIN_H #define MAIN_H +#include "global.h" + typedef struct { // 0x03001000 u8 field_0x0; u8 field_0x1; diff --git a/include/random.h b/include/random.h index d87b75e7..d2c7f3d7 100644 --- a/include/random.h +++ b/include/random.h @@ -1,6 +1,8 @@ #ifndef RANDOM_H #define RANDOM_H +#include "gba/types.h" + extern u32 Random(void); extern u32 gRand; diff --git a/include/script.h b/include/script.h index cfc2c180..7a72550f 100644 --- a/include/script.h +++ b/include/script.h @@ -1,7 +1,7 @@ #ifndef SCRIPT_H #define SCRIPT_H -#include "global.h" +#include "entity.h" typedef struct ScriptExecutionContext { u16* scriptInstructionPointer; diff --git a/src/enemy/moldorm.c b/src/enemy/moldorm.c index ed08478d..2fc1f67f 100644 --- a/src/enemy/moldorm.c +++ b/src/enemy/moldorm.c @@ -141,6 +141,9 @@ void sub_08022DE8(Entity* this) { } } +// this definition is only here, so clang-tidy does not mess gUnk_080CBBBC up. +extern void sub_08022E40(Entity* this); + ASM_FUNC("asm/non_matching/moldorm/sub_08022E40.inc", void sub_08022E40(Entity* this)) ASM_FUNC("asm/non_matching/moldorm/sub_08022EAC.inc", void sub_08022EAC(Entity* this))