From 451b24f79baf25104bd42c3f9fafb01788838fe6 Mon Sep 17 00:00:00 2001 From: Tharo <17233964+Thar0@users.noreply.github.com> Date: Fri, 3 Jun 2022 17:51:23 +0100 Subject: [PATCH] Fix a number of warnings when compiling with GCC (#1239) * Silence a number of GCC warnings * Remove * Suggested changes * Format * Fix comment in en_go2 --- include/functions.h | 19 +++---- include/macros.h | 13 +++++ src/boot/z_std_dma.c | 2 +- src/code/audio_effects.c | 8 +-- src/code/audio_load.c | 1 + src/code/audio_seqplayer.c | 8 +-- src/code/code_800EC960.c | 2 +- src/code/db_camera.c | 5 +- src/code/gfxprint.c | 1 + src/code/relocation.c | 3 ++ src/code/z_actor.c | 3 ++ src/code/z_camera.c | 49 +++++++++++++------ src/code/z_en_item00.c | 1 + src/code/z_message_PAL.c | 3 ++ src/code/z_parameter.c | 5 +- src/code/z_play.c | 2 +- src/code/z_skelanime.c | 15 +++--- src/libultra/os/settimer.c | 4 +- .../ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c | 2 +- .../actors/ovl_Boss_Dodongo/z_boss_dodongo.c | 2 + src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c | 2 + src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c | 1 + .../actors/ovl_Boss_Ganon/z_boss_ganon.c | 24 ++++----- .../actors/ovl_Boss_Ganon2/z_boss_ganon2.c | 13 +++++ .../ovl_Boss_Ganondrof/z_boss_ganondrof.c | 4 ++ .../actors/ovl_Boss_Goma/z_boss_goma.c | 2 +- src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c | 2 + src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c | 8 +-- src/overlays/actors/ovl_Boss_Va/z_boss_va.c | 8 ++- .../actors/ovl_Demo_Effect/z_demo_effect.c | 1 + .../actors/ovl_Demo_Kankyo/z_demo_kankyo.c | 4 ++ src/overlays/actors/ovl_En_Bb/z_en_bb.c | 5 +- src/overlays/actors/ovl_En_Bw/z_en_bw.c | 3 ++ .../actors/ovl_En_Clear_Tag/z_en_clear_tag.c | 2 + src/overlays/actors/ovl_En_Dh/z_en_dh.c | 3 ++ .../actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c | 2 + .../actors/ovl_En_Dy_Extra/z_en_dy_extra.c | 4 +- src/overlays/actors/ovl_En_Elf/z_en_elf.c | 2 + .../actors/ovl_En_Encount2/z_en_encount2.c | 1 + .../actors/ovl_En_Ex_Item/z_en_ex_item.c | 3 ++ .../actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c | 1 + .../actors/ovl_En_Fire_Rock/z_en_fire_rock.c | 4 ++ src/overlays/actors/ovl_En_Ge3/z_en_ge3.c | 2 +- src/overlays/actors/ovl_En_Gm/z_en_gm.c | 3 ++ src/overlays/actors/ovl_En_Go/z_en_go.c | 1 + src/overlays/actors/ovl_En_Go2/z_en_go2.c | 25 +++++++++- src/overlays/actors/ovl_En_Hy/z_en_hy.c | 2 +- .../actors/ovl_En_Kanban/z_en_kanban.c | 1 + src/overlays/actors/ovl_En_Ko/z_en_ko.c | 2 +- src/overlays/actors/ovl_En_Ma3/z_en_ma3.c | 4 ++ src/overlays/actors/ovl_En_Md/z_en_md.c | 24 +++++++++ src/overlays/actors/ovl_En_Niw/z_en_niw.c | 2 + .../actors/ovl_En_Niw_Lady/z_en_niw_lady.c | 1 + src/overlays/actors/ovl_En_Ny/z_en_ny.c | 1 + .../ovl_En_Okarina_Tag/z_en_okarina_tag.c | 1 + src/overlays/actors/ovl_En_Part/z_en_part.c | 4 ++ .../actors/ovl_En_Po_Field/z_en_po_field.c | 2 +- src/overlays/actors/ovl_En_Rd/z_en_rd.c | 4 +- src/overlays/actors/ovl_En_Reeba/z_en_reeba.c | 2 + src/overlays/actors/ovl_En_Rr/z_en_rr.c | 4 ++ src/overlays/actors/ovl_En_Sa/z_en_sa.c | 7 +++ src/overlays/actors/ovl_En_Sb/z_en_sb.c | 1 + src/overlays/actors/ovl_En_Sw/z_en_sw.c | 2 + src/overlays/actors/ovl_En_Test/z_en_test.c | 4 +- .../actors/ovl_En_Wood02/z_en_wood02.c | 5 ++ src/overlays/actors/ovl_En_Zl3/z_en_zl3.c | 2 + src/overlays/actors/ovl_En_Zl4/z_en_zl4.c | 15 ++++++ src/overlays/actors/ovl_En_fHG/z_en_fhg.c | 2 + src/overlays/actors/ovl_Fishing/z_fishing.c | 6 +-- .../actors/ovl_player_actor/z_player.c | 4 +- .../z_eff_ss_solder_srch_ball.c | 4 +- 71 files changed, 298 insertions(+), 86 deletions(-) diff --git a/include/functions.h b/include/functions.h index a45495e445..3267816620 100644 --- a/include/functions.h +++ b/include/functions.h @@ -2,14 +2,11 @@ #define FUNCTIONS_H #include "z64.h" +#include "macros.h" f32 fabsf(f32 f); #ifndef __sgi -#define fabsf __builtin_fabsf -f32 __floatundisf(u32 c); -f64 __floatundidf(u32 c); -f32 __powisf2(f32 a, s32 b); -unsigned long __udivdi3(unsigned long a, unsigned long b); +#define fabsf(f) __builtin_fabsf((f32)(f)) #else #pragma intrinsic(fabsf) #endif @@ -1251,12 +1248,12 @@ void LinkAnimation_BlendToMorph(PlayState* play, SkelAnime* skelAnime, LinkAnima Vec3s* blendTable); void LinkAnimation_EndLoop(SkelAnime* skelAnime); s32 LinkAnimation_OnFrame(SkelAnime* skelAnime, f32 frame); -s32 SkelAnime_Init(PlayState* play, SkelAnime* skelAnime, SkeletonHeader* skeletonHeaderSeg, - AnimationHeader* animation, Vec3s* jointTable, Vec3s* morphTable, s32 limbCount); -s32 SkelAnime_InitFlex(PlayState* play, SkelAnime* skelAnime, FlexSkeletonHeader* skeletonHeaderSeg, - AnimationHeader* animation, Vec3s* jointTable, Vec3s* morphTable, s32 limbCount); -s32 SkelAnime_InitSkin(PlayState* play, SkelAnime* skelAnime, SkeletonHeader* skeletonHeaderSeg, - AnimationHeader* animation); +BAD_RETURN(s32) SkelAnime_Init(PlayState* play, SkelAnime* skelAnime, SkeletonHeader* skeletonHeaderSeg, + AnimationHeader* animation, Vec3s* jointTable, Vec3s* morphTable, s32 limbCount); +BAD_RETURN(s32) SkelAnime_InitFlex(PlayState* play, SkelAnime* skelAnime, FlexSkeletonHeader* skeletonHeaderSeg, + AnimationHeader* animation, Vec3s* jointTable, Vec3s* morphTable, s32 limbCount); +BAD_RETURN(s32) SkelAnime_InitSkin(PlayState* play, SkelAnime* skelAnime, SkeletonHeader* skeletonHeaderSeg, + AnimationHeader* animation); s32 SkelAnime_Update(SkelAnime* skelAnime); void Animation_ChangeImpl(SkelAnime* skelAnime, AnimationHeader* animation, f32 playSpeed, f32 startFrame, f32 endFrame, u8 mode, f32 morphFrames, s8 taper); diff --git a/include/macros.h b/include/macros.h index 87fa315718..09dddd40d8 100644 --- a/include/macros.h +++ b/include/macros.h @@ -1,6 +1,19 @@ #ifndef MACROS_H #define MACROS_H +#ifndef __GNUC__ +#define __attribute__(x) +#endif + +#ifndef AVOID_UB +#define BAD_RETURN(type) type +#else +#define BAD_RETURN(type) void +#endif + +#define UNUSED __attribute__((unused)) +#define FALLTHROUGH __attribute__((fallthrough)) + #define ARRAY_COUNT(arr) (s32)(sizeof(arr) / sizeof(arr[0])) #define ARRAY_COUNTU(arr) (u32)(sizeof(arr) / sizeof(arr[0])) diff --git a/src/boot/z_std_dma.c b/src/boot/z_std_dma.c index a0050fca50..942288e17a 100644 --- a/src/boot/z_std_dma.c +++ b/src/boot/z_std_dma.c @@ -431,7 +431,7 @@ s32 DmaMgr_SendRequest2(DmaRequest* req, u32 ram, u32 vrom, u32 size, u32 unk5, const char* file, s32 line) { req->filename = file; req->line = line; - DmaMgr_SendRequestImpl(req, ram, vrom, size, unk5, queue, msg); + return DmaMgr_SendRequestImpl(req, ram, vrom, size, unk5, queue, msg); } s32 DmaMgr_SendRequest1(void* ram0, u32 vrom, u32 size, const char* file, s32 line) { diff --git a/src/code/audio_effects.c b/src/code/audio_effects.c index 13156e8831..d1e860df8b 100644 --- a/src/code/audio_effects.c +++ b/src/code/audio_effects.c @@ -233,11 +233,11 @@ f32 Audio_AdsrUpdate(AdsrState* adsr) { adsr->action.s.state = ADSR_STATE_HANG; break; } - // fallthrough + FALLTHROUGH; case ADSR_STATE_START_LOOP: adsr->envIndex = 0; adsr->action.s.state = ADSR_STATE_LOOP; - // fallthrough + FALLTHROUGH; retry: case ADSR_STATE_LOOP: adsr->delay = adsr->envelope[adsr->envIndex].delay; @@ -273,14 +273,14 @@ f32 Audio_AdsrUpdate(AdsrState* adsr) { if (adsr->action.s.state != ADSR_STATE_FADE) { break; } - // fallthrough + FALLTHROUGH; case ADSR_STATE_FADE: adsr->current += adsr->velocity; adsr->delay--; if (adsr->delay <= 0) { adsr->action.s.state = ADSR_STATE_LOOP; } - // fallthrough + FALLTHROUGH; case ADSR_STATE_HANG: break; diff --git a/src/code/audio_load.c b/src/code/audio_load.c index f331f8bdc2..27a1ae1f0c 100644 --- a/src/code/audio_load.c +++ b/src/code/audio_load.c @@ -1281,6 +1281,7 @@ void AudioLoad_ProcessSlowLoads(s32 resetStatus) { slowLoad->status = LOAD_STATUS_DONE; continue; } + FALLTHROUGH; case LOAD_STATUS_START: slowLoad->status = LOAD_STATUS_LOADING; if (slowLoad->bytesRemaining == 0) { diff --git a/src/code/audio_seqplayer.c b/src/code/audio_seqplayer.c index 566ce17f92..6001056076 100644 --- a/src/code/audio_seqplayer.c +++ b/src/code/audio_seqplayer.c @@ -692,7 +692,7 @@ s32 AudioSeq_SeqLayerProcessScriptStep2(SequenceLayer* layer) { case 0xCB: sp3A = AudioSeq_ScriptReadS16(state); layer->adsr.envelope = (AdsrEnvelope*)(seqPlayer->seqData + sp3A); - // fallthrough + FALLTHROUGH; case 0xCF: layer->adsr.decayIndex = AudioSeq_ScriptReadU8(state); break; @@ -1172,7 +1172,7 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) { } cmdArgs[0] = cmdArgs[1]; - // fallthrough + FALLTHROUGH; case 0xC1: cmd = (u8)cmdArgs[0]; AudioSeq_SetInstrument(channel, cmd); @@ -1719,7 +1719,7 @@ void AudioSeq_SequencePlayerProcessSequence(SequencePlayer* seqPlayer) { break; case 0xDF: seqPlayer->transposition = 0; - // Note: intentional fallthrough, also executes below command + FALLTHROUGH; case 0xDE: seqPlayer->transposition += (s8)AudioSeq_ScriptReadU8(seqScript); break; @@ -1759,7 +1759,7 @@ void AudioSeq_SequencePlayerProcessSequence(SequencePlayer* seqPlayer) { case 1: seqPlayer->state = 0; seqPlayer->fadeVolume = 0.0f; - // NOTE: Intentional fallthrough + FALLTHROUGH; case 0: seqPlayer->fadeTimer = seqPlayer->fadeTimerUnkEu; if (seqPlayer->fadeTimerUnkEu != 0) { diff --git a/src/code/code_800EC960.c b/src/code/code_800EC960.c index a1c2249083..523af6200f 100644 --- a/src/code/code_800EC960.c +++ b/src/code/code_800EC960.c @@ -3984,7 +3984,7 @@ void Audio_SetSoundProperties(u8 bankId, u8 entryIdx, u8 channelIdx) { if (D_80130604 == 2) { sp38 = func_800F3990(*entry->posY, entry->sfxParams); } - // fallthrough + FALLTHROUGH; case BANK_OCARINA: entry->dist = sqrtf(entry->dist); vol = Audio_ComputeSoundVolume(bankId, entryIdx) * *entry->vol; diff --git a/src/code/db_camera.c b/src/code/db_camera.c index 1e5564a31e..994f64d9c8 100644 --- a/src/code/db_camera.c +++ b/src/code/db_camera.c @@ -574,8 +574,8 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) { VecSph spFC; VecSph spF4; PosRot* temp_s6; - Vec3f* eye; - Vec3f* at; + UNUSED Vec3f* eye; + UNUSED Vec3f* at; Vec3f* phi_s0; Vec3f spD8; s32 pad; @@ -1263,6 +1263,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) { DbCamera_Vec3FToS(&spD8, &dbCamera->sub.position[i].pos); } } + FALLTHROUGH; case 4: dbCamera->sub.unk_0C = true; break; diff --git a/src/code/gfxprint.c b/src/code/gfxprint.c index 3917d440ae..397e330e8a 100644 --- a/src/code/gfxprint.c +++ b/src/code/gfxprint.c @@ -255,6 +255,7 @@ void GfxPrint_PrintChar(GfxPrint* this, u8 c) { break; case '\n': this->posY += 32; + FALLTHROUGH; case '\r': this->posX = this->baseX; break; diff --git a/src/code/relocation.c b/src/code/relocation.c index 60fbc7e1ab..96b8068585 100644 --- a/src/code/relocation.c +++ b/src/code/relocation.c @@ -105,14 +105,17 @@ void Overlay_Relocate(void* allocatedVRamAddress, OverlayRelocationSection* over switch (RELOC_TYPE_MASK(reloc)) { case R_MIPS_32 << RELOC_TYPE_SHIFT: dbg = 0x16; + FALLTHROUGH; case R_MIPS_26 << RELOC_TYPE_SHIFT: dbg += 0xA; + FALLTHROUGH; case R_MIPS_LO16 << RELOC_TYPE_SHIFT: if (gOverlayLogSeverity >= 3) { osSyncPrintf("%02d %08x %08x %08x ", dbg, relocDataP, relocatedValue, relocatedAddress); osSyncPrintf(" %08x %08x %08x %08x\n", (uintptr_t)relocDataP + (uintptr_t)vRamStart - allocu32, relocData, unrelocatedAddress, relocOffset); } + // Adding a break prevents matching } } } diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 594cd82fc8..0d36371604 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -3811,12 +3811,15 @@ void func_80034A14(Actor* actor, struct_80034A14_arg1* arg1, s16 arg2, s16 arg3) sp38.unk_00 = 0; sp38.unk_04 = 0; sp38.unk_02 = 0; + FALLTHROUGH; case 3: sp38.unk_06 = 0; sp38.unk_0A = 0; sp38.unk_08 = 0; + FALLTHROUGH; case 2: sp38.unk_0C = 0; + break; } func_800344BC(actor, arg1, sp38.unk_00, sp38.unk_04, sp38.unk_02, sp38.unk_06, sp38.unk_0A, sp38.unk_08, diff --git a/src/code/z_camera.c b/src/code/z_camera.c index 7e8abdda24..5425743640 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -1380,7 +1380,7 @@ void func_80046E20(Camera* camera, VecSph* eyeAdjustment, f32 minDist, f32 arg3, camera->eye = newEyeColChk.pos; atEyeColChk = newEyeColChk; - + FALLTHROUGH; case 3: case 6: if (anim->unk_18 != 0) { @@ -1475,6 +1475,7 @@ s32 Camera_Normal1(Camera* camera) { case 20: camera->yawUpdateRateInv = OREG(27); camera->pitchUpdateRateInv = OREG(27); + FALLTHROUGH; case 0: case 10: case 25: @@ -2035,6 +2036,7 @@ s32 Camera_Parallel1(Camera* camera) { rwData->unk_00.x = 0.0f; rwData->yTarget = playerPosRot->pos.y - camera->playerPosDelta.y; camera->animState++; + break; } if (rwData->animTimer != 0) { @@ -2153,7 +2155,7 @@ s32 Camera_Parallel1(Camera* camera) { camera->fov = Camera_LERPCeilF(roData->fovTarget, camera->fov, camera->fovUpdateRate, 1.0f); camera->roll = Camera_LERPCeilS(0, camera->roll, 0.5, 0xA); camera->atLERPStepScale = Camera_ClampLERPScale(camera, sp6A ? roData->unk_1C : roData->unk_14); - //! @bug No return + //! @bug doesn't return } s32 Camera_Parallel2(Camera* camera) { @@ -2528,7 +2530,7 @@ s32 Camera_Jump3(Camera* camera) { f32 spC4; f32 spC0; f32 spBC; - Vec3f spB0; // unused + UNUSED Vec3f spB0; VecSph eyeDiffSph; PosRot* playerPosRot = &camera->playerPosRot; Jump3ReadOnlyData* roData = &camera->paramData.jump3.roData; @@ -2611,8 +2613,7 @@ s32 Camera_Jump3(Camera* camera) { break; } - spB0 = *eye; // unused - (void)spB0; // suppresses set but unused warning + spB0 = *eye; spC4 = CAM_DATA_SCALED(OREG(25)) * camera->speedRatio; spC0 = camera->speedRatio * CAM_DATA_SCALED(OREG(26)); @@ -3027,6 +3028,7 @@ s32 Camera_Battle4(Camera* camera) { case 20: rwData->animTimer = 50; camera->animState++; + break; } camera->yawUpdateRateInv = Camera_LERPCeilF(roData->lerpUpdateRate, camera->yawUpdateRateInv, @@ -3798,7 +3800,7 @@ s32 Camera_KeepOn0(Camera* camera) { KeepOn0ReadWriteData* rwData = &camera->paramData.keep0.rwData; s32 pad; Vec3s* sceneCamData; - Vec3s sceneCamRot; + UNUSED Vec3s sceneCamRot; s16 fov; camera->unk_14C &= ~0x10; @@ -3818,8 +3820,7 @@ s32 Camera_KeepOn0(Camera* camera) { Camera_Vec3sToVec3f(eyeNext, &BGCAM_POS(sceneCamData)); *eye = *eyeNext; - sceneCamRot = BGCAM_ROT(sceneCamData); // unused - (void)sceneCamRot; // suppresses set but unused warning + sceneCamRot = BGCAM_ROT(sceneCamData); fov = BGCAM_FOV(sceneCamData); if (fov == -1) { @@ -4734,6 +4735,7 @@ s32 Camera_Unique3(Camera* camera) { rwData->initialFov = camera->fov; rwData->initialDist = OLib_Vec3fDist(at, &camera->eye); camera->animState++; + FALLTHROUGH; case 1: if (doorParams->timer1-- > 0) { break; @@ -4747,7 +4749,7 @@ s32 Camera_Unique3(Camera* camera) { sp60.pitch = -sp4C.x; Camera_Vec3fVecSphGeoAdd(at, &camera->eye, &sp60); camera->animState++; - + FALLTHROUGH; case 2: if (roData->interfaceFlags & 4) { camera->at = cameraPlayerPosRot->pos; @@ -4757,7 +4759,7 @@ s32 Camera_Unique3(Camera* camera) { break; } camera->animState++; - + FALLTHROUGH; case 3: camera->unk_14C |= (0x400 | 0x10); if ((camera->unk_14C & 8) != 0) { @@ -4765,6 +4767,7 @@ s32 Camera_Unique3(Camera* camera) { } else { break; } + FALLTHROUGH; case 4: if (roData->interfaceFlags & 2) { camera->unk_14C |= 4; @@ -4785,6 +4788,7 @@ s32 Camera_Unique3(Camera* camera) { } else { break; } + FALLTHROUGH; case 5: camera->fov = Camera_LERPCeilF(rwData->initialFov, camera->fov, 0.4f, 0.1f); OLib_Vec3fDiffToVecSphGeo(&sp60, at, &camera->eye); @@ -4795,6 +4799,7 @@ s32 Camera_Unique3(Camera* camera) { break; } camera->animState++; + FALLTHROUGH; default: camera->unk_14C |= 4; camera->unk_14C &= ~8; @@ -4996,7 +5001,7 @@ s32 Camera_Unique7(Camera* camera) { VecSph playerPosEyeOffset; s16 fov; Vec3s* sceneCamData; - Vec3s sceneCamRot; + UNUSED Vec3s sceneCamRot; Vec3f* at = &camera->at; PosRot* playerPosRot = &camera->playerPosRot; Vec3f* eye = &camera->eye; @@ -5016,8 +5021,7 @@ s32 Camera_Unique7(Camera* camera) { Camera_Vec3sToVec3f(eyeNext, &BGCAM_POS(sceneCamData)); *eye = *eyeNext; - sceneCamRot = BGCAM_ROT(sceneCamData); // unused - (void)sceneCamRot; // suppresses set but unused warning + sceneCamRot = BGCAM_ROT(sceneCamData); OLib_Vec3fDiffToVecSphGeo(&playerPosEyeOffset, eye, &playerPosRot->pos); @@ -5392,6 +5396,7 @@ s32 Camera_Unique9(Camera* camera) { Camera_LERPFloorF(eyeTarget.y, camera->eyeNext.y, rwData->curKeyFrame->lerpStepScale, 1.0f); camera->eyeNext.z = Camera_LERPFloorF(eyeTarget.z, camera->eyeNext.z, rwData->curKeyFrame->lerpStepScale, 1.0f); + FALLTHROUGH; case 9: case 10: // linear interpolation of at/fov/roll @@ -5427,6 +5432,7 @@ s32 Camera_Unique9(Camera* camera) { Camera_LERPCeilF(rwData->eyeTarget.y, camera->eyeNext.y, rwData->curKeyFrame->lerpStepScale, 1.0f); camera->eyeNext.z = Camera_LERPCeilF(rwData->eyeTarget.z, camera->eyeNext.z, rwData->curKeyFrame->lerpStepScale, 1.0f); + FALLTHROUGH; case 11: case 12: setAtFOVRoll: @@ -5477,6 +5483,7 @@ s32 Camera_Unique9(Camera* camera) { Camera_ChangeModeFlags(camera->play->cameraPtrs[camIdx], CAM_MODE_NORMAL, 1); } + FALLTHROUGH; case 18: { // copy the current camera to the parent (or default)'s camera. s32 camIdx = camera->parentCamId <= CAM_ID_NONE ? CAM_ID_MAIN : camera->parentCamId; @@ -5485,10 +5492,12 @@ s32 Camera_Unique9(Camera* camera) { *eye = *eyeNext; Camera_Copy(cam, camera); } + FALLTHROUGH; default: if (camera->camId != CAM_ID_MAIN) { camera->timer = 0; } + break; } *eye = *eyeNext; @@ -5608,6 +5617,7 @@ s32 Camera_Demo1(Camera* camera) { Camera_DebugPrintSplineArray("CENTER", 5, csAtPoints); Camera_DebugPrintSplineArray(" EYE", 5, csEyePoints); } + FALLTHROUGH; case 1: // follow CutsceneCameraPoints. function returns 1 if at the end. if (func_800BB2B4(&csEyeUpdate, &newRoll, cameraFOV, csEyePoints, &rwData->keyframe, &rwData->curFrame) || @@ -5787,6 +5797,7 @@ s32 Camera_Demo3(Camera* camera) { if (camera->unk_14C & 8) { camera->animState = 4; } + FALLTHROUGH; case 10: case 20: skipUpdateEye = true; @@ -5810,7 +5821,7 @@ s32 Camera_Demo3(Camera* camera) { camera->unk_14C & 8)) { goto skipeyeUpdate; } - + FALLTHROUGH; default: camera->unk_14C |= 0x14; camera->unk_14C &= ~8; @@ -6141,6 +6152,7 @@ s32 Camera_Demo6(Camera* camera) { Camera_Vec3fVecSphGeoAdd(eyeNext, &camera->at, &eyeOffset); camera->eye = *eyeNext; camera->animState++; + FALLTHROUGH; case 1: if (stateTimers[camera->animState] < rwData->animTimer) { func_8002DF54(camera->play, &camera->player->actor, 8); @@ -6152,6 +6164,7 @@ s32 Camera_Demo6(Camera* camera) { } else { break; } + FALLTHROUGH; case 2: Camera_LERPCeilVec3f(&rwData->atTarget, &camera->at, 0.1f, 0.1f, 8.0f); if (stateTimers[camera->animState] < rwData->animTimer) { @@ -6159,6 +6172,7 @@ s32 Camera_Demo6(Camera* camera) { } else { break; } + FALLTHROUGH; case 3: camera->fov = Camera_LERPCeilF(50.0f, camera->fov, 0.2f, 0.01f); if (stateTimers[camera->animState] < rwData->animTimer) { @@ -6243,6 +6257,7 @@ s32 Camera_Demo9(Camera* camera) { onePointCamData->actionParameters &= 0xFFF; } rwData->animTimer = onePointCamData->initTimer; + FALLTHROUGH; case 1: // Run the camera state if (rwData->animTimer > 0) { @@ -6296,6 +6311,7 @@ s32 Camera_Demo9(Camera* camera) { rwData->animTimer--; break; } + FALLTHROUGH; case 3: // the cs is finished, decide the next action camera->timer = 0; @@ -6738,6 +6754,7 @@ s32 Camera_Special9(Camera* camera) { rwData->targetYaw = ABS(playerPosRot->rot.y - adjustedPlayerPosRot.rot.y) >= 0x4000 ? BINANG_ROT180(adjustedPlayerPosRot.rot.y) : adjustedPlayerPosRot.rot.y; + FALLTHROUGH; case 1: doorParams->timer1--; if (doorParams->timer1 <= 0) { @@ -6767,6 +6784,7 @@ s32 Camera_Special9(Camera* camera) { } else { break; } + FALLTHROUGH; case 2: spAC = playerPosRot->pos; spAC.y += playerYOffset + roData->yOffset; @@ -6779,6 +6797,7 @@ s32 Camera_Special9(Camera* camera) { } else { break; } + FALLTHROUGH; case 3: spAC = playerPosRot->pos; spAC.y += (playerYOffset + roData->yOffset); @@ -6794,8 +6813,10 @@ s32 Camera_Special9(Camera* camera) { } else { break; } + FALLTHROUGH; case 4: camera->animState++; + FALLTHROUGH; default: camera->unk_14C |= (0x400 | 0x10); sCameraInterfaceFlags = 0; diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c index f1b69c759d..a9b4510840 100644 --- a/src/code/z_en_item00.c +++ b/src/code/z_en_item00.c @@ -777,6 +777,7 @@ void EnItem00_Draw(Actor* thisx, PlayState* play) { } break; } + FALLTHROUGH; case ITEM00_BOMBS_A: case ITEM00_BOMBS_B: case ITEM00_BOMBS_SPECIAL: diff --git a/src/code/z_message_PAL.c b/src/code/z_message_PAL.c index 7d54ff2cb4..50abb78e11 100644 --- a/src/code/z_message_PAL.c +++ b/src/code/z_message_PAL.c @@ -2341,6 +2341,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { case MSGMODE_OCARINA_FAIL: case MSGMODE_SONG_PLAYBACK_FAIL: Message_DrawText(play, &gfx); + FALLTHROUGH; case MSGMODE_OCARINA_FAIL_NO_TEXT: msgCtx->stateTimer--; if (msgCtx->stateTimer == 0) { @@ -2539,6 +2540,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { sOcarinaButtonIndexBufPos++; } } + FALLTHROUGH; case MSGMODE_SONG_DEMONSTRATION_DONE: Message_DrawText(play, &gfx); break; @@ -2838,6 +2840,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { Message_ResetOcarinaNoteState(); msgCtx->msgMode = MSGMODE_FROGS_WAITING; } + FALLTHROUGH; case MSGMODE_FROGS_WAITING: break; case MSGMODE_TEXT_DONE: diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index 4b4a6a4f85..08e5a5f6e6 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -2471,7 +2471,7 @@ void Magic_Update(PlayState* play) { gSaveContext.magicState = MAGIC_STATE_METER_FLASH_1; sMagicBorderR = sMagicBorderG = sMagicBorderB = 255; } - // fallthrough (flash border while magic is being consumed) + FALLTHROUGH; // Flash border while magic is being consumed case MAGIC_STATE_METER_FLASH_1: case MAGIC_STATE_METER_FLASH_2: case MAGIC_STATE_METER_FLASH_3: @@ -3535,6 +3535,7 @@ void Interface_Draw(PlayState* play) { gSaveContext.timer1State = 8; } } + FALLTHROUGH; case 4: case 8: if ((gSaveContext.timer1State == 4) || (gSaveContext.timer1State == 8)) { @@ -3604,6 +3605,7 @@ void Interface_Draw(PlayState* play) { gSaveContext.timer1State = 14; } + FALLTHROUGH; case 14: if (gSaveContext.timer1State == 14) { if (gSaveContext.healthCapacity > 0xA0) { @@ -3707,6 +3709,7 @@ void Interface_Draw(PlayState* play) { gSaveContext.timer2State = 10; } } + FALLTHROUGH; case 4: case 10: if ((gSaveContext.timer2State == 4) || (gSaveContext.timer2State == 10)) { diff --git a/src/code/z_play.c b/src/code/z_play.c index f42ff8f58f..76b3010f24 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -513,7 +513,7 @@ void Play_Update(PlayState* this) { // non-instance modes break out of this switch break; } - // fallthrough + FALLTHROUGH; case TRANS_MODE_INSTANCE_INIT: this->transitionCtx.init(&this->transitionCtx.instanceData); diff --git a/src/code/z_skelanime.c b/src/code/z_skelanime.c index 9ccf57a568..7ced702785 100644 --- a/src/code/z_skelanime.c +++ b/src/code/z_skelanime.c @@ -1371,8 +1371,9 @@ s32 LinkAnimation_OnFrame(SkelAnime* skelAnime, f32 frame) { /** * Initializes a normal skeleton to a looping animation, dynamically allocating the frame tables if not provided. */ -s32 SkelAnime_Init(PlayState* play, SkelAnime* skelAnime, SkeletonHeader* skeletonHeaderSeg, AnimationHeader* animation, - Vec3s* jointTable, Vec3s* morphTable, s32 limbCount) { +BAD_RETURN(s32) +SkelAnime_Init(PlayState* play, SkelAnime* skelAnime, SkeletonHeader* skeletonHeaderSeg, AnimationHeader* animation, + Vec3s* jointTable, Vec3s* morphTable, s32 limbCount) { SkeletonHeader* skeletonHeader = SEGMENTED_TO_VIRTUAL(skeletonHeaderSeg); skelAnime->limbCount = skeletonHeader->limbCount + 1; @@ -1401,8 +1402,9 @@ s32 SkelAnime_Init(PlayState* play, SkelAnime* skelAnime, SkeletonHeader* skelet /** * Initializes a flex skeleton to a looping animation, dynamically allocating the frame tables if not given. */ -s32 SkelAnime_InitFlex(PlayState* play, SkelAnime* skelAnime, FlexSkeletonHeader* skeletonHeaderSeg, - AnimationHeader* animation, Vec3s* jointTable, Vec3s* morphTable, s32 limbCount) { +BAD_RETURN(s32) +SkelAnime_InitFlex(PlayState* play, SkelAnime* skelAnime, FlexSkeletonHeader* skeletonHeaderSeg, + AnimationHeader* animation, Vec3s* jointTable, Vec3s* morphTable, s32 limbCount) { FlexSkeletonHeader* skeletonHeader = SEGMENTED_TO_VIRTUAL(skeletonHeaderSeg); skelAnime->limbCount = skeletonHeader->sh.limbCount + 1; @@ -1435,8 +1437,9 @@ s32 SkelAnime_InitFlex(PlayState* play, SkelAnime* skelAnime, FlexSkeletonHeader /** * Initializes a skeleton with SkinLimbs to a looping animation, dynamically allocating the frame tables. */ -s32 SkelAnime_InitSkin(PlayState* play, SkelAnime* skelAnime, SkeletonHeader* skeletonHeaderSeg, - AnimationHeader* animation) { +BAD_RETURN(s32) +SkelAnime_InitSkin(PlayState* play, SkelAnime* skelAnime, SkeletonHeader* skeletonHeaderSeg, + AnimationHeader* animation) { SkeletonHeader* skeletonHeader = SEGMENTED_TO_VIRTUAL(skeletonHeaderSeg); skelAnime->limbCount = skeletonHeader->limbCount + 1; diff --git a/src/libultra/os/settimer.c b/src/libultra/os/settimer.c index b0c4a05e91..7775b987bf 100644 --- a/src/libultra/os/settimer.c +++ b/src/libultra/os/settimer.c @@ -1,7 +1,7 @@ #include "global.h" s32 osSetTimer(OSTimer* timer, OSTime countdown, OSTime interval, OSMesgQueue* mq, OSMesg msg) { - OSTime time; + UNUSED OSTime time; OSTimer* next; u32 count; u32 value; @@ -39,7 +39,5 @@ s32 osSetTimer(OSTimer* timer, OSTime countdown, OSTime interval, OSMesgQueue* m __osRestoreInt(prevInt); - if (time) {} // suppresses set but unused warning - return 0; } diff --git a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c index 06b8f1c8cf..7cf7004d78 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c @@ -102,8 +102,8 @@ s32 BgHidanHamstep_SpawnChildren(BgHidanHamstep* this, PlayState* play2) { s16 params; PlayState* play = play2; - pos = pos; // Required to match pos.y = this->dyna.actor.home.pos.y - 100.0f; + pos = pos; // Required to match sin = Math_SinS(this->dyna.actor.shape.rot.y + 0x8000); cos = Math_CosS(this->dyna.actor.shape.rot.y + 0x8000); diff --git a/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c b/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c index 96f9ac163f..37a31d398d 100644 --- a/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c +++ b/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c @@ -279,6 +279,7 @@ void BossDodongo_IntroCutscene(BossDodongo* this, PlayState* play) { this->unk_198 = 160; player->actor.world.pos.y = -1023.76f; this->subCamEye.y = player->actor.world.pos.y - 480.0f + 50.0f; + FALLTHROUGH; case 2: if (this->unk_198 >= 131) { player->actor.world.pos.x = -890.0f; @@ -1616,6 +1617,7 @@ void BossDodongo_DeathCutscene(BossDodongo* this, PlayState* play) { this->skelAnime.playSpeed = 0.0f; Flags_SetClear(play, play->roomCtx.curRoom.num); } + FALLTHROUGH; case 100: if ((this->unk_1DA < 0x2C6) && (Rand_ZeroOne() < 0.5f)) { Vec3f sp68; diff --git a/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c b/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c index be18f1894b..22fc435cb9 100644 --- a/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c +++ b/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c @@ -372,6 +372,7 @@ void BossFd_Fly(BossFd* this, PlayState* play) { this->timers[0] = 100; this->introState = BFD_CS_LOOK_LINK; } + FALLTHROUGH; case BFD_CS_LOOK_LINK: player2->actor.world.pos.x = 380.0f; player2->actor.world.pos.y = 100.0f; @@ -504,6 +505,7 @@ void BossFd_Fly(BossFd* this, PlayState* play) { case INTRO_FLY_EMERGE: this->timers[5] = 100; this->introFlyState = INTRO_FLY_HOLE; + FALLTHROUGH; case INTRO_FLY_HOLE: if (this->timers[5] == 0) { this->introFlyState = INTRO_FLY_CAMERA; diff --git a/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c b/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c index 9fe91c411c..a61ded7617 100644 --- a/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c +++ b/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c @@ -674,6 +674,7 @@ void BossFd2_Death(BossFd2* this, PlayState* play) { this->subCamAtMaxVelFrac.x = 0.1f; this->subCamAtMaxVelFrac.y = 0.1f; this->subCamAtMaxVelFrac.z = 0.1f; + FALLTHROUGH; case DEATH_RETREAT: this->work[FD2_HOLE_COUNTER]++; if (this->work[FD2_HOLE_COUNTER] < 15) { diff --git a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c index 20ea3e017e..4dfcd9d56f 100644 --- a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c +++ b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c @@ -586,7 +586,7 @@ void BossGanon_IntroCutscene(BossGanon* this, PlayState* play) { Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_GANON_ORGAN, 0.0f, 0.0f, 0.0f, 0, 0, 0, 1); sCape->minY = 57.0f; - // fallthrough + FALLTHROUGH; case 1: this->envLightMode = 3; if (this->csTimer == 70) { @@ -619,7 +619,7 @@ void BossGanon_IntroCutscene(BossGanon* this, PlayState* play) { this->csCamAt.x = 0.0f; this->unk_704 = 1.2566371f; - // fallthrough + FALLTHROUGH; case 3: this->envLightMode = 0; play->envCtx.lightBlend = 0.0f; @@ -636,7 +636,7 @@ void BossGanon_IntroCutscene(BossGanon* this, PlayState* play) { this->csState = 4; BossGanon_SetIntroCsCamera(this, 2); this->csTimer = 0; - // fallthrough + FALLTHROUGH; case 4: if ((this->csTimer == 0) || (this->csTimer == 10) || (this->csTimer == 20)) { this->csCamEye.y += 68.0f; @@ -692,7 +692,7 @@ void BossGanon_IntroCutscene(BossGanon* this, PlayState* play) { this->fwork[GDF_TRIFORCE_ENV_G] = 100.0f; func_80078884(NA_SE_EV_TRIFORCE_MARK); play->envCtx.lightBlend = 0.0f; - // fallthrough + FALLTHROUGH; case 7: this->envLightMode = 6; // fade in links triforce @@ -739,7 +739,7 @@ void BossGanon_IntroCutscene(BossGanon* this, PlayState* play) { this->fwork[GDF_TRIFORCE_ENV_G] = 100.0f; func_80078884(NA_SE_EV_TRIFORCE_MARK); play->envCtx.lightBlend = 0.0f; - // fallthrough + FALLTHROUGH; case 9: this->envLightMode = 7; BossGanon_SetIntroCsCamera(this, 6); @@ -924,7 +924,7 @@ void BossGanon_IntroCutscene(BossGanon* this, PlayState* play) { this->fwork[GDF_TRIFORCE_PRIM_B] = 255.0f; this->fwork[GDF_TRIFORCE_ENV_G] = 100.0f; play->envCtx.lightBlend = 0.0f; - // fallthrough + FALLTHROUGH; case 19: // show triforce this->envLightMode = 8; @@ -1049,7 +1049,7 @@ void BossGanon_IntroCutscene(BossGanon* this, PlayState* play) { this->csCamAt.z = this->unk_1FC.z; this->fwork[GDF_VORTEX_ALPHA] = 255.0f; this->fwork[GDF_VORTEX_SCALE] = 0.2f; - // fallthrough + FALLTHROUGH; case 22: // start floating, show title card, start fight if (this->csTimer > 30) { this->envLightMode = 0; @@ -1247,7 +1247,7 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, PlayState* play) { this->csState = 1; this->csTimer = 0; this->useOpenHand = true; - // fallthrough + FALLTHROUGH; case 1: player->actor.shape.rot.y = -0x8000; @@ -1542,7 +1542,7 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, PlayState* play) { this->whiteFillAlpha = 255.0f; play->envCtx.lightBlend = 1.0f; - // fallthrough + FALLTHROUGH; case 101: player->actor.world.pos.y = 4102.0f; Math_ApproachZeroF(&this->whiteFillAlpha, 1.0f, 5.0f); @@ -1628,7 +1628,7 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, PlayState* play) { } else { break; } - // fallthrough + FALLTHROUGH; case 104: this->csCamEye.x = -432.0f; this->csCamEye.y = 4147.0f; @@ -4020,7 +4020,7 @@ void BossGanon_LightBall_Update(Actor* thisx, PlayState* play2) { this->unk_1C2 = 0; break; } - // fallthrough + FALLTHROUGH; case 4: if (sqrtf(SQ(xDistFromGanondorf) + SQ(yDistFromGanondorf) + SQ(zDistFromGanondorf)) < 30.0f) { spBA = 3; @@ -4384,7 +4384,7 @@ void func_808E2544(Actor* thisx, PlayState* play) { new_var = this->unk_1F0.x - this->actor.world.pos.x; this->actor.shape.rot.y = RAD_TO_BINANG(Math_FAtan2F(new_var, this->unk_1F0.z - this->actor.world.pos.z)) + (this->actor.params << 0xD) - 0x20C000; - // fallthrough + FALLTHROUGH; case 11: if (this->timers[0] != 0) { this->unk_1F0 = player->actor.world.pos; diff --git a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c index 480f639d0c..93c4a546dd 100644 --- a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c +++ b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c @@ -227,6 +227,7 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) { } else { break; } + FALLTHROUGH; case 1: if (this->unk_398 < 70) { play->envCtx.lightBlend = 0.0f; @@ -249,6 +250,7 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) { } else { break; } + FALLTHROUGH; case 2: this->unk_339 = 4; player->actor.world.pos.x = 970.0f; @@ -339,6 +341,7 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) { } else { break; } + FALLTHROUGH; case 10: player->actor.world.pos.x = 490.0f; player->actor.world.pos.y = 1086.0f; @@ -420,6 +423,7 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) { } else { break; } + FALLTHROUGH; case 12: case 13: SkelAnime_Update(&this->skelAnime); @@ -446,6 +450,7 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) { } else { break; } + FALLTHROUGH; case 14: SkelAnime_Update(&this->skelAnime); Math_ApproachF(&this->actor.world.pos.y, 1289.0f, 0.05f, 1.0f); @@ -511,6 +516,7 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) { } else { break; } + FALLTHROUGH; case 16: if (this->unk_398 < 25) { this->unk_339 = 55; @@ -650,6 +656,7 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) { } else { break; } + FALLTHROUGH; case 22: if (this->unk_398 < 60) { this->unk_339 = 7; @@ -776,6 +783,7 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) { } else { break; } + FALLTHROUGH; case 26: this->subCamEye.x = sZelda->actor.world.pos.x + 100.0f + 30.0f; this->subCamEye.y = sZelda->actor.world.pos.y + 10.0f; @@ -1297,6 +1305,7 @@ void func_80900890(BossGanon2* this, PlayState* play) { this->unk_1A2[0] = 300; this->unk_1A2[1] = 100; play->envCtx.lightBlend = 0.0f; + FALLTHROUGH; case 1: if (this->unk_1A2[1] == 50) { func_80078884(NA_SE_EN_MGANON_WALK); @@ -1351,6 +1360,7 @@ void func_80900890(BossGanon2* this, PlayState* play) { this->unk_334 = 1; func_8002DF54(play, &this->actor, 0x60); this->unk_398 = 0; + FALLTHROUGH; case 11: player->actor.world.pos.x = sZelda->actor.world.pos.x + 50.0f + 10.0f; player->actor.world.pos.z = sZelda->actor.world.pos.z - 25.0f; @@ -1485,6 +1495,7 @@ void func_8090120C(BossGanon2* this, PlayState* play) { this->actor.speedXZ = 0.0f; this->unk_31A = this->unk_31C; play->envCtx.lightBlend = 0.0f; + FALLTHROUGH; case 1: if (this->unk_398 < 90) { this->unk_339 = 20; @@ -1637,6 +1648,7 @@ void func_8090120C(BossGanon2* this, PlayState* play) { } else { break; } + FALLTHROUGH; case 7: this->unk_339 = 23; Math_ApproachZeroF(&play->envCtx.lightBlend, 1.0f, 0.2f); @@ -1790,6 +1802,7 @@ void func_8090120C(BossGanon2* this, PlayState* play) { if (this->unk_398 < 160) { break; } + FALLTHROUGH; case 20: play->nextEntranceIndex = ENTR_KENJYANOMA_0; gSaveContext.nextCutsceneIndex = 0xFFF2; diff --git a/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c b/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c index c0bfb99dd9..d2c176de7b 100644 --- a/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c +++ b/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c @@ -834,6 +834,7 @@ void BossGanondrof_Charge(BossGanondrof* this, PlayState* play) { Animation_MorphToLoop(&this->skelAnime, &gPhantomGanonChargeAnim, 0.0f); this->work[GND_ACTION_STATE] = CHARGE_ATTACK; } + FALLTHROUGH; case CHARGE_ATTACK: if (this->timers[0] != 0) { Vec3f vecToLink; @@ -985,6 +986,7 @@ void BossGanondrof_Death(BossGanondrof* this, PlayState* play) { this->subCamAtMaxVelFrac.x = 0.2f; this->subCamAtMaxVelFrac.y = 0.2f; this->subCamAtMaxVelFrac.z = 0.2f; + FALLTHROUGH; case DEATH_THROES: switch (this->work[GND_ACTION_STATE]) { case DEATH_SPASM: @@ -1001,6 +1003,7 @@ void BossGanondrof_Death(BossGanondrof* this, PlayState* play) { Animation_MorphToLoop(&this->skelAnime, &gPhantomGanonLimpAnim, -20.0f); this->work[GND_ACTION_STATE] = DEATH_HUNCHED; } + FALLTHROUGH; case DEATH_HUNCHED: bodyDecayLevel = 1; break; @@ -1432,6 +1435,7 @@ s32 BossGanondrof_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, if (this->deathState != NOT_DEAD) { *dList = NULL; } + FALLTHROUGH; default: rot->y += this->rideRotY[limbIndex]; rot->z += this->rideRotZ[limbIndex]; diff --git a/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c b/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c index 88fdb8c319..d20fb6dc62 100644 --- a/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c +++ b/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c @@ -716,7 +716,7 @@ void BossGoma_Encounter(BossGoma* this, PlayState* play) { this->timer = 80; this->frameCount = 0; this->actor.flags &= ~ACTOR_FLAG_0; - // fall-through + FALLTHROUGH; case 2: // zoom on player from room center // room entrance, towards center player->actor.shape.rot.y = -0x705C; diff --git a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c index 8abc5cecad..d842d24ba0 100644 --- a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c +++ b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c @@ -1524,6 +1524,7 @@ void BossMo_DeathCs(BossMo* this, PlayState* play) { this->subCamYaw = Math_FAtan2F(dx, dz); this->subCamDist = sqrtf(SQ(dx) + SQ(dz)); this->subCamYawRate = 0.0f; + FALLTHROUGH; case MO_DEATH_MO_CORE_BURST: this->baseAlpha = 0.0f; if (this->timers[0] & 4) { @@ -1638,6 +1639,7 @@ void BossMo_DeathCs(BossMo* this, PlayState* play) { sMorphaTent1->timers[0] = 120; this->timers[0] = 150; } + FALLTHROUGH; case MO_DEATH_CEILING: Math_ApproachF(&this->subCamYaw, 0.0f, 0.05f, 0.0029999996f); Math_ApproachF(&this->subCamDist, 490.0f, 0.1f, 1.0f); diff --git a/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c b/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c index fc63e2613e..b03e8f7b99 100644 --- a/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c +++ b/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c @@ -1520,7 +1520,7 @@ void BossTw_TwinrovaMergeCS(BossTw* this, PlayState* play) { this->workf[UNK_F11] = 600.0f; Audio_QueueSeqCmd(0x1 << 28 | SEQ_PLAYER_BGM_MAIN << 24 | 0xC800FF); this->work[CS_TIMER_2] = 0; - // fallthrough + FALLTHROUGH; case 1: if (this->work[CS_TIMER_2] == 20) { Message_StartTextbox(play, 0x6059, NULL); @@ -1663,7 +1663,7 @@ void BossTw_TwinrovaMergeCS(BossTw* this, PlayState* play) { sEnvType = -1; play->envCtx.lightSetting = 4; Math_ApproachF(&play->envCtx.lightBlend, 1, 1, 0.1f); - // fallthrough + FALLTHROUGH; case 2: SkelAnime_Update(&this->skelAnime); Math_ApproachF(&this->actor.scale.x, 0.0069999993f, 1, 0.0006999999f); @@ -3934,7 +3934,7 @@ void BossTw_BlastFire(BossTw* this, PlayState* play) { this->blastTailPos[i] = this->actor.world.pos; } this->workf[TAIL_ALPHA] = 255.0f; - // fallthrough + FALLTHROUGH; case 1: case 10: this->blastActive = true; @@ -4122,7 +4122,7 @@ void BossTw_BlastIce(BossTw* this, PlayState* play) { } this->workf[TAIL_ALPHA] = 255.0f; - // fallthrough + FALLTHROUGH; case 1: case 10: this->blastActive = true; diff --git a/src/overlays/actors/ovl_Boss_Va/z_boss_va.c b/src/overlays/actors/ovl_Boss_Va/z_boss_va.c index e512738a07..3a352c3f50 100644 --- a/src/overlays/actors/ovl_Boss_Va/z_boss_va.c +++ b/src/overlays/actors/ovl_Boss_Va/z_boss_va.c @@ -1555,6 +1555,7 @@ void BossVa_BodyDeath(BossVa* this, PlayState* play) { play->envCtx.screenFillColor[3] = 0; play->envCtx.fillScreen = true; sCsState++; + FALLTHROUGH; case DEATH_BODY_TUMORS: this->unk_1AC += 0x100; sSubCamEyeNext.x = (Math_SinS(this->unk_1AC) * (160.0f + this->unk_1A8)) + sSubCamAtNext.x; @@ -1648,6 +1649,7 @@ void BossVa_BodyDeath(BossVa* this, PlayState* play) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_RU1, sWarpPos[sp7C].x, sWarpPos[sp7C].y, sWarpPos[sp7C].z, 0, 0, 0, 0); } + FALLTHROUGH; case DEATH_FINISH: Rand_CenteredFloat(0.5f); play->envCtx.fillScreen = false; @@ -1818,7 +1820,7 @@ void BossVa_SupportCut(BossVa* this, PlayState* play) { Math_SmoothStepToF(&sSubCamEye.z, sSubCamAtNext.z, 1.0f, 10.0f, 0.0f); sSubCamEye.y += 20.0f; sCsState++; - + FALLTHROUGH; case DEATH_CORE_TUMORS: case DEATH_CORE_DEAD: case DEATH_CORE_BURST: @@ -2169,6 +2171,7 @@ void BossVa_ZapperDeath(BossVa* this, PlayState* play) { switch (sCsState) { case DEATH_ZAPPER_2: sp3C = -55.0f; + FALLTHROUGH; case DEATH_ZAPPER_1: case DEATH_ZAPPER_3: if (!this->burst) { @@ -2476,6 +2479,7 @@ void BossVa_BariIntro(BossVa* this, PlayState* play) { } } } + FALLTHROUGH; case INTRO_UNUSED_CALL_BARI: this->timer--; if (this->timer == 0) { @@ -3725,6 +3729,7 @@ void BossVa_SpawnSpark(PlayState* play, BossVaEffect* effect, BossVa* this, Vec3 switch (mode) { case SPARK_UNUSED: effect->type = VA_SMALL_SPARK; + FALLTHROUGH; case SPARK_TETHER: tempVec = *offset; tempVec.x += this->actor.world.pos.x; @@ -3735,6 +3740,7 @@ void BossVa_SpawnSpark(PlayState* play, BossVaEffect* effect, BossVa* this, Vec3 case SPARK_BODY: effect->type = VA_SMALL_SPARK; + FALLTHROUGH; case SPARK_BARI: effect->offset.x = offset->x; effect->offset.z = offset->z; diff --git a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c index 27b9a538d1..53e0004a35 100644 --- a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c +++ b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c @@ -458,6 +458,7 @@ void DemoEffect_Init(Actor* thisx, PlayState* play2) { case DEMO_EFFECT_TIMEWARP_TIMEBLOCK_LARGE: case DEMO_EFFECT_TIMEWARP_TIMEBLOCK_SMALL: this->actor.flags |= ACTOR_FLAG_25; + FALLTHROUGH; case DEMO_EFFECT_TIMEWARP_MASTERSWORD: this->initDrawFunc = DemoEffect_DrawTimeWarp; this->initUpdateFunc = DemoEffect_InitTimeWarp; diff --git a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c index cca2510c23..be2709e535 100644 --- a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c +++ b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c @@ -789,6 +789,7 @@ void DemoKankyo_DrawWarpSparkles(Actor* thisx, PlayState* play) { this->unk_150[i].unk_0.z = (s16)((Rand_ZeroOne() - 0.5f) * 16.0f * temp_f22); this->unk_150[i].unk_23 = 0; this->unk_150[i].unk_22++; + FALLTHROUGH; case 1: if (this->actor.params == DEMOKANKYO_WARP_OUT) { if (func_800BB2B4(&camPos, &sWarpRoll, &sWarpFoV, sWarpOutCameraPoints, &this->unk_150[i].unk_20, @@ -834,6 +835,7 @@ void DemoKankyo_DrawWarpSparkles(Actor* thisx, PlayState* play) { case 0: this->unk_150[i].unk_18 = Rand_ZeroOne(); this->unk_150[i].unk_23++; + FALLTHROUGH; case 1: Math_SmoothStepToF(&this->unk_150[i].unk_18, 1.0f, 0.5f, 0.4f, 0.2f); if (this->unk_150[i].unk_18 >= 1.0f) { @@ -927,6 +929,7 @@ void DemoKankyo_DrawSparkles(Actor* thisx, PlayState* play) { this->unk_150[i].unk_0.z = (s16)((Rand_ZeroOne() - 0.5f) * 16.0f * temp_f20); this->unk_150[i].unk_23 = 0; this->unk_150[i].unk_22++; + FALLTHROUGH; case 1: if (func_800BB2B4(&camPos, &sSparklesRoll, &sSparklesFoV, sSparklesCameraPoints, &this->unk_150[i].unk_20, &this->unk_150[i].unk_1C) != 0) { @@ -950,6 +953,7 @@ void DemoKankyo_DrawSparkles(Actor* thisx, PlayState* play) { case 0: this->unk_150[i].unk_18 = Rand_ZeroOne(); this->unk_150[i].unk_23++; + FALLTHROUGH; case 1: Math_SmoothStepToF(&this->unk_150[i].unk_18, 1.0f, 0.5f, 0.4f, 0.2f); if (1.0f <= this->unk_150[i].unk_18) { diff --git a/src/overlays/actors/ovl_En_Bb/z_en_bb.c b/src/overlays/actors/ovl_En_Bb/z_en_bb.c index 4ea6ab8c10..0887ea337a 100644 --- a/src/overlays/actors/ovl_En_Bb/z_en_bb.c +++ b/src/overlays/actors/ovl_En_Bb/z_en_bb.c @@ -379,7 +379,7 @@ void EnBb_Init(Actor* thisx, PlayState* play) { this->path = this->actionState >> 4; this->collider.elements[0].dim.modelSphere.radius = 0x16; Actor_SetScale(thisx, 0.03f); - // fallthrough + FALLTHROUGH; case ENBB_GREEN: thisx->naviEnemyId = NAVI_ENEMY_GREEN_BUBBLE; this->bobSize = (this->actionState & 0xF) * 20.0f; @@ -1087,6 +1087,7 @@ void EnBb_SetupStunned(EnBb* this) { break; case 9: this->fireIceTimer = 0x30; + FALLTHROUGH; case 15: Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); Actor_SetColorFilter(&this->actor, 0, 0xB4, 0, 0x50); @@ -1154,6 +1155,7 @@ void EnBb_CollisionCheck(EnBb* this, PlayState* play) { switch (this->dmgEffect) { case 7: this->actor.freezeTimer = this->collider.elements[0].info.acHitInfo->toucher.damage; + FALLTHROUGH; case 5: this->fireIceTimer = 0x30; //! @bug @@ -1212,6 +1214,7 @@ void EnBb_CollisionCheck(EnBb* this, PlayState* play) { ((this->actor.params != ENBB_WHITE) && (this->flameScaleX < 20.0f))) { EnBb_SetupDamage(this); } + FALLTHROUGH; case 13: break; } diff --git a/src/overlays/actors/ovl_En_Bw/z_en_bw.c b/src/overlays/actors/ovl_En_Bw/z_en_bw.c index 898b0092a9..a496025045 100644 --- a/src/overlays/actors/ovl_En_Bw/z_en_bw.c +++ b/src/overlays/actors/ovl_En_Bw/z_en_bw.c @@ -241,6 +241,7 @@ void func_809CEA24(EnBw* this, PlayState* play) { switch (sp64) { case 0: this->unk_236 += this->unk_238; + FALLTHROUGH; case 1: if (this->unk_221 == 3) { if (play->gameplayFrames & 2) { @@ -261,11 +262,13 @@ void func_809CEA24(EnBw* this, PlayState* play) { break; case 2: this->unk_236 += this->unk_238; + FALLTHROUGH; case 3: this->unk_238 = 0x4000; break; case 4: this->unk_236 += this->unk_238; + FALLTHROUGH; case 5: this->unk_238 = -0x4000; break; diff --git a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c index 43ad89bdda..20e4d4061e 100644 --- a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c +++ b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c @@ -488,6 +488,7 @@ void EnClearTag_Update(Actor* thisx, PlayState* play2) { this->actor.world.pos.y, this->actor.world.pos.z, this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, CLEAR_TAG_STATE_LASER); } + FALLTHROUGH; } case CLEAR_TAG_STATE_CRASHING: state_crashing: @@ -591,6 +592,7 @@ void EnClearTag_Update(Actor* thisx, PlayState* play2) { this->subCamId = Play_CreateSubCamera(play); Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STAT_WAIT); Play_ChangeCameraStatus(play, this->subCamId, CAM_STAT_ACTIVE); + FALLTHROUGH; case CLEAR_TAG_CUTSCENE_MODE_PLAY: // Update the Arwing cutscene camera to spin around in a circle. cutsceneTimer = this->frameCounter * 128; diff --git a/src/overlays/actors/ovl_En_Dh/z_en_dh.c b/src/overlays/actors/ovl_En_Dh/z_en_dh.c index dad253def9..5b5d82c1f0 100644 --- a/src/overlays/actors/ovl_En_Dh/z_en_dh.c +++ b/src/overlays/actors/ovl_En_Dh/z_en_dh.c @@ -212,6 +212,7 @@ void EnDh_Wait(EnDh* this, PlayState* play) { this->actionState++; this->drawDirtWave++; Audio_PlayActorSound2(&this->actor, NA_SE_EN_DEADHAND_HIDE); + FALLTHROUGH; case 1: this->dirtWavePhase += 0x3A7; Math_SmoothStepToF(&this->dirtWaveSpread, 300.0f, 1.0f, 5.0f, 0.0f); @@ -311,6 +312,7 @@ void EnDh_Attack(EnDh* this, PlayState* play) { Animation_PlayOnce(&this->skelAnime, &object_dh_Anim_001A3C); this->actionState++; Audio_PlayActorSound2(&this->actor, NA_SE_EN_DEADHAND_BITE); + FALLTHROUGH; case 0: Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0x5DC, 0); break; @@ -376,6 +378,7 @@ void EnDh_Burrow(EnDh* this, PlayState* play) { AT_ON | AT_TYPE_ENEMY; // also TOUCH_ON | TOUCH_SFX_WOOD this->collider1.info.toucher.dmgFlags = 0xFFCFFFFF; this->collider1.info.toucher.damage = 4; + FALLTHROUGH; case 1: this->dirtWavePhase += 0x47E; Math_SmoothStepToF(&this->dirtWaveSpread, 300.0f, 1.0f, 8.0f, 0.0f); diff --git a/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c b/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c index 7863578025..32930b07d3 100644 --- a/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c +++ b/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c @@ -162,6 +162,7 @@ void EnDntDemo_Judge(EnDntDemo* this, PlayState* play) { Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_SARIA_THEME); break; } + FALLTHROUGH; case PLAYER_MASK_TRUTH: if (!GET_ITEMGETINF(ITEMGETINF_1F) && (Player_GetMask(play) != PLAYER_MASK_SKULL)) { Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, @@ -176,6 +177,7 @@ void EnDntDemo_Judge(EnDntDemo* this, PlayState* play) { } break; } + FALLTHROUGH; case PLAYER_MASK_KEATON: case PLAYER_MASK_SPOOKY: case PLAYER_MASK_BUNNY: diff --git a/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c b/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c index f697182fa2..8f88659a34 100644 --- a/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c +++ b/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c @@ -90,8 +90,8 @@ void EnDyExtra_Update(Actor* thisx, PlayState* play) { void EnDyExtra_Draw(Actor* thisx, PlayState* play) { static Color_RGBA8 primColors[] = { { 255, 255, 170, 255 }, { 255, 255, 170, 255 } }; static Color_RGBA8 envColors[] = { { 255, 100, 255, 255 }, { 100, 255, 255, 255 } }; - static u8 D_809FFC50[] = { 0x02, 0x01, 0x01, 0x02, 0x00, 0x00, 0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x02, - 0x01, 0x00, 0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x01, 0x02 }; + static u8 D_809FFC50[] = { 0x02, 0x01, 0x01, 0x02, 0x00, 0x00, 0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x02, 0x01, + 0x00, 0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x01, 0x02, 0x00 }; EnDyExtra* this = (EnDyExtra*)thisx; s32 pad; GraphicsContext* gfxCtx = play->state.gfxCtx; diff --git a/src/overlays/actors/ovl_En_Elf/z_en_elf.c b/src/overlays/actors/ovl_En_Elf/z_en_elf.c index 180dd766db..eabcc551b9 100644 --- a/src/overlays/actors/ovl_En_Elf/z_en_elf.c +++ b/src/overlays/actors/ovl_En_Elf/z_en_elf.c @@ -373,8 +373,10 @@ void EnElf_Init(Actor* thisx, PlayState* play) { case FAIRY_HEAL_BIG: this->fairyFlags |= FAIRY_FLAG_BIG; thisx->shape.shadowDraw = ActorShadow_DrawWhiteCircle; + FALLTHROUGH; case FAIRY_HEAL_TIMED: this->fairyFlags |= FAIRY_FLAG_TIMED; + FALLTHROUGH; case FAIRY_HEAL: colorConfig = -1; EnElf_SetupAction(this, func_80A0329C); diff --git a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c index 26e5c13bbe..c558374d61 100644 --- a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c +++ b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c @@ -98,6 +98,7 @@ void EnEncount2_Wait(EnEncount2* this, PlayState* play) { Quake_SetCountdown(quakeIndex, 300); this->isQuaking = true; } + FALLTHROUGH; case ENCOUNT2_ACTIVE_GANONS_TOWER: this->envEffectsTimer++; if (this->envEffectsTimer > 60) { diff --git a/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c b/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c index 2360be2329..a00ed9457c 100644 --- a/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c +++ b/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c @@ -134,6 +134,7 @@ void EnExItem_WaitForObject(EnExItem* this, PlayState* play) { switch (this->type) { case EXITEM_BOMB_BAG_COUNTER: onCounter = true; + FALLTHROUGH; case EXITEM_BOMB_BAG_BOWLING: this->unk_17C = func_8002EBCC; this->giDrawId = GID_BOMB_BAG_30; @@ -149,6 +150,7 @@ void EnExItem_WaitForObject(EnExItem* this, PlayState* play) { break; case EXITEM_HEART_PIECE_COUNTER: onCounter = true; + FALLTHROUGH; case EXITEM_HEART_PIECE_BOWLING: this->unk_17C = func_8002ED80; this->timer = 65; @@ -164,6 +166,7 @@ void EnExItem_WaitForObject(EnExItem* this, PlayState* play) { break; case EXITEM_BOMBCHUS_COUNTER: onCounter = true; + FALLTHROUGH; case EXITEM_BOMBCHUS_BOWLING: this->unk_17C = func_8002EBCC; this->giDrawId = GID_BOMBCHU; diff --git a/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c b/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c index 4877df839d..877b14b9a5 100644 --- a/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c +++ b/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c @@ -253,6 +253,7 @@ void EnFhgFire_LightningTrail(EnFhgFire* this, PlayState* play) { case TRAIL_INIT: this->work[FHGFIRE_FIRE_MODE] = TRAIL_APPEAR; this->work[FHGFIRE_TIMER] = (s16)(Rand_ZeroOne() * 7.0f) + 7; + FALLTHROUGH; case TRAIL_APPEAR: Math_ApproachF(&this->fwork[FHGFIRE_SCALE], 1.7f, 1.0f, 0.34f); diff --git a/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c b/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c index 701d8c77a6..48f0d2e819 100644 --- a/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c +++ b/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c @@ -106,6 +106,7 @@ void EnFireRock_Init(Actor* thisx, PlayState* play) { // sets unused vars? this->unk_17C.x = (f32)(Rand_CenteredFloat(50.0f) + player->actor.world.pos.x); this->unk_17C.z = (f32)(Rand_CenteredFloat(50.0f) + player->actor.world.pos.z); + FALLTHROUGH; case FIRE_ROCK_SPAWNED_FALLING2: // spawned by encount2 and by the ceilling spawner this->scale = (Rand_ZeroFloat(2.0f) / 100.0f) + 0.02f; Actor_SetScale(&this->actor, this->scale); @@ -180,6 +181,7 @@ void EnFireRock_Fall(EnFireRock* this, PlayState* play) { Math_ApproachF(&this->actor.world.pos.z, player->actor.world.pos.z, 1.0f, 10.0f); } } + FALLTHROUGH; case FIRE_ROCK_SPAWNED_FALLING2: flamePos.x = Rand_CenteredFloat(20.0f) + this->actor.world.pos.x; flamePos.y = Rand_CenteredFloat(20.0f) + this->actor.world.pos.y; @@ -197,6 +199,7 @@ void EnFireRock_Fall(EnFireRock* this, PlayState* play) { case FIRE_ROCK_SPAWNED_FALLING1: case FIRE_ROCK_SPAWNED_FALLING2: func_80033E88(&this->actor, play, 5, 2); + FALLTHROUGH; case FIRE_ROCK_BROKEN_PIECE1: Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, this->actor.shape.shadowScale, 1, 8.0f, 500, 10, false); @@ -236,6 +239,7 @@ void EnFireRock_SpawnMoreBrokenPieces(EnFireRock* this, PlayState* play) { break; case FIRE_ROCK_BROKEN_PIECE1: nextRockType = FIRE_ROCK_BROKEN_PIECE2; + break; } if (nextRockType != FIRE_ROCK_SPAWNED_FALLING1) { diff --git a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c index 7f31b3fe57..5702d5fa8d 100644 --- a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c +++ b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c @@ -237,7 +237,7 @@ s32 EnGe3_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p // Turn head case GELDB_LIMB_HEAD: rot->x += this->headRot.y; - + FALLTHROUGH; // This is a hack to fix the color-changing clothes this Gerudo has on N64 versions default: OPEN_DISPS(play->state.gfxCtx, "../z_en_ge3.c", 547); diff --git a/src/overlays/actors/ovl_En_Gm/z_en_gm.c b/src/overlays/actors/ovl_En_Gm/z_en_gm.c index 6984f98cf8..d4e6b07b96 100644 --- a/src/overlays/actors/ovl_En_Gm/z_en_gm.c +++ b/src/overlays/actors/ovl_En_Gm/z_en_gm.c @@ -203,13 +203,16 @@ void func_80A3DC44(EnGm* this, PlayState* play) { switch (func_80A3D7C8()) { case 0: SET_INFTABLE(INFTABLE_B0); + FALLTHROUGH; case 3: this->actionFunc = func_80A3DD7C; return; case 1: SET_INFTABLE(INFTABLE_B1); + FALLTHROUGH; case 2: this->actionFunc = EnGm_ProcessChoiceIndex; + FALLTHROUGH; default: return; } diff --git a/src/overlays/actors/ovl_En_Go/z_en_go.c b/src/overlays/actors/ovl_En_Go/z_en_go.c index cb4540e463..196eac516b 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -305,6 +305,7 @@ s16 EnGo_SetFlagsGetStates(PlayState* play, Actor* thisx) { switch (thisx->textId) { case 0x3035: SET_INFTABLE(INFTABLE_10B); + FALLTHROUGH; case 0x3032: case 0x3033: thisx->textId = 0x3034; diff --git a/src/overlays/actors/ovl_En_Go2/z_en_go2.c b/src/overlays/actors/ovl_En_Go2/z_en_go2.c index 7603a7365f..315669afb5 100644 --- a/src/overlays/actors/ovl_En_Go2/z_en_go2.c +++ b/src/overlays/actors/ovl_En_Go2/z_en_go2.c @@ -351,6 +351,7 @@ s16 EnGo2_GetStateGoronCityRollingBig(PlayState* play, EnGo2* this) { return 2; } } + FALLTHROUGH; default: return 1; } @@ -383,6 +384,7 @@ s16 EnGo2_GetStateGoronDmtBombFlower(PlayState* play, EnGo2* this) { } return 1; } + FALLTHROUGH; default: return 1; } @@ -515,6 +517,7 @@ s16 EnGo2_GetStateGoronCityLink(PlayState* play, EnGo2* this) { return 2; case 0x3037: SET_INFTABLE(INFTABLE_10E); + FALLTHROUGH; default: return 0; } @@ -544,6 +547,7 @@ s16 EnGo2_GetStateGoronCityLink(PlayState* play, EnGo2* this) { switch (this->actor.textId) { case 0x3035: SET_INFTABLE(INFTABLE_10B); + FALLTHROUGH; case 0x3032: case 0x3033: this->actor.textId = 0x3034; @@ -553,6 +557,7 @@ s16 EnGo2_GetStateGoronCityLink(PlayState* play, EnGo2* this) { return 2; } } + break; } return 1; } @@ -598,15 +603,18 @@ s16 EnGo2_GetStateGoronDmtBiggoron(PlayState* play, EnGo2* this) { if (func_8002F368(play) != EXCH_ITEM_CLAIM_CHECK) { break; } + FALLTHROUGH; case 0x3059: if (dialogState == TEXT_STATE_NONE) { func_800F4524(&gSfxDefaultPos, NA_SE_EN_GOLON_WAKE_UP, 60); } + FALLTHROUGH; case 0x3054: if (dialogState == TEXT_STATE_NONE) { Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } + break; } return 1; case TEXT_STATE_CHOICE: @@ -631,6 +639,7 @@ s16 EnGo2_GetStateGoronDmtBiggoron(PlayState* play, EnGo2* this) { } return 2; } + break; } return 1; } @@ -655,6 +664,7 @@ s16 EnGo2_GetStateGoronFireGeneric(PlayState* play, EnGo2* this) { } return 1; } + FALLTHROUGH; default: return 1; } @@ -732,7 +742,7 @@ u16 EnGo2_GetTextId(PlayState* play, Actor* thisx) { EnGo2* this = (EnGo2*)thisx; u16 faceReaction = Text_GetFaceReaction(play, 0x20); - if (faceReaction) { + if (faceReaction != 0) { return faceReaction; } else { switch (this->actor.params & 0x1F) { @@ -766,6 +776,9 @@ u16 EnGo2_GetTextId(PlayState* play, Actor* thisx) { return EnGo2_GetTextIdGoronMarketBazaar(play, this); } } +#ifdef AVOID_UB + return faceReaction; // faceReaction is always in the v0 return value register at this point +#endif } s16 EnGo2_GetState(PlayState* play, Actor* thisx) { @@ -800,6 +813,11 @@ s16 EnGo2_GetState(PlayState* play, Actor* thisx) { case GORON_MARKET_BAZAAR: return EnGo2_GetStateGoronMarketBazaar(play, this); } +#ifdef AVOID_UB + // The v0 register isn't set in this function, the last value in v0 is the return value of Actor_ProcessTalkRequest + // called in the function below, which must be false for this function to be called + return false; +#endif } s32 func_80A44790(EnGo2* this, PlayState* play) { @@ -1121,6 +1139,7 @@ void func_80A454CC(EnGo2* this) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENGO2_ANIM_4); break; } + FALLTHROUGH; default: this->skelAnime.playSpeed = 0.0f; break; @@ -1217,8 +1236,10 @@ void EnGo2_SelectGoronWakingUp(EnGo2* this) { EnGo2_WakingUp(this); break; } + FALLTHROUGH; default: EnGo2_DefaultWakingUp(this); + break; } } @@ -1592,10 +1613,12 @@ void EnGo2_Init(Actor* thisx, PlayState* play) { Path_CopyLastPoint(this->path, &this->actor.world.pos); this->actor.home.pos = this->actor.world.pos; } + FALLTHROUGH; case GORON_DMT_DC_ENTRANCE: case GORON_DMT_FAIRY_HINT: default: this->actionFunc = EnGo2_CurledUp; + break; } } diff --git a/src/overlays/actors/ovl_En_Hy/z_en_hy.c b/src/overlays/actors/ovl_En_Hy/z_en_hy.c index e79dab58ff..ad455968eb 100644 --- a/src/overlays/actors/ovl_En_Hy/z_en_hy.c +++ b/src/overlays/actors/ovl_En_Hy/z_en_hy.c @@ -931,7 +931,7 @@ void EnHy_InitImpl(EnHy* this, PlayState* play) { this->actionFunc = func_80A710F8; break; } - // fall-through + FALLTHROUGH; case ENHY_TYPE_COB: case ENHY_TYPE_AHG_2: case ENHY_TYPE_AHG_4: diff --git a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c index 53651cdf12..0660d387b9 100644 --- a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c +++ b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c @@ -583,6 +583,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play2) { if (DECR(this->airTimer) == 0) { this->actionState = ENKANBAN_GROUND; } + FALLTHROUGH; } case ENKANBAN_GROUND: case ENKANBAN_WATER: diff --git a/src/overlays/actors/ovl_En_Ko/z_en_ko.c b/src/overlays/actors/ovl_En_Ko/z_en_ko.c index 1515254dba..7862e98e43 100644 --- a/src/overlays/actors/ovl_En_Ko/z_en_ko.c +++ b/src/overlays/actors/ovl_En_Ko/z_en_ko.c @@ -563,7 +563,7 @@ s16 func_80A97738(PlayState* play, Actor* thisx) { break; case 0x10B7: SET_INFTABLE(INFTABLE_BC); - + FALLTHROUGH; case 0x10B8: this->actor.textId = (play->msgCtx.choiceIndex == 0) ? 0x10BA : 0x10B9; return (play->msgCtx.choiceIndex == 0) ? 2 : 1; diff --git a/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c b/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c index a1e830f381..cd224a3ae9 100644 --- a/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c +++ b/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c @@ -144,11 +144,13 @@ s16 func_80AA2BD4(PlayState* play, Actor* thisx) { break; case 0x208F: SET_EVENTCHKINF(EVENTCHKINF_1E); + FALLTHROUGH; case 0x2004: case 0x2012: if (HIGH_SCORE(HS_HORSE_RACE) > gSaveContext.timer1Value) { HIGH_SCORE(HS_HORSE_RACE) = gSaveContext.timer1Value; } + FALLTHROUGH; case 0x208E: CLEAR_EVENTINF(EVENTINF_HORSES_0A); thisx->flags &= ~ACTOR_FLAG_16; @@ -157,6 +159,7 @@ s16 func_80AA2BD4(PlayState* play, Actor* thisx) { break; case 0x2002: SET_INFTABLE(INFTABLE_B9); + FALLTHROUGH; case 0x2003: if (!GET_EVENTINF(EVENTINF_HORSES_0A)) { ret = 0; @@ -164,6 +167,7 @@ s16 func_80AA2BD4(PlayState* play, Actor* thisx) { break; default: ret = 0; + break; } break; case TEXT_STATE_NONE: diff --git a/src/overlays/actors/ovl_En_Md/z_en_md.c b/src/overlays/actors/ovl_En_Md/z_en_md.c index 5318126987..ffecef5402 100644 --- a/src/overlays/actors/ovl_En_Md/z_en_md.c +++ b/src/overlays/actors/ovl_En_Md/z_en_md.c @@ -104,11 +104,13 @@ void func_80AAA274(EnMd* this) { case 0: Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_2); this->unk_20A++; + FALLTHROUGH; case 1: if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_3); this->unk_20A++; } + break; } } @@ -117,11 +119,13 @@ void func_80AAA308(EnMd* this) { case 0: Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_4); this->unk_20A++; + FALLTHROUGH; case 1: if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_5); this->unk_20A++; } + break; } } @@ -131,6 +135,7 @@ void func_80AAA39C(EnMd* this) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_2); func_80AAA250(this); this->unk_20A++; + FALLTHROUGH; case 1: if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_7); @@ -138,11 +143,13 @@ void func_80AAA39C(EnMd* this) { } else { break; } + FALLTHROUGH; case 2: if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_8); this->unk_20A++; } + break; } } @@ -151,11 +158,13 @@ void func_80AAA474(EnMd* this) { case 0: Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_7); this->unk_20A++; + FALLTHROUGH; case 1: if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_10); this->unk_20A++; } + break; } } @@ -165,11 +174,13 @@ void func_80AAA508(EnMd* this) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_2); func_80AAA250(this); this->unk_20A++; + FALLTHROUGH; case 1: if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_10); this->unk_20A++; } + break; } } @@ -178,11 +189,13 @@ void func_80AAA5A4(EnMd* this) { case 0: Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_9); this->unk_20A++; + FALLTHROUGH; case 1: if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_6); this->unk_20A++; } + break; } } @@ -192,11 +205,13 @@ void func_80AAA638(EnMd* this) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_9); func_80AAA250(this); this->unk_20A++; + FALLTHROUGH; case 1: if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_10); this->unk_20A++; } + break; } } @@ -205,11 +220,13 @@ void func_80AAA6D4(EnMd* this) { case 0: Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_11); this->unk_20A++; + FALLTHROUGH; case 1: if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_6); this->unk_20A++; } + break; } } @@ -218,11 +235,13 @@ void func_80AAA768(EnMd* this) { case 0: Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_12); this->unk_20A++; + FALLTHROUGH; case 1: if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_3); this->unk_20A++; } + break; } } @@ -231,11 +250,13 @@ void func_80AAA7FC(EnMd* this) { case 0: Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_13); this->unk_20A++; + FALLTHROUGH; case 1: if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_6); this->unk_20A++; } + break; } } @@ -245,11 +266,13 @@ void func_80AAA890(EnMd* this) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_7); func_80AAA250(this); this->unk_20A++; + FALLTHROUGH; case 1: if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENMD_ANIM_10); this->unk_20A++; } + break; } } @@ -475,6 +498,7 @@ s16 func_80AAAF04(PlayState* play, Actor* thisx) { if (Message_ShouldAdvance(play)) { return 2; } + FALLTHROUGH; default: return 1; } diff --git a/src/overlays/actors/ovl_En_Niw/z_en_niw.c b/src/overlays/actors/ovl_En_Niw/z_en_niw.c index 766f11b026..90e060f11f 100644 --- a/src/overlays/actors/ovl_En_Niw/z_en_niw.c +++ b/src/overlays/actors/ovl_En_Niw/z_en_niw.c @@ -209,6 +209,7 @@ void EnNiw_Init(Actor* thisx, PlayState* play) { break; case 0xD: this->actor.gravity = 0.0f; + FALLTHROUGH; case 0xE: this->actor.colChkInfo.mass = 0; this->actor.flags &= ~ACTOR_FLAG_0; @@ -223,6 +224,7 @@ void EnNiw_Init(Actor* thisx, PlayState* play) { switch (this->actor.params) { case 0xA: this->actor.colChkInfo.mass = MASS_IMMOVABLE; + FALLTHROUGH; case 0xD: case 0xE: Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit2); diff --git a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c index 0d845de414..77da8a3c93 100644 --- a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c +++ b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c @@ -109,6 +109,7 @@ void EnNiwLady_ChoseAnimation(EnNiwLady* this, PlayState* play, s32 arg2) { switch (arg2) { case 10: this->unk_275 = 1; + FALLTHROUGH; case 9: frames = Animation_GetLastFrame(&gObjOsAnim_07D0); Animation_Change(&this->skelAnime, &gObjOsAnim_07D0, 1.0f, 0.0f, frames, ANIMMODE_LOOP, -10.0f); diff --git a/src/overlays/actors/ovl_En_Ny/z_en_ny.c b/src/overlays/actors/ovl_En_Ny/z_en_ny.c index b2c73cb3aa..432a98b376 100644 --- a/src/overlays/actors/ovl_En_Ny/z_en_ny.c +++ b/src/overlays/actors/ovl_En_Ny/z_en_ny.c @@ -312,6 +312,7 @@ s32 EnNy_CollisionCheck(EnNy* this, PlayState* play) { switch (this->actor.colChkInfo.damageEffect) { case 0xE: sp3F = 1; + FALLTHROUGH; case 0xF: Actor_ApplyDamage(&this->actor); Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0x2000, 0x50); diff --git a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c index dcc1747c75..8b2925f1bd 100644 --- a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c +++ b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c @@ -88,6 +88,7 @@ void EnOkarinaTag_Init(Actor* thisx, PlayState* play) { Actor_Kill(&this->actor); break; } + FALLTHROUGH; case 1: case 4: case 6: diff --git a/src/overlays/actors/ovl_En_Part/z_en_part.c b/src/overlays/actors/ovl_En_Part/z_en_part.c index 57ebc46d8d..020298000f 100644 --- a/src/overlays/actors/ovl_En_Part/z_en_part.c +++ b/src/overlays/actors/ovl_En_Part/z_en_part.c @@ -49,6 +49,7 @@ void func_80ACDDE8(EnPart* this, PlayState* play) { break; case 13: this->timer = 400; + FALLTHROUGH; case 12: this->actor.speedXZ = Rand_CenteredFloat(6.0f); this->actor.home.pos = this->actor.world.pos; @@ -59,11 +60,13 @@ void func_80ACDDE8(EnPart* this, PlayState* play) { break; case 14: EffectSsEnFire_SpawnVec3f(play, &this->actor, &this->actor.world.pos, 40, 0x8001, 0, -1); + FALLTHROUGH; case 1: case 4: case 9: case 10: this->timer += (s16)(Rand_ZeroOne() * 17.0f) + 5; + FALLTHROUGH; case 2: this->actor.velocity.y = Rand_ZeroOne() * 5.0f + 4.0f; this->actor.gravity = -0.6f - Rand_ZeroOne() * 0.5f; @@ -71,6 +74,7 @@ void func_80ACDDE8(EnPart* this, PlayState* play) { break; case 11: EffectSsEnFire_SpawnVec3f(play, &this->actor, &this->actor.world.pos, 40, 0x8001, 0, -1); + FALLTHROUGH; case 3: this->actor.speedXZ = (Rand_ZeroOne() - 0.5f) * 3.0f; this->timer = (s16)(Rand_ZeroOne() * 17.0f) + 10; diff --git a/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c b/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c index d01dcce1af..d3c653a9f9 100644 --- a/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c +++ b/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c @@ -376,7 +376,7 @@ void EnPoField_CorrectYPos(EnPoField* this, PlayState* play) { this->actor.world.pos.y = Math_SinS(this->unk_194 * 0x800) * 13.0f + this->actor.home.pos.y; } -f32 EnPoField_SetFleeSpeed(EnPoField* this, PlayState* play) { +void EnPoField_SetFleeSpeed(EnPoField* this, PlayState* play) { Player* player = GET_PLAYER(play); f32 speed = ((player->stateFlags1 & PLAYER_STATE1_23) && player->rideActor != NULL) ? player->rideActor->speedXZ : 12.0f; diff --git a/src/overlays/actors/ovl_En_Rd/z_en_rd.c b/src/overlays/actors/ovl_En_Rd/z_en_rd.c index 8683742714..0684940a43 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.c +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.c @@ -527,11 +527,11 @@ void EnRd_Grab(EnRd* this, PlayState* play) { play->damagePlayer(play, -8); func_800AA000(this->actor.xzDistToPlayer, 0xFF, 1, 0xC); this->grabDamageTimer = 20; - // fallthrough + FALLTHROUGH; case REDEAD_GRAB_START: Math_SmoothStepToS(&this->headYRotation, 0, 1, 0x5DC, 0); Math_SmoothStepToS(&this->upperBodyYRotation, 0, 1, 0x5DC, 0); - // fallthrough + FALLTHROUGH; case REDEAD_GRAB_ATTACK: if (!(player->stateFlags2 & PLAYER_STATE2_7)) { Animation_Change(&this->skelAnime, &gGibdoRedeadGrabEndAnim, 0.5f, 0.0f, diff --git a/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c b/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c index dbdb5e762f..c7f636a7b4 100644 --- a/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c +++ b/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c @@ -532,6 +532,7 @@ void func_80AE5EDC(EnReeba* this, PlayState* play) { this->actionfunc = func_80AE58EC; break; } + FALLTHROUGH; case 13: // hookshot/longshot if ((this->actor.colChkInfo.health > 2) && (this->unk_27E != 4)) { this->unk_27E = 4; @@ -540,6 +541,7 @@ void func_80AE5EDC(EnReeba* this, PlayState* play) { this->actionfunc = func_80AE58EC; break; } + FALLTHROUGH; case 14: this->unk_27C = 6; Actor_ApplyDamage(&this->actor); diff --git a/src/overlays/actors/ovl_En_Rr/z_en_rr.c b/src/overlays/actors/ovl_En_Rr/z_en_rr.c index 9274bbd175..8348ea9b47 100644 --- a/src/overlays/actors/ovl_En_Rr/z_en_rr.c +++ b/src/overlays/actors/ovl_En_Rr/z_en_rr.c @@ -435,12 +435,16 @@ void EnRr_CollisionCheck(EnRr* this, PlayState* play) { switch (this->actor.colChkInfo.damageEffect) { case RR_DMG_LIGHT_ARROW: dropType++; // purple rupee + FALLTHROUGH; case RR_DMG_SHDW_ARROW: dropType++; // flexible + FALLTHROUGH; case RR_DMG_WIND_ARROW: dropType++; // arrow + FALLTHROUGH; case RR_DMG_SPRT_ARROW: dropType++; // magic jar + FALLTHROUGH; case RR_DMG_NORMAL: // "ouch" osSyncPrintf(VT_FGCOL(RED) "いてっ( %d : LIFE %d : DAMAGE %d : %x )!!" VT_RST "\n", diff --git a/src/overlays/actors/ovl_En_Sa/z_en_sa.c b/src/overlays/actors/ovl_En_Sa/z_en_sa.c index 776c3dbfa3..60ea172815 100644 --- a/src/overlays/actors/ovl_En_Sa/z_en_sa.c +++ b/src/overlays/actors/ovl_En_Sa/z_en_sa.c @@ -240,6 +240,7 @@ void func_80AF58B8(EnSa* this) { case 0: Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo2, ENSA_ANIM2_3); this->unk_20A++; + FALLTHROUGH; case 1: if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo2, ENSA_ANIM2_2); @@ -254,6 +255,7 @@ void func_80AF594C(EnSa* this) { case 0: Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo2, ENSA_ANIM2_8); this->unk_20A++; + FALLTHROUGH; case 1: if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo2, ENSA_ANIM2_9); @@ -268,6 +270,7 @@ void func_80AF59E0(EnSa* this) { case 0: Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo2, ENSA_ANIM2_1); this->unk_20A++; + FALLTHROUGH; case 1: if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo2, ENSA_ANIM2_7); @@ -283,6 +286,7 @@ void func_80AF5A74(EnSa* this) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo2, ENSA_ANIM2_1); func_80AF5894(this); this->unk_20A++; + FALLTHROUGH; case 1: if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo2, ENSA_ANIM2_9); @@ -297,6 +301,7 @@ void func_80AF5B10(EnSa* this) { case 0: Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo2, ENSA_ANIM2_6); this->unk_20A++; + FALLTHROUGH; case 1: if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo2, ENSA_ANIM2_4); @@ -312,6 +317,7 @@ void func_80AF5BA4(EnSa* this) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo2, ENSA_ANIM2_6); func_80AF5894(this); this->unk_20A++; + FALLTHROUGH; case 1: if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo2, ENSA_ANIM2_9); @@ -326,6 +332,7 @@ void func_80AF5C40(EnSa* this) { case 0: Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo2, ENSA_ANIM2_5); this->unk_20A++; + FALLTHROUGH; case 1: if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo2, ENSA_ANIM2_0); diff --git a/src/overlays/actors/ovl_En_Sb/z_en_sb.c b/src/overlays/actors/ovl_En_Sb/z_en_sb.c index 23f531cd86..da7aa51d32 100644 --- a/src/overlays/actors/ovl_En_Sb/z_en_sb.c +++ b/src/overlays/actors/ovl_En_Sb/z_en_sb.c @@ -385,6 +385,7 @@ s32 EnSb_UpdateDamage(EnSb* this, PlayState* play) { switch (this->actor.colChkInfo.damageEffect) { case 14: // wind arrow hitByWindArrow = true; + FALLTHROUGH; case 15: // explosions, arrow, hammer, ice arrow, light arrow, spirit arrow, shadow arrow if (EnSb_IsVulnerable(this)) { hitY = this->collider.info.bumper.hitPos.y - this->actor.world.pos.y; diff --git a/src/overlays/actors/ovl_En_Sw/z_en_sw.c b/src/overlays/actors/ovl_En_Sw/z_en_sw.c index 3fd44cece3..aae1d7e9fe 100644 --- a/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -277,8 +277,10 @@ void EnSw_Init(Actor* thisx, PlayState* play) { this->actor.velocity.y = 8.0f; this->actor.speedXZ = 4.0f; this->actor.gravity = -1.0f; + FALLTHROUGH; case 2: this->actor.scale.x = 0.0f; + FALLTHROUGH; case 1: this->collider.elements[0].info.toucher.damage *= 2; this->actor.naviEnemyId = NAVI_ENEMY_GOLD_SKULLTULA; diff --git a/src/overlays/actors/ovl_En_Test/z_en_test.c b/src/overlays/actors/ovl_En_Test/z_en_test.c index a8f4f36226..8df12fc5a5 100644 --- a/src/overlays/actors/ovl_En_Test/z_en_test.c +++ b/src/overlays/actors/ovl_En_Test/z_en_test.c @@ -339,7 +339,7 @@ void EnTest_ChooseRandomAction(EnTest* this, PlayState* play) { EnTest_SetupJumpslash(this); break; } - // fallthrough + FALLTHROUGH; case 8: EnTest_SetupWalkAndBlock(this); break; @@ -1755,7 +1755,7 @@ void EnTest_Update(Actor* thisx, PlayState* play) { case 3: this->unk_7DE++; this->upperSkelanime.morphWeight = 4.0f; - // fallthrough + FALLTHROUGH; case 4: oldWeight = this->upperSkelanime.morphWeight; this->upperSkelanime.morphWeight -= 1.0f; diff --git a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c index bb6ab7f98e..1ea2d431df 100644 --- a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c +++ b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c @@ -191,9 +191,11 @@ void EnWood02_Init(Actor* thisx, PlayState* play2) { case WOOD_BUSH_GREEN_LARGE_SPAWNER: case WOOD_BUSH_BLACK_LARGE_SPAWNER: spawnType = 1; + FALLTHROUGH; case WOOD_BUSH_GREEN_LARGE_SPAWNED: case WOOD_BUSH_BLACK_LARGE_SPAWNED: spawnType++; + FALLTHROUGH; case WOOD_TREE_CONICAL_LARGE: case WOOD_BUSH_GREEN_LARGE: case WOOD_BUSH_BLACK_LARGE: @@ -208,12 +210,14 @@ void EnWood02_Init(Actor* thisx, PlayState* play2) { case WOOD_BUSH_GREEN_SMALL_SPAWNER: case WOOD_BUSH_BLACK_SMALL_SPAWNER: spawnType = 1; + FALLTHROUGH; case WOOD_TREE_CONICAL_SPAWNED: case WOOD_TREE_OVAL_YELLOW_SPAWNED: case WOOD_TREE_OVAL_GREEN_SPAWNED: case WOOD_BUSH_GREEN_SMALL_SPAWNED: case WOOD_BUSH_BLACK_SMALL_SPAWNED: spawnType++; + FALLTHROUGH; case WOOD_TREE_CONICAL_MEDIUM: case WOOD_TREE_OVAL_GREEN: case WOOD_TREE_KAKARIKO_ADULT: @@ -236,6 +240,7 @@ void EnWood02_Init(Actor* thisx, PlayState* play2) { this->actor.velocity.x = Rand_CenteredFloat(6.0f); this->actor.velocity.z = Rand_CenteredFloat(6.0f); this->actor.velocity.y = (Rand_ZeroOne() * 1.25f) + -3.1f; + break; } if (this->actor.params <= WOOD_TREE_CONICAL_SPAWNED) { diff --git a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c index 144177bc77..14559584b5 100644 --- a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c +++ b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c @@ -942,8 +942,10 @@ void func_80B55444(EnZl3* this, PlayState* play) { break; case 8: this->unk_328 = 1; + FALLTHROUGH; default: osSyncPrintf("En_Zl3_inFinal_Check_DemoMode:そんな動作は無い!!!!!!!!\n"); + break; } this->unk_2F0 = temp_v0; } diff --git a/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c b/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c index a8798e8b77..f1c910443c 100644 --- a/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c +++ b/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c @@ -515,6 +515,7 @@ s32 EnZl4_CsAskStone(EnZl4* this, PlayState* play) { if (EnZl4_SetNextAnim(this, ZL4_ANIM_25)) { this->talkState++; } + FALLTHROUGH; case 1: if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) { EnZl4_SetActiveCamDir(play, 3); @@ -555,6 +556,7 @@ s32 EnZl4_CsAskStone(EnZl4* this, PlayState* play) { if (EnZl4_SetNextAnim(this, ZL4_ANIM_10)) { this->talkState++; } + FALLTHROUGH; case 5: if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) { play->msgCtx.msgMode = MSGMODE_PAUSED; @@ -574,6 +576,7 @@ s32 EnZl4_CsAskStone(EnZl4* this, PlayState* play) { if (EnZl4_SetNextAnim(this, ZL4_ANIM_25)) { this->talkState = 13; } + FALLTHROUGH; case 13: if (!((Message_GetState(&play->msgCtx) == TEXT_STATE_CHOICE) && Message_ShouldAdvance(play))) { break; @@ -600,6 +603,7 @@ s32 EnZl4_CsAskStone(EnZl4* this, PlayState* play) { if (EnZl4_SetNextAnim(this, ZL4_ANIM_29)) { this->talkState++; } + FALLTHROUGH; case 8: if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) { EnZl4_SetActiveCamMove(play, 2); @@ -654,6 +658,7 @@ s32 EnZl4_CsAskName(EnZl4* this, PlayState* play) { if (EnZl4_SetNextAnim(this, ZL4_ANIM_2)) { this->talkState++; } + FALLTHROUGH; case 3: if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ZL4_ANIM_16); @@ -697,6 +702,7 @@ s32 EnZl4_CsAskName(EnZl4* this, PlayState* play) { if (EnZl4_SetNextAnim(this, ZL4_ANIM_25)) { this->talkState++; } + FALLTHROUGH; case 9: if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) { Message_StartTextbox(play, 0x7033, NULL); @@ -738,6 +744,7 @@ s32 EnZl4_CsAskName(EnZl4* this, PlayState* play) { if (EnZl4_SetNextAnim(this, ZL4_ANIM_12)) { this->talkState++; } + FALLTHROUGH; case 13: if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ZL4_ANIM_6); @@ -766,6 +773,7 @@ s32 EnZl4_CsAskName(EnZl4* this, PlayState* play) { play->msgCtx.msgMode = MSGMODE_PAUSED; this->talkState++; } + FALLTHROUGH; case 17: this->talkTimer2++; if (this->talkTimer2 == 130) { @@ -833,6 +841,7 @@ s32 EnZl4_CsTellLegend(EnZl4* this, PlayState* play) { if (EnZl4_SetNextAnim(this, ZL4_ANIM_4)) { this->talkState++; } + FALLTHROUGH; case 6: if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ZL4_ANIM_33); @@ -864,6 +873,7 @@ s32 EnZl4_CsTellLegend(EnZl4* this, PlayState* play) { if (EnZl4_SetNextAnim(this, ZL4_ANIM_27)) { this->talkState++; } + FALLTHROUGH; case 11: if (!((Message_GetState(&play->msgCtx) == TEXT_STATE_CHOICE) && Message_ShouldAdvance(play))) { break; @@ -946,6 +956,7 @@ s32 EnZl4_CsWarnAboutGanon(EnZl4* this, PlayState* play) { this->talkTimer2 = 0; this->talkState++; Message_StartTextbox(play, 0x2079, NULL); + FALLTHROUGH; case 1: this->talkTimer2++; if (this->talkTimer2 >= 20) { @@ -1035,6 +1046,7 @@ s32 EnZl4_CsWarnAboutGanon(EnZl4* this, PlayState* play) { if (EnZl4_SetNextAnim(this, ZL4_ANIM_32)) { this->talkState++; } + FALLTHROUGH; case 12: if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) { play->msgCtx.msgMode = MSGMODE_PAUSED; @@ -1055,6 +1067,7 @@ s32 EnZl4_CsMakePlan(EnZl4* this, PlayState* play) { EnZl4_SetActiveCamMove(play, 10); this->talkTimer2 = 0; this->talkState++; + FALLTHROUGH; case 1: this->talkTimer2++; if (this->talkTimer2 >= 10) { @@ -1077,6 +1090,7 @@ s32 EnZl4_CsMakePlan(EnZl4* this, PlayState* play) { if (EnZl4_SetNextAnim(this, ZL4_ANIM_20)) { this->talkState++; } + FALLTHROUGH; case 4: if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) { Message_StartTextbox(play, 0x207D, NULL); @@ -1092,6 +1106,7 @@ s32 EnZl4_CsMakePlan(EnZl4* this, PlayState* play) { if (EnZl4_SetNextAnim(this, ZL4_ANIM_8)) { this->talkState++; } + FALLTHROUGH; case 6: if (!((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play))) { break; diff --git a/src/overlays/actors/ovl_En_fHG/z_en_fhg.c b/src/overlays/actors/ovl_En_fHG/z_en_fhg.c index 0f4eb17030..aadcd4e3cd 100644 --- a/src/overlays/actors/ovl_En_fHG/z_en_fhg.c +++ b/src/overlays/actors/ovl_En_fHG/z_en_fhg.c @@ -161,6 +161,7 @@ void EnfHG_Intro(EnfHG* this, PlayState* play) { Audio_QueueSeqCmd(0x1 << 28 | SEQ_PLAYER_BGM_MAIN << 24 | 0x100FF); SET_EVENTCHKINF(EVENTCHKINF_72); Flags_SetSwitch(play, 0x23); + FALLTHROUGH; case INTRO_FENCE: player->actor.world.pos.x = GND_BOSSROOM_CENTER_X + 0.0f; player->actor.world.pos.y = GND_BOSSROOM_CENTER_Y + 7.0f; @@ -241,6 +242,7 @@ void EnfHG_Intro(EnfHG* this, PlayState* play) { this->subCamAtVel.y = fabsf(this->subCamAt.y - (GND_BOSSROOM_CENTER_Y + 197.0f)); this->subCamAtVel.z = fabsf(this->subCamAt.z - (GND_BOSSROOM_CENTER_Z - 65.0f)); this->timers[0] = 250; + FALLTHROUGH; case INTRO_LAUGH: Math_ApproachF(&this->subCamEye.x, GND_BOSSROOM_CENTER_X + 20.0f, 0.05f, this->subCamVelFactor * this->subCamEyeVel.x); diff --git a/src/overlays/actors/ovl_Fishing/z_fishing.c b/src/overlays/actors/ovl_Fishing/z_fishing.c index d31434d720..7804ae7704 100644 --- a/src/overlays/actors/ovl_Fishing/z_fishing.c +++ b/src/overlays/actors/ovl_Fishing/z_fishing.c @@ -5242,7 +5242,7 @@ void Fishing_UpdateOwner(Actor* thisx, PlayState* play2) { D_80B7A6CC = 2; Interface_ChangeAlpha(12); sSubCamVelFactor = 0.0f; - // fallthrough + FALLTHROUGH; } case 2: @@ -5374,7 +5374,7 @@ void Fishing_UpdateOwner(Actor* thisx, PlayState* play2) { Message_StartTextbox(play, 0x409E, NULL); D_80B7A6CC = 11; func_800A9F6C(0.0f, 150, 10, 10); - // fallthrough + FALLTHROUGH; } case 11: @@ -5417,7 +5417,7 @@ void Fishing_UpdateOwner(Actor* thisx, PlayState* play2) { D_80B7A6CC = 21; D_80B7FEC8 = 45.0f; D_80B7A6D0 = 10; - // fallthrough + FALLTHROUGH; } case 21: diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index da5588f450..c140059350 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -1299,13 +1299,13 @@ static LinkAnimationHeader* D_808543D4[] = { }; // return type can't be void due to regalloc in func_8084FCAC -s32 func_80832210(Player* this) { +BAD_RETURN(s32) func_80832210(Player* this) { this->actor.speedXZ = 0.0f; this->linearVelocity = 0.0f; } // return type can't be void due to regalloc in func_8083F72C -s32 func_80832224(Player* this) { +BAD_RETURN(s32) func_80832224(Player* this) { func_80832210(this); this->unk_6AD = 0; } diff --git a/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.c b/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.c index dd3d93f6f5..1667ac8983 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.c +++ b/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.c @@ -25,7 +25,7 @@ u32 EffectSsSolderSrchBall_Init(PlayState* play, u32 index, EffectSs* this, void this->update = EffectSsSolderSrchBall_Update; this->life = 100; this->rUnused = initParams->unused; - this->actor = initParams->linkDetected; // actor field was incorrectly used as a pointer to something else + this->actor = (Actor*)initParams->linkDetected; // actor field was incorrectly used as a pointer to something else return 1; } @@ -37,7 +37,7 @@ void EffectSsSolderSrchBall_Update(PlayState* play, u32 index, EffectSs* this) { s16* linkDetected; Player* player = GET_PLAYER(play); - linkDetected = this->actor; + linkDetected = (s16*)this->actor; playerPosDiffX = player->actor.world.pos.x - this->pos.x; playerPosDiffY = player->actor.world.pos.y - this->pos.y;