diff options
| author | Tharo <tharo10600@gmail.com> | 2026-09-24 05:29:19 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-24 06:29:19 +0200 |
| commit | 1bef952ff61a6dd1945c7887c1babd94efe95f72 (patch) | |
| tree | 7436c39fce905685f6d2115d487be3303ceda09c /include | |
| parent | 39070bb9dd5bba8b60363b81ef0b36f4590e68f4 (diff) | |
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 <Dragorn421@users.noreply.github.com>
* Merge 2x u8 stack pads into 1x s16 stack pad in en_ik
* Remove UNUSED from function prototypes
* Suggested changes
Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
* 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 <Dragorn421@users.noreply.github.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/actor.h | 2 | ||||
| -rw-r--r-- | include/environment.h | 8 | ||||
| -rw-r--r-- | include/gfx.h | 11 | ||||
| -rw-r--r-- | include/stack_pad.h | 21 |
4 files changed, 32 insertions, 10 deletions
diff --git a/include/actor.h b/include/actor.h index 08904a20e..103a3a218 100644 --- a/include/actor.h +++ b/include/actor.h @@ -807,7 +807,7 @@ u8 Actor_ApplyDamage(Actor* actor); void Actor_SetDropFlag(Actor* actor, ColliderElement* elem, s32 freezeFlag); void Actor_SetDropFlagJntSph(Actor* actor, ColliderJntSph* jntSph, s32 freezeFlag); void func_80035844(Vec3f* arg0, Vec3f* arg1, Vec3s* arg2, s32 arg3); -Actor* func_800358DC(Actor* actor, Vec3f* spawnPos, Vec3s* spawnRot, f32* arg3, s32 timer, s16* unused, +Actor* func_800358DC(Actor* actor, Vec3f* spawnPos, Vec3s* spawnRot, f32* arg3, s32 timer, s16* arg5, struct PlayState* play, s16 params, Gfx* dList); void func_800359B8(Actor* actor, s16 arg1, Vec3s* arg2); s32 Flags_GetEventChkInf(s32 flag); diff --git a/include/environment.h b/include/environment.h index 1c820ffeb..43ba0c6d4 100644 --- a/include/environment.h +++ b/include/environment.h @@ -263,7 +263,7 @@ void Environment_DrawSkyboxFilters(struct PlayState* play); s32 Environment_ZBufValToFixedPoint(s32 zBufferVal); u16 Environment_GetPixelDepth(s32 x, s32 y); void Environment_GraphCallback(struct GraphicsContext* gfxCtx, void* param); -void Environment_Init(struct PlayState* play2, EnvironmentContext* envCtx, s32 unused); +void Environment_Init(struct PlayState* play2, EnvironmentContext* envCtx, s32 arg2); u8 Environment_SmoothStepToU8(u8* pvalue, u8 target, u8 scale, u8 step, u8 minStep); u8 Environment_SmoothStepToS8(s8* pvalue, s8 target, u8 scale, u8 step, u8 minStep); f32 Environment_LerpWeight(u16 max, u16 min, u16 val); @@ -275,15 +275,15 @@ void Environment_Update(struct PlayState* play, EnvironmentContext* envCtx, Ligh struct GameOverContext* gameOverCtx, struct GraphicsContext* gfxCtx); void Environment_DrawSunAndMoon(struct PlayState* play); void Environment_DrawSunLensFlare(struct PlayState* play, EnvironmentContext* envCtx, struct View* view, - struct GraphicsContext* gfxCtx, Vec3f pos, s32 unused); + struct GraphicsContext* gfxCtx, Vec3f pos, s32 arg5); void Environment_DrawLensFlare(struct PlayState* play, EnvironmentContext* envCtx, struct View* view, - struct GraphicsContext* gfxCtx, Vec3f pos, s32 unused, s16 scale, f32 colorIntensity, + struct GraphicsContext* gfxCtx, Vec3f pos, s32 arg5, s16 scale, f32 colorIntensity, s16 glareStrength, u8 isSun); void Environment_DrawRain(struct PlayState* play, struct View* view, struct GraphicsContext* gfxCtx); void Environment_ChangeLightSetting(struct PlayState* play, u32 lightSetting); void Environment_UpdateLightningStrike(struct PlayState* play); void Environment_AddLightningBolts(struct PlayState* play, u8 num); -void Environment_DrawLightning(struct PlayState* play, s32 unused); +void Environment_DrawLightning(struct PlayState* play, s32 arg1); void Environment_PlaySceneSequence(struct PlayState* play); void Environment_DrawCustomLensFlare(struct PlayState* play); void Environment_InitGameOverLights(struct PlayState* play); diff --git a/include/gfx.h b/include/gfx.h index 6e1fcabe1..01a33f974 100644 --- a/include/gfx.h +++ b/include/gfx.h @@ -4,6 +4,7 @@ #include "ultra64.h" #include "ultra64/gbi.h" #include "alignment.h" +#include "attributes.h" #include "sched.h" #include "thga.h" #include "versions.h" @@ -109,10 +110,10 @@ void Graph_CloseDisps(Gfx** dispRefs, GraphicsContext* gfxCtx, const char* file, #else -#define OPEN_DISPS(gfxCtx, file, line) \ - { \ - GraphicsContext* __gfxCtx = gfxCtx; \ - s32 __dispPad +#define OPEN_DISPS(gfxCtx, file, line) \ + { \ + UNUSED GraphicsContext* __gfxCtx = gfxCtx; \ + UNUSED s32 __dispPad #define CLOSE_DISPS(gfxCtx, file, line) \ do {} while (0); \ @@ -123,7 +124,7 @@ void Graph_CloseDisps(Gfx** dispRefs, GraphicsContext* gfxCtx, const char* file, #endif -void Graph_ThreadEntry(void*); +void Graph_ThreadEntry(void* arg); extern u64 gMojiFontTLUTs[4][4]; // original name: "moji_tlut" extern u64 gMojiFontTex[]; // original name: "font_ff" diff --git a/include/stack_pad.h b/include/stack_pad.h new file mode 100644 index 000000000..c616460e4 --- /dev/null +++ b/include/stack_pad.h @@ -0,0 +1,21 @@ +#ifndef STACK_PAD_H +#define STACK_PAD_H + +#include "attributes.h" + +#ifndef GLUE +#define GLUE(a, b) a##b +#endif +#ifndef GLUE2 +#define GLUE2(a, b) GLUE(a, b) +#endif + +#ifndef NON_MATCHING +#define STACK_PAD(type) UNUSED type GLUE2(__stack_pad_, __LINE__) +#define STACK_PADS(type, n) STACK_PAD(type)[(n)] +#else +#define STACK_PAD(type) +#define STACK_PADS(type, n) +#endif + +#endif |
