From 11dda014eead83e83811b0ec6348e570960cce6e Mon Sep 17 00:00:00 2001 From: Drew T <50529377+Druthulu@users.noreply.github.com> Date: Wed, 2 Sep 2026 13:32:32 -0600 Subject: [PATCH] =?UTF-8?q?fix(main):=20align=205=20forward=20declarations?= =?UTF-8?q?=20with=20their=20definitions=20(=C2=A7376),=20byte-neutral?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Each of these five had a TU forward declaration that contradicted the real signature, which is what made gate_main drop their byte-correct drafts: func_800316F8 void f(void*) -> void f(s32) + cast at the one call func_8003602C void f(void) -> void f(s32) (use is address-taken) func_80036260 void f(void) -> int f(void) (use is address-taken) func_80038FFC void f(u8**) -> s32 f(s32*) + cast at the one call func_80039C70 void f(void*,s16,u8) -> void f(u8*,s16,s16) Verified byte-identical with NO draft substituted, so any later gate failure is attributable to the draft and not to this edit. OPERATIONAL NOTE: gate_main's first action is , so an UNCOMMITTED declaration edit is silently discarded and the gate then judges the drafts against the old declarations. Commit alignment work before gating (R42's shape, seen from the tool's side). --- src/800_b.c | 4 ++-- src/800_c.c | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/800_b.c b/src/800_b.c index 0359bd210..026ed2d5a 100644 --- a/src/800_b.c +++ b/src/800_b.c @@ -2996,7 +2996,7 @@ extern s32 D_800C7D2C; extern void func_8002EFF8(s32 a0, s32 a1); extern void func_8003D3B4(s32, s32); extern void func_800314DC(struct Obj *); -extern void func_800316F8(void *); +extern void func_800316F8(s32); /* §376: the definition takes s32; cast at the use site */ extern void func_80031988(struct Ent30D80 *); typedef struct VoiceF80 { @@ -3048,7 +3048,7 @@ void func_80030F80(void) *(s32 *)p -= 1; if (*(s32 *)p == 0) { func_8002EFF8(1, tbl[*(u16 *)(p + 0xA)]); - func_800316F8(p); + func_800316F8((s32)p); } } else { if (p[0x4E] >= 2) { diff --git a/src/800_c.c b/src/800_c.c index 91b713059..d1a96c1c6 100644 --- a/src/800_c.c +++ b/src/800_c.c @@ -95,7 +95,7 @@ extern u32 CdMode(void); extern void CdFlush(void); extern void *CdReadyCallback(void *func); extern void func_800377D8(void); /* this loader's CdlReadN ready-callback */ -extern void func_80036260(void); /* sub-handler passed to func_80037CD8 */ +extern int func_80036260(void); /* sub-handler passed to func_80037CD8; §376: the definition returns int */ extern void func_8002EC10(void); extern void func_80037334(void); extern void func_80037358(int posInt); @@ -464,7 +464,7 @@ extern void func_80034DFC(s16); extern s32 func_8003EDE8(s32, s32, s32); extern void func_80035C4C(void); extern void func_80036F98(void); -extern void func_8003602C(void); +extern void func_8003602C(s32); /* §376: the definition takes s32 (the use is address-taken and already cast) */ extern void func_80036FB0(s32, s32); void func_80036D58(s16 arg0) @@ -1876,7 +1876,7 @@ extern s16 D_800A4EF8; extern u16 D_800A4EE0; extern u8 D_800A4F16; extern s32 func_80038FC4(u8 **); -extern void func_80038FFC(u8 **); +extern s32 func_80038FFC(s32 *); /* §376: the definition returns s32 and takes s32* */ void func_80038A58(void) { @@ -1975,7 +1975,7 @@ void func_80038A58(void) *(s32 *)(p - 8) = 0; do { if (p[0x1E8] != 0) { - func_80038FFC((u8 **)base); + func_80038FFC((s32 *)base); if (p[0x1E9] != 0) { p[0x1EA] = 0; p[0x1E8] = 0; @@ -2209,7 +2209,7 @@ void func_80039F14(u8 *arg0, s16 arg1, u8 arg2) { arg0[0x21] = b | 2; } -extern void func_80039C70(void *arg0, s16 arg1, u8 arg2); +extern void func_80039C70(u8 *arg0, s16 arg1, s16 arg2); /* §376: matches the definition */ extern void func_80039DEC(void *arg0, s16 arg1, u8 arg2); void func_80039F50(u8 **a0, s16 a1)