From dea3c8fd792d29648697f697f34d3658bf3838cf Mon Sep 17 00:00:00 2001 From: Zach Banks Date: Tue, 18 May 2021 22:28:04 -0400 Subject: Fix all warnings raised by IDO (#152) * Fix all warnings raised by IDO, ignore trailing commas * Set -woff=624,...; keep const in printf functions * Remove redefined macros in irqmgr.c * Remove DECR macro & reformat * Address PR comments from AngheloAlf --- src/code/z_actor.c | 12 ++++-------- src/code/z_bgcheck.c | 2 +- src/code/z_effect_soft_sprite.c | 4 ++-- src/code/z_lights.c | 13 ++++++++++--- src/code/z_skelanime.c | 7 ++++--- src/code/z_snap.c | 4 ++-- 6 files changed, 23 insertions(+), 19 deletions(-) (limited to 'src/code') diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 1049911a9..a7578a4df 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -1,10 +1,6 @@ #include #include -// From OOT -#define ABS(x) ((x) < 0 ? -(x) : (x)) -#define DECR(x) ((x) == 0 ? 0 : ((x) -= 1)) - void Actor_PrintLists(ActorContext* actorCtx) { ActorListEntry* actorList = &actorCtx->actorList[0]; Actor* actor; @@ -526,7 +522,7 @@ s32 Actor_IsActorFacedByActor(Actor* actor, Actor* other, s16 tolerance) { angle = Actor_YawBetweenActors(actor, other) + 0x8000; dist = angle - other->shape.rot.y; - if (ABS(dist) < tolerance) { + if (ABS_ALT(dist) < tolerance) { return 1; } return 0; @@ -536,7 +532,7 @@ s32 Actor_IsActorFacingLink(Actor* actor, s16 angle) { s16 dist; dist = actor->yawTowardsPlayer - actor->shape.rot.y; - if (ABS(dist) < angle) { + if (ABS_ALT(dist) < angle) { return 1; } return 0; @@ -546,7 +542,7 @@ s32 Actor_IsActorFacingActor(Actor* actor, Actor* other, s16 tolerance) { s16 dist; dist = Actor_YawBetweenActors(actor, other) - actor->shape.rot.y; - if (ABS(dist) < tolerance) { + if (ABS_ALT(dist) < tolerance) { return 1; } return 0; @@ -559,7 +555,7 @@ s32 Actor_IsActorFacingActorAndWithinRange(Actor* actor, Actor* other, f32 range if (Actor_DistanceBetweenActors(actor, other) < range) { dist = Actor_YawBetweenActors(actor, other) - actor->shape.rot.y; - if (ABS(dist) < tolerance) { + if (ABS_ALT(dist) < tolerance) { return 1; } } diff --git a/src/code/z_bgcheck.c b/src/code/z_bgcheck.c index 3e72440e5..e877a2689 100644 --- a/src/code/z_bgcheck.c +++ b/src/code/z_bgcheck.c @@ -162,7 +162,7 @@ void BgCheck_CreateVertexFromVec3f(Vec3s* vertex, Vec3f* vector) { #pragma GLOBAL_ASM("./asm/non_matchings/code/z_bgcheck/func_800C40B4.asm") -f32 func_800C411C(CollisionContext* bgCtxt, CollisionPoly* arg1, s32* arg2, Actor* actor, Vec3f* pos) { +f32 func_800C411C(CollisionContext* bgCtxt, CollisionPoly** arg1, s32* arg2, Actor* actor, Vec3f* pos) { return func_800C3D50(0, bgCtxt, 2, arg1, arg2, pos, actor, 28, 1.0f, 0); } diff --git a/src/code/z_effect_soft_sprite.c b/src/code/z_effect_soft_sprite.c index 802ac59f2..50b492128 100644 --- a/src/code/z_effect_soft_sprite.c +++ b/src/code/z_effect_soft_sprite.c @@ -225,7 +225,7 @@ void EffectSS_UpdateParticle(GlobalContext* ctxt, s32 index) { particle->pos.y += particle->velocity.y; particle->pos.z += particle->velocity.z; - (*particle->update)(ctxt, index, particle); + particle->update(ctxt, index, particle); } } @@ -250,7 +250,7 @@ void EffectSS_UpdateAllParticles(GlobalContext* ctxt) { void EffectSS_DrawParticle(GlobalContext* ctxt, s32 index) { EffectSs* entry = &EffectSS2Info.data_table[index]; if (entry->draw != 0) { - (*entry->draw)(ctxt, index, entry); + entry->draw(ctxt, index, entry); } } diff --git a/src/code/z_lights.c b/src/code/z_lights.c index da3b79ae2..161eff724 100644 --- a/src/code/z_lights.c +++ b/src/code/z_lights.c @@ -187,9 +187,16 @@ void Lights_BindDirectional(Lights* lights, LightParams* params, void* unused) { * available in the Lights group. This is at most 7 slots for a new group, but could be less. */ void Lights_BindAll(Lights* lights, LightNode* listHead, Vec3f* refPos, GlobalContext* globalCtx) { - static LightsPosBindFunc posBindFuncs[] = { Lights_BindPoint, Lights_BindDirectional, Lights_BindPoint }; - static LightsBindFunc dirBindFuncs[] = { Lights_BindPointWithReference, Lights_BindDirectional, - Lights_BindPointWithReference }; + static LightsPosBindFunc posBindFuncs[] = { + Lights_BindPoint, + (LightsPosBindFunc)Lights_BindDirectional, + Lights_BindPoint, + }; + static LightsBindFunc dirBindFuncs[] = { + Lights_BindPointWithReference, + (LightsBindFunc)Lights_BindDirectional, + Lights_BindPointWithReference, + }; if (listHead != NULL) { if ((refPos == NULL) && (lights->enablePosLights == 1)) { diff --git a/src/code/z_skelanime.c b/src/code/z_skelanime.c index 16e1f3b11..a22306dbc 100644 --- a/src/code/z_skelanime.c +++ b/src/code/z_skelanime.c @@ -19,8 +19,9 @@ void SkelAnime_AnimationType4Loaded(GlobalContext* globalCtx, AnimationEntryType void SkelAnime_AnimationType5Loaded(GlobalContext* globalCtx, AnimationEntryType5* entry); static AnimationEntryCallback sAnimationLoadDone[] = { - SkelAnime_LinkAnimetionLoaded, SkelAnime_AnimationType1Loaded, SkelAnime_AnimationType2Loaded, - SkelAnime_AnimationType3Loaded, SkelAnime_AnimationType4Loaded, SkelAnime_AnimationType5Loaded, + (AnimationEntryCallback)SkelAnime_LinkAnimetionLoaded, (AnimationEntryCallback)SkelAnime_AnimationType1Loaded, + (AnimationEntryCallback)SkelAnime_AnimationType2Loaded, (AnimationEntryCallback)SkelAnime_AnimationType3Loaded, + (AnimationEntryCallback)SkelAnime_AnimationType4Loaded, (AnimationEntryCallback)SkelAnime_AnimationType5Loaded, }; s32 D_801F5AB0; @@ -1240,7 +1241,7 @@ void SkelAnime_ChangeLinkAnim(GlobalContext* globalCtx, SkelAnime* skelAnime, Li skelAnime->initialFrame = frame; skelAnime->animCurrentFrame = frame; skelAnime->animFrameCount = frameCount; - skelAnime->totalFrames = SkelAnime_GetTotalFrames(linkAnimetionEntrySeg); + skelAnime->totalFrames = SkelAnime_GetTotalFrames(&linkAnimetionEntrySeg->genericHeader); skelAnime->animPlaybackSpeed = playbackSpeed; } diff --git a/src/code/z_snap.c b/src/code/z_snap.c index aa2f7439f..972f359f0 100644 --- a/src/code/z_snap.c +++ b/src/code/z_snap.c @@ -113,11 +113,11 @@ s32 func_8013A530(GlobalContext* globalCtx, Actor* actor, s32 flag, Vec3f* pos, s16 x; s16 y; f32 distance; - UNK_TYPE unk1; + CollisionPoly* unk1; Camera* camera; Actor* actors[2]; s32 ret = 0; - UNK_TYPE unk2; + u32 unk2; camera = ACTIVE_CAM; -- cgit v1.2.3