diff options
| author | louist103 <35883445+louist103@users.noreply.github.com> | 2021-09-12 07:02:45 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-12 13:02:45 +0200 |
| commit | e31e35658dd08e9f983eef8aef0e239ecd603333 (patch) | |
| tree | 860251b0e12df6da711197463c3b3f145db73ab4 /src/code | |
| parent | 90c841c435463dc4601b371e2d19d7a6f7da4bac (diff) | |
Fix return UB (#958)
* Ydan_SP
* func_8002D7EC
* Gameplay_ChangeCameraStatus
* Graph_InitTHGA
* CollisioCheck_LineOC
* Fix more in camera and jpeg
* revert comment in player
Diffstat (limited to 'src/code')
| -rw-r--r-- | src/code/graph.c | 2 | ||||
| -rw-r--r-- | src/code/z_actor.c | 2 | ||||
| -rw-r--r-- | src/code/z_camera.c | 3 | ||||
| -rw-r--r-- | src/code/z_collision_check.c | 4 | ||||
| -rw-r--r-- | src/code/z_jpeg.c | 2 | ||||
| -rw-r--r-- | src/code/z_play.c | 2 |
6 files changed, 8 insertions, 7 deletions
diff --git a/src/code/graph.c b/src/code/graph.c index d11b2e22e..ad960cf06 100644 --- a/src/code/graph.c +++ b/src/code/graph.c @@ -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; diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 1cbb2027d..a0dc3d788 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -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; diff --git a/src/code/z_camera.c b/src/code/z_camera.c index 473c096c5..77197662e 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -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); } /** diff --git a/src/code/z_collision_check.c b/src/code/z_collision_check.c index 036880382..7088730ae 100644 --- a/src/code/z_collision_check.c +++ b/src/code/z_collision_check.c @@ -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); } /** diff --git a/src/code/z_jpeg.c b/src/code/z_jpeg.c index 4f12984f0..8dd991a15 100644 --- a/src/code/z_jpeg.c +++ b/src/code/z_jpeg.c @@ -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 diff --git a/src/code/z_play.c b/src/code/z_play.c index 8b1332227..52f72c83d 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -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) { |
