1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-15 11:30:30 +00:00

Fix some more GCC warnings, mark some bugs based on GCC warnings (#2309)

* Fix some more GCC warnings, mark some bugs based on GCC warnings

* Weird formatting

* Suggested changes

* More weird indentation I guess

* UNREACHABLE() macro, add missing NORETURNs to fault_n64.c

* AVOID_UB for PAL path in z_file_nameset.c

* Remove comments about return types

* Remove temp no longer needed
This commit is contained in:
Tharo 2024-12-02 09:40:49 +00:00 committed by GitHub
parent 6199634ffb
commit 3f703a39d9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
39 changed files with 156 additions and 83 deletions

View file

@ -1146,6 +1146,8 @@ void BossVa_BodyPhase2(BossVa* this, PlayState* play) {
sKillBari++;
if ((this->actor.colorFilterTimer != 0) && !(this->actor.colorFilterParams & 0x4000)) {
this->invincibilityTimer = this->actor.colorFilterTimer - 5;
//! @bug This condition is always false as this->invincibilityTimer is an s8 so can never
//! be larger than 160.
if (this->invincibilityTimer > 160) {
this->invincibilityTimer = 0;
}

View file

@ -230,7 +230,8 @@ s32 DemoGj_FindGanon(DemoGj* this, PlayState* play) {
PRINTF("Demo_Gj_Search_Boss_Ganon %d:ガノン発見出来ず\n", this->dyna.actor.params);
return false;
}
//! @bug: Missing return value when `this->ganon` is already set.
//! @bug Missing return value when `this->ganon` is already set. No caller uses the return value
//! so it doesn't matter.
}
static InitChainEntry sInitChain[] = {

View file

@ -834,6 +834,8 @@ s32 EnKo_ChildStart(EnKo* this, PlayState* play) {
case ENKO_TYPE_CHILD_FADO:
return func_80A97E18(this, play);
}
// Note this function assumes the kokiri type is valid
UNREACHABLE();
}
s32 EnKo_ChildStone(EnKo* this, PlayState* play) {
@ -865,6 +867,8 @@ s32 EnKo_ChildStone(EnKo* this, PlayState* play) {
case ENKO_TYPE_CHILD_FADO:
return func_80A97E18(this, play);
}
// Note this function assumes the kokiri type is valid
UNREACHABLE();
}
s32 EnKo_ChildSaria(EnKo* this, PlayState* play) {
@ -896,6 +900,8 @@ s32 EnKo_ChildSaria(EnKo* this, PlayState* play) {
case ENKO_TYPE_CHILD_FADO:
return func_80A97E18(this, play);
}
// Note this function assumes the kokiri type is valid
UNREACHABLE();
}
s32 EnKo_AdultEnemy(EnKo* this, PlayState* play) {
@ -927,6 +933,8 @@ s32 EnKo_AdultEnemy(EnKo* this, PlayState* play) {
case ENKO_TYPE_CHILD_FADO:
return func_80A97E18(this, play);
}
// Note this function assumes the kokiri type is valid
UNREACHABLE();
}
s32 EnKo_AdultSaved(EnKo* this, PlayState* play) {
@ -958,7 +966,10 @@ s32 EnKo_AdultSaved(EnKo* this, PlayState* play) {
case ENKO_TYPE_CHILD_FADO:
return func_80A97E18(this, play);
}
// Note this function assumes the kokiri type is valid
UNREACHABLE();
}
void func_80A9877C(EnKo* this, PlayState* play) {
Player* player = GET_PLAYER(play);
@ -1136,6 +1147,8 @@ s32 func_80A98ECC(EnKo* this, PlayState* play) {
case ENKO_FQS_ADULT_SAVED:
return EnKo_AdultSaved(this, play);
}
// Note this function assumes the kokiri type is valid
UNREACHABLE();
}
void EnKo_Init(Actor* thisx, PlayState* play) {

View file

@ -563,7 +563,9 @@ s32 EnSt_DecrStunTimer(EnSt* this) {
if (this->stunTimer == 0) {
return 0;
}
this->stunTimer--; //! @bug no return but v0 ends up being stunTimer before decrement
this->stunTimer--;
//! @bug No return, v0 ends up being stunTimer before decrement.
//! The return value is not used so it doesn't matter.
}
/**

View file

@ -111,7 +111,7 @@ s32 func_80B0BE20(EnSw* this, CollisionPoly* poly) {
this->unk_3D8.zw = 0.0f;
this->unk_3D8.ww = 1.0f;
Matrix_MtxFToYXZRotS(&this->unk_3D8, &this->actor.world.rot, 0);
//! @bug: Does not return.
//! @bug Does not return, but the return value is not used by any caller so it doesn't matter.
}
CollisionPoly* func_80B0C020(PlayState* play, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3, s32* arg4) {

View file

@ -651,7 +651,7 @@ void EnfHG_Retreat(EnfHG* this, PlayState* play) {
BossGanondrof* bossGnd = (BossGanondrof*)this->actor.parent;
s16 paintingIdxReal;
s16 paintingIdxFake;
Actor* child;
UNUSED_NDEBUG Actor* child;
if (this->actor.params != GND_REAL_BOSS) {
this->killActor = true;

View file

@ -1700,7 +1700,6 @@ BAD_RETURN(s32) Player_ZeroSpeedXZ(Player* this) {
this->speedXZ = 0.0f;
}
// return type can't be void due to regalloc in func_8083F72C
BAD_RETURN(s32) func_80832224(Player* this) {
Player_ZeroSpeedXZ(this);
this->unk_6AD = 0;
@ -12117,7 +12116,9 @@ void Player_Update(Actor* thisx, PlayState* play) {
Player_UpdateCommon(this, play, &input);
#if DEBUG_FEATURES
skip_update:;
#endif
{
s32 pad;