Fix format.sh

This commit is contained in:
octorock 2021-07-04 16:48:34 +02:00
parent 3664b4a37b
commit 811ea30321
14 changed files with 24 additions and 4 deletions

View File

@ -24,7 +24,7 @@ clang-format ${FORMAT_OPTS} src/**/*.c
clang-format ${FORMAT_OPTS} include/**/*.h clang-format ${FORMAT_OPTS} include/**/*.h
echo "Running clang-tidy..." echo "Running clang-tidy..."
clang-tidy ${TIDY_OPTS} src/**/*.c -- ${COMPILER_OPTS} &> /dev/null 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..." echo "Adding missing final new lines..."
find src/ -type f -name "*.c" -exec sed -i -e '$a\' {} \; find src/ -type f -name "*.c" -exec sed -i -e '$a\' {} \;
echo "Done formatting all files." echo "Done formatting all files."

View File

@ -1,6 +1,8 @@
#ifndef CREATEOBJECT_H #ifndef CREATEOBJECT_H
#define CREATEOBJECT_H #define CREATEOBJECT_H
#include "entity.h"
// maybe a dedicated (create)Effect.h/c // maybe a dedicated (create)Effect.h/c
void CreateDust(Entity* parent); void CreateDust(Entity* parent);
void CreateDustSmall(Entity* parent); void CreateDustSmall(Entity* parent);

View File

@ -8,7 +8,7 @@ typedef struct {
u8 textIndex; u8 textIndex;
u8 filler[11]; u8 filler[11];
u16 pauseTime; u16 pauseTime;
u8 filler[2]; u8 filler2[2];
s32 targetX; s32 targetX;
s32 targetY; s32 targetY;
} CutsceneBehavior; } CutsceneBehavior;

View File

@ -1,5 +1,5 @@
#ifndef ENEMY_H #ifndef ENEMY_H
#define EMEMY_H #define ENEMY_H
#include "global.h" #include "global.h"
#include "entity.h" #include "entity.h"

View File

@ -1,6 +1,8 @@
#ifndef GAME_H #ifndef GAME_H
#define GAME_H #define GAME_H
#include "gba/types.h"
u32 CheckIsDungeon(void); u32 CheckIsDungeon(void);
#endif // GAME_H #endif // GAME_H

View File

@ -1,6 +1,8 @@
#ifndef GUARD_GBA_EEPROM #ifndef GUARD_GBA_EEPROM
#define GUARD_GBA_EEPROM #define GUARD_GBA_EEPROM
#include "types.h"
// error codes // error codes
#define EEPROM_OUT_OF_RANGE 0x80ff #define EEPROM_OUT_OF_RANGE 0x80ff
#define EEPROM_COMPARE_FAILED 0x8000 #define EEPROM_COMPARE_FAILED 0x8000

View File

@ -1,6 +1,8 @@
#ifndef GUARD_GBA_FLASH_INTERNAL_H #ifndef GUARD_GBA_FLASH_INTERNAL_H
#define GUARD_GBA_FLASH_INTERNAL_H #define GUARD_GBA_FLASH_INTERNAL_H
#include "types.h"
#define FLASH_BASE ((u8*)0xE000000) #define FLASH_BASE ((u8*)0xE000000)
#define FLASH_WRITE(addr, data) ((*(vu8*)(FLASH_BASE + (addr))) = (data)) #define FLASH_WRITE(addr, data) ((*(vu8*)(FLASH_BASE + (addr))) = (data))

View File

@ -1,6 +1,8 @@
#ifndef GUARD_GBA_MULTI_BOOT_H #ifndef GUARD_GBA_MULTI_BOOT_H
#define GUARD_GBA_MULTI_BOOT_H #define GUARD_GBA_MULTI_BOOT_H
#include "types.h"
#define MULTIBOOT_NCHILD 3 // Maximum number of slaves #define MULTIBOOT_NCHILD 3 // Maximum number of slaves
#define MULTIBOOT_HEADER_SIZE 0xc0 // Header size #define MULTIBOOT_HEADER_SIZE 0xc0 // Header size
#define MULTIBOOT_SEND_SIZE_MIN 0x100 // Minimum transmission size #define MULTIBOOT_SEND_SIZE_MIN 0x100 // Minimum transmission size

View File

@ -1,6 +1,8 @@
#ifndef GUARD_GBA_SYSCALL_H #ifndef GUARD_GBA_SYSCALL_H
#define GUARD_GBA_SYSCALL_H #define GUARD_GBA_SYSCALL_H
#include "types.h"
#define RESET_EWRAM 0x01 #define RESET_EWRAM 0x01
#define RESET_IWRAM 0x02 #define RESET_IWRAM 0x02
#define RESET_PALETTE 0x04 #define RESET_PALETTE 0x04

View File

@ -1,6 +1,7 @@
#ifndef GREATFAIRY_H #ifndef GREATFAIRY_H
#define GREATFAIRY_H #define GREATFAIRY_H
#include "entity.h"
#include "screen.h" #include "screen.h"
void GreatFairy_InitializeAnimation(Entity*); void GreatFairy_InitializeAnimation(Entity*);

View File

@ -1,6 +1,8 @@
#ifndef MAIN_H #ifndef MAIN_H
#define MAIN_H #define MAIN_H
#include "global.h"
typedef struct { // 0x03001000 typedef struct { // 0x03001000
u8 field_0x0; u8 field_0x0;
u8 field_0x1; u8 field_0x1;

View File

@ -1,6 +1,8 @@
#ifndef RANDOM_H #ifndef RANDOM_H
#define RANDOM_H #define RANDOM_H
#include "gba/types.h"
extern u32 Random(void); extern u32 Random(void);
extern u32 gRand; extern u32 gRand;

View File

@ -1,7 +1,7 @@
#ifndef SCRIPT_H #ifndef SCRIPT_H
#define SCRIPT_H #define SCRIPT_H
#include "global.h" #include "entity.h"
typedef struct ScriptExecutionContext { typedef struct ScriptExecutionContext {
u16* scriptInstructionPointer; u16* scriptInstructionPointer;

View File

@ -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_08022E40.inc", void sub_08022E40(Entity* this))
ASM_FUNC("asm/non_matching/moldorm/sub_08022EAC.inc", void sub_08022EAC(Entity* this)) ASM_FUNC("asm/non_matching/moldorm/sub_08022EAC.inc", void sub_08022EAC(Entity* this))