fix a lot of warning in code (#598)

* Fix warnings
* Fix building
This commit is contained in:
coco875
2024-04-16 18:00:08 +02:00
committed by GitHub
parent d9c1ebb626
commit 9ac20c80b8
58 changed files with 893 additions and 901 deletions
+28 -27
View File
@@ -33,6 +33,7 @@
#include "menus.h"
#include "data/other_textures.h"
#include "data/some_data.h"
#include "memory.h"
//! @todo unused?
f32 D_800E43B0[] = {
@@ -67,7 +68,7 @@ Vtx D_800E44B0[] = {
{{{ -24, 20, 0}, 0, { 3008, 2496}, { 0xFF, 0xFF, 0xFF, 0xFF}}},
};
u8 *gItemWindowTLUTs[] = {
u16 *gItemWindowTLUTs[] = {
common_tlut_item_window_none, common_tlut_item_window_banana, common_tlut_item_window_banana_bunch, common_tlut_item_window_green_shell,
common_tlut_item_window_triple_green_shell, common_tlut_item_window_red_shell, common_tlut_item_window_triple_red_shell, common_tlut_item_window_blue_shell,
common_tlut_item_window_thunder_bolt, common_tlut_item_window_fake_item_box, common_tlut_item_window_star, common_tlut_item_window_boo,
@@ -81,11 +82,11 @@ u8 *gItemWindowTextures[] = {
common_texture_item_window_mushroom, common_texture_item_window_double_mushroom, common_texture_item_window_triple_mushroom, common_texture_item_window_super_mushroom
};
u8 *gHudLapTextures[] = {
u16 *gHudLapTextures[] = {
common_texture_hud_lap_1_on_3, common_texture_hud_lap_2_on_3, common_texture_hud_lap_3_on_3
};
u8 *gPortraitTLUTs[] = {
u16 *gPortraitTLUTs[] = {
common_tlut_portrait_mario, common_tlut_portrait_luigi, common_tlut_portrait_yoshi, common_tlut_portrait_toad,
common_tlut_portrait_donkey_kong, common_tlut_portrait_wario, common_tlut_portrait_peach, common_tlut_portrait_bowser
};
@@ -753,7 +754,7 @@ UNUSED void func_800734D4() {
void update_neon_texture(s32 objectIndex) {
// I have no idea why this typecast works
gObjectList[objectIndex].activeTLUT = (u32*)gObjectList[objectIndex].tlutList + (gObjectList[objectIndex].itemDisplay * 128);
gObjectList[objectIndex].activeTLUT = (u8*)((u32*)gObjectList[objectIndex].tlutList + (gObjectList[objectIndex].itemDisplay * 128));
gObjectList[objectIndex].activeTexture = gObjectList[objectIndex].textureList;
}
@@ -1233,7 +1234,7 @@ void func_8007466C(s32 objectIndex, s32 arg1) {
if ((gObjectList[objectIndex].status & 1) != 0) {
// I have no idea why this typecase works
gObjectList[objectIndex].activeTLUT = (u32*)gObjectList[objectIndex].tlutList + (gObjectList[objectIndex].unk_0D3 << 7) ;
gObjectList[objectIndex].activeTLUT = (u8*) ((u32*)gObjectList[objectIndex].tlutList + (gObjectList[objectIndex].unk_0D3 << 7)) ;
gObjectList[objectIndex].status ^= 2;
phi_a1 = 0;
if ((gObjectList[objectIndex].status & 2) != 0) {
@@ -1584,7 +1585,7 @@ void func_80075714(s32 objectIndex) {
}
void update_train_smoke(void) {
s32 pad[2];
UNUSED s32 pad[2];
s32 count;
s32 i;
s32 temp_a0;
@@ -1705,7 +1706,7 @@ void func_80075B84(s32 objectIndex) {
}
void update_ferries_smoke_particle(void) {
s32 pad[2];
UNUSED s32 pad[2];
s32 count;
s32 i;
s32 temp_a0;
@@ -1882,8 +1883,8 @@ void func_8007634C(s32 objectIndex) {
Objects *temp_v0;
temp_v0 = &gObjectList[objectIndex];
temp_v0->activeTexture = common_texture_particle_smoke;
temp_v0->textureList = common_texture_particle_smoke;
temp_v0->activeTexture = common_texture_particle_smoke[0];
temp_v0->textureList = common_texture_particle_smoke[0];
temp_v0->primAlpha = 0x00FF;
set_obj_orientation(objectIndex, 0U, 0U, 0U);
set_obj_origin_offset(objectIndex, 0.0f, 0.0f, 0.0f);
@@ -2018,7 +2019,7 @@ s32 func_80076828(Vec3s arg0, s32 arg1) {
}
void func_80076884(s32 arg0) {
s32 stackPadding0;
UNUSED s32 stackPadding0;
s32 i;
s32 temp_v0;
s16 *var_s2;
@@ -2052,8 +2053,8 @@ void func_80076958(s32 objectIndex) {
Objects *temp_v0;
temp_v0 = &gObjectList[objectIndex];
temp_v0->activeTexture = common_texture_particle_smoke;
temp_v0->textureList = common_texture_particle_smoke;
temp_v0->activeTexture = common_texture_particle_smoke[0];
temp_v0->textureList = common_texture_particle_smoke[0];
temp_v0->primAlpha = 0x00FF;
set_obj_orientation(objectIndex, 0U, 0U, 0U);
set_obj_origin_offset(objectIndex, 0.0f, 0.0f, 0.0f);
@@ -2145,8 +2146,8 @@ void init_object_smoke_paticle(s32 objectIndex, Vec3f arg1, s16 arg2) {
init_object(objectIndex, (s32) arg2);
temp_v0 = &gObjectList[objectIndex];
temp_v0->unk_0D5 = 0x0A;
temp_v0->activeTexture = common_texture_particle_smoke;
temp_v0->textureList = common_texture_particle_smoke;
temp_v0->activeTexture = common_texture_particle_smoke[0];
temp_v0->textureList = common_texture_particle_smoke[0];
temp_v0->sizeScaling = 0.3f;
set_obj_origin_pos(objectIndex, arg1[0], arg1[1], arg1[2]);
temp_v0->type = 0x00FF;
@@ -2221,8 +2222,8 @@ void init_object_smoke_particle(s32 objectIndex, s32 flameIndex) {
init_object(objectIndex, 3);
gObjectList[objectIndex].unk_0D5 = 0xB;
gObjectList[objectIndex].activeTexture = common_texture_particle_smoke;
gObjectList[objectIndex].textureList = common_texture_particle_smoke;
gObjectList[objectIndex].activeTexture = common_texture_particle_smoke[0];
gObjectList[objectIndex].textureList = common_texture_particle_smoke[0];
gObjectList[objectIndex].sizeScaling = 0.8f;
gObjectList[objectIndex].origin_pos[0] = (f32)*(gTorchSpawns + (flameIndex * 3) + 0) * xOrientation;
@@ -2381,8 +2382,8 @@ void init_object_leaf_particle(s32 objectIndex, Vec3f arg1, s32 num) {
init_object(objectIndex, 0);
gObjectList[objectIndex].unk_0D5 = 7;
gObjectList[objectIndex].activeTLUT = (u32 *) common_texture_particle_leaf;
gObjectList[objectIndex].tlutList = (u32 *) common_texture_particle_leaf;
gObjectList[objectIndex].activeTLUT = (u8*) common_texture_particle_leaf;
gObjectList[objectIndex].tlutList = (u8*) common_texture_particle_leaf;
gObjectList[objectIndex].sizeScaling = 0.1f;
gObjectList[objectIndex].unk_044 = arg1[1];
switch (gCurrentCourseId) {
@@ -3045,7 +3046,7 @@ void init_obj_lakitu_red_flag(s32 objectIndex, s32 playerIndex) {
Objects *temp_v0;
func_800791F0(objectIndex, playerIndex);
init_texture_object(objectIndex, common_tlut_lakitu_checkered_flag, gTextureLakituCheckeredFlag01, 0x48U, (u16) 0x00000038);
init_texture_object(objectIndex, (u8*) common_tlut_lakitu_checkered_flag, gTextureLakituCheckeredFlag01, 0x48U, (u16) 0x00000038);
temp_v0 = &gObjectList[objectIndex];
temp_v0->activeTexture = D_8018C028;
temp_v0->vertex = common_vtx_also_lakitu;
@@ -3122,7 +3123,7 @@ void func_8007993C(s32 objectIndex, Player *player) {
void init_obj_lakitu_red_flag_fishing(s32 objectIndex, s32 arg1) {
func_800791F0(objectIndex, arg1);
init_texture_object(objectIndex, common_tlut_lakitu_fishing, gTextureLakituFishing1, 0x38U, (u16) 0x00000048);
init_texture_object(objectIndex, (u8*) common_tlut_lakitu_fishing, gTextureLakituFishing1, 0x38U, (u16) 0x00000048);
gObjectList[objectIndex].vertex = D_0D005F30;
gObjectList[objectIndex].sizeScaling = 0.15f;
func_80086E70(objectIndex);
@@ -3295,7 +3296,7 @@ void func_8007A060(s32 objectIndex, s32 playerIndex) {
Objects *temp_v0;
func_800791F0(objectIndex, playerIndex);
init_texture_object(objectIndex, common_tlut_lakitu_second_lap, gTextureLakituSecondLap01, 0x48U, (u16) 0x00000038);
init_texture_object(objectIndex, (u8*) common_tlut_lakitu_second_lap, gTextureLakituSecondLap01, 0x48U, (u16) 0x00000038);
temp_v0 = &gObjectList[objectIndex];
temp_v0->activeTexture = D_8018C028;
temp_v0->vertex = common_vtx_also_lakitu;
@@ -3343,7 +3344,7 @@ void func_8007A228(s32 objectIndex, s32 playerIndex) {
Objects *temp_v0;
func_800791F0(objectIndex, playerIndex);
init_texture_object(objectIndex, common_tlut_lakitu_final_lap, gTextureLakituFinalLap01, 0x48U, (u16) 0x00000038);
init_texture_object(objectIndex, (u8*) common_tlut_lakitu_final_lap, gTextureLakituFinalLap01, 0x48U, (u16) 0x00000038);
temp_v0 = &gObjectList[objectIndex];
temp_v0->activeTexture = D_8018C028;
temp_v0->vertex = common_vtx_also_lakitu;
@@ -3390,7 +3391,7 @@ void update_object_lakitu_final_lap(s32 objectIndex, s32 playerIndex) {
void func_8007A3F0(s32 objectIndex, s32 arg1) {
f32 var = 5000.0f;
func_800791F0(objectIndex, arg1);
init_texture_object(objectIndex, common_tlut_lakitu_reverse, gTextureLakituReverse01, 0x48U, (u16) 0x00000038);
init_texture_object(objectIndex, (u8*) common_tlut_lakitu_reverse, gTextureLakituReverse01, 0x48U, (u16) 0x00000038);
gObjectList[objectIndex].activeTexture = D_8018C028;
gObjectList[objectIndex].vertex = common_vtx_also_lakitu;
gObjectList[objectIndex].pos[2] = var;
@@ -3585,7 +3586,7 @@ void consume_item(s32 playerId) {
player = &gPlayerOne[playerId];
objectIndex = gItemWindowObjectByPlayerId[playerId];
itemWindow = &gObjectList[objectIndex];
itemWindow = (ItemWindowObjects *) &gObjectList[objectIndex];
if (itemWindow->currentItem == ITEM_SUPER_MUSHROOM) {
if (func_80072354(objectIndex, 2) != 0) {
func_800722A4(objectIndex, 2);
@@ -3670,7 +3671,7 @@ s16 func_8007AFB0(s32 objectIndex, s32 arg1) {
}
s32 func_8007B040(s32 objectIndex, s32 playerId) {
s16 stackPadding;
UNUSED s16 stackPadding;
s32 temp_v1;
s32 var_a3;
s32 var_t3;
@@ -3942,7 +3943,7 @@ void func_8007B34C(s32 playerId) {
}
}
}
temp_t0->activeTLUT = gItemWindowTLUTs[temp_t0->itemDisplay];
temp_t0->activeTLUT = (u8*) gItemWindowTLUTs[temp_t0->itemDisplay];
temp_t0->activeTexture = gItemWindowTextures[temp_t0->itemDisplay];
sp38->currentItemCopy = temp_t0->type;
}
@@ -6487,7 +6488,7 @@ void func_8008275C(s32 objectIndex) {
case 2:
func_8008B78C(objectIndex);
vec3f_copy(gObjectList[objectIndex].unk_01C, gObjectList[objectIndex].pos);
func_8000D940(gObjectList[objectIndex].origin_pos, &gObjectList[objectIndex].unk_0C6, gObjectList[objectIndex].unk_034, 0.0f, 0);
func_8000D940(gObjectList[objectIndex].origin_pos, (s16 *) &gObjectList[objectIndex].unk_0C6, gObjectList[objectIndex].unk_034, 0.0f, 0);
gObjectList[objectIndex].offset[0] *= 2.0;
gObjectList[objectIndex].offset[1] *= 2.5;
gObjectList[objectIndex].offset[2] *= 2.0;