From c3113db931ad406154c3bfd60dc26458e0d5fe3f Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sun, 14 Oct 2018 20:00:14 +0200 Subject: [PATCH] Move HEAP_SIZE to malloc and use void instead of empty argument list --- include/field_weather.h | 2 +- include/global.h | 2 -- include/malloc.h | 1 + include/palette.h | 2 +- include/party_menu.h | 4 ++-- include/rotating_gate.h | 2 +- src/battle_anim_80A5C6C.c | 2 +- src/field_player_avatar.c | 4 ++-- src/fldeff_sweetscent.c | 2 +- src/item_use.c | 4 ++-- src/task.c | 4 ++-- 11 files changed, 14 insertions(+), 15 deletions(-) diff --git a/include/field_weather.h b/include/field_weather.h index 7ad8d21e78..a48361b8af 100644 --- a/include/field_weather.h +++ b/include/field_weather.h @@ -155,7 +155,7 @@ void sub_80AEDBC(void); void SetSav1WeatherFromCurrMapHeader(void); // ... void DoCurrentWeather(void); -void sub_8080750(); +void sub_8080750(void); bool8 IsWeatherNotFadingIn(void); bool8 IsWeatherChangeComplete(void); diff --git a/include/global.h b/include/global.h index 9ae892b5c5..3dab84a3af 100644 --- a/include/global.h +++ b/include/global.h @@ -61,8 +61,6 @@ #define min(a, b) ((a) < (b) ? (a) : (b)) #define max(a, b) ((a) >= (b) ? (a) : (b)) -#define HEAP_SIZE 0x1C000 - extern u8 gStringVar1[]; extern u8 gStringVar2[]; extern u8 gStringVar3[]; diff --git a/include/malloc.h b/include/malloc.h index 6efa8fbef7..c215f56c04 100644 --- a/include/malloc.h +++ b/include/malloc.h @@ -13,6 +13,7 @@ } extern u8 gHeap[]; + void *Alloc(u32 size); void *AllocZeroed(u32 size); void Free(void *pointer); diff --git a/include/palette.h b/include/palette.h index d14fa1fcd8..c14e9f453a 100644 --- a/include/palette.h +++ b/include/palette.h @@ -55,7 +55,7 @@ bool8 unref_sub_8073D3C(u32, u8, u8, u8, u16); void unref_sub_8073D84(u8, u32 *); void ResetPaletteStructByUid(u16); void ResetPaletteStruct(u8); -void ResetPaletteFadeControl(); +void ResetPaletteFadeControl(void); void unref_sub_8074168(u16); void unref_sub_8074194(u16); void InvertPlttBuffer(u32); diff --git a/include/party_menu.h b/include/party_menu.h index b93b78544c..170fcafc18 100644 --- a/include/party_menu.h +++ b/include/party_menu.h @@ -50,8 +50,8 @@ void sub_81B1370(u8 taskId); void display_pokemon_menu_message(u8 windowId); void sub_81B1F18(u8 taskId, u8 pokemonIdx, s8 a, s16 hp, TaskFunc func); void sub_81B1B5C(void *a, u8 b); -u8 sub_81B1BD4(); -void sub_81B8448(); +u8 sub_81B1BD4(void); +void sub_81B8448(void); void sub_81B8518(u8 unused); u8 sub_81B1360(void); void sub_81B8904(u8 arg0, void (*callback)(void)); diff --git a/include/rotating_gate.h b/include/rotating_gate.h index 2ae26aa5b8..fd86a6b04d 100644 --- a/include/rotating_gate.h +++ b/include/rotating_gate.h @@ -2,7 +2,7 @@ #define GUARD_ROTATING_GATE_H void RotatingGatePuzzleCameraUpdate(s16, s16); -void RotatingGate_InitPuzzleAndGraphics(); +void RotatingGate_InitPuzzleAndGraphics(void); u32 CheckForRotatingGatePuzzleCollision(u8, s16, s16); bool32 CheckForRotatingGatePuzzleCollisionWithoutAnimation(u8, s16, s16); diff --git a/src/battle_anim_80A5C6C.c b/src/battle_anim_80A5C6C.c index a461d3d1db..ebe1718b71 100644 --- a/src/battle_anim_80A5C6C.c +++ b/src/battle_anim_80A5C6C.c @@ -860,7 +860,7 @@ bool8 IsBattlerSpritePresent(u8 battlerId) return FALSE; } -bool8 IsDoubleBattle() +bool8 IsDoubleBattle(void) { return IS_DOUBLE_BATTLE(); } diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index fd315dd98d..b9cf7d102b 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -285,7 +285,7 @@ void MovementType_Player(struct Sprite *sprite) UpdateEventObjectCurrentMovement(&gEventObjects[sprite->data[0]], sprite, EventObjectCB2_NoMovement2); } -static u8 EventObjectCB2_NoMovement2() +static u8 EventObjectCB2_NoMovement2(void) { return 0; } @@ -375,7 +375,7 @@ static void PlayerAllowForcedMovementIfMovingSameDirection(void) gPlayerAvatar.flags &= ~PLAYER_AVATAR_FLAG_5; } -static bool8 TryDoMetatileBehaviorForcedMovement() +static bool8 TryDoMetatileBehaviorForcedMovement(void) { return gUnknown_08497444[GetForcedMovementByMetatileBehavior()](); } diff --git a/src/fldeff_sweetscent.c b/src/fldeff_sweetscent.c index 14da87eb33..f592ed5329 100644 --- a/src/fldeff_sweetscent.c +++ b/src/fldeff_sweetscent.c @@ -35,7 +35,7 @@ void hm2_sweet_scent(void) gFieldEffectArguments[0] = GetCursorSelectionMonId(); } -bool8 FldEff_SweetScent() +bool8 FldEff_SweetScent(void) { u8 taskId; diff --git a/src/item_use.c b/src/item_use.c index 67bdabd879..633d975a8c 100755 --- a/src/item_use.c +++ b/src/item_use.c @@ -203,7 +203,7 @@ u8 CheckIfItemIsTMHMOrEvolutionStone(u16 itemId) return 0; } -void sub_80FD254() +void sub_80FD254(void) { struct MailStruct mail; mail.itemId = gSpecialVar_ItemId; @@ -249,7 +249,7 @@ void ItemUseOnFieldCB_Bike(u8 taskId) DestroyTask(taskId); } -bool32 CanFish() +bool32 CanFish(void) { s16 x, y; u16 tileBehavior; diff --git a/src/task.c b/src/task.c index fafa7c70d6..f067e21b4c 100644 --- a/src/task.c +++ b/src/task.c @@ -7,7 +7,7 @@ struct Task gTasks[NUM_TASKS]; static void InsertTask(u8 newTaskId); -static u8 FindFirstActiveTask(); +static u8 FindFirstActiveTask(void); void ResetTasks(void) { @@ -124,7 +124,7 @@ void RunTasks(void) } } -static u8 FindFirstActiveTask() +static u8 FindFirstActiveTask(void) { u8 taskId;