Enable more IDO warnings and apply fixes (#1264)

* Update asm-processor and fix includes with EARLY

* Enable more IDO warnings and disable unwanted warning 516

* Fix most new and remaining warnings

* Improve skelanime comment

* Improve asmproc pragma comment

Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>

* Add suggested comment for a wrong prototype

* Update asm-processor with the latest fix

Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>
This commit is contained in:
Roman971
2022-06-13 01:24:45 +02:00
committed by GitHub
parent 4cb1c3345f
commit feadb0d9ee
30 changed files with 269 additions and 148 deletions
+5 -3
View File
@@ -96,9 +96,10 @@ typedef enum {
} SeqCmdType;
void Audio_ProcessSeqCmd(u32 cmd) {
s32 pad[2];
s32 pad;
u16 fadeTimer;
u16 channelMask;
u32 channelMaskReversed;
u16 val;
u8 oldSpec;
u8 spec;
@@ -305,9 +306,10 @@ void Audio_ProcessSeqCmd(u32 cmd) {
// stop channels
Audio_QueueCmdS8(0x08000000 | _SHIFTL(playerIdx, 16, 8) | 0xFF00, 1);
}
if ((channelMask ^ 0xFFFF) != 0) {
channelMaskReversed = channelMask ^ 0xFFFF;
if (channelMaskReversed != 0) {
// with channel mask ~channelMask...
Audio_QueueCmdU16(0x90000000 | _SHIFTL(playerIdx, 16, 8), (channelMask ^ 0xFFFF));
Audio_QueueCmdU16(0x90000000 | _SHIFTL(playerIdx, 16, 8), channelMaskReversed);
// unstop channels
Audio_QueueCmdS8(0x08000000 | _SHIFTL(playerIdx, 16, 8) | 0xFF00, 0);
}
+3
View File
@@ -31,6 +31,9 @@ void Graph_FaultClient(void) {
osViSwapBuffer(nextFb);
}
// TODO: merge Gfx and GfxMod to make this function's arguments consistent
void UCodeDisas_Disassemble(UCodeDisas*, Gfx*);
void Graph_DisassembleUCode(Gfx* workBuf) {
UCodeDisas disassembler;
+1 -1
View File
@@ -36,7 +36,7 @@ void SysCfb_Init(s32 n64dd) {
osSyncPrintf("フレームバッファのアドレスは %08x と %08x です\n", sSysCfbFbPtr[0], sSysCfbFbPtr[1]);
}
void SysCfb_Reset() {
void SysCfb_Reset(void) {
sSysCfbFbPtr[0] = 0;
sSysCfbFbPtr[1] = 0;
sSysCfbEnd = 0;
+1 -1
View File
@@ -8142,7 +8142,7 @@ s32 Camera_Copy(Camera* dstCamera, Camera* srcCamera) {
return true;
}
s32 Camera_GetDbgCamEnabled() {
s32 Camera_GetDbgCamEnabled(void) {
return gDbgCamEnabled;
}
+1 -1
View File
@@ -161,7 +161,7 @@ void Lights_BindAll(Lights* lights, LightNode* listHead, Vec3f* vec) {
}
}
LightNode* Lights_FindBufSlot() {
LightNode* Lights_FindBufSlot(void) {
LightNode* node;
if (sLightsBuffer.numOccupied >= LIGHTS_BUFFER_SIZE) {
+1 -1
View File
@@ -307,7 +307,7 @@ void Play_Init(GameState* thisx) {
if ((gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_SPOT09) &&
gSaveContext.sceneSetupIndex == 6) {
osSyncPrintf("エンディングはじまるよー\n"); // "The ending starts"
((void (*)())0x81000000)();
((void (*)(void))0x81000000)();
osSyncPrintf("出戻り?\n"); // "Return?"
}
+10 -10
View File
@@ -1086,9 +1086,9 @@ void SkelAnime_InitLink(PlayState* play, SkelAnime* skelAnime, FlexSkeletonHeade
*/
void LinkAnimation_SetUpdateFunction(SkelAnime* skelAnime) {
if (skelAnime->mode <= ANIMMODE_LOOP_INTERP) {
skelAnime->update = LinkAnimation_Loop;
skelAnime->update.link = LinkAnimation_Loop;
} else {
skelAnime->update = LinkAnimation_Once;
skelAnime->update.link = LinkAnimation_Once;
}
skelAnime->morphWeight = 0.0f;
}
@@ -1098,7 +1098,7 @@ void LinkAnimation_SetUpdateFunction(SkelAnime* skelAnime) {
* finishes.
*/
s32 LinkAnimation_Update(PlayState* play, SkelAnime* skelAnime) {
return skelAnime->update(play, skelAnime);
return skelAnime->update.link(play, skelAnime);
}
/**
@@ -1201,7 +1201,7 @@ void LinkAnimation_Change(PlayState* play, SkelAnime* skelAnime, LinkAnimationHe
SkelAnime_CopyFrameTable(skelAnime, skelAnime->morphTable, skelAnime->jointTable);
morphFrames = -morphFrames;
} else {
skelAnime->update = LinkAnimation_Morph;
skelAnime->update.link = LinkAnimation_Morph;
AnimationContext_SetLoadFrame(play, animation, (s32)startFrame, skelAnime->limbCount,
skelAnime->morphTable);
}
@@ -1463,11 +1463,11 @@ SkelAnime_InitSkin(PlayState* play, SkelAnime* skelAnime, SkeletonHeader* skelet
*/
void SkelAnime_SetUpdate(SkelAnime* skelAnime) {
if (skelAnime->mode <= ANIMMODE_LOOP_INTERP) {
skelAnime->update = SkelAnime_LoopFull;
skelAnime->update.normal = SkelAnime_LoopFull;
} else if (skelAnime->mode <= ANIMMODE_ONCE_INTERP) {
skelAnime->update = SkelAnime_Once;
skelAnime->update.normal = SkelAnime_Once;
} else {
skelAnime->update = SkelAnime_LoopPartial;
skelAnime->update.normal = SkelAnime_LoopPartial;
}
}
@@ -1476,7 +1476,7 @@ void SkelAnime_SetUpdate(SkelAnime* skelAnime) {
* finishes.
*/
s32 SkelAnime_Update(SkelAnime* skelAnime) {
return skelAnime->update(skelAnime);
return skelAnime->update.normal(skelAnime);
}
/**
@@ -1636,10 +1636,10 @@ void Animation_ChangeImpl(SkelAnime* skelAnime, AnimationHeader* animation, f32
morphFrames = -morphFrames;
} else {
if (taper != ANIMTAPER_NONE) {
skelAnime->update = SkelAnime_MorphTaper;
skelAnime->update.normal = SkelAnime_MorphTaper;
skelAnime->taper = taper;
} else {
skelAnime->update = SkelAnime_Morph;
skelAnime->update.normal = SkelAnime_Morph;
}
SkelAnime_GetFrameData(animation, startFrame, skelAnime->limbCount, skelAnime->morphTable);
}
+1 -1
View File
@@ -266,7 +266,7 @@ s32 func_800AE2C0(SkyboxContext* skyboxCtx, Vtx* roomVtx, s32 arg2, s32 arg3, s3
}
break;
}
skyboxCtx->unk_138 = &skyboxCtx->dListBuf[2 * arg8];
skyboxCtx->unk_138 = &skyboxCtx->dListBuf[2 * arg8][0];
for (i = 0; i < 0x20; i++) {
index = D_8012ADD8[i];
+1 -1
View File
@@ -2038,7 +2038,7 @@ void BossVa_ZapperAttack(BossVa* this, PlayState* play) {
this->skelAnime.playSpeed = 0.0f;
if (Math_SmoothStepToF(&this->skelAnime.curFrame, 0.0f, 1.0f, 2.0f, 0.0f) == 0.0f) {
if (sp88 < sp90) {
if (sp88 < (u32)sp90) {
this->timer2 = 0;
this->burst++;
this->unk_1D8 = sp7C;
+3 -2
View File
@@ -16,7 +16,8 @@ void DemoDu_Draw(Actor* thisx, PlayState* play);
static s32 sUnused = 0;
#include "z_demo_du_cutscene_data.c" EARLY
#pragma asmproc recurse
#include "z_demo_du_cutscene_data.c"
static void* sEyeTextures[] = { gDaruniaEyeOpenTex, gDaruniaEyeOpeningTex, gDaruniaEyeShutTex, gDaruniaEyeClosingTex };
static void* sMouthTextures[] = { gDaruniaMouthSeriousTex, gDaruniaMouthGrinningTex, gDaruniaMouthOpenTex,
@@ -707,7 +708,7 @@ void DemoDu_InitCs_AfterGanon(DemoDu* this, PlayState* play) {
this->actor.shape.shadowAlpha = 0;
}
void DemoDu_CsPlaySfx_WhiteOut() {
void DemoDu_CsPlaySfx_WhiteOut(void) {
func_800788CC(NA_SE_SY_WHITE_OUT_T);
}
+2 -2
View File
@@ -19,7 +19,7 @@ void DemoGt_Destroy(Actor* thisx, PlayState* play) {
}
}
void DemoGt_PlayEarthquakeSfx() {
void DemoGt_PlayEarthquakeSfx(void) {
func_800788CC(NA_SE_EV_EARTHQUAKE - SFX_FLAG);
}
@@ -435,7 +435,7 @@ void func_8097ED64(DemoGt* this, PlayState* play, s32 actionIdx) {
func_8097E824(this, actionIdx);
}
u8 func_8097ED94() {
u8 func_8097ED94(void) {
if (kREG(2) != 0) {
return true;
} else if (gSaveContext.sceneSetupIndex < 4) {
+2 -1
View File
@@ -72,7 +72,8 @@ static ColliderCylinderInitType1 sCylinderInit = {
{ 25, 80, 0, { 0, 0, 0 } },
};
#include "z_demo_im_cutscene_data.c" EARLY
#pragma asmproc recurse
#include "z_demo_im_cutscene_data.c"
static DemoImActionFunc sActionFuncs[] = {
func_809856F8, func_80985718, func_80985738, func_80985770, func_809857B0, func_809857F0, func_80985830,
+2 -1
View File
@@ -71,7 +71,8 @@ static void* sMouthTextures[] = {
static u32 D_80990108 = 0;
#include "z_demo_sa_cutscene_data.c" EARLY
#pragma asmproc recurse
#include "z_demo_sa_cutscene_data.c"
static DemoSaActionFunc sActionFuncs[] = {
func_8098EBB8, func_8098EBD8, func_8098EBF8, func_8098EC28, func_8098EC60, func_8098EC94, func_8098ECCC,
+1 -1
View File
@@ -155,7 +155,7 @@ void EnDs_OfferOddPotion(EnDs* this, PlayState* play) {
}
}
s32 EnDs_CheckRupeesAndBottle() {
s32 EnDs_CheckRupeesAndBottle(void) {
if (gSaveContext.rupees < 100) {
return 0;
} else if (Inventory_HasEmptyBottle() == 0) {
+1 -1
View File
@@ -34,7 +34,7 @@ const ActorInit En_Eg_InitVars = {
(ActorFunc)EnEg_Draw,
};
void EnEg_PlayVoidOutSFX() {
void EnEg_PlayVoidOutSFX(void) {
func_800788CC(NA_SE_OC_ABYSS);
}
+1 -1
View File
@@ -798,7 +798,7 @@ void EnFr_CheckOcarinaInputFrogSong(u8 ocarinaNote) {
}
}
void EnFr_DeactivateButterfly() {
void EnFr_DeactivateButterfly(void) {
s32 frogIndex;
EnFr* frog;
+1 -1
View File
@@ -75,7 +75,7 @@ void EnHoll_SetupAction(EnHoll* this, EnHollActionFunc func) {
this->actionFunc = func;
}
s32 EnHoll_IsKokiriSetup8() {
s32 EnHoll_IsKokiriSetup8(void) {
return gSaveContext.entranceIndex == ENTR_SPOT04_0 && gSaveContext.sceneSetupIndex == 8;
}
+2 -1
View File
@@ -42,7 +42,8 @@ const ActorInit En_Jj_InitVars = {
static s32 sUnused = 0;
#include "z_en_jj_cutscene_data.c" EARLY
#pragma asmproc recurse
#include "z_en_jj_cutscene_data.c"
static s32 sUnused2[] = { 0, 0 };
+1 -1
View File
@@ -69,7 +69,7 @@ typedef enum {
/* 10 */ ENMD_ANIM_10,
/* 11 */ ENMD_ANIM_11,
/* 12 */ ENMD_ANIM_12,
/* 13 */ ENMD_ANIM_13,
/* 13 */ ENMD_ANIM_13
} EnMdAnimation;
static AnimationInfo sAnimationInfo[] = {
+2 -1
View File
@@ -85,7 +85,8 @@ static void* sEyeTextures[] = {
static s32 D_80AB4318 = 0;
#include "z_en_nb_cutscene_data.c" EARLY
#pragma asmproc recurse
#include "z_en_nb_cutscene_data.c"
s32 EnNb_GetPath(EnNb* this) {
s32 path = this->actor.params >> 8;
+2 -1
View File
@@ -105,7 +105,8 @@ static void* sMouthTextures[] = {
static s32 sUnused = 0;
#include "z_en_ru1_cutscene_data.c" EARLY
#pragma asmproc recurse
#include "z_en_ru1_cutscene_data.c"
static u32 D_80AF1938 = 0;
+3 -2
View File
@@ -63,7 +63,8 @@ static void* sEyeTextures[] = {
static UNK_TYPE D_80AF4118 = 0;
#include "z_en_ru2_cutscene_data.c" EARLY
#pragma asmproc recurse
#include "z_en_ru2_cutscene_data.c"
static EnRu2ActionFunc sActionFuncs[] = {
func_80AF2CB4, func_80AF2CD4, func_80AF2CF4, func_80AF2D2C, func_80AF2D6C, func_80AF2DAC, func_80AF2DEC,
@@ -379,7 +380,7 @@ void func_80AF2E1C(EnRu2* this, PlayState* play) {
this->actor.shape.shadowAlpha = 0;
}
void func_80AF2E64() {
void func_80AF2E64(void) {
func_800788CC(NA_SE_SY_WHITE_OUT_T);
}
+4 -2
View File
@@ -160,7 +160,8 @@ void EnTp_Init(Actor* thisx, PlayState* play2) {
next = (EnTp*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_TP, this->actor.world.pos.x,
this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0 * i);
if (0 * i) {} // Very fake, but needed to get the s registers right
if ((0 * i) != 0) {} // Very fake, but needed to get the s registers right
if (next != NULL) {
now->actor.child = &next->actor;
next->actor.parent = &now->actor;
@@ -176,7 +177,8 @@ void EnTp_Init(Actor* thisx, PlayState* play2) {
next->timer = next->unk_15C = i * -5;
next->horizontalVariation = 6.0f - (i * 0.75f);
now = next;
if (0 * i) {}
if ((0 * i) != 0) {}
}
}
} else if (this->actor.params == TAILPASARAN_TAIL) {
+1 -1
View File
@@ -1360,7 +1360,7 @@ void func_80B3F3C8(EnXc* this, PlayState* play) {
this->action = SHEIK_ACTION_45;
}
void func_80B3F3D8() {
void func_80B3F3D8(void) {
func_800788CC(NA_SE_PL_SKIP);
}
@@ -113,6 +113,9 @@ void KaleidoScope_DrawPlayerWork(PlayState* play) {
BOOTS_EQUIP_TO_PLAYER(CUR_EQUIP_VALUE(EQUIP_TYPE_BOOTS)));
}
// Wrong prototype; this function is called with `play` even though it has no arguments
void KaleidoScope_ProcessPlayerPreRender(PlayState* play);
void KaleidoScope_DrawEquipment(PlayState* play) {
PauseContext* pauseCtx = &play->pauseCtx;
Input* input = &play->state.input[0];