From 2f4c25da53b3a23251a6f2ab477d588b4da38475 Mon Sep 17 00:00:00 2001 From: Roman971 <32455037+Roman971@users.noreply.github.com> Date: Tue, 4 Oct 2022 07:18:50 +0200 Subject: [PATCH] Fix many missing NULLs (#1389) * Fix many missing NULLs * Fix a raw actor id in en_horse --- src/boot/z_std_dma.c | 2 +- src/code/audio_data.c | 2 +- src/code/audio_synthesis.c | 2 +- src/code/code_800EC960.c | 2 +- src/code/code_800FC620.c | 4 ++-- src/code/fault.c | 2 +- src/code/z_DLF.c | 2 +- src/code/z_actor.c | 6 +++--- src/code/z_collision_check.c | 2 +- src/code/z_kaleido_manager.c | 2 +- src/code/z_play.c | 2 +- src/code/z_skelanime.c | 2 +- src/libultra/io/pfsfindfile.c | 4 ++-- .../actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.c | 2 +- .../actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c | 2 +- .../actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c | 2 +- src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c | 8 ++++---- src/overlays/actors/ovl_Demo_Go/z_demo_go.c | 2 +- src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c | 4 ++-- .../actors/ovl_En_Attack_Niw/z_en_attack_niw.c | 2 +- src/overlays/actors/ovl_En_Dog/z_en_dog.c | 2 +- src/overlays/actors/ovl_En_Du/z_en_du.c | 2 +- src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c | 2 +- src/overlays/actors/ovl_En_Go/z_en_go.c | 2 +- src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c | 2 +- src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c | 6 +++--- src/overlays/actors/ovl_En_Horse/z_en_horse.c | 7 ++++--- .../actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c | 2 +- src/overlays/actors/ovl_En_Ishi/z_en_ishi.c | 2 +- src/overlays/actors/ovl_En_It/z_en_it.c | 2 +- src/overlays/actors/ovl_En_Niw/z_en_niw.c | 2 +- src/overlays/actors/ovl_En_Ossan/z_en_ossan.c | 4 ++-- src/overlays/actors/ovl_En_Rd/z_en_rd.c | 2 +- src/overlays/actors/ovl_En_Ru1/z_en_ru1.c | 6 +++--- src/overlays/actors/ovl_En_Ru2/z_en_ru2.c | 2 +- src/overlays/actors/ovl_En_Skb/z_en_skb.c | 2 +- src/overlays/actors/ovl_En_Tr/z_en_tr.c | 2 +- .../actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c | 2 +- src/overlays/actors/ovl_Fishing/z_fishing.c | 5 +++-- .../actors/ovl_Item_Ocarina/z_item_ocarina.c | 4 ++-- src/overlays/actors/ovl_player_actor/z_player.c | 12 ++++++------ .../ovl_Effect_Ss_G_Splash/z_eff_ss_g_splash.c | 2 +- 42 files changed, 66 insertions(+), 64 deletions(-) diff --git a/src/boot/z_std_dma.c b/src/boot/z_std_dma.c index 4b078d5c7e..7c6d77dbbf 100644 --- a/src/boot/z_std_dma.c +++ b/src/boot/z_std_dma.c @@ -445,7 +445,7 @@ s32 DmaMgr_SendRequest1(void* ram, uintptr_t vrom, u32 size, const char* file, s req.filename = file; req.line = line; osCreateMesgQueue(&queue, &msg, 1); - ret = DmaMgr_SendRequestImpl(&req, ram, vrom, size, 0, &queue, 0); + ret = DmaMgr_SendRequestImpl(&req, ram, vrom, size, 0, &queue, NULL); if (ret == -1) { return ret; } diff --git a/src/code/audio_data.c b/src/code/audio_data.c index 10ddc4601e..d1bd4acc12 100644 --- a/src/code/audio_data.c +++ b/src/code/audio_data.c @@ -553,7 +553,7 @@ EnvelopePoint gDefaultEnvelope[] = { NoteSubEu gZeroNoteSub = { 0 }; NoteSubEu gDefaultNoteSub = { - { 1, 1, 0, 0, 0, 0, 0, 0 }, { 0 }, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + { 1, 1, 0, 0, 0, 0, 0, 0 }, { 0 }, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, 0, }; u16 gHaasEffectDelaySizes[64] = { diff --git a/src/code/audio_synthesis.c b/src/code/audio_synthesis.c index 26538dcfde..587b7e60e0 100644 --- a/src/code/audio_synthesis.c +++ b/src/code/audio_synthesis.c @@ -1085,7 +1085,7 @@ Acmd* AudioSynth_ProcessNote(s32 noteIndex, NoteSubEu* noteSubEu, NoteSynthesisS } filter = noteSubEu->filter; - if (filter != 0) { + if (filter != NULL) { AudioSynth_LoadFilterSize(cmd++, aiBufLen * SAMPLE_SIZE, filter); AudioSynth_LoadFilterBuffer(cmd++, flags, DMEM_TEMP, synthState->synthesisBuffers->mixEnvelopeState); } diff --git a/src/code/code_800EC960.c b/src/code/code_800EC960.c index 98e3a03560..db828c39af 100644 --- a/src/code/code_800EC960.c +++ b/src/code/code_800EC960.c @@ -3071,7 +3071,7 @@ void AudioDebug_Draw(GfxPrint* printer) { } GfxPrint_SetPos(printer, 3, 24); - if (sSariaBgmPtr != 0) { + if (sSariaBgmPtr != NULL) { GfxPrint_Printf(printer, "SARIA BGM PTR %08x", sSariaBgmPtr); } diff --git a/src/code/code_800FC620.c b/src/code/code_800FC620.c index 951b2e79a9..d31d028a9b 100644 --- a/src/code/code_800FC620.c +++ b/src/code/code_800FC620.c @@ -73,10 +73,10 @@ void func_800FCA18(void* blk, u32 nBlk, u32 blkSize, arg3_800FCA18 arg3, s32 arg u32 pos; u32 end; - if (blk == 0) { + if (blk == NULL) { return; } - if (arg3 != 0) { + if (arg3 != NULL) { end = (u32)blk; pos = (u32)end + (nBlk * blkSize); diff --git a/src/code/fault.c b/src/code/fault.c index 95144a527c..b33a06eda9 100644 --- a/src/code/fault.c +++ b/src/code/fault.c @@ -1272,7 +1272,7 @@ void Fault_Init(void) { gFaultMgr.faultHandlerEnabled = true; osCreateMesgQueue(&sFaultInstance->queue, &sFaultInstance->msg, 1); StackCheck_Init(&sFaultThreadInfo, sFaultStack, STACK_TOP(sFaultStack), 0, 0x100, "fault"); - osCreateThread(&sFaultInstance->thread, THREAD_ID_FAULT, Fault_ThreadEntry, 0, STACK_TOP(sFaultStack), + osCreateThread(&sFaultInstance->thread, THREAD_ID_FAULT, Fault_ThreadEntry, NULL, STACK_TOP(sFaultStack), THREAD_PRI_FAULT); osStartThread(&sFaultInstance->thread); } diff --git a/src/code/z_DLF.c b/src/code/z_DLF.c index b51cfee434..3b082fbd77 100644 --- a/src/code/z_DLF.c +++ b/src/code/z_DLF.c @@ -7,7 +7,7 @@ void Overlay_LoadGameState(GameStateOverlay* overlayEntry) { return; } - if (overlayEntry->vramStart == 0) { + if (overlayEntry->vramStart == NULL) { overlayEntry->unk_28 = 0; } else { overlayEntry->loadedRamAddr = Overlay_AllocateAndLoad(overlayEntry->vromStart, overlayEntry->vromEnd, diff --git a/src/code/z_actor.c b/src/code/z_actor.c index f7b37812ef..bd73ab8d70 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -2682,7 +2682,7 @@ Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 pos return NULL; } - if (overlayEntry->vramStart == 0) { + if (overlayEntry->vramStart == NULL) { if (HREG(20) != 0) { osSyncPrintf("オーバーレイではありません\n"); // "Not an overlay" } @@ -2894,7 +2894,7 @@ Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, PlayState* play) { ZeldaArena_FreeDebug(actor, "../z_actor.c", 7242); - if (overlayEntry->vramStart == 0) { + if (overlayEntry->vramStart == NULL) { if (HREG(20) != 0) { osSyncPrintf("オーバーレイではありません\n"); // "Not an overlay" } @@ -3001,7 +3001,7 @@ Actor* func_80032AF0(PlayState* play, ActorContext* actorCtx, Actor** actorPtr, } } - if (D_8015BBE8 == 0) { + if (D_8015BBE8 == NULL) { *actorPtr = D_8015BBEC; } else { *actorPtr = D_8015BBE8; diff --git a/src/code/z_collision_check.c b/src/code/z_collision_check.c index 8ef0fbed06..92d695c599 100644 --- a/src/code/z_collision_check.c +++ b/src/code/z_collision_check.c @@ -680,7 +680,7 @@ s32 Collider_ResetTrisElementOC(PlayState* play, ColliderTrisElement* element) { s32 Collider_InitTris(PlayState* play, ColliderTris* tris) { Collider_InitBase(play, &tris->base); tris->count = 0; - tris->elements = 0; + tris->elements = NULL; return true; } diff --git a/src/code/z_kaleido_manager.c b/src/code/z_kaleido_manager.c index 65784c99d2..04c401a5dd 100644 --- a/src/code/z_kaleido_manager.c +++ b/src/code/z_kaleido_manager.c @@ -64,7 +64,7 @@ void KaleidoManager_Init(PlayState* play) { osSyncPrintf("KaleidoArea %08x - %08x\n", sKaleidoAreaPtr, (u32)sKaleidoAreaPtr + largestSize); osSyncPrintf(VT_RST); - gKaleidoMgrCurOvl = 0; + gKaleidoMgrCurOvl = NULL; } void KaleidoManager_Destroy(void) { diff --git a/src/code/z_play.c b/src/code/z_play.c index f501a93cf9..4002800d0f 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -175,7 +175,7 @@ void Play_Destroy(GameState* thisx) { Player* player = GET_PLAYER(this); this->state.gfxCtx->callback = NULL; - this->state.gfxCtx->callbackParam = 0; + this->state.gfxCtx->callbackParam = NULL; SREG(91) = 0; R_PAUSE_MENU_MODE = 0; diff --git a/src/code/z_skelanime.c b/src/code/z_skelanime.c index 1398b8a52c..1f1b6aaadb 100644 --- a/src/code/z_skelanime.c +++ b/src/code/z_skelanime.c @@ -208,7 +208,7 @@ void SkelAnime_DrawFlexLod(PlayState* play, void** skeleton, Vec3s* jointTable, newDList = limbDList = rootLimb->dLists[lod]; - if ((overrideLimbDraw == 0) || !overrideLimbDraw(play, 1, &newDList, &pos, &rot, arg)) { + if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, 1, &newDList, &pos, &rot, arg)) { Matrix_TranslateRotateZYX(&pos, &rot); if (newDList != NULL) { Matrix_ToMtx(mtx, "../z_skelanime.c", 1033); diff --git a/src/libultra/io/pfsfindfile.c b/src/libultra/io/pfsfindfile.c index d7798e4fb3..ad0bde885a 100644 --- a/src/libultra/io/pfsfindfile.c +++ b/src/libultra/io/pfsfindfile.c @@ -26,7 +26,7 @@ s32 osPfsFindFile(OSPfs* pfs, u16 companyCode, u32 gameCode, u8* gameName, u8* e if ((dir.company_code == companyCode) && (dir.game_code == gameCode)) { err = 0; - if (gameName != 0) { + if (gameName != NULL) { for (i = 0; i < PFS_FILE_NAME_LEN; i++) { if (dir.game_name[i] != gameName[i]) { err = 1; @@ -34,7 +34,7 @@ s32 osPfsFindFile(OSPfs* pfs, u16 companyCode, u32 gameCode, u8* gameName, u8* e } } } - if ((extName != 0) && (err == 0)) { + if ((extName != NULL) && (err == 0)) { for (i = 0; i < PFS_FILE_EXT_LEN; i++) { if (dir.ext_name[i] != extName[i]) { err = 1; diff --git a/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.c b/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.c index 39c597f49c..874ed0892a 100644 --- a/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.c +++ b/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.c @@ -64,7 +64,7 @@ void func_8086E638(BgBomGuard* this, PlayState* play) { this->unk_168 = 0; - while (it != 0) { + while (it != NULL) { if (it->id == ACTOR_EN_BOM_BOWL_MAN) { if ((((EnBomBowlMan*)it)->minigamePlayStatus != 0) && (fabsf(play->view.eye.x) > -20.0f) && (fabsf(play->view.eye.y) > 110.0f)) { diff --git a/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c b/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c index 310fb6b7f1..cfb65bed4d 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c +++ b/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c @@ -180,7 +180,7 @@ void BgHakaTrap_Init(Actor* thisx, PlayState* play) { thisx->uncullZoneScale = 500.0f; } - CollisionCheck_SetInfo(&thisx->colChkInfo, 0, &sColChkInfoInit); + CollisionCheck_SetInfo(&thisx->colChkInfo, NULL, &sColChkInfoInit); } void BgHakaTrap_Destroy(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c b/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c index d616cc6ee2..ca31b8c1e8 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c +++ b/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c @@ -110,7 +110,7 @@ void func_80899950(BgJyaKanaami* this, PlayState* play) { } void func_80899A08(BgJyaKanaami* this) { - this->actionFunc = 0; + this->actionFunc = NULL; this->dyna.actor.world.rot.x = 0x4000; } diff --git a/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c b/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c index 70d38516b8..aedb325c26 100644 --- a/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c +++ b/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c @@ -285,11 +285,11 @@ void DemoEc_DrawSkeletonCustomColor(DemoEc* this, PlayState* play, Gfx* arg2, Gf Gfx_SetupDL_25Opa(gfxCtx); - if (arg2 != 0) { + if (arg2 != NULL) { gSPSegment(POLY_OPA_DISP++, 0x0A, SEGMENTED_TO_VIRTUAL(arg2)); } - if (arg3 != 0) { + if (arg3 != NULL) { gSPSegment(POLY_OPA_DISP++, 0x0B, SEGMENTED_TO_VIRTUAL(arg3)); } @@ -370,7 +370,7 @@ void DemoEc_UpdateIngo(DemoEc* this, PlayState* play) { } void DemoEc_DrawIngo(DemoEc* this, PlayState* play) { - DemoEc_DrawSkeleton(this, play, gIngoEyeClosed2Tex, gIngoRedTex, 0, 0); + DemoEc_DrawSkeleton(this, play, gIngoEyeClosed2Tex, gIngoRedTex, NULL, NULL); } void DemoEc_InitTalon(DemoEc* this, PlayState* play) { @@ -705,7 +705,7 @@ void DemoEc_CarpenterPostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, V } void DemoEc_DrawCarpenter(DemoEc* this, PlayState* play) { - DemoEc_DrawSkeleton(this, play, NULL, 0, DemoEc_CarpenterOverrideLimbDraw, DemoEc_CarpenterPostLimbDraw); + DemoEc_DrawSkeleton(this, play, NULL, NULL, DemoEc_CarpenterOverrideLimbDraw, DemoEc_CarpenterPostLimbDraw); } void DemoEc_InitGerudo(DemoEc* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_Demo_Go/z_demo_go.c b/src/overlays/actors/ovl_Demo_Go/z_demo_go.c index 31108fcc8d..751b2c6269 100644 --- a/src/overlays/actors/ovl_Demo_Go/z_demo_go.c +++ b/src/overlays/actors/ovl_Demo_Go/z_demo_go.c @@ -303,7 +303,7 @@ void func_8097D130(DemoGo* this, PlayState* play) { void DemoGo_Update(Actor* thisx, PlayState* play) { DemoGo* this = (DemoGo*)thisx; - if (this->action < 0 || this->action >= 7 || D_8097D44C[this->action] == 0) { + if (this->action < 0 || this->action >= 7 || D_8097D44C[this->action] == NULL) { osSyncPrintf(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); return; } diff --git a/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c b/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c index 648c2ba1b9..877f807ba8 100644 --- a/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c +++ b/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c @@ -136,7 +136,7 @@ void EfcErupc_Draw(Actor* thisx, PlayState* play) { G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); if (play->csCtx.state != 0) { - if ((play->csCtx.npcActions[1] != 0) && (play->csCtx.npcActions[1]->action == 2)) { + if ((play->csCtx.npcActions[1] != NULL) && (play->csCtx.npcActions[1]->action == 2)) { gSPDisplayList(POLY_XLU_DISP++, object_efc_erupc_DL_002570); } } @@ -146,7 +146,7 @@ void EfcErupc_Draw(Actor* thisx, PlayState* play) { G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); if (play->csCtx.state != 0) { CsCmdActorAction* csActorAction = play->csCtx.npcActions[2]; - if (csActorAction != 0) { + if (csActorAction != NULL) { csAction = csActorAction->action; if ((csAction == 2) || (csAction == 3)) { gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 255, 200, 255); diff --git a/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c b/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c index e7d1718ee3..22c51eaba8 100644 --- a/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c +++ b/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c @@ -345,7 +345,7 @@ void EnAttackNiw_Update(Actor* thisx, PlayState* play) { if ((this->actor.bgCheckFlags & BGCHECKFLAG_WATER) && (this->actionFunc != func_809B5C18)) { Math_Vec3f_Copy(&sp30, &this->actor.world.pos); sp30.y += this->actor.yDistToWater; - EffectSsGSplash_Spawn(play, &sp30, 0, 0, 0, 0x190); + EffectSsGSplash_Spawn(play, &sp30, NULL, NULL, 0, 0x190); this->unk_2DC = 0.0f; this->actor.gravity = 0.0f; this->unk_2E0 = 0.0f; diff --git a/src/overlays/actors/ovl_En_Dog/z_en_dog.c b/src/overlays/actors/ovl_En_Dog/z_en_dog.c index 6357a3104e..3f2fe1a7b5 100644 --- a/src/overlays/actors/ovl_En_Dog/z_en_dog.c +++ b/src/overlays/actors/ovl_En_Dog/z_en_dog.c @@ -260,7 +260,7 @@ void EnDog_Init(Actor* thisx, PlayState* play) { Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); - CollisionCheck_SetInfo2(&this->actor.colChkInfo, 0, &sColChkInfoInit); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInfoInit); Actor_SetScale(&this->actor, 0.0075f); this->waypoint = 0; this->actor.gravity = -1.0f; diff --git a/src/overlays/actors/ovl_En_Du/z_en_du.c b/src/overlays/actors/ovl_En_Du/z_en_du.c index 143594ab46..da27cf6eec 100644 --- a/src/overlays/actors/ovl_En_Du/z_en_du.c +++ b/src/overlays/actors/ovl_En_Du/z_en_du.c @@ -281,7 +281,7 @@ void EnDu_Init(Actor* thisx, PlayState* play) { s32 pad; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); - SkelAnime_InitFlex(play, &this->skelAnime, &gDaruniaSkel, NULL, 0, 0, 0); + SkelAnime_InitFlex(play, &this->skelAnime, &gDaruniaSkel, NULL, NULL, NULL, 0); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0x16), &sColChkInfoInit); diff --git a/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c b/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c index 3d92e7f398..08aa360db1 100644 --- a/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c +++ b/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c @@ -254,7 +254,7 @@ void EnExRuppy_Sink(EnExRuppy* this, PlayState* play) { pos.y += this->actor.yDistToWater; this->actor.velocity.y = -1.0f; this->actor.gravity = -0.2f; - EffectSsGSplash_Spawn(play, &pos, 0, 0, 0, 800); + EffectSsGSplash_Spawn(play, &pos, NULL, NULL, 0, 800); func_80078914(&this->actor.projectedPos, NA_SE_EV_BOMB_DROP_WATER); this->actionFunc = EnExRuppy_WaitInGame; } 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 7f60ae24b8..f7a32a99d7 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -625,7 +625,7 @@ void EnGo_Init(Actor* thisx, PlayState* play) { Vec3f D_80A41BA8 = { 0.0f, 0.0f, 0.0f }; // unused ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); - SkelAnime_InitFlex(play, &this->skelAnime, &gGoronSkel, NULL, 0, 0, 0); + SkelAnime_InitFlex(play, &this->skelAnime, &gGoronSkel, NULL, NULL, NULL, 0); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0x16), &sColChkInfoInit); diff --git a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c index 4a9636ef27..0f931ea560 100644 --- a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c +++ b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c @@ -284,7 +284,7 @@ void EnGoroiwa_SpawnWaterEffects(PlayState* play, Vec3f* contactPos) { splashPos.x = contactPos->x + (Math_SinS(angle) * 55.0f); splashPos.y = contactPos->y; splashPos.z = contactPos->z + (Math_CosS(angle) * 55.0f); - EffectSsGSplash_Spawn(play, &splashPos, 0, 0, 0, 350); + EffectSsGSplash_Spawn(play, &splashPos, NULL, NULL, 0, 350); } EffectSsGRipple_Spawn(play, contactPos, 300, 700, 0); diff --git a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c index 5cafe6cd86..c98d26f6da 100644 --- a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c +++ b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c @@ -111,7 +111,7 @@ void EnHeishi2_Init(Actor* thisx, PlayState* play) { this->actor.world.pos.z += 90.0f; this->actor.shape.rot.y = this->actor.world.rot.y; Collider_DestroyCylinder(play, &this->collider); - func_8002DF54(play, 0, 8); + func_8002DF54(play, NULL, 8); this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_4; this->actionFunc = func_80A544AC; } @@ -423,7 +423,7 @@ void func_80A53AD4(EnHeishi2* this, PlayState* play) { void func_80A53C0C(EnHeishi2* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if ((this->unk_300 == Message_GetState(&play->msgCtx)) && Message_ShouldAdvance(play)) { - func_8002DF54(play, 0, 8); + func_8002DF54(play, NULL, 8); play->msgCtx.msgMode = MSGMODE_PAUSED; this->actionFunc = func_80A53C90; } @@ -525,7 +525,7 @@ void func_80A54038(EnHeishi2* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) { SET_INFTABLE(INFTABLE_76); Message_CloseTextbox(play); - func_8002DF54(play, 0, 7); + func_8002DF54(play, NULL, 7); this->actionFunc = func_80A53908; } } diff --git a/src/overlays/actors/ovl_En_Horse/z_en_horse.c b/src/overlays/actors/ovl_En_Horse/z_en_horse.c index 5d05a3f526..2463adb389 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.c +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.c @@ -2385,7 +2385,7 @@ void EnHorse_CutsceneUpdate(EnHorse* this, PlayState* play) { EnHorse_Freeze(this); return; } - if (linkCsAction != 0) { + if (linkCsAction != NULL) { csFunctionIdx = EnHorse_GetCutsceneFunctionIndex(linkCsAction->action); if (csFunctionIdx != 0) { if (this->cutsceneAction != csFunctionIdx) { @@ -2956,7 +2956,7 @@ void EnHorse_CheckFloors(EnHorse* this, PlayState* play) { } floorSlope = RAD_TO_BINANG(Math_FAtan2F(this->yBack - this->yFront, 60.0f)); - if (this->actor.floorPoly != 0) { + if (this->actor.floorPoly != NULL) { nx = COLPOLY_GET_NORMAL(this->actor.floorPoly->normal.x); ny = COLPOLY_GET_NORMAL(this->actor.floorPoly->normal.y); nz = COLPOLY_GET_NORMAL(this->actor.floorPoly->normal.z); @@ -3207,7 +3207,8 @@ void EnHorse_UpdateBgCheckInfo(EnHorse* this, PlayState* play) { } dynaPoly = DynaPoly_GetActor(&play->colCtx, bgId); - if ((this->stateFlags & ENHORSE_FLAG_26) && ((dynaPoly && dynaPoly->actor.id != 0x108) || dynaPoly == 0)) { + if ((this->stateFlags & ENHORSE_FLAG_26) && + ((dynaPoly && dynaPoly->actor.id != ACTOR_BG_UMAJUMP) || dynaPoly == NULL)) { if (movingFast == false) { this->stateFlags |= ENHORSE_FORCE_REVERSING; } else if (movingFast == true) { diff --git a/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c b/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c index b974ca0b40..86f7ac3210 100644 --- a/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c +++ b/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c @@ -186,7 +186,7 @@ void EnHorseGanon_Init(Actor* thisx, PlayState* play) { Collider_InitJntSph(play, &this->colliderHead); Collider_SetJntSph(play, &this->colliderHead, &this->actor, &sJntSphInit, this->headElements); - CollisionCheck_SetInfo(&this->actor.colChkInfo, 0, &sColChkInfoInit); + CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); func_80A68AC4(this); } diff --git a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c index 851cf501a4..6fda0facc8 100644 --- a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c +++ b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c @@ -445,7 +445,7 @@ void EnIshi_Fly(EnIshi* this, PlayState* play) { contactPos.x = this->actor.world.pos.x; contactPos.y = this->actor.world.pos.y + this->actor.yDistToWater; contactPos.z = this->actor.world.pos.z; - EffectSsGSplash_Spawn(play, &contactPos, 0, 0, 0, 350); + EffectSsGSplash_Spawn(play, &contactPos, NULL, NULL, 0, 350); if (type == ROCK_SMALL) { EffectSsGRipple_Spawn(play, &contactPos, 150, 650, 0); EffectSsGRipple_Spawn(play, &contactPos, 400, 800, 4); diff --git a/src/overlays/actors/ovl_En_It/z_en_it.c b/src/overlays/actors/ovl_En_It/z_en_it.c index aaa75343a6..fd57adea24 100644 --- a/src/overlays/actors/ovl_En_It/z_en_it.c +++ b/src/overlays/actors/ovl_En_It/z_en_it.c @@ -52,7 +52,7 @@ void EnIt_Init(Actor* thisx, PlayState* play) { this->actor.params = 0x0D05; Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); - CollisionCheck_SetInfo2(&this->actor.colChkInfo, 0, &sColChkInfoInit); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInfoInit); } void EnIt_Destroy(Actor* thisx, PlayState* play) { 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 a5784f0c67..06abff8ec4 100644 --- a/src/overlays/actors/ovl_En_Niw/z_en_niw.c +++ b/src/overlays/actors/ovl_En_Niw/z_en_niw.c @@ -1044,7 +1044,7 @@ void EnNiw_Update(Actor* thisx, PlayState* play) { Math_Vec3f_Copy(&pos, &thisx->world.pos); pos.y += thisx->yDistToWater; this->timer4 = 30; - EffectSsGSplash_Spawn(play, &pos, 0, 0, 0, 400); + EffectSsGSplash_Spawn(play, &pos, NULL, NULL, 0, 400); this->timer5 = 0; osSyncPrintf("\n\n"); osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ ぶくぶく ☆☆☆☆☆ \n" VT_RST); diff --git a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c index ec41e1acc3..2f9b4393d6 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -2017,7 +2017,7 @@ void EnOssan_InitZoraShopkeeper(EnOssan* this, PlayState* play) { } void EnOssan_InitPotionShopkeeper(EnOssan* this, PlayState* play) { - SkelAnime_InitFlex(play, &this->skelAnime, &object_ds2_Skel_004258, &object_ds2_Anim_0002E4, 0, 0, 0); + SkelAnime_InitFlex(play, &this->skelAnime, &object_ds2_Skel_004258, &object_ds2_Anim_0002E4, NULL, NULL, 0); this->actor.draw = EnOssan_DrawPotionShopkeeper; this->obj3ToSeg6Func = NULL; } @@ -2029,7 +2029,7 @@ void EnOssan_InitHappyMaskShopkeeper(EnOssan* this, PlayState* play) { } void EnOssan_InitBombchuShopkeeper(EnOssan* this, PlayState* play) { - SkelAnime_InitFlex(play, &this->skelAnime, &object_rs_Skel_004868, &object_rs_Anim_00065C, 0, 0, 0); + SkelAnime_InitFlex(play, &this->skelAnime, &object_rs_Skel_004868, &object_rs_Anim_00065C, NULL, NULL, 0); this->actor.draw = EnOssan_DrawBombchuShopkeeper; this->obj3ToSeg6Func = NULL; } 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 67567ed167..7aa129d138 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.c +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.c @@ -828,7 +828,7 @@ void EnRd_UpdateDamage(EnRd* this, PlayState* play) { if (this->actor.colChkInfo.health == 0) { EnRd_UpdateMourningTarget(play, &this->actor, true); EnRd_SetupDead(this); - Item_DropCollectibleRandom(play, 0, &this->actor.world.pos, 0x90); + Item_DropCollectibleRandom(play, NULL, &this->actor.world.pos, 0x90); } else { EnRd_SetupDamaged(this); } 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 3899b0fee0..84382d49e3 100644 --- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c +++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c @@ -453,7 +453,7 @@ void EnRu1_SpawnSplash(EnRu1* this, PlayState* play) { pos.y = this->actor.world.pos.y + this->actor.yDistToWater; pos.z = this->actor.world.pos.z; - EffectSsGSplash_Spawn(play, &pos, 0, 0, 1, 0); + EffectSsGSplash_Spawn(play, &pos, NULL, NULL, 1, 0); } void func_80AEB6E0(EnRu1* this, PlayState* play) { @@ -1601,7 +1601,7 @@ s32 func_80AEE6D0(EnRu1* this, PlayState* play) { s32 pad; s8 curRoomNum = play->roomCtx.curRoom.num; - if (!GET_INFTABLE(INFTABLE_144) && (func_80AEB124(play) != 0)) { + if (!GET_INFTABLE(INFTABLE_144) && (func_80AEB124(play) != NULL)) { if (!Player_InCsMode(play)) { Animation_Change(&this->skelAnime, &gRutoChildSeesSapphireAnim, 1.0f, 0, Animation_GetLastFrame(&gRutoChildSquirmAnim), ANIMMODE_LOOP, -8.0f); @@ -2361,7 +2361,7 @@ void EnRu1_DrawXlu(EnRu1* this, PlayState* play) { void EnRu1_Draw(Actor* thisx, PlayState* play) { EnRu1* this = (EnRu1*)thisx; - if (this->drawConfig < 0 || this->drawConfig >= ARRAY_COUNT(sDrawFuncs) || sDrawFuncs[this->drawConfig] == 0) { + if (this->drawConfig < 0 || this->drawConfig >= ARRAY_COUNT(sDrawFuncs) || sDrawFuncs[this->drawConfig] == NULL) { // "Draw mode is improper!" osSyncPrintf(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); return; diff --git a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c index 55c8586cf5..1af1f3bbc3 100644 --- a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c +++ b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c @@ -817,7 +817,7 @@ void EnRu2_Draw(Actor* thisx, PlayState* play) { EnRu2* this = (EnRu2*)thisx; if ((this->drawConfig < 0) || (this->drawConfig >= ARRAY_COUNT(sDrawFuncs)) || - (sDrawFuncs[this->drawConfig] == 0)) { + (sDrawFuncs[this->drawConfig] == NULL)) { // "Draw Mode is improper!" osSyncPrintf(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); return; diff --git a/src/overlays/actors/ovl_En_Skb/z_en_skb.c b/src/overlays/actors/ovl_En_Skb/z_en_skb.c index dce775f55f..73877c16c1 100644 --- a/src/overlays/actors/ovl_En_Skb/z_en_skb.c +++ b/src/overlays/actors/ovl_En_Skb/z_en_skb.c @@ -144,7 +144,7 @@ void EnSkb_SpawnDebris(PlayState* play, EnSkb* this, Vec3f* spawnPos) { accel.z = Rand_CenteredFloat(1.0f); vel.y += (Rand_ZeroOne() - 0.5f) * 4.0f; scale = (Rand_ZeroOne() * 5.0f) + 12.0f; - EffectSsHahen_Spawn(play, &pos, &vel, &accel, 2, scale * 0.8f, -1, 10, 0); + EffectSsHahen_Spawn(play, &pos, &vel, &accel, 2, scale * 0.8f, -1, 10, NULL); func_80033480(play, &pos, 10.0f, 1, 150, 0, 1); } diff --git a/src/overlays/actors/ovl_En_Tr/z_en_tr.c b/src/overlays/actors/ovl_En_Tr/z_en_tr.c index f6da3b2602..de39aa665b 100644 --- a/src/overlays/actors/ovl_En_Tr/z_en_tr.c +++ b/src/overlays/actors/ovl_En_Tr/z_en_tr.c @@ -431,7 +431,7 @@ void EnTr_Draw(Actor* thisx, PlayState* play) { if (1) {} - if ((play->csCtx.state == CS_STATE_IDLE) || (play->csCtx.npcActions[this->actionIndex] == 0)) { + if ((play->csCtx.state == CS_STATE_IDLE) || (play->csCtx.npcActions[this->actionIndex] == NULL)) { this->actor.shape.shadowDraw = NULL; } else { this->actor.shape.shadowDraw = ActorShadow_DrawCircle; diff --git a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c index 0faa1a41bf..8c833b50eb 100644 --- a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c +++ b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c @@ -135,7 +135,7 @@ void EnTuboTrap_SpawnEffectsInWater(EnTuboTrap* this, PlayState* play) { pos = *actorPos; pos.y += this->actor.yDistToWater; - EffectSsGSplash_Spawn(play, &pos, 0, 0, 0, 400); + EffectSsGSplash_Spawn(play, &pos, NULL, NULL, 0, 400); for (i = 0, var = 0; i < 15; i++, var += 20000) { sin = Math_SinS(var); diff --git a/src/overlays/actors/ovl_Fishing/z_fishing.c b/src/overlays/actors/ovl_Fishing/z_fishing.c index 420cb29780..ab0754b0a9 100644 --- a/src/overlays/actors/ovl_Fishing/z_fishing.c +++ b/src/overlays/actors/ovl_Fishing/z_fishing.c @@ -3963,10 +3963,11 @@ void Fishing_UpdateFish(Actor* thisx, PlayState* play2) { SkelAnime_Free(&this->skelAnime, play); if (this->unk_150 == 0) { - SkelAnime_InitFlex(play, &this->skelAnime, &gFishingFishSkel, &gFishingFishAnim, 0, 0, 0); + SkelAnime_InitFlex(play, &this->skelAnime, &gFishingFishSkel, &gFishingFishAnim, NULL, NULL, 0); Animation_MorphToLoop(&this->skelAnime, &gFishingFishAnim, 0.0f); } else { - SkelAnime_InitFlex(play, &this->skelAnime, &gFishingLoachSkel, &gFishingLoachAnim, 0, 0, 0); + SkelAnime_InitFlex(play, &this->skelAnime, &gFishingLoachSkel, &gFishingLoachAnim, NULL, NULL, + 0); Animation_MorphToLoop(&this->skelAnime, &gFishingLoachAnim, 0.0f); } } diff --git a/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c b/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c index 8b446eb8b2..da9c29d645 100644 --- a/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c +++ b/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c @@ -42,7 +42,7 @@ void ItemOcarina_Init(Actor* thisx, PlayState* play) { ItemOcarina* this = (ItemOcarina*)thisx; s32 params = thisx->params; - ActorShape_Init(&this->actor.shape, 0, 0, 0); + ActorShape_Init(&this->actor.shape, 0, NULL, 0); Actor_SetScale(&this->actor, 0.1f); switch (params) { @@ -101,7 +101,7 @@ void ItemOcarina_Fly(ItemOcarina* this, PlayState* play) { if (play->csCtx.frames == 897) { EffectSsGRipple_Spawn(play, &this->actor.world.pos, 100, 500, 0); - EffectSsGSplash_Spawn(play, &this->actor.world.pos, 0, 0, 1, 0); + EffectSsGSplash_Spawn(play, &this->actor.world.pos, NULL, NULL, 1, 0); this->actor.velocity.x = 0.0f; this->actor.velocity.y = 0.0f; this->actor.velocity.z = 0.0f; diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index ff3a63b034..6a0fab022d 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -2876,7 +2876,7 @@ void func_80835E44(PlayState* play, s16 camSetting) { void func_80835EA4(PlayState* play, s32 arg1) { func_80835E44(play, CAM_SET_TURN_AROUND); - Camera_SetCameraData(Play_GetCamera(play, CAM_ID_MAIN), 4, 0, 0, arg1, 0, 0); + Camera_SetCameraData(Play_GetCamera(play, CAM_ID_MAIN), 4, NULL, NULL, arg1, 0, 0); } void func_80835EFC(Player* this) { @@ -2959,7 +2959,7 @@ void func_80835F44(PlayState* play, Player* this, s32 item) { this->itemActionParam = actionParam; } } else if ((actionParam != this->heldItemActionParam) || - ((this->heldActor == 0) && (Player_ActionToExplosive(this, actionParam) >= 0))) { + ((this->heldActor == NULL) && (Player_ActionToExplosive(this, actionParam) >= 0))) { this->nextModelGroup = Player_ActionToModelGroup(this, actionParam); nextAnimType = gPlayerModelTypes[this->nextModelGroup][PLAYER_MODELGROUPENTRY_ANIM]; @@ -5764,7 +5764,7 @@ void func_8083D36C(PlayState* play, Player* this) { if ((this->currentBoots != PLAYER_BOOTS_IRON) && (this->stateFlags2 & PLAYER_STATE2_10)) { this->stateFlags2 &= ~PLAYER_STATE2_10; - func_8083D12C(play, this, 0); + func_8083D12C(play, this, NULL); this->unk_84F = 1; } else if (func_80844A44 == this->func_674) { func_80835C58(play, this, func_8084DC48, 0); @@ -13708,7 +13708,7 @@ void func_808514C0(PlayState* play, Player* this, CsCmdActorAction* arg2) { func_80851314(this); if (func_808332B8(this)) { - func_808513BC(play, this, 0); + func_808513BC(play, this, NULL); return; } @@ -13732,7 +13732,7 @@ void func_808515A4(PlayState* play, Player* this, CsCmdActorAction* arg2) { LinkAnimationHeader* anim; if (func_808332B8(this)) { - func_80851368(play, this, 0); + func_80851368(play, this, NULL); return; } @@ -13757,7 +13757,7 @@ void func_80851688(PlayState* play, Player* this, CsCmdActorAction* arg2) { } if (func_808332B8(this) != 0) { - func_808513BC(play, this, 0); + func_808513BC(play, this, NULL); return; } diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Splash/z_eff_ss_g_splash.c b/src/overlays/effects/ovl_Effect_Ss_G_Splash/z_eff_ss_g_splash.c index 32477114b1..3315b5c0a6 100644 --- a/src/overlays/effects/ovl_Effect_Ss_G_Splash/z_eff_ss_g_splash.c +++ b/src/overlays/effects/ovl_Effect_Ss_G_Splash/z_eff_ss_g_splash.c @@ -132,7 +132,7 @@ void EffectSsGSplash_Update(PlayState* play, u32 index, EffectSs* this) { if ((this->rType == 1) && (this->life == 5)) { newSplashPos = this->pos; newSplashPos.y += ((this->rgScale * 20) * 0.002f); - EffectSsGSplash_Spawn(play, &newSplashPos, 0, 0, 2, this->rgScale / 2); + EffectSsGSplash_Spawn(play, &newSplashPos, NULL, NULL, 2, this->rgScale / 2); } this->rgTexIdx += this->rgTexIdxStep;