From a7421f5f6631a82d8aa593c09731cb50e4ce8a2c Mon Sep 17 00:00:00 2001 From: LagoLunatic Date: Mon, 29 Dec 2025 13:39:55 -0500 Subject: [PATCH] Add UNUSED macro, enable clangd unused parameter warnings --- .clangd | 2 +- include/global.h | 4 ++++ src/d/actor/d_a_bita.cpp | 1 + src/d/actor/d_a_bmdfoot.cpp | 1 + src/d/actor/d_a_bmdhand.cpp | 1 + src/d/actor/d_a_bpw.cpp | 1 + src/d/actor/d_a_btd.cpp | 3 +++ src/d/actor/d_a_bwd.cpp | 2 ++ src/d/actor/d_a_bwdg.cpp | 1 + src/d/actor/d_a_cc.cpp | 1 + src/d/actor/d_a_dr2.cpp | 1 + src/d/actor/d_a_kamome.cpp | 3 +++ 12 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.clangd b/.clangd index 2426bef5b..6c7744b87 100644 --- a/.clangd +++ b/.clangd @@ -12,7 +12,7 @@ CompileFlags: "-Wbitwise-op-parentheses", "-Wunused-variable", # "-Wunused-but-set-variable", - # "-Wunused-parameter", + "-Wunused-parameter", "-Wunused-but-set-parameter", "-Wself-assign", ] diff --git a/include/global.h b/include/global.h index 4ec7e4259..b3ce236fe 100644 --- a/include/global.h +++ b/include/global.h @@ -13,6 +13,10 @@ #define IS_ALIGNED(X, N) (((X) & ((N)-1)) == 0) #define IS_NOT_ALIGNED(X, N) (((X) & ((N)-1)) != 0) +// Silence unused parameter warnings. +// TP debug suggests the original devs used something like this. +#define UNUSED(x) ((void)(x)) + #define JUT_EXPECT(...) #define ASSERT(...) #define LOGF(FMT, ...) diff --git a/src/d/actor/d_a_bita.cpp b/src/d/actor/d_a_bita.cpp index 3a66b7f2c..56c30bd75 100644 --- a/src/d/actor/d_a_bita.cpp +++ b/src/d/actor/d_a_bita.cpp @@ -26,6 +26,7 @@ static u32 ita_Ef[] = { BITA_BRK_EF_BTDITA0, BITA_BRK_EF_BTDITA1 }; /* 00000078-000000C4 .text b_a_sub__FPvPv */ static void* b_a_sub(void* search, void* user) { + UNUSED(user); if (fopAc_IsActor(search) && fopAcM_GetName(search) == PROC_BTD) return search; return NULL; diff --git a/src/d/actor/d_a_bmdfoot.cpp b/src/d/actor/d_a_bmdfoot.cpp index b5245c903..d2ec25ba0 100644 --- a/src/d/actor/d_a_bmdfoot.cpp +++ b/src/d/actor/d_a_bmdfoot.cpp @@ -607,6 +607,7 @@ void move(bmdfoot_class* i_this) { /* 000021B8-00002204 .text s_a_d_sub__FPvPv */ void* s_a_d_sub(void* search, void* param_2) { + UNUSED(param_2); if ((fopAc_IsActor(search)) && (fopAcM_GetName(search) == PROC_BMD)) { return search; } else { diff --git a/src/d/actor/d_a_bmdhand.cpp b/src/d/actor/d_a_bmdhand.cpp index 1acc0d4de..53b4de71f 100644 --- a/src/d/actor/d_a_bmdhand.cpp +++ b/src/d/actor/d_a_bmdhand.cpp @@ -637,6 +637,7 @@ void hand_move(bmdhand_class* i_this) { /* 00002E74-00002EC0 .text s_a_d_sub__FPvPv */ void* s_a_d_sub(void* param_1, void* param_2) { + UNUSED(param_2); if ((fopAc_IsActor(param_1)) && (fopAcM_GetName(param_1) == PROC_BMD)) { return param_1; } else { diff --git a/src/d/actor/d_a_bpw.cpp b/src/d/actor/d_a_bpw.cpp index 761139d66..5a6f49421 100644 --- a/src/d/actor/d_a_bpw.cpp +++ b/src/d/actor/d_a_bpw.cpp @@ -877,6 +877,7 @@ void light_on_off(bpw_class* i_this) { /* 0000242C-000024B0 .text skull_search_sub__FPvPv */ void* skull_search_sub(void* param_1, void* param_2) { + UNUSED(param_2); fopAc_ac_c* actor = (fopAc_ac_c*)param_1; if ((get_check_count < 100) && (fopAc_IsActor(actor))) { diff --git a/src/d/actor/d_a_btd.cpp b/src/d/actor/d_a_btd.cpp index 3a7edc7b5..a0be3a5ef 100644 --- a/src/d/actor/d_a_btd.cpp +++ b/src/d/actor/d_a_btd.cpp @@ -1769,6 +1769,7 @@ void move(btd_class* i_this) { /* 00005BCC-00005C24 .text k_a_d_sub__FPvPv */ void* k_a_d_sub(void* i_this, void* param_2) { + UNUSED(param_2); if (((fopAc_IsActor(i_this)) && (fopAcM_GetName(i_this) == PROC_KUI)) && (fopAcM_GetParam(i_this) == 0x511)) { return i_this; } @@ -1777,6 +1778,7 @@ void* k_a_d_sub(void* i_this, void* param_2) { /* 00005C24-00005C70 .text dr2_a_d_sub__FPvPv */ void* dr2_a_d_sub(void* i_this, void* param_2) { + UNUSED(param_2); if ((fopAc_IsActor(i_this)) && (fopAcM_GetName(i_this) == PROC_DR2)) { return i_this; } else { @@ -1786,6 +1788,7 @@ void* dr2_a_d_sub(void* i_this, void* param_2) { /* 00005C70-00005CC8 .text wepon_s_sub__FPvPv */ void* wepon_s_sub(void* i_this, void* param_2) { + UNUSED(param_2); if (((fopAc_IsActor(i_this)) && (fopAcM_GetName(i_this) == PROC_HIMO2)) || (fopAcM_GetName(i_this) == PROC_BOOMERANG)) { return i_this; } diff --git a/src/d/actor/d_a_bwd.cpp b/src/d/actor/d_a_bwd.cpp index 6adbd1ba7..8258a5045 100644 --- a/src/d/actor/d_a_bwd.cpp +++ b/src/d/actor/d_a_bwd.cpp @@ -112,6 +112,7 @@ void g_eff_off(bwd_class* i_this) { /* 000001CC-00000250 .text ko_s_sub__FPvPv */ void* ko_s_sub(void* param_1, void* param_2) { + UNUSED(param_2); fopAc_ac_c* actor = (fopAc_ac_c*)param_1; if ((fopAc_IsActor(actor)) && (fopAcM_GetName(actor) == PROC_BWDS)) { @@ -126,6 +127,7 @@ void* ko_s_sub(void* param_1, void* param_2) { /* 00000250-0000029C .text ko_delete_sub__FPvPv */ void* ko_delete_sub(void* param_1, void* param_2) { + UNUSED(param_2); bwds_class* actor = (bwds_class*)param_1; if ((fopAc_IsActor(actor)) && (fopAcM_GetName(actor) == PROC_BWDS)) { diff --git a/src/d/actor/d_a_bwdg.cpp b/src/d/actor/d_a_bwdg.cpp index d5d57511d..aef1a9ad0 100644 --- a/src/d/actor/d_a_bwdg.cpp +++ b/src/d/actor/d_a_bwdg.cpp @@ -153,6 +153,7 @@ static void wave_cont(bwdg_class* i_this, u8 r4) { /* 00000734-00000780 .text boss_a_d_sub__FPvPv */ static void* boss_a_d_sub(void* param_1, void* param_2) { + UNUSED(param_2); if (fopAc_IsActor(param_1) && fopAcM_GetName(param_1) == PROC_BWD) { return param_1; } diff --git a/src/d/actor/d_a_cc.cpp b/src/d/actor/d_a_cc.cpp index 45dec4a4d..6482ed48e 100644 --- a/src/d/actor/d_a_cc.cpp +++ b/src/d/actor/d_a_cc.cpp @@ -271,6 +271,7 @@ void damage_mode_move(cc_class* i_this) { /* 00000C74-00000D30 .text s_b_sub__FPvPv */ void* s_b_sub(void* arg0, void* arg1) { + UNUSED(arg1); if (fopAcM_IsActor(arg0)) { bool bVar2 = false; if (fopAcM_GetName(arg0) == PROC_BOMB) { diff --git a/src/d/actor/d_a_dr2.cpp b/src/d/actor/d_a_dr2.cpp index d730c9259..8e51c3f99 100644 --- a/src/d/actor/d_a_dr2.cpp +++ b/src/d/actor/d_a_dr2.cpp @@ -186,6 +186,7 @@ static BOOL daDr2_Draw(dr2_class* i_this) { /* 000006D4-00000720 .text s_a_d_sub__FPvPv */ void* s_a_d_sub(void* ac1, void* ac2) { + UNUSED(ac2); if (fopAcM_IsActor(ac1) && fopAcM_GetName(ac1) == PROC_BTD) { return ac1; } diff --git a/src/d/actor/d_a_kamome.cpp b/src/d/actor/d_a_kamome.cpp index 5453fdab8..7d787bac8 100644 --- a/src/d/actor/d_a_kamome.cpp +++ b/src/d/actor/d_a_kamome.cpp @@ -114,6 +114,7 @@ fopAc_ac_c* search_esa(kamome_class* i_this) { /* 00000A44-00000A90 .text s_a_i_sub__FPvPv */ void* s_a_i_sub(void* ac1, void* ac2) { + UNUSED(ac2); if (fopAc_IsActor(ac1) && fpcM_GetName(ac1) == PROC_NPC_LS1) { return ac1; } @@ -257,6 +258,7 @@ void kamome_ground_pos_move(kamome_class* i_this) { /* 00001150-000011B8 .text ko_s_sub__FPvPv */ void* ko_s_sub(void* ac1, void* ac2) { + UNUSED(ac2); kamome_class* i_this = (kamome_class*)ac1; if (fopAcM_IsActor(&i_this->actor) && fopAcM_GetName(&i_this->actor) == PROC_KAMOME && (fopAcM_GetParam(&i_this->actor) & 0xf) == 7) { ko_count++; @@ -292,6 +294,7 @@ void heisou_control(kamome_class* i_this) { /* 00001304-00001360 .text h_s_sub__FPvPv */ void* h_s_sub(void* ac1, void* ac2) { + UNUSED(ac2); kamome_class* i_this = (kamome_class*)ac1; if (fopAcM_IsActor(&i_this->actor) && fopAcM_GetName(&i_this->actor) == PROC_KAMOME && (fopAcM_GetParam(&i_this->actor) & 0xf) == 6) { return &i_this->actor;