mirror of
https://github.com/zeldaret/mm.git
synced 2026-07-09 05:43:18 -04:00
Enable full IDO warnings (#781)
* Fix a lot of IDO warnings (and some Clang ones) * Format * Put FULL_DISASM=0 back * Fix bss
This commit is contained in:
@@ -459,6 +459,7 @@ s32 AudioLoad_SyncLoadInstrument(s32 fontId, s32 instId, s32 drumId) {
|
||||
if (instrument->normalRangeHi != 0x7F) {
|
||||
return AudioLoad_SyncLoadSample(instrument->highNotesSound.sample, fontId);
|
||||
}
|
||||
// TODO: is this missing return UB?
|
||||
} else if (instId == 0x7F) {
|
||||
Drum* drum = AudioPlayback_GetDrum(fontId, drumId);
|
||||
|
||||
@@ -468,6 +469,7 @@ s32 AudioLoad_SyncLoadInstrument(s32 fontId, s32 instId, s32 drumId) {
|
||||
AudioLoad_SyncLoadSample(drum->sound.sample, fontId);
|
||||
return 0;
|
||||
}
|
||||
// TODO: is this missing return UB?
|
||||
}
|
||||
|
||||
void AudioLoad_AsyncLoad(s32 tableType, s32 id, s32 nChunks, s32 retData, OSMesgQueue* retQueue) {
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ GfxMasterList* gGfxMasterDL;
|
||||
CfbInfo sGraphCfbInfos[3];
|
||||
OSTime sGraphTaskStartTime;
|
||||
|
||||
void* Graph_FaultClient(void) {
|
||||
void Graph_FaultClient(void) {
|
||||
FaultDrawer_DrawText(30, 100, "ShowFrameBuffer PAGE 0/1");
|
||||
osViSwapBuffer(SysCfb_GetFbPtr(0));
|
||||
osViSetMode(D_801FBB88);
|
||||
|
||||
+1
-1
@@ -240,7 +240,7 @@ void ActorShadow_DrawFeet(Actor* actor, Lights* mapper, GlobalContext* globalCtx
|
||||
}
|
||||
actor->shape.unk_17 &= ~spB8;
|
||||
|
||||
if (!mapper->l.l) {} // POSSIBLE FAKE MATCH
|
||||
if ((uintptr_t)mapper->l.l) {} // POSSIBLE FAKE MATCH
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4441,11 +4441,13 @@ s32 WaterBox_GetSurfaceImpl(GlobalContext* globalCtx, CollisionContext* colCtx,
|
||||
return false;
|
||||
}
|
||||
|
||||
// boolean
|
||||
s32 WaterBox_GetSurface1(GlobalContext* globalCtx, CollisionContext* colCtx, f32 x, f32 z, f32* ySurface,
|
||||
WaterBox** outWaterBox) {
|
||||
WaterBox_GetSurface1_2(globalCtx, colCtx, x, z, ySurface, outWaterBox);
|
||||
return WaterBox_GetSurface1_2(globalCtx, colCtx, x, z, ySurface, outWaterBox);
|
||||
}
|
||||
|
||||
// boolean
|
||||
s32 WaterBox_GetSurface1_2(GlobalContext* globalCtx, CollisionContext* colCtx, f32 x, f32 z, f32* ySurface,
|
||||
WaterBox** outWaterBox) {
|
||||
s32 bgId;
|
||||
|
||||
@@ -1418,6 +1418,7 @@ void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx,
|
||||
}
|
||||
}
|
||||
#else
|
||||
void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx, u8* cutscenePtr);
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/Cutscene_ProcessCommands.s")
|
||||
#endif
|
||||
|
||||
|
||||
@@ -309,6 +309,7 @@ void EffectBlure_GetComputedValues(EffectBlure* this, s32 index, f32 ratio, Vec3
|
||||
Vec3s sp30;
|
||||
f32 mode4Param;
|
||||
EffectBlureElement* elem = &this->elements[index];
|
||||
Vec3s* unusedPtr = &sp30; // Optimized out but seems necessary to match stack usage
|
||||
|
||||
switch (this->calcMode) {
|
||||
case 1:
|
||||
@@ -367,8 +368,6 @@ void EffectBlure_GetComputedValues(EffectBlure* this, s32 index, f32 ratio, Vec3
|
||||
break;
|
||||
}
|
||||
|
||||
sp30 = sp30; // Optimized out but seems necessary to match stack usage
|
||||
|
||||
if (this->flags & 0x10) {
|
||||
color1->r = color1->g = color1->b = color1->a = 255;
|
||||
color2->r = color2->g = color2->b = color2->a = 255;
|
||||
|
||||
+1
-1
@@ -216,7 +216,7 @@ void Lights_BindAll(Lights* lights, LightNode* listHead, Vec3f* refPos, GlobalCo
|
||||
}
|
||||
}
|
||||
|
||||
LightNode* Lights_FindBufSlot() {
|
||||
LightNode* Lights_FindBufSlot(void) {
|
||||
LightNode* ret;
|
||||
|
||||
if (sLightsBuffer.numOccupied >= LIGHTS_BUFFER_SIZE) {
|
||||
|
||||
+1
-1
@@ -638,7 +638,7 @@ void Distortion_Update(void) {
|
||||
sDistortionContext.countdown = 2;
|
||||
player = GET_PLAYER(globalCtx);
|
||||
|
||||
if (&player->actor != NULL) {
|
||||
if (player != NULL) {
|
||||
Actor_GetWorldPosShapeRot(&playerPosRot, &player->actor);
|
||||
}
|
||||
|
||||
|
||||
+2
-4
@@ -341,7 +341,7 @@ void Scene_HeaderCmdEnvLightSettings(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
* Loads different texture files for each region of the world.
|
||||
* These later are stored in segment 0x06, and used in maps.
|
||||
*/
|
||||
s32 Scene_LoadAreaTextures(GlobalContext* globalCtx, s32 fileIndex) {
|
||||
void Scene_LoadAreaTextures(GlobalContext* globalCtx, s32 fileIndex) {
|
||||
static RomFile sceneTextureFiles[9] = {
|
||||
{ 0, 0 }, // Default
|
||||
{ SEGMENT_ROM_START(scene_texture_01), SEGMENT_ROM_END(scene_texture_01) },
|
||||
@@ -358,10 +358,8 @@ s32 Scene_LoadAreaTextures(GlobalContext* globalCtx, s32 fileIndex) {
|
||||
|
||||
if (size != 0) {
|
||||
globalCtx->roomCtx.unk74 = THA_AllocEndAlign16(&globalCtx->state.heap, size);
|
||||
return DmaMgr_SendRequest0(globalCtx->roomCtx.unk74, vromStart, size);
|
||||
DmaMgr_SendRequest0(globalCtx->roomCtx.unk74, vromStart, size);
|
||||
}
|
||||
|
||||
// UB: Undefined behaviour to not have a return statement here, but it breaks matching to add one.
|
||||
}
|
||||
|
||||
// SceneTableEntry Header Command 0x11: Skybox Settings
|
||||
|
||||
@@ -234,7 +234,7 @@ f32 Scene_LagrangeInterp(s32 n, f32 x[], f32 fx[], f32 xp) {
|
||||
s32 i;
|
||||
s32 j;
|
||||
|
||||
for (i = 0, weightsPtr = weights, xPtr1 = x, fxPtr = fx, weightsPtr = weightsPtr; i < n; i++) {
|
||||
for (i = 0, xPtr1 = x, fxPtr = fx, weightsPtr = weights; i < n; i++) {
|
||||
for (xVal = *xPtr1, m = 1.0f, j = 0, xPtr2 = x; j < n; j++) {
|
||||
if (j != i) {
|
||||
m *= xVal - (*xPtr2);
|
||||
|
||||
+10
-10
@@ -1238,9 +1238,9 @@ void SkelAnime_InitLink(GlobalContext* globalCtx, SkelAnime* skelAnime, FlexSkel
|
||||
*/
|
||||
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;
|
||||
}
|
||||
@@ -1250,7 +1250,7 @@ void LinkAnimation_SetUpdateFunction(SkelAnime* skelAnime) {
|
||||
* finishes.
|
||||
*/
|
||||
s32 LinkAnimation_Update(GlobalContext* globalCtx, SkelAnime* skelAnime) {
|
||||
return skelAnime->update(globalCtx, skelAnime);
|
||||
return skelAnime->update.link(globalCtx, skelAnime);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1355,7 +1355,7 @@ void LinkAnimation_Change(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAn
|
||||
SkelAnime_CopyFrameTable(skelAnime, skelAnime->morphTable, skelAnime->jointTable);
|
||||
morphFrames = -morphFrames;
|
||||
} else {
|
||||
skelAnime->update = LinkAnimation_Morph;
|
||||
skelAnime->update.link = LinkAnimation_Morph;
|
||||
AnimationContext_SetLoadFrame(globalCtx, animation, (s32)startFrame, skelAnime->limbCount,
|
||||
skelAnime->morphTable);
|
||||
}
|
||||
@@ -1599,11 +1599,11 @@ void SkelAnime_InitSkin(GameState* gameState, SkelAnime* skelAnime, SkeletonHead
|
||||
*/
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1612,7 +1612,7 @@ void SkelAnime_SetUpdate(SkelAnime* skelAnime) {
|
||||
* finishes.
|
||||
*/
|
||||
s32 SkelAnime_Update(SkelAnime* skelAnime) {
|
||||
return skelAnime->update(skelAnime);
|
||||
return skelAnime->update.normal(skelAnime);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1774,10 +1774,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);
|
||||
}
|
||||
|
||||
@@ -1495,7 +1495,7 @@ void func_80146DF8(SramContext* sramCtx) {
|
||||
}
|
||||
|
||||
void Sram_InitSram(GameState* gameState, SramContext* sramCtx) {
|
||||
if (&gSaveContext.save) {}
|
||||
if (gSaveContext.save.entranceIndex) {} // Required to match
|
||||
|
||||
func_801A3D98(gSaveContext.options.audioSetting);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user