From bba57b078ee70fd211ac1bf0611c4e77e94a0c12 Mon Sep 17 00:00:00 2001 From: louist103 <35883445+louist103@users.noreply.github.com> Date: Thu, 11 Jan 2024 19:49:32 -0500 Subject: [PATCH] Fix (2) pointers cast as u32 --- mm/src/code/z_jpeg.c | 2 +- mm/src/overlays/actors/ovl_En_Slime/z_en_slime.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/src/code/z_jpeg.c b/mm/src/code/z_jpeg.c index ebe40b8b9..39c1e5d7f 100644 --- a/mm/src/code/z_jpeg.c +++ b/mm/src/code/z_jpeg.c @@ -109,7 +109,7 @@ void Jpeg_CopyToZbuffer(u16* src, u16* zbuffer, s32 x, s32 y) { * unaligned values in JPEG header files. */ u16 Jpeg_GetUnalignedU16(u8* ptr) { - if (((u32)ptr & 1) == 0) { + if (((uintptr_t)ptr & 1) == 0) { // Read the value normally if it's aligned to a 16-bit address. return *(u16*)ptr; } else { diff --git a/mm/src/overlays/actors/ovl_En_Slime/z_en_slime.c b/mm/src/overlays/actors/ovl_En_Slime/z_en_slime.c index d091ed925..ff1b3322e 100644 --- a/mm/src/overlays/actors/ovl_En_Slime/z_en_slime.c +++ b/mm/src/overlays/actors/ovl_En_Slime/z_en_slime.c @@ -1208,14 +1208,14 @@ void EnSlime_Draw(Actor* thisx, PlayState* play) { // Ice block is not active Scene_SetRenderModeXlu(play, 0, 1); - gSPSegment(POLY_OPA_DISP++, 9, (u32)sEyeTextures[this->eyeTexIndex]); + gSPSegment(POLY_OPA_DISP++, 9, (uintptr_t)sEyeTextures[this->eyeTexIndex]); gDPSetEnvColor(POLY_OPA_DISP++, 0, 30, 70, 255); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, gChuchuEyesDL); } else { Scene_SetRenderModeXlu(play, 1, 2); - gSPSegment(POLY_XLU_DISP++, 9, (u32)sEyeTextures[this->eyeTexIndex]); + gSPSegment(POLY_XLU_DISP++, 9, (uintptr_t)sEyeTextures[this->eyeTexIndex]); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gChuchuEyesDL); } @@ -1241,7 +1241,7 @@ void EnSlime_Draw(Actor* thisx, PlayState* play) { this->actor.world.pos.z, MTXMODE_NEW); Matrix_Scale(0.03f, 0.03f, 0.03f, MTXMODE_APPLY); - gSPSegment(POLY_OPA_DISP++, 8, (u32)this->itemDropTex); + gSPSegment(POLY_OPA_DISP++, 8, (uintptr_t)this->itemDropTex); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, gItemDropDL); }