Merge pull request #19 from gheskett/compiler-warnings

Compiler warnings
This commit is contained in:
Reonu authored and GitHub committed 2021-07-18 11:39:10 +01:00
commit ddbb78c638
53 files changed
+116 -92

No files matched your search

+1
View File
@@ -526,6 +526,7 @@ $(CRASH_TEXTURE_C_FILES): TEXTURE_ENCODING := u32
ifeq ($(COMPILER),gcc)
$(BUILD_DIR)/src/libz/%.o: OPT_FLAGS := -Os
$(BUILD_DIR)/src/libz/%.o: CFLAGS += -Wno-implicit-fallthrough -Wno-unused-parameter -Wno-pointer-sign
endif
ifeq ($(VERSION),eu)
+1 -1
View File
@@ -180,7 +180,7 @@ static const Lights1 bobomb_seg8_lights_08022E00 = gdSPDefLights1(
);
// Unreferenced light group
static const Lights1 bobomb_lights_unused = gdSPDefLights1(
UNUSED static const Lights1 bobomb_lights_unused = gdSPDefLights1(
0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x28, 0x28, 0x28
);
+2 -2
View File
@@ -52,13 +52,13 @@ ALIGNED8 static const Texture bowser_seg6_texture_06025C38[] = {
// unreferenced, seen in pre-Spaceworld 1995 B-roll footage build
// 0x06026438
ALIGNED8 static const Texture bowser_seg6_texture_06026438[] = {
UNUSED ALIGNED8 static const Texture bowser_seg6_texture_06026438[] = {
#include "actors/bowser/bowser_blue_eye_unused.rgba16.inc.c"
};
// unreferenced (stubbed texture? possibly original texture for mouth)
// 0x06027438
ALIGNED8 static const Texture bowser_seg6_texture_06027438[] = {
UNUSED ALIGNED8 static const Texture bowser_seg6_texture_06027438[] = {
#include "actors/bowser/bowser_mouth_unused.rgba16.inc.c"
};
+1 -1
View File
@@ -14,7 +14,7 @@ ALIGNED8 static const Texture bubba_seg5_texture_05000008[] = {
// unused eye texture, assumed leftover from when actor file was copied from bub
// 0x05000408
ALIGNED8 static const Texture bubba_seg5_texture_05000408[] = {
UNUSED ALIGNED8 static const Texture bubba_seg5_texture_05000408[] = {
#include "actors/bubba/bubba_eyes_unused.rgba16.inc.c"
};
+1 -1
View File
@@ -23,7 +23,7 @@ ALIGNED8 static const Texture chair_seg5_texture_05004060[] = {
// unreferenced
// 0x05004460
ALIGNED8 static const Texture chair_seg5_texture_05004460[] = {
UNUSED ALIGNED8 static const Texture chair_seg5_texture_05004460[] = {
#include "actors/chair/chair_surface_unused.rgba16.inc.c"
};
+1 -1
View File
@@ -41,7 +41,7 @@ ALIGNED8 static const Texture haunted_cage_seg5_texture_0500DA88[] = {
// also could be some sort of shader mask from much earlier in development, considering
// Big Boo's Haunt was a very very early level.
// 0x0500E288
ALIGNED8 static const Texture haunted_cage_seg5_texture_0500E288[] = {
UNUSED ALIGNED8 static const Texture haunted_cage_seg5_texture_0500E288[] = {
#include "actors/haunted_cage/bbh_cage_garbage.rgba16.inc.c"
};
+5 -5
View File
@@ -1,19 +1,19 @@
// Heave Ho
// Unreferenced light group
static const Lights1 heave_ho_lights_unused1 = gdSPDefLights1(
UNUSED static const Lights1 heave_ho_lights_unused1 = gdSPDefLights1(
0x2c, 0x2c, 0x2c,
0xb2, 0xb2, 0xb2, 0x28, 0x28, 0x28
);
// Unreferenced light group
static const Lights1 heave_ho_lights_unused2 = gdSPDefLights1(
UNUSED static const Lights1 heave_ho_lights_unused2 = gdSPDefLights1(
0x3f, 0x38, 0x00,
0xff, 0xe3, 0x00, 0x28, 0x28, 0x28
);
// Unreferenced light group
static const Lights1 heave_ho_lights_unused3 = gdSPDefLights1(
UNUSED static const Lights1 heave_ho_lights_unused3 = gdSPDefLights1(
0x3f, 0x00, 0x00,
0xff, 0x00, 0x00, 0x28, 0x28, 0x28
);
@@ -31,13 +31,13 @@ static const Lights1 heave_ho_seg5_lights_0500E980 = gdSPDefLights1(
);
// Unreferenced light group
static const Lights1 heave_ho_lights_unused4 = gdSPDefLights1(
UNUSED static const Lights1 heave_ho_lights_unused4 = gdSPDefLights1(
0x3b, 0x38, 0x21,
0xec, 0xe3, 0x84, 0x28, 0x28, 0x28
);
// Unreferenced light group
static const Lights1 heave_ho_lights_unused5 = gdSPDefLights1(
UNUSED static const Lights1 heave_ho_lights_unused5 = gdSPDefLights1(
0x32, 0x32, 0x32,
0xc8, 0xc8, 0xc8, 0x28, 0x28, 0x28
);
+5 -5
View File
@@ -31,12 +31,12 @@ UNUSED static const Lights1 king_bobomb_lights_unused5 = gdSPDefLights1(
);
// 0x05000078
ALIGNED8 static const Texture king_bobomb_seg5_texture_05000078[] = {
UNUSED ALIGNED8 static const Texture king_bobomb_seg5_texture_05000078[] = {
#include "actors/king_bobomb/bob-omb_buddy_left_side_unused.rgba16.inc.c"
};
// 0x05001078
ALIGNED8 static const Texture king_bobomb_seg5_texture_05001078[] = {
UNUSED ALIGNED8 static const Texture king_bobomb_seg5_texture_05001078[] = {
#include "actors/king_bobomb/bob-omb_buddy_right_side_unused.rgba16.inc.c"
};
@@ -46,7 +46,7 @@ ALIGNED8 static const Texture king_bobomb_seg5_texture_05002078[] = {
};
// 0x05002878
ALIGNED8 static const Texture king_bobomb_seg5_texture_05002878[] = {
UNUSED ALIGNED8 static const Texture king_bobomb_seg5_texture_05002878[] = {
#include "actors/king_bobomb/king_bob-omb_body_unused.rgba16.inc.c"
};
@@ -56,7 +56,7 @@ ALIGNED8 static const Texture king_bobomb_seg5_texture_05004878[] = {
};
// 0x05005078 - Unused
ALIGNED8 static const Texture king_bobomb_seg5_texture_05005078[] = {
UNUSED ALIGNED8 static const Texture king_bobomb_seg5_texture_05005078[] = {
#include "actors/king_bobomb/king_bob-omb_eyes_blink.rgba16.inc.c"
};
@@ -71,7 +71,7 @@ ALIGNED8 static const Texture king_bobomb_seg5_texture_05006078[] = {
};
// 0x05006478
ALIGNED8 static const Texture king_bobomb_seg5_texture_05006478[] = {
UNUSED ALIGNED8 static const Texture king_bobomb_seg5_texture_05006478[] = {
#include "actors/king_bobomb/bob-omb_buddy_body_unused.rgba16.inc.c"
};
+3 -3
View File
@@ -1,19 +1,19 @@
// Koopa Flag
// 0x06000000
static const Lights1 koopa_flag_seg6_lights_06000000 = gdSPDefLights1(
UNUSED static const Lights1 koopa_flag_seg6_lights_06000000 = gdSPDefLights1(
0x00, 0x1b, 0x00,
0x00, 0x6e, 0x00, 0x28, 0x28, 0x28
);
// 0x06000018
static const Lights1 koopa_flag_seg6_lights_06000018 = gdSPDefLights1(
UNUSED static const Lights1 koopa_flag_seg6_lights_06000018 = gdSPDefLights1(
0x3f, 0x39, 0x15,
0xff, 0xe6, 0x57, 0x28, 0x28, 0x28
);
// 0x06000030
static const Lights1 koopa_flag_seg6_lights_06000030 = gdSPDefLights1(
UNUSED static const Lights1 koopa_flag_seg6_lights_06000030 = gdSPDefLights1(
0x2b, 0x15, 0x01,
0xac, 0x54, 0x05, 0x28, 0x28, 0x28
);
+1 -1
View File
@@ -1,7 +1,7 @@
// Lakitu (Cameraman)
// 0x06000000
ALIGNED8 static const Texture lakitu_seg6_texture_06000000[] = {
UNUSED ALIGNED8 static const Texture lakitu_seg6_texture_06000000[] = {
#include "actors/lakitu_cameraman/lakitu_cameraman_cloud_face_unused.rgba16.inc.c"
};
+1 -1
View File
@@ -20,7 +20,7 @@ UNUSED static const Lights1 lakitu_enemy_lights_unused2 = gdSPDefLights1(
// Unreferenced texture
// 0x0500ECE0
ALIGNED8 static const Texture lakitu_enemy_seg5_texture_0500ECE0[] = {
UNUSED ALIGNED8 static const Texture lakitu_enemy_seg5_texture_0500ECE0[] = {
#include "actors/lakitu_enemy/lakitu_enemy_cloud_face_unused.rgba16.inc.c"
};
+1 -1
View File
@@ -13,7 +13,7 @@ static const Lights1 manta_seg5_lights_05001770 = gdSPDefLights1(
);
// Unreferenced light group
static const Lights1 manta_lights_unused = gdSPDefLights1(
UNUSED static const Lights1 manta_lights_unused = gdSPDefLights1(
0x3f, 0x3f, 0x35,
0xff, 0xff, 0xd7, 0x28, 0x28, 0x28
);
+2 -2
View File
@@ -78,13 +78,13 @@ ALIGNED8 static const Texture mario_texture_eyes_closed[] = {
// Unreferenced
// 0x04004890
ALIGNED8 static const Texture mario_texture_eyes_closed_unused1[] = {
UNUSED ALIGNED8 static const Texture mario_texture_eyes_closed_unused1[] = {
#include "actors/mario/mario_eyes_closed_unused_0.rgba16.inc.c"
};
// Unreferenced
// 0x04005090
ALIGNED8 static const Texture mario_texture_eyes_closed_unused2[] = {
UNUSED ALIGNED8 static const Texture mario_texture_eyes_closed_unused2[] = {
#include "actors/mario/mario_eyes_closed_unused_1.rgba16.inc.c"
};
+1 -1
View File
@@ -237,7 +237,7 @@ static const Vtx wiggler_seg5_vertex_0500D228[] = {
};
// Unused vertices? what are these? [D318]
static const Vtx wiggler_seg5_vertex_0500D318[] = {
UNUSED static const Vtx wiggler_seg5_vertex_0500D318[] = {
{{{ 92, 51, 0}, 0, { 0, 0}, {0x5d, 0x55, 0x00, 0x00}}},
{{{ 87, 46, -28}, 0, { 0, 0}, {0x5a, 0x53, 0xe1, 0x00}}},
{{{ 49, 88, -28}, 0, { 0, 0}, {0x5a, 0x53, 0xe1, 0x00}}},
+1 -1
View File
@@ -177,7 +177,7 @@ static const Vtx bitfs_seg7_vertex_07003340[] = {
// TODO: what is this?
// Possibly vertices for a perfect triangle, but flag seems to be used here.
// 0x070033B0 - 0x070033E0
static const s16 bitfs_seg7_todo_070033B0[] = {
UNUSED static const s16 bitfs_seg7_todo_070033B0[] = {
0x0080, 0x0100, 0x0000, 0x0000, 0x03de, 0x0000, 0xFFFF, 0xFFFF,
0xFF81, 0x0100, 0x0000, 0x0000, 0xFBE4, 0x0000, 0xFFFF, 0xFFFF,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x07DA, 0xFFFF, 0xFFFF,
+2 -2
View File
@@ -14,7 +14,7 @@ ALIGNED8 static const Texture lll_seg7_texture_07001000[] = {
};
// 0x07001800 - 0x07002000
ALIGNED8 static const Texture lll_seg7_texture_07001800[] = {
UNUSED ALIGNED8 static const Texture lll_seg7_texture_07001800[] = {
#include "levels/lll/3.rgba16.inc.c"
};
@@ -34,7 +34,7 @@ ALIGNED8 static const Texture lll_seg7_texture_07003000[] = {
};
// 0x07003800 - 0x07004000
ALIGNED8 static const Texture lll_seg7_texture_07003800[] = {
UNUSED ALIGNED8 static const Texture lll_seg7_texture_07003800[] = {
#include "levels/lll/7.rgba16.inc.c"
};
+1 -1
View File
@@ -19,7 +19,7 @@ ALIGNED8 static const Texture ssl_seg7_texture_07001800[] = {
};
// 0x07002000 - 0x07002800
ALIGNED8 static const Texture ssl_seg7_texture_07002000[] = {
UNUSED ALIGNED8 static const Texture ssl_seg7_texture_07002000[] = {
#include "levels/ssl/4.rgba16.inc.c"
};
@@ -126,12 +126,12 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) {
u8 sameSound;
u8 cmd; // a0 sp3E, EU s2
u8 cmdSemitone; // sp3D, t0
u16 sp3A; // t2, a0, a1
u16 sp3A = 0; // t2, a0, a1
f32 tuning; // f0
s32 vel; // sp30, t3
s32 vel = 0; // sp30, t3
s32 usedSemitone; // a1
f32 freqScale; // sp28, f0
f32 sp24;
f32 freqScale = 0.0f; // sp28, f0
f32 sp24 = 0.0f;
f32 temp_f12;
f32 temp_f2;
+4 -2
View File
@@ -190,6 +190,7 @@ s8 get_vibrato_pitch_change(struct VibratoState *vib) {
switch (index & 0x30) {
case 0x10:
index = 31 - index;
// fall through
case 0x00:
return vib->curve[index];
@@ -385,8 +386,8 @@ s32 adsr_update(struct AdsrState *adsr) {
adsr->state = ADSR_STATE_HANG;
break;
}
// fallthrough
}
// fall through
case ADSR_STATE_START_LOOP:
adsr->envIndex = 0;
@@ -394,11 +395,12 @@ s32 adsr_update(struct AdsrState *adsr) {
adsr->currentHiRes = adsr->current << 0x10;
#endif
adsr->state = ADSR_STATE_LOOP;
// fallthrough
#ifdef VERSION_SH
restart:
#endif
// fall through
case ADSR_STATE_LOOP:
adsr->delay = BSWAP16(adsr->envelope[adsr->envIndex].delay);
switch (adsr->delay) {
+2 -2
View File
@@ -409,9 +409,9 @@ void *alloc_bank_or_seq(struct SoundMultiPool *arg0, s32 arg1, s32 size, s32 arg
#endif
u32 nullID = -1;
UNUSED s32 i;
u8 *table;
u8 *table = NULL;
#ifndef VERSION_SH
u8 isSound;
u8 isSound = FALSE;
#endif
#if defined(VERSION_JP) || defined(VERSION_US)
u16 firstVal;
+4 -4
View File
@@ -764,8 +764,8 @@ u8 get_missing_bank(u32 seqId, s32 *nonNullCount, s32 *nullCount) {
}
struct AudioBank *load_banks_immediate(s32 seqId, u8 *outDefaultBank) {
void *ret;
u32 bankId;
void *ret = NULL;
u32 bankId = 0;
u16 offset;
u8 i;
@@ -945,10 +945,10 @@ void audio_init() {
// It seems boot.s doesn't clear the .bss area for audio, so do it here.
i = 0;
lim3 = ((uintptr_t) &gAudioGlobalsEndMarker - (uintptr_t) &gAudioGlobalsStartMarker) / 8;
ptr64 = &gAudioGlobalsStartMarker - 1;
ptr64 = &gAudioGlobalsStartMarker;
for (k = lim3; k >= 0; k--) {
i++;
ptr64[i] = 0;
i++;
}
#endif
+2 -2
View File
@@ -1493,7 +1493,7 @@ void sequence_channel_process_script(struct SequenceChannel *seqChannel) {
u8 loBits;
u16 sp5A;
s32 sp38;
s8 value;
s8 value = 0;
s32 i;
u8 *seqData;
@@ -2235,7 +2235,7 @@ void sequence_player_process_sequence(struct SequencePlayer *seqPlayer) {
#endif
u8 loBits;
u8 temp;
s32 value;
s32 value = 0;
s32 i;
u16 u16v;
u8 *seqData;
+8 -8
View File
@@ -35,7 +35,7 @@
aSetBuffer(pkt, 0, 0, c + DMEM_ADDR_WET_RIGHT_CH, d); \
aSaveBuffer(pkt, VIRTUAL_TO_PHYSICAL2(gSynthesisReverb.ringBuffer.right + (off)));
#define ALIGN(val, amnt) (((val) + (1 << amnt) - 1) & ~((1 << amnt) - 1))
#define AUDIO_ALIGN(val, amnt) (((val) + (1 << amnt) - 1) & ~((1 << amnt) - 1))
struct VolumeChange {
u16 sourceLeft;
@@ -379,7 +379,7 @@ u64 *synthesis_resample_and_mix_reverb(u64 *cmd, s32 bufLen, s16 reverbIndex, s1
aMix(cmd++, 0, 0x8000 + gSynthesisReverbs[reverbIndex].reverbGain, DMEM_ADDR_WET_LEFT_CH, DMEM_ADDR_WET_LEFT_CH);
} else {
startPad = (item->startPos % 8u) * 2;
paddedLengthA = ALIGN(startPad + item->lengthA, 4);
paddedLengthA = AUDIO_ALIGN(startPad + item->lengthA, 4);
cmd = synthesis_load_reverb_ring_buffer(cmd, DMEM_ADDR_RESAMPLED, (item->startPos - startPad / 2), DEFAULT_LEN_1CH, reverbIndex);
if (item->lengthB != 0) {
@@ -539,7 +539,7 @@ u64 *synthesis_do_one_audio_update(s16 *aiBuf, s32 bufLen, u64 *cmd, s32 updateI
// Same as above but upsample the previously downsampled samples used for reverb first
temp = 0; //! jesus christ
t4 = (v1->startPos & 7) * 2;
ra = ALIGN(v1->lengthA + t4, 4);
ra = AUDIO_ALIGN(v1->lengthA + t4, 4);
aSetLoadBufferPair(cmd++, 0, v1->startPos - t4 / 2);
if (v1->lengthB != 0) {
// Ring buffer wrapped
@@ -606,11 +606,11 @@ u64 *synthesis_process_notes(s16 *aiBuf, s32 bufLen, u64 *cmd) {
UNUSED u8 pad7[0x0c]; // sp100
UNUSED s32 tempBufLen;
#ifdef VERSION_EU
s32 sp130; //sp128, sp104
s32 sp130 = 0; //sp128, sp104
UNUSED u32 pad9;
#else
UNUSED u32 pad9;
s32 sp130; //sp128, sp104
s32 sp130 = 0; //sp128, sp104
#endif
s32 nAdpcmSamplesProcessed; // signed required for US
s32 t0;
@@ -891,7 +891,7 @@ u64 *synthesis_process_notes(s16 *aiBuf, s32 bufLen, u64 *cmd) {
VIRTUAL_TO_PHYSICAL2(synthesisState->synthesisBuffers->adpcmdecState));
sp130 = s2 * 2;
} else {
s5Aligned = ALIGN(s5, 5);
s5Aligned = AUDIO_ALIGN(s5, 5);
aSetBuffer(cmd++, 0, DMEM_ADDR_COMPRESSED_ADPCM_DATA + a3,
DMEM_ADDR_UNCOMPRESSED_NOTE + s5Aligned, s0 * 2);
aADPCMdec(cmd++, flags,
@@ -905,9 +905,9 @@ u64 *synthesis_process_notes(s16 *aiBuf, s32 bufLen, u64 *cmd) {
aADPCMdec(cmd++, flags, VIRTUAL_TO_PHYSICAL2(note->synthesisBuffers->adpcmdecState));
sp130 = s2 * 2;
} else {
aSetBuffer(cmd++, 0, DMEM_ADDR_COMPRESSED_ADPCM_DATA + a3, DMEM_ADDR_UNCOMPRESSED_NOTE + ALIGN(s5, 5), s0 * 2);
aSetBuffer(cmd++, 0, DMEM_ADDR_COMPRESSED_ADPCM_DATA + a3, DMEM_ADDR_UNCOMPRESSED_NOTE + AUDIO_ALIGN(s5, 5), s0 * 2);
aADPCMdec(cmd++, flags, VIRTUAL_TO_PHYSICAL2(note->synthesisBuffers->adpcmdecState));
aDMEMMove(cmd++, DMEM_ADDR_UNCOMPRESSED_NOTE + ALIGN(s5, 5) + (s2 * 2), DMEM_ADDR_UNCOMPRESSED_NOTE + s5, (nSamplesInThisIteration) * 2);
aDMEMMove(cmd++, DMEM_ADDR_UNCOMPRESSED_NOTE + AUDIO_ALIGN(s5, 5) + (s2 * 2), DMEM_ADDR_UNCOMPRESSED_NOTE + s5, (nSamplesInThisIteration) * 2);
}
#endif
+1 -1
View File
@@ -595,7 +595,7 @@ u32 get_area_terrain_size(s16 *data) {
*/
void load_area_terrain(s16 index, s16 *data, s8 *surfaceRooms, s16 *macroObjects) {
s16 terrainLoadType;
s16 *vertexData;
s16 *vertexData = NULL;
UNUSED s32 unused;
// Initialize the data for this.
+1 -1
View File
@@ -864,7 +864,7 @@ void bhv_boo_in_castle_loop(void) {
}
void bhv_boo_staircase(void) {
f32 targetY;
f32 targetY = 0.0f;
switch (o->oBehParams2ndByte) {
case 1:
+4 -3
View File
@@ -258,7 +258,7 @@ void bhv_free_bowling_ball_init(void) {
}
void bhv_free_bowling_ball_roll_loop(void) {
s16 collisionFlags = object_step();
/*s16 collisionFlags = */object_step();
bowling_ball_set_hitbox();
if (o->oForwardVel > 10.0f) {
@@ -266,8 +266,9 @@ void bhv_free_bowling_ball_roll_loop(void) {
cur_obj_play_sound_1(SOUND_ENV_UNKNOWN2);
}
if ((collisionFlags & OBJ_COL_FLAG_GROUNDED) && !(collisionFlags & OBJ_COL_FLAGS_LANDED))
cur_obj_play_sound_2(SOUND_GENERAL_QUIET_POUND1_LOWPRIO);
/* Always false, commented out to suppress compiler warnings */
// if ((collisionFlags & OBJ_COL_FLAG_GROUNDED) && !(collisionFlags & OBJ_COL_FLAGS_LANDED))
// cur_obj_play_sound_2(SOUND_GENERAL_QUIET_POUND1_LOWPRIO);
if (!is_point_within_radius_of_mario(o->oPosX, o->oPosY, o->oPosZ, 6000)) {
o->header.gfx.node.flags |= GRAPH_RENDER_INVISIBLE;
+4 -1
View File
@@ -1564,8 +1564,11 @@ void bowser_free_update(void) {
struct Object *platform;
UNUSED f32 floorHeight;
#ifdef PLATFORM_DISPLACEMENT_2
s16 tmpOFaceAngleYaw = (s16) o->oFaceAngleYaw;
if ((platform = o->platform) != NULL) {
apply_platform_displacement(&sBowserDisplacementInfo, &o->oPosX, &o->oFaceAngleYaw, platform);
// NOTE: This function was at one point using '&o->oFaceAngleYaw', which is a s32 address. Should tmpOFaceAngleYaw be using the first 16 bits instead, or was that a bug?
apply_platform_displacement(&sBowserDisplacementInfo, &o->oPosX, &tmpOFaceAngleYaw, platform);
o->oFaceAngleYaw = tmpOFaceAngleYaw;
}
#else
if ((platform = o->platform) != NULL) {
+3
View File
@@ -33,6 +33,9 @@ static void fish_spawner_act_spawn(void) {
case FISH_SPAWNER_BP_FEW_CYAN:
model = MODEL_CYAN_FISH; schoolQuantity = 5; minDistToMario = 1500.0f; fishAnimation = cyan_fish_seg6_anims_0600E264;
break;
default:
return;
}
+1 -1
View File
@@ -42,7 +42,7 @@ void bhv_jrb_sliding_box_loop(void) {
struct Surface *sp38;
UNUSED Vec3f sp2C;
Vec3f sp20;
s16 sp1E;
s16 sp1E = 0;
if (o->oJrbSlidingBoxUnkF4 == NULL) {
sp3C = cur_obj_nearest_object_with_behavior(bhvInSunkenShip3);
if (sp3C != NULL) // NULL check only for assignment, not for dereference?
+1
View File
@@ -163,6 +163,7 @@ void bhv_unagi_loop(void) {
break;
case 2:
unagi_act_2();
// fall through
case 3:
unagi_act_3();
break;
+3 -2
View File
@@ -1625,7 +1625,8 @@ s32 update_boss_fight_camera(struct Camera *c, Vec3f focus, Vec3f pos) {
switch (gCurrLevelArea) {
case AREA_BOB:
pos[1] += 125.f;
//! fall through, makes the BoB boss fight camera move up twice as high as it should
// fall through
//! makes the BoB boss fight camera move up twice as high as it should
case AREA_WF:
pos[1] += 125.f;
}
@@ -5127,7 +5128,7 @@ s32 determine_dance_cutscene(UNUSED struct Camera *c) {
* @return `pullResult` or `pushResult` depending on Mario's door action
*/
u8 open_door_cutscene(u8 pullResult, u8 pushResult) {
s16 result;
s16 result = 0;
if (sMarioCamState->action == ACT_PULLING_DOOR) {
result = pullResult;
+2
View File
@@ -455,6 +455,8 @@ void envfx_set_bubble_texture(s32 mode, s16 index) {
imageArr = segmented_to_virtual(&bubble_ptr_0B006848);
frame = 0;
break;
default:
return;
}
gDPSetTextureImage(sGfxCursor++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, *(imageArr + frame));
+1 -1
View File
@@ -72,7 +72,7 @@ struct DmaHandlerList gDemoInputsBuf;
// fillers
UNUSED static u8 sfillerGameInit[0x90];
static s32 sUnusedGameInitValue = 0;
UNUSED static s32 sUnusedGameInitValue = 0;
// General timer that runs as the game starts
u32 gGlobalTimer = 0;
+1 -1
View File
@@ -1020,7 +1020,7 @@ s8 gDialogCourseActNum = 1;
void render_dialog_entries(void) {
void **dialogTable;
struct DialogEntry *dialog;
s8 lowerBound;
s8 lowerBound = 0;
dialogTable = segmented_to_virtual(seg2_dialog_table);
dialog = segmented_to_virtual(dialogTable[gDialogID]);
+2 -2
View File
@@ -492,7 +492,7 @@ void warp_level(void) {
}
void warp_credits(void) {
s32 marioAction;
s32 marioAction = 0;
switch (sWarpDest.nodeId) {
case WARP_NODE_CREDITS_START:
@@ -1144,7 +1144,7 @@ UNUSED static s32 play_mode_unused(void) {
}
s32 update_level(void) {
s32 changeLevel;
s32 changeLevel = FALSE;
switch (sCurrPlayMode) {
case PLAY_MODE_NORMAL:
+7 -5
View File
@@ -61,9 +61,11 @@ s32 lava_boost_on_wall(struct MarioState *m) {
}
s32 check_fall_damage(struct MarioState *m, u32 hardFallAction) {
#ifndef NO_FALL_DAMAGE
f32 fallHeight;
f32 damageHeight;
#ifdef NO_FALL_DAMAGE
return FALSE;
#endif
fallHeight = m->peakHeight - m->pos[1];
@@ -104,7 +106,7 @@ s32 check_fall_damage(struct MarioState *m, u32 hardFallAction) {
}
}
}
#endif
return FALSE;
}
@@ -526,7 +528,7 @@ s32 act_backflip(struct MarioState *m) {
}
s32 act_freefall(struct MarioState *m) {
s32 animation;
s32 animation = 0;
if (m->input & INPUT_B_PRESSED) {
return set_mario_action(m, ACT_DIVE, 0);
@@ -1034,7 +1036,7 @@ s32 act_burning_fall(struct MarioState *m) {
}
s32 act_crazy_box_bounce(struct MarioState *m) {
f32 minSpeed;
f32 minSpeed = 0.0f;
if (m->actionTimer == 0) {
switch (m->actionArg) {
@@ -2069,7 +2071,7 @@ s32 check_common_airborne_cancels(struct MarioState *m) {
}
s32 mario_execute_airborne_action(struct MarioState *m) {
u32 cancel;
u32 cancel = FALSE;
if (check_common_airborne_cancels(m)) {
return TRUE;
+1 -1
View File
@@ -860,7 +860,7 @@ s32 check_common_automatic_cancels(struct MarioState *m) {
}
s32 mario_execute_automatic_action(struct MarioState *m) {
s32 cancel;
s32 cancel = FALSE;
if (check_common_automatic_cancels(m)) {
return TRUE;
+1
View File
@@ -1292,6 +1292,7 @@ s32 act_crawling(struct MarioState *m) {
mario_set_forward_vel(m, 10.0f);
}
//! Possibly unintended missing break
// fall through
case GROUND_STEP_NONE:
align_with_floor(m);
+3 -3
View File
@@ -37,7 +37,7 @@ s32 mario_update_punch_sequence(struct MarioState *m) {
switch (m->actionArg) {
case 0:
play_sound(SOUND_MARIO_PUNCH_YAH, m->marioObj->header.gfx.cameraToObject);
// Fall-through:
// fall through
case 1:
set_mario_animation(m, MARIO_ANIM_FIRST_PUNCH);
if (is_anim_past_end(m)) {
@@ -77,7 +77,7 @@ s32 mario_update_punch_sequence(struct MarioState *m) {
case 3:
play_sound(SOUND_MARIO_PUNCH_WAH, m->marioObj->header.gfx.cameraToObject);
// Fall-through:
// fall through
case 4:
set_mario_animation(m, MARIO_ANIM_SECOND_PUNCH);
if (is_anim_past_end(m)) {
@@ -456,7 +456,7 @@ s32 check_common_object_cancels(struct MarioState *m) {
}
s32 mario_execute_object_action(struct MarioState *m) {
s32 cancel;
s32 cancel = FALSE;
if (check_common_object_cancels(m)) {
return TRUE;
+1 -1
View File
@@ -180,7 +180,7 @@ void play_anim_sound(struct MarioState *m, u32 actionState, s32 animFrame, u32 s
s32 act_start_sleeping(struct MarioState *m) {
#ifndef VERSION_JP
s32 animFrame;
s32 animFrame = 0;
#endif
if (check_common_idle_cancels(m)) {
+2
View File
@@ -969,6 +969,8 @@ Gfx *geo_movtex_update_horizontal(s32 callContext, struct GraphNode *node, UNUSE
case MOVTEX_TREADMILL_SMALL:
movtexVerts = segmented_to_virtual(ttc_movtex_tris_small_surface_treadmill);
break;
default:
return NULL;
}
update_moving_texture_offset(movtexVerts, MOVTEX_ATTR_COLORED_S);
}
+3 -2
View File
@@ -394,7 +394,8 @@ s16 obj_angle_to_object(struct Object *obj1, struct Object *obj2) {
s16 obj_turn_toward_object(struct Object *obj, struct Object *target, s16 angleIndex, s16 turnAmount) {
f32 a, b, c, d;
UNUSED s32 unused;
s16 targetAngle, startAngle;
s16 targetAngle = 0;
s16 startAngle;
switch (angleIndex) {
case O_MOVE_ANGLE_PITCH_INDEX:
@@ -1825,7 +1826,7 @@ void cur_obj_move_standard(s16 steepSlopeAngleDegrees) {
}
}
static s32 cur_obj_within_12k_bounds(void) {
UNUSED static s32 cur_obj_within_12k_bounds(void) {
if (o->oPosX < -12000.0f || 12000.0f < o->oPosX) {
return FALSE;
}
+1 -1
View File
@@ -1019,7 +1019,7 @@ Gfx *display_painting_rippling(struct Painting *painting) {
s16 *neighborTris = segmented_to_virtual(seg2_painting_mesh_neighbor_tris);
s16 numVtx = mesh[0];
s16 numTris = mesh[numVtx * 3 + 1];
Gfx *dlist;
Gfx *dlist = NULL;
// Generate the mesh and its lighting data
painting_generate_mesh(painting, mesh, numVtx);
+1 -1
View File
@@ -30,7 +30,7 @@ s32 set_and_reset_transition_fade_timer(s8 fadeTimer, u8 transTime) {
}
u8 set_transition_color_fade_alpha(s8 fadeType, s8 fadeTimer, u8 transTime) {
u8 time;
u8 time = 0;
switch (fadeType) {
case 0:
+7 -5
View File
@@ -310,7 +310,8 @@ void make_shadow_vertex_at_xyz(Vtx *vertices, s8 index, f32 relX, f32 relY, f32
s16 vtxX = round_float(relX);
s16 vtxY = round_float(relY);
s16 vtxZ = round_float(relZ);
s16 textureX, textureY;
s16 textureX = 0;
s16 textureY = 0;
switch (shadowVertexType) {
case SHADOW_WITH_9_VERTS:
@@ -545,9 +546,6 @@ s8 correct_shadow_solidity_for_animations(s32 isLuigi, u8 initialSolidity, struc
s16 animFrame;
switch (isLuigi) {
case 0:
player = gMarioObject;
break;
case 1:
/**
* This is evidence of a removed second player, likely Luigi.
@@ -559,6 +557,10 @@ s8 correct_shadow_solidity_for_animations(s32 isLuigi, u8 initialSolidity, struc
*/
player = gLuigiObject;
break;
case 0:
default:
player = gMarioObject;
break;
}
animFrame = player->header.gfx.animInfo.animFrame;
@@ -612,7 +614,7 @@ Gfx *create_shadow_player(f32 xPos, f32 yPos, f32 zPos, s16 shadowScale, u8 soli
Vtx *verts;
Gfx *displayList;
struct Shadow shadow;
s8 ret;
s8 ret = 0;
s32 i;
// Update global variables about whether Mario is on a flying carpet.
+2
View File
@@ -12,6 +12,8 @@
#define ABS(val) (((val) < 0 ? (-(val)) : (val)))
#define SQ(val) ((val) * (val))
#ifndef ALIGN
#define ALIGN(VAL_, ALIGNMENT_) (((VAL_) + ((ALIGNMENT_) - 1)) & ~((ALIGNMENT_) - 1))
#endif
#endif // GD_MACROS_H
+1 -1
View File
@@ -668,7 +668,7 @@ void func_80190574(s32 a0, struct ObjJoint *a1, struct ObjJoint *a2, f32 x, f32
UNUSED u32 pad268;
UNUSED u32 sp264 = 0;
UNUSED u32 sp258[3]; // unused vec?
struct GdVec3f sp24C;
struct GdVec3f sp24C = {0, 0, 0};
struct GdVec3f sp240;
UNUSED u32 pad238[2];
s32 sp234; // i?
+1 -1
View File
@@ -21,7 +21,7 @@
*/
// bss
static char sDefSettingsMenuStr[0x100];
UNUSED static char sDefSettingsMenuStr[0x100];
static struct GdVec3f sStaticVec;
UNUSED static struct GdVec3f unusedVec;
static struct ObjGadget *sCurGadgetPtr;
+3 -3
View File
@@ -153,7 +153,7 @@ static s32 sLightId;
static Hilite sHilites[600];
static struct GdVec3f D_801BD758;
static struct GdVec3f D_801BD768; // had to migrate earlier
static u32 D_801BD774;
UNUSED static u32 D_801BD774;
static struct GdObj *sMenuGadgets[9]; // @ 801BD778; d_obj ptr storage? menu?
static struct ObjView *sDebugViews[2]; // Seems to be a list of ObjViews for displaying debug info
static struct GdDisplayList *sStaticDl; // @ 801BD7A8
@@ -171,7 +171,7 @@ static LookAt D_801BE7D0[3];
static OSMesgQueue D_801BE830; // controller msg queue
static OSMesg D_801BE848[10];
UNUSED static u32 unref_801be870[16];
static OSMesgQueue D_801BE8B0;
UNUSED static OSMesgQueue D_801BE8B0;
static OSMesgQueue sGdDMAQueue; // @ 801BE8C8
UNUSED static u32 unref_801be8e0[25];
static OSMesg sGdMesgBuf[1]; // @ 801BE944
@@ -205,7 +205,7 @@ static s32 D_801A86BC = 1;
static s32 D_801A86C0 = 0; // gd_dl id for something?
UNUSED static u32 unref_801a86C4 = 10;
static s32 sMtxParamType = G_MTX_PROJECTION;
static struct GdVec3f D_801A86CC = { 1.0f, 1.0f, 1.0f };
UNUSED static struct GdVec3f D_801A86CC = { 1.0f, 1.0f, 1.0f };
static struct ObjView *sActiveView = NULL; // @ 801A86D8 current view? used when drawing dl
static struct ObjView *sScreenView = NULL; // @ 801A86DC
static struct ObjView *D_801A86E0 = NULL;
+1 -1
View File
@@ -229,7 +229,7 @@ s32 intro_play_its_a_me_mario(void) {
* Returns a level ID after their criteria is met.
*/
s32 lvl_intro_update(s16 arg, UNUSED s32 unusedArg) {
s32 retVar;
s32 retVar = 0;
switch (arg) {
case LVL_INTRO_PLAY_ITS_A_ME_MARIO:
+1 -1
View File
@@ -66,7 +66,7 @@ int main(int argc, char *argv[argc + 1])
return EXIT_FAILURE;
}
fread(data, insize, 1, fin);
size_t fread_result = fread(data, insize, 1, fin);
size_stored = data + outsize - 4;
*size_stored = __bswap_32(atoi(argv[3]));
+1 -1
View File
@@ -1684,7 +1684,7 @@ int main(int argc, char *argv[])
v->file_size = ftell(in) - v->read_start_offset;
fseek(in, v->read_start_offset, SEEK_SET);
v->input = (uint8*)malloc(v->file_size);
fread(v->input, v->file_size, 1, in);
size_t fread_result = fread(v->input, v->file_size, 1, in);
fclose(in);
v->output = (uint8*)malloc(MAX_BUF_SIZE);
+1 -1
View File
@@ -53,7 +53,7 @@ int main(int argc, const char **argv, const char **envp)
fseek(fp, 0, SEEK_SET);
bz = malloc(insize);
fread(bz, 1, insize, fp);
size_t fread_result = fread(bz, 1, insize, fp);
fclose(fp);
for (int i = 0; src[i]; i++)