From 09529e36f89ce0fc22986c3c0badbf97e3ddbf02 Mon Sep 17 00:00:00 2001 From: Dragorn421 Date: Tue, 21 Sep 2021 11:10:26 +0200 Subject: [PATCH] Clean-up some objectively useless parens --- src/code/z_actor.c | 2 +- .../actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c | 6 +++--- src/overlays/actors/ovl_Demo_Im/z_demo_im.c | 2 +- src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c | 2 +- src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c | 2 +- src/overlays/actors/ovl_En_Floormas/z_en_floormas.c | 9 ++++----- src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c | 2 +- src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c | 2 +- src/overlays/actors/ovl_En_Ru1/z_en_ru1.c | 13 ++++++------- src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c | 4 ++-- src/overlays/actors/ovl_En_Xc/z_en_xc.c | 2 +- src/overlays/actors/ovl_En_Zl2/z_en_zl2.c | 2 +- 12 files changed, 23 insertions(+), 25 deletions(-) diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 23bd01d08e..3ae577d8cf 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -2694,7 +2694,7 @@ Actor* Actor_Spawn(ActorContext* actorCtx, GlobalContext* globalCtx, s16 actorId objBankIndex = Object_GetIndex(&globalCtx->objectCtx, actorInit->objectId); if ((objBankIndex < 0) || - ((actorInit->category == ACTORCAT_ENEMY) && (Flags_GetClear(globalCtx, globalCtx->roomCtx.curRoom.num)))) { + ((actorInit->category == ACTORCAT_ENEMY) && Flags_GetClear(globalCtx, globalCtx->roomCtx.curRoom.num))) { // "No data bank!! (profilep->bank=%d)" osSyncPrintf(VT_COL(RED, WHITE) "データバンク無し!!<データバンク=%d>(profilep->bank=%d)\n" VT_RST, objBankIndex, actorInit->objectId); diff --git a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c index 031666567d..81050c6a3f 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c +++ b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c @@ -115,9 +115,9 @@ void BgMoriHineri_Destroy(Actor* thisx, GlobalContext* globalCtx) { void func_808A39FC(BgMoriHineri* this, GlobalContext* globalCtx) { CollisionHeader* colHeader; - if ((Object_IsLoaded(&globalCtx->objectCtx, this->moriHineriObjIdx)) && - (Object_IsLoaded(&globalCtx->objectCtx, this->moriTexObjIdx)) && - ((this->boxObjIdx < 0) || (Object_IsLoaded(&globalCtx->objectCtx, this->boxObjIdx)))) { + if (Object_IsLoaded(&globalCtx->objectCtx, this->moriHineriObjIdx) && + Object_IsLoaded(&globalCtx->objectCtx, this->moriTexObjIdx) && + ((this->boxObjIdx < 0) || Object_IsLoaded(&globalCtx->objectCtx, this->boxObjIdx))) { this->dyna.actor.objBankIndex = this->moriHineriObjIdx; if (this->dyna.actor.params >= 4) { this->dyna.actor.params -= 4; diff --git a/src/overlays/actors/ovl_Demo_Im/z_demo_im.c b/src/overlays/actors/ovl_Demo_Im/z_demo_im.c index 122b9d8659..fb59c2e298 100644 --- a/src/overlays/actors/ovl_Demo_Im/z_demo_im.c +++ b/src/overlays/actors/ovl_Demo_Im/z_demo_im.c @@ -717,7 +717,7 @@ void func_8098652C(DemoIm* this, GlobalContext* globalCtx) { } void func_80986570(DemoIm* this, GlobalContext* globalCtx) { - if ((Animation_OnFrame(&this->skelAnime, 7.0f)) && (this->actor.bgCheckFlags & 1)) { + if (Animation_OnFrame(&this->skelAnime, 7.0f) && (this->actor.bgCheckFlags & 1)) { u32 sfxId = SFX_FLAG; sfxId += SurfaceType_GetSfx(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId); diff --git a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c index 83fca32de9..cb4fae34d6 100644 --- a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c +++ b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c @@ -105,7 +105,7 @@ s32 ElfMsg_KillCheck(ElfMsg* this, GlobalContext* globalCtx) { } Actor_Kill(&this->actor); return 1; - } else if ((this->actor.world.rot.y == -1) && (Flags_GetClear(globalCtx, this->actor.room))) { + } else if ((this->actor.world.rot.y == -1) && Flags_GetClear(globalCtx, this->actor.room)) { LOG_STRING("共倒れ", "../z_elf_msg.c", 172); // "Mutual destruction" if (((this->actor.params >> 8) & 0x3F) != 0x3F) { Flags_SetSwitch(globalCtx, ((this->actor.params >> 8) & 0x3F)); diff --git a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c index 43c8027951..a04484310c 100644 --- a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c +++ b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c @@ -82,7 +82,7 @@ s32 ElfMsg2_KillCheck(ElfMsg2* this, GlobalContext* globalCtx) { } Actor_Kill(&this->actor); return 1; - } else if ((this->actor.world.rot.y == -1) && (Flags_GetClear(globalCtx, this->actor.room))) { + } else if ((this->actor.world.rot.y == -1) && Flags_GetClear(globalCtx, this->actor.room)) { LOG_STRING("共倒れ2", "../z_elf_msg2.c", 182); // "Mutual destruction 2" if (((this->actor.params >> 8) & 0x3F) != 0x3F) { Flags_SetSwitch(globalCtx, ((this->actor.params >> 8) & 0x3F)); diff --git a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c index 662f8379f5..7344a449a1 100644 --- a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c +++ b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c @@ -506,9 +506,8 @@ void EnFloormas_BigStopWalk(EnFloormas* this, GlobalContext* globalCtx) { void EnFloormas_Run(EnFloormas* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); - if ((((Animation_OnFrame(&this->skelAnime, 0.0f)) || (Animation_OnFrame(&this->skelAnime, 12.0f))) || - (Animation_OnFrame(&this->skelAnime, 24.0f))) || - (Animation_OnFrame(&this->skelAnime, 36.0f))) { + if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 12.0f) || + Animation_OnFrame(&this->skelAnime, 24.0f) || Animation_OnFrame(&this->skelAnime, 36.0f)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_FALL_WALK); } @@ -680,7 +679,7 @@ void EnFloormas_SmWalk(EnFloormas* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); DECR(this->smActionTimer); - if ((Animation_OnFrame(&this->skelAnime, 0.0f)) || (Animation_OnFrame(&this->skelAnime, 18.0f))) { + if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 18.0f)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_SM_WALK); } @@ -699,7 +698,7 @@ void EnFloormas_SmDecideAction(EnFloormas* this, GlobalContext* globalCtx) { s32 isAgainstWall; SkelAnime_Update(&this->skelAnime); - if ((Animation_OnFrame(&this->skelAnime, 0.0f)) || (Animation_OnFrame(&this->skelAnime, 18.0f))) { + if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 18.0f)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_SM_WALK); } isAgainstWall = this->actor.bgCheckFlags & 8; diff --git a/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c b/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c index 5627963bad..2e4f3858b8 100644 --- a/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c +++ b/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c @@ -181,7 +181,7 @@ void EnHeishi3_CatchStart(EnHeishi3* this, GlobalContext* globalCtx) { void func_80A55BD4(EnHeishi3* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); - if ((Animation_OnFrame(&this->skelAnime, 1.0f) != 0) || (Animation_OnFrame(&this->skelAnime, 17.0f) != 0)) { + if (Animation_OnFrame(&this->skelAnime, 1.0f) || Animation_OnFrame(&this->skelAnime, 17.0f)) { Audio_PlayActorSound2(&this->actor, NA_SE_EV_KNIGHT_WALK); } if (this->caughtTimer == 0) { diff --git a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c index 8f9791b308..c802237243 100644 --- a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c +++ b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c @@ -403,7 +403,7 @@ void EnHintnuts_Leave(EnHintnuts* this, GlobalContext* globalCtx) { if (this->animFlagAndTimer != 0) { this->animFlagAndTimer--; } - if ((Animation_OnFrame(&this->skelAnime, 0.0f)) || (Animation_OnFrame(&this->skelAnime, 6.0f))) { + if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 6.0f)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_WALK); } if (this->actor.bgCheckFlags & 8) { diff --git a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c index c02257c31b..06fb424049 100644 --- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c +++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c @@ -573,9 +573,8 @@ void func_80AEBB3C(EnRu1* this) { void func_80AEBB78(EnRu1* this) { SkelAnime* skelAnime = &this->skelAnime; - if ((((Animation_OnFrame(skelAnime, 4.0f)) || (Animation_OnFrame(skelAnime, 13.0f))) || - (Animation_OnFrame(skelAnime, 22.0f))) || - (Animation_OnFrame(skelAnime, 31.0f))) { + if (Animation_OnFrame(skelAnime, 4.0f) || Animation_OnFrame(skelAnime, 13.0f) || + Animation_OnFrame(skelAnime, 22.0f) || Animation_OnFrame(skelAnime, 31.0f)) { func_80078914(&this->actor.projectedPos, NA_SE_PL_SWIM); } } @@ -832,7 +831,7 @@ void func_80AEC650(EnRu1* this) { s32 pad[2]; if (this->unk_280 == 0) { - if ((Animation_OnFrame(&this->skelAnime, 2.0f)) || (Animation_OnFrame(&this->skelAnime, 7.0f))) { + if (Animation_OnFrame(&this->skelAnime, 2.0f) || Animation_OnFrame(&this->skelAnime, 7.0f)) { func_80078914(&this->actor.projectedPos, NA_SE_PL_WALK_DIRT); } } @@ -1893,9 +1892,9 @@ void func_80AEF3A8(EnRu1* this, GlobalContext* globalCtx) { void func_80AEF40C(EnRu1* this) { SkelAnime* skelAnime = &this->skelAnime; - if ((Animation_OnFrame(skelAnime, 2.0f)) || (Animation_OnFrame(skelAnime, 7.0f)) || - (Animation_OnFrame(skelAnime, 12.0f)) || (Animation_OnFrame(skelAnime, 18.0f)) || - (Animation_OnFrame(skelAnime, 25.0f)) || (Animation_OnFrame(skelAnime, 33.0f))) { + if (Animation_OnFrame(skelAnime, 2.0f) || Animation_OnFrame(skelAnime, 7.0f) || + Animation_OnFrame(skelAnime, 12.0f) || Animation_OnFrame(skelAnime, 18.0f) || + Animation_OnFrame(skelAnime, 25.0f) || Animation_OnFrame(skelAnime, 33.0f)) { func_80078914(&this->actor.projectedPos, NA_SE_PL_WALK_DIRT); } } diff --git a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c index 24d396067c..51eb30d627 100644 --- a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c +++ b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c @@ -351,8 +351,8 @@ void EnWallmas_Walk(EnWallmas* this, GlobalContext* globalCtx) { Math_ScaledStepToS(&this->actor.world.rot.y, (s16)((s32)this->actor.yawTowardsPlayer + 0x8000), 0xB6); - if ((Animation_OnFrame(&this->skelAnime, 0.0f) != 0) || (Animation_OnFrame(&this->skelAnime, 12.0f) != 0) || - (Animation_OnFrame(&this->skelAnime, 24.0f) != 0) || (Animation_OnFrame(&this->skelAnime, 36.0f) != 0)) { + if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 12.0f) || + Animation_OnFrame(&this->skelAnime, 24.0f) || Animation_OnFrame(&this->skelAnime, 36.0f)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_FALL_WALK); } } diff --git a/src/overlays/actors/ovl_En_Xc/z_en_xc.c b/src/overlays/actors/ovl_En_Xc/z_en_xc.c index 52bc37aa39..dea87be627 100644 --- a/src/overlays/actors/ovl_En_Xc/z_en_xc.c +++ b/src/overlays/actors/ovl_En_Xc/z_en_xc.c @@ -370,7 +370,7 @@ void EnXc_SetWalkingSFX(EnXc* this, GlobalContext* globalCtx) { u32 sfxId; s32 pad2; - if ((Animation_OnFrame(&this->skelAnime, 11.0f)) || (Animation_OnFrame(&this->skelAnime, 23.0f))) { + if (Animation_OnFrame(&this->skelAnime, 11.0f) || Animation_OnFrame(&this->skelAnime, 23.0f)) { if (this->actor.bgCheckFlags & 1) { sfxId = SFX_FLAG; sfxId += SurfaceType_GetSfx(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId); diff --git a/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c b/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c index dc46a05687..4d21be0d78 100644 --- a/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c +++ b/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c @@ -1438,7 +1438,7 @@ void func_80B51D24(EnZl2* this, GlobalContext* globalCtx) { u32 sfxId; SkelAnime* skelAnime = &this->skelAnime; - if ((Animation_OnFrame(skelAnime, 6.0f)) || (Animation_OnFrame(skelAnime, 0.0f))) { + if (Animation_OnFrame(skelAnime, 6.0f) || Animation_OnFrame(skelAnime, 0.0f)) { if (this->actor.bgCheckFlags & 1) { sfxId = SFX_FLAG; sfxId += SurfaceType_GetSfx(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId);