diff --git a/port/src/preprocess/filebg.c b/port/src/preprocess/filebg.c index 33dc5f156..95c909694 100644 --- a/port/src/preprocess/filebg.c +++ b/port/src/preprocess/filebg.c @@ -300,7 +300,7 @@ static void convertPrimaryLights(u8 *dst, u32 *dstpos, u8 *src, u32 *srcpos, u32 #define BLOCK_LEAF 0 #define BLOCK_PARENT 1 -void relinkPtr(uintptr_t** ptr) +void relinkPtr(uintptr_t* ptr) { if (!*ptr) return; @@ -455,10 +455,10 @@ static u32 convertRoomGfxData(u8 *dst, u8 *src, u32 infsize, u32 src_ofs) for (size_t i = 0; i < numblocks; i++) { struct host_roomblock *block = (struct host_roomblock*)&ptr_dst_roomblocks[i]; - relinkPtr(&block->ptr_next); + relinkPtr((uintptr_t*)&block->ptr_next); if (block->type == BLOCK_LEAF) { - relinkPtr(&block->ptr_gdl); + relinkPtr((uintptr_t*)&block->ptr_gdl); u32 offset_vtx = block->ptr_vertices - ptr_src_vertices - src_ofs; u32 offset_col = block->ptr_colours - ptr_src_colors - src_ofs; @@ -466,16 +466,16 @@ static u32 convertRoomGfxData(u8 *dst, u8 *src, u32 infsize, u32 src_ofs) block->ptr_colours = ptr_dst_colors + offset_col; } else { - relinkPtr(&block->ptr_gdl); // child - relinkPtr(&block->ptr_vertices); // coord + relinkPtr((uintptr_t*)&block->ptr_gdl); // child + relinkPtr((uintptr_t*)&block->ptr_vertices); // coord } } // relink ptrs: header - relinkPtr(&dst_header->ptr_vertices); - relinkPtr(&dst_header->ptr_colours); - relinkPtr(&dst_header->ptr_opablocks); - relinkPtr(&dst_header->ptr_xlublocks); + relinkPtr((uintptr_t*)&dst_header->ptr_vertices); + relinkPtr((uintptr_t*)&dst_header->ptr_colours); + relinkPtr((uintptr_t*)&dst_header->ptr_opablocks); + relinkPtr((uintptr_t*)&dst_header->ptr_xlublocks); return curpos_dst; } diff --git a/port/src/preprocess/filesetup.c b/port/src/preprocess/filesetup.c index 9d4c9c7b2..2c4e8e977 100644 --- a/port/src/preprocess/filesetup.c +++ b/port/src/preprocess/filesetup.c @@ -1138,8 +1138,7 @@ static u32 convertLists(u8 *dst, u8 *src, u32 dstpos, u32 src_ofs) u32 listsize = chraiGetAilistLength(list); memcpy(dst + dstpos, list, listsize); - // align to the next multiple of 4 - dstpos += ((listsize + 3) >> 2) << 2; + dstpos += ALIGN(listsize, 4); } return dstpos; @@ -1177,7 +1176,7 @@ static int convertSetup(u8 *dst, u8 *src, u32 srclen) dst_header->paths = (struct path*) dstpos; dstpos += convertPaths(&dst[dstpos], &src[srcpos]); - dstpos += convertPads(&dst[(uintptr_t)dst_header->paths], dst, src, dstpos); + dstpos += convertPads((struct path*)&dst[(uintptr_t)dst_header->paths], dst, src, dstpos); return dstpos; } diff --git a/src/game/bondgun.c b/src/game/bondgun.c index e0e04a49d..e3359415d 100644 --- a/src/game/bondgun.c +++ b/src/game/bondgun.c @@ -4192,7 +4192,7 @@ void bgunTickMasterLoad(void) modelInit(&hand->handmodel, player->gunctrl.handmodeldef, hand->handsavedata, false); } - hand->unk0dcc = (s32 *) player->gunctrl.memloadptr; + hand->unk0dcc = (uintptr_t *) player->gunctrl.memloadptr; value = bgunCreateModelCmdList(&hand->gunmodel, player->gunctrl.gunmodeldef->rootnode, (uintptr_t *) player->gunctrl.memloadptr); diff --git a/src/include/types.h b/src/include/types.h index 3b761854c..bfc30039a 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -2306,7 +2306,7 @@ struct hand { /*0x0dbc*/ u32 fspare7; /*0x0dc0*/ u32 fspare8; /*0x0dc4*/ struct abmag abmag; - /*0x0dcc*/ s32 *unk0dcc; + /*0x0dcc*/ uintptr_t *unk0dcc; /*0x0dd0*/ uintptr_t *unk0dd0; /*0x0dd4*/ s32 unk0dd4; /*0x0dd8*/ Mtxf *unk0dd8;