From 063ded531b258dbd0ad793a5014fede2d3c3fa8d Mon Sep 17 00:00:00 2001 From: Tharo <17233964+Thar0@users.noreply.github.com> Date: Sun, 4 May 2025 22:43:04 +0100 Subject: [PATCH] C23 Compatibility --- src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c | 6 ++++++ src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.h | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c index b9a55b7eef..75c942820d 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c @@ -125,8 +125,10 @@ void KaleidoScope_DrawPlayerWork(PlayState* play) { BOOTS_EQUIP_TO_PLAYER(CUR_EQUIP_VALUE(EQUIP_TYPE_BOOTS))); } +#ifndef AVOID_UB // Wrong prototype; this function is called with `play` even though it has no arguments void KaleidoScope_ProcessPlayerPreRender(PlayState* play); +#endif void KaleidoScope_DrawEquipment(PlayState* play) { static s16 sEquipTimer = 0; @@ -592,8 +594,12 @@ void KaleidoScope_DrawEquipment(PlayState* play) { } if ((pauseCtx->mainState == PAUSE_MAIN_STATE_7) && (sEquipTimer == 9)) { +#ifndef AVOID_UB //! @bug: This function shouldn't take any arguments KaleidoScope_ProcessPlayerPreRender(play); +#else + KaleidoScope_ProcessPlayerPreRender(); +#endif } gSPSegment(POLY_OPA_DISP++, 0x07, pauseCtx->playerSegment); diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.h b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.h index 5a99234432..27454ee1f7 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.h +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.h @@ -184,7 +184,9 @@ Gfx* KaleidoScope_QuadTextureIA4(Gfx* gfx, void* texture, s16 width, s16 height, Gfx* KaleidoScope_QuadTextureIA8(Gfx* gfx, void* texture, s16 width, s16 height, u16 point); void KaleidoScope_MoveCursorToSpecialPos(struct PlayState* play, u16 specialPos); void KaleidoScope_DrawQuadTextureRGBA32(GraphicsContext* gfxCtx, void* texture, u16 width, u16 height, u16 point); -void KaleidoScope_ProcessPlayerPreRender(); +#ifdef AVOID_UB +void KaleidoScope_ProcessPlayerPreRender(void); +#endif void KaleidoScope_SetupPlayerPreRender(struct PlayState* play); void KaleidoScope_DrawCursor(struct PlayState* play, u16 pageIndex); void KaleidoScope_UpdateDungeonMap(struct PlayState* play);