From 1bef952ff61a6dd1945c7887c1babd94efe95f72 Mon Sep 17 00:00:00 2001 From: Tharo Date: Thu, 24 Sep 2026 05:29:19 +0100 Subject: Unused variable/parameter cleanup (#1321) * UNUSED attribute for variables and parameters in static segments and for all stack padding variables * No more unused variable warnings * Make pad variable names consistent * Small cleanup * Macro-ify stack padding * Use stack padding for more variables not previously named pad * Format * Check unused parameter on gamestate overlays and pause menu Co-authored-by: Dragorn421 * Merge 2x u8 stack pads into 1x s16 stack pad in en_ik * Remove UNUSED from function prototypes * Suggested changes Co-authored-by: Dragorn421 * More unused variables * Fix merge, updated for new versions * Format * questionable UNUSED and STACK_PAD more usage * format * format * one more STACK_PADS in z_kaleido_map.c --------- Co-authored-by: Dragorn421 --- src/code/z_debug.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/code/z_debug.c') diff --git a/src/code/z_debug.c b/src/code/z_debug.c index 6de85056c..529ac06dd 100644 --- a/src/code/z_debug.c +++ b/src/code/z_debug.c @@ -1,4 +1,5 @@ #include "libc64/malloc.h" +#include "attributes.h" #include "libu64/gfxprint.h" #include "libu64/pad.h" #include "array_count.h" @@ -8,6 +9,7 @@ #include "gfxalloc.h" #include "regs.h" #include "rumble.h" +#include "stack_pad.h" #include "ultra64.h" #include "debug.h" @@ -125,7 +127,7 @@ void Regs_Init(void) { } // Function is stubbed. Name is assumed by similarities in signature to `DebugCamera_ScreenTextColored` and usage. -void DebugCamera_ScreenText(u8 x, u8 y, const char* text) { +void DebugCamera_ScreenText(UNUSED u8 x, UNUSED u8 y, UNUSED const char* text) { } void DebugCamera_ScreenTextColored(u8 x, u8 y, u8 colorIndex, const char* text) { @@ -264,7 +266,7 @@ void Regs_DrawEditor(GfxPrint* printer) { s32 i; s32 pageStart = (gRegEditor->regPage - 1) * REGS_PER_PAGE; s32 pageDataStart = ((gRegEditor->regGroup * REG_PAGES) + gRegEditor->regPage - 1) * REGS_PER_PAGE; - s32 pad; + STACK_PAD(s32); char regGroupName[3]; regGroupName[0] = 'R'; @@ -295,7 +297,7 @@ void Debug_DrawText(GraphicsContext* gfxCtx) { Gfx* gfx; Gfx* opaStart; GfxPrint printer; - s32 pad; + STACK_PAD(s32); OPEN_DISPS(gfxCtx, "../z_debug.c", 628); -- cgit v1.2.3