mirror of
https://github.com/zeldaret/oot.git
synced 2024-12-27 23:36:22 +00:00
Fix return UB (#958)
* Ydan_SP * func_8002D7EC * Gameplay_ChangeCameraStatus * Graph_InitTHGA * CollisioCheck_LineOC * Fix more in camera and jpeg * revert comment in player
This commit is contained in:
parent
90c841c435
commit
e31e35658d
9 changed files with 12 additions and 11 deletions
|
@ -381,7 +381,7 @@ void Actor_Kill(Actor* actor);
|
|||
void Actor_SetFocus(Actor* actor, f32 offset);
|
||||
void Actor_SetScale(Actor* actor, f32 scale);
|
||||
void Actor_SetObjectDependency(GlobalContext* globalCtx, Actor* actor);
|
||||
s16 func_8002D7EC(Actor* actor);
|
||||
void func_8002D7EC(Actor* actor);
|
||||
void func_8002D868(Actor* actor);
|
||||
void Actor_MoveForward(Actor* actor);
|
||||
void func_8002D908(Actor* actor);
|
||||
|
@ -1614,7 +1614,7 @@ void GameAlloc_Init(GameAlloc* this);
|
|||
void Graph_FaultClient();
|
||||
void Graph_DisassembleUCode(Gfx* workBuf);
|
||||
void Graph_UCodeFaultClient(Gfx* workBuf);
|
||||
void* Graph_InitTHGA(GraphicsContext* gfxCtx);
|
||||
void Graph_InitTHGA(GraphicsContext* gfxCtx);
|
||||
GameStateOverlay* Graph_GetNextGameState(GameState* gameState);
|
||||
void Graph_Init(GraphicsContext* gfxCtx);
|
||||
void Graph_Destroy(GraphicsContext* gfxCtx);
|
||||
|
|
|
@ -79,7 +79,7 @@ void Graph_UCodeFaultClient(Gfx* workBuf) {
|
|||
UCodeDisas_Destroy(&disassembler);
|
||||
}
|
||||
|
||||
void* Graph_InitTHGA(GraphicsContext* gfxCtx) {
|
||||
void Graph_InitTHGA(GraphicsContext* gfxCtx) {
|
||||
GfxPool* pool = &gGfxPools[gfxCtx->gfxPoolIdx & 1];
|
||||
|
||||
pool->headMagic = GFXPOOL_HEAD_MAGIC;
|
||||
|
|
|
@ -845,7 +845,7 @@ void Actor_Destroy(Actor* actor, GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
|
||||
s16 func_8002D7EC(Actor* actor) {
|
||||
void func_8002D7EC(Actor* actor) {
|
||||
f32 speedRate = R_UPDATE_RATE * 0.5f;
|
||||
|
||||
actor->world.pos.x += (actor->velocity.x * speedRate) + actor->colChkInfo.displacement.x;
|
||||
|
|
|
@ -2125,6 +2125,7 @@ s32 Camera_Parallel1(Camera* camera) {
|
|||
camera->fov = Camera_LERPCeilF(para1->fovTarget, camera->fov, camera->fovUpdateRate, 1.0f);
|
||||
camera->roll = Camera_LERPCeilS(0, camera->roll, 0.5, 0xA);
|
||||
camera->atLERPStepScale = Camera_ClampLERPScale(camera, sp6A ? para1->unk_1C : para1->unk_14);
|
||||
//! @bug No return
|
||||
}
|
||||
|
||||
s32 Camera_Parallel2(Camera* camera) {
|
||||
|
@ -2929,7 +2930,7 @@ s32 Camera_Battle2(Camera* camera) {
|
|||
}
|
||||
|
||||
s32 Camera_Battle3(Camera* camera) {
|
||||
Camera_Noop(camera);
|
||||
return Camera_Noop(camera);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -3175,7 +3175,7 @@ s32 CollisionCheck_LineOC(GlobalContext* globalCtx, CollisionCheckContext* colCh
|
|||
* otherwise. Unused.
|
||||
*/
|
||||
s32 CollisionCheck_LineOCCheckAll(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Vec3f* a, Vec3f* b) {
|
||||
CollisionCheck_LineOC(globalCtx, colChkCtx, a, b, NULL, 0);
|
||||
return CollisionCheck_LineOC(globalCtx, colChkCtx, a, b, NULL, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3184,7 +3184,7 @@ s32 CollisionCheck_LineOCCheckAll(GlobalContext* globalCtx, CollisionCheckContex
|
|||
*/
|
||||
s32 CollisionCheck_LineOCCheck(GlobalContext* globalCtx, CollisionCheckContext* colChkCtx, Vec3f* a, Vec3f* b,
|
||||
Actor** exclusions, s32 numExclusions) {
|
||||
CollisionCheck_LineOC(globalCtx, colChkCtx, a, b, exclusions, numExclusions);
|
||||
return CollisionCheck_LineOC(globalCtx, colChkCtx, a, b, exclusions, numExclusions);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
/**
|
||||
* Configures and schedules a JPEG decoder task and waits for it to finish.
|
||||
*/
|
||||
u32 Jpeg_ScheduleDecoderTask(JpegContext* ctx) {
|
||||
void Jpeg_ScheduleDecoderTask(JpegContext* ctx) {
|
||||
static OSTask_t sJpegTask = {
|
||||
M_NJPEGTASK, // type
|
||||
0, // flags
|
||||
|
|
|
@ -1533,7 +1533,7 @@ s16 Gameplay_ChangeCameraStatus(GlobalContext* globalCtx, s16 camId, s16 status)
|
|||
globalCtx->activeCamera = camIdx;
|
||||
}
|
||||
|
||||
Camera_ChangeStatus(globalCtx->cameraPtrs[camIdx], status);
|
||||
return Camera_ChangeStatus(globalCtx->cameraPtrs[camIdx], status);
|
||||
}
|
||||
|
||||
void Gameplay_ClearCamera(GlobalContext* globalCtx, s16 camId) {
|
||||
|
|
|
@ -153,7 +153,7 @@ void BgYdanSp_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
|||
Collider_DestroyTris(globalCtx, &this->trisCollider);
|
||||
}
|
||||
|
||||
void* BgYdanSp_UpdateFloorWebCollision(BgYdanSp* this) {
|
||||
void BgYdanSp_UpdateFloorWebCollision(BgYdanSp* this) {
|
||||
s16 newY;
|
||||
CollisionHeader* colHeader;
|
||||
|
||||
|
|
|
@ -566,7 +566,7 @@ s32 EnSt_DecrStunTimer(EnSt* this) {
|
|||
if (this->stunTimer == 0) {
|
||||
return 0;
|
||||
}
|
||||
this->stunTimer--; //! @bug ? no return but v0 ends up being stunTimer before decrement
|
||||
this->stunTimer--; //! @bug no return but v0 ends up being stunTimer before decrement
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue