summaryrefslogtreecommitdiff
path: root/src/code
diff options
context:
space:
mode:
authorRoman971 <32455037+Roman971@users.noreply.github.com>2022-10-04 07:18:50 +0200
committerGitHub <noreply@github.com>2022-10-04 01:18:50 -0400
commit2f4c25da53b3a23251a6f2ab477d588b4da38475 (patch)
tree5f6bed10b7d66be3892d7f8a6a2ac34d880d0bc2 /src/code
parent78e528d6fb61068bf1320073c7a440ad2d920b2f (diff)
Fix many missing NULLs (#1389)
* Fix many missing NULLs * Fix a raw actor id in en_horse
Diffstat (limited to 'src/code')
-rw-r--r--src/code/audio_data.c2
-rw-r--r--src/code/audio_synthesis.c2
-rw-r--r--src/code/code_800EC960.c2
-rw-r--r--src/code/code_800FC620.c4
-rw-r--r--src/code/fault.c2
-rw-r--r--src/code/z_DLF.c2
-rw-r--r--src/code/z_actor.c6
-rw-r--r--src/code/z_collision_check.c2
-rw-r--r--src/code/z_kaleido_manager.c2
-rw-r--r--src/code/z_play.c2
-rw-r--r--src/code/z_skelanime.c2
11 files changed, 14 insertions, 14 deletions
diff --git a/src/code/audio_data.c b/src/code/audio_data.c
index 10ddc4601..d1bd4acc1 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 26538dcfd..587b7e60e 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 98e3a0356..db828c39a 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 951b2e79a..d31d028a9 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 95144a527..b33a06eda 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 b51cfee43..3b082fbd7 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 f7b37812e..bd73ab8d7 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 8ef0fbed0..92d695c59 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 65784c99d..04c401a5d 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 f501a93cf..4002800d0 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 1398b8a52..1f1b6aaad 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);