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/graph.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/code/graph.c') diff --git a/src/code/graph.c b/src/code/graph.c index 826dd71c0..439220b11 100644 --- a/src/code/graph.c +++ b/src/code/graph.c @@ -1,4 +1,5 @@ #include "libc64/malloc.h" +#include "attributes.h" #include "libc64/sprintf.h" #include "libu64/debug.h" #include "array_count.h" @@ -16,6 +17,7 @@ #include "regs.h" #include "setup_state.h" #include "speed_meter.h" +#include "stack_pad.h" #include "sys_cfb.h" #include "sys_debug_controller.h" #include "sys_ucode.h" @@ -207,7 +209,7 @@ void Graph_Init(GraphicsContext* gfxCtx) { #endif } -void Graph_Destroy(GraphicsContext* gfxCtx) { +void Graph_Destroy(UNUSED GraphicsContext* gfxCtx) { #if DEBUG_FEATURES func_800D3210(); Fault_RemoveClient(&sGraphFaultClient); @@ -469,7 +471,7 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) { { OSTime timeNow = osGetTime(); - s32 pad; + STACK_PAD(s32); gRSPGfxTimeTotal = gRSPGfxTimeAcc; gRSPAudioTimeTotal = gRSPAudioTimeAcc; @@ -501,7 +503,7 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) { #endif } -void Graph_ThreadEntry(void* arg0) { +void Graph_ThreadEntry(UNUSED void* arg) { GraphicsContext gfxCtx; GameState* gameState; u32 size; @@ -549,7 +551,7 @@ void Graph_ThreadEntry(void* arg0) { } void* Graph_Alloc(GraphicsContext* gfxCtx, size_t size) { - TwoHeadGfxArena* thga = &gfxCtx->polyOpa; + UNUSED_NDEBUG TwoHeadGfxArena* thga = &gfxCtx->polyOpa; if (HREG(59) == 1) { PRINTF("graph_alloc siz=%d thga size=%08x bufp=%08x head=%08x tail=%08x\n", size, thga->size, thga->start, @@ -559,7 +561,7 @@ void* Graph_Alloc(GraphicsContext* gfxCtx, size_t size) { } void* Graph_Alloc2(GraphicsContext* gfxCtx, size_t size) { - TwoHeadGfxArena* thga = &gfxCtx->polyOpa; + UNUSED_NDEBUG TwoHeadGfxArena* thga = &gfxCtx->polyOpa; if (HREG(59) == 1) { PRINTF("graph_alloc siz=%d thga size=%08x bufp=%08x head=%08x tail=%08x\n", size, thga->size, thga->start, -- cgit v1.2.3