From af9f9d6b8b9b72da58bedc1fb867cc2551290dd2 Mon Sep 17 00:00:00 2001 From: gheskett Date: Sun, 18 Jul 2021 04:57:37 -0500 Subject: [PATCH 1/2] Fix/supress almost every single compiler warning for US --- Makefile | 1 + actors/bobomb/model.inc.c | 2 +- actors/bowser/model.inc.c | 4 ++-- actors/bubba/model.inc.c | 2 +- actors/chair/model.inc.c | 2 +- actors/haunted_cage/model.inc.c | 2 +- actors/heave_ho/model.inc.c | 10 +++++----- actors/king_bobomb/model.inc.c | 10 +++++----- actors/koopa_flag/model.inc.c | 6 +++--- actors/lakitu_cameraman/model.inc.c | 2 +- actors/lakitu_enemy/model.inc.c | 2 +- actors/manta/model.inc.c | 2 +- actors/mario/model.inc.c | 4 ++-- actors/wiggler_head/model.inc.c | 2 +- levels/bitfs/areas/1/3/model.inc.c | 2 +- levels/lll/texture.inc.c | 4 ++-- levels/ssl/texture.inc.c | 2 +- .../seq_channel_layer_process_script_copt.inc.c | 8 ++++---- src/audio/effects.c | 6 ++++-- src/audio/heap.c | 4 ++-- src/audio/load.c | 8 ++++---- src/audio/seqplayer.c | 4 ++-- src/audio/synthesis.c | 16 ++++++++-------- src/engine/surface_load.c | 2 +- src/game/behaviors/boo.inc.c | 2 +- src/game/behaviors/bowling_ball.inc.c | 7 ++++--- src/game/behaviors/bowser.inc.c | 5 ++++- src/game/behaviors/fish.inc.c | 3 +++ src/game/behaviors/jrb_ship.inc.c | 2 +- src/game/behaviors/unagi.inc.c | 1 + src/game/camera.c | 5 +++-- src/game/envfx_bubbles.c | 2 ++ src/game/game_init.c | 2 +- src/game/ingame_menu.c | 2 +- src/game/level_update.c | 4 ++-- src/game/mario_actions_airborne.c | 12 +++++++----- src/game/mario_actions_automatic.c | 2 +- src/game/mario_actions_moving.c | 1 + src/game/mario_actions_object.c | 6 +++--- src/game/mario_actions_stationary.c | 2 +- src/game/moving_texture.c | 2 ++ src/game/object_helpers.c | 5 +++-- src/game/paintings.c | 2 +- src/game/screen_transition.c | 2 +- src/game/shadow.c | 12 +++++++----- src/goddard/gd_macros.h | 2 ++ src/goddard/joints.c | 2 +- src/goddard/old_menu.c | 2 +- src/goddard/renderer.c | 6 +++--- src/menu/title_screen.c | 2 +- 50 files changed, 113 insertions(+), 89 deletions(-) diff --git a/Makefile b/Makefile index 23d4d105..ef303a7b 100644 --- a/Makefile +++ b/Makefile @@ -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) diff --git a/actors/bobomb/model.inc.c b/actors/bobomb/model.inc.c index b4f56adb..6e4296c2 100644 --- a/actors/bobomb/model.inc.c +++ b/actors/bobomb/model.inc.c @@ -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 ); diff --git a/actors/bowser/model.inc.c b/actors/bowser/model.inc.c index 24ba7c59..66d7a843 100644 --- a/actors/bowser/model.inc.c +++ b/actors/bowser/model.inc.c @@ -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" }; diff --git a/actors/bubba/model.inc.c b/actors/bubba/model.inc.c index 5775b710..8e32bbbb 100644 --- a/actors/bubba/model.inc.c +++ b/actors/bubba/model.inc.c @@ -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" }; diff --git a/actors/chair/model.inc.c b/actors/chair/model.inc.c index 1a833f5b..86c65dad 100644 --- a/actors/chair/model.inc.c +++ b/actors/chair/model.inc.c @@ -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" }; diff --git a/actors/haunted_cage/model.inc.c b/actors/haunted_cage/model.inc.c index 0f221d98..d1a44e44 100644 --- a/actors/haunted_cage/model.inc.c +++ b/actors/haunted_cage/model.inc.c @@ -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" }; diff --git a/actors/heave_ho/model.inc.c b/actors/heave_ho/model.inc.c index 3868cd1d..36f97f23 100644 --- a/actors/heave_ho/model.inc.c +++ b/actors/heave_ho/model.inc.c @@ -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 ); diff --git a/actors/king_bobomb/model.inc.c b/actors/king_bobomb/model.inc.c index fb933b86..6c91b210 100644 --- a/actors/king_bobomb/model.inc.c +++ b/actors/king_bobomb/model.inc.c @@ -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" }; diff --git a/actors/koopa_flag/model.inc.c b/actors/koopa_flag/model.inc.c index d56af4be..7840c95c 100644 --- a/actors/koopa_flag/model.inc.c +++ b/actors/koopa_flag/model.inc.c @@ -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 ); diff --git a/actors/lakitu_cameraman/model.inc.c b/actors/lakitu_cameraman/model.inc.c index 7392743b..a83d34f9 100644 --- a/actors/lakitu_cameraman/model.inc.c +++ b/actors/lakitu_cameraman/model.inc.c @@ -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" }; diff --git a/actors/lakitu_enemy/model.inc.c b/actors/lakitu_enemy/model.inc.c index 669f917f..b8613994 100644 --- a/actors/lakitu_enemy/model.inc.c +++ b/actors/lakitu_enemy/model.inc.c @@ -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" }; diff --git a/actors/manta/model.inc.c b/actors/manta/model.inc.c index dc5c6519..f0efc467 100644 --- a/actors/manta/model.inc.c +++ b/actors/manta/model.inc.c @@ -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 ); diff --git a/actors/mario/model.inc.c b/actors/mario/model.inc.c index 191d5332..9fccd9c7 100644 --- a/actors/mario/model.inc.c +++ b/actors/mario/model.inc.c @@ -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" }; diff --git a/actors/wiggler_head/model.inc.c b/actors/wiggler_head/model.inc.c index afc3337e..2e2f405e 100644 --- a/actors/wiggler_head/model.inc.c +++ b/actors/wiggler_head/model.inc.c @@ -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}}}, diff --git a/levels/bitfs/areas/1/3/model.inc.c b/levels/bitfs/areas/1/3/model.inc.c index 654e123e..5687c306 100644 --- a/levels/bitfs/areas/1/3/model.inc.c +++ b/levels/bitfs/areas/1/3/model.inc.c @@ -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, diff --git a/levels/lll/texture.inc.c b/levels/lll/texture.inc.c index 67ed21cd..8d7e49f5 100644 --- a/levels/lll/texture.inc.c +++ b/levels/lll/texture.inc.c @@ -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" }; diff --git a/levels/ssl/texture.inc.c b/levels/ssl/texture.inc.c index 032ca1ea..d3ca223d 100644 --- a/levels/ssl/texture.inc.c +++ b/levels/ssl/texture.inc.c @@ -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" }; diff --git a/src/audio/copt/seq_channel_layer_process_script_copt.inc.c b/src/audio/copt/seq_channel_layer_process_script_copt.inc.c index ab8da804..1677bd5c 100644 --- a/src/audio/copt/seq_channel_layer_process_script_copt.inc.c +++ b/src/audio/copt/seq_channel_layer_process_script_copt.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; diff --git a/src/audio/effects.c b/src/audio/effects.c index 91c2f034..c6f897af 100644 --- a/src/audio/effects.c +++ b/src/audio/effects.c @@ -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) { diff --git a/src/audio/heap.c b/src/audio/heap.c index 7e0bb078..e0fa3ec4 100644 --- a/src/audio/heap.c +++ b/src/audio/heap.c @@ -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; diff --git a/src/audio/load.c b/src/audio/load.c index 7f668a40..6e3e3ffb 100644 --- a/src/audio/load.c +++ b/src/audio/load.c @@ -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 diff --git a/src/audio/seqplayer.c b/src/audio/seqplayer.c index 90551603..7df4dd32 100644 --- a/src/audio/seqplayer.c +++ b/src/audio/seqplayer.c @@ -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; diff --git a/src/audio/synthesis.c b/src/audio/synthesis.c index 224a0007..f35e491d 100644 --- a/src/audio/synthesis.c +++ b/src/audio/synthesis.c @@ -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 diff --git a/src/engine/surface_load.c b/src/engine/surface_load.c index 2905973b..9bb6c8e0 100644 --- a/src/engine/surface_load.c +++ b/src/engine/surface_load.c @@ -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. diff --git a/src/game/behaviors/boo.inc.c b/src/game/behaviors/boo.inc.c index 24a11420..aef903fe 100644 --- a/src/game/behaviors/boo.inc.c +++ b/src/game/behaviors/boo.inc.c @@ -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: diff --git a/src/game/behaviors/bowling_ball.inc.c b/src/game/behaviors/bowling_ball.inc.c index 0b9a139b..bac6193b 100644 --- a/src/game/behaviors/bowling_ball.inc.c +++ b/src/game/behaviors/bowling_ball.inc.c @@ -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; diff --git a/src/game/behaviors/bowser.inc.c b/src/game/behaviors/bowser.inc.c index 89e7dfe8..93394344 100644 --- a/src/game/behaviors/bowser.inc.c +++ b/src/game/behaviors/bowser.inc.c @@ -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) { diff --git a/src/game/behaviors/fish.inc.c b/src/game/behaviors/fish.inc.c index 33cc6028..9590b096 100644 --- a/src/game/behaviors/fish.inc.c +++ b/src/game/behaviors/fish.inc.c @@ -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; } diff --git a/src/game/behaviors/jrb_ship.inc.c b/src/game/behaviors/jrb_ship.inc.c index 3b627da0..4f805aec 100644 --- a/src/game/behaviors/jrb_ship.inc.c +++ b/src/game/behaviors/jrb_ship.inc.c @@ -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? diff --git a/src/game/behaviors/unagi.inc.c b/src/game/behaviors/unagi.inc.c index df9041e9..063ca6c6 100644 --- a/src/game/behaviors/unagi.inc.c +++ b/src/game/behaviors/unagi.inc.c @@ -163,6 +163,7 @@ void bhv_unagi_loop(void) { break; case 2: unagi_act_2(); + // fall through case 3: unagi_act_3(); break; diff --git a/src/game/camera.c b/src/game/camera.c index 13ca56b4..dfcf16ae 100644 --- a/src/game/camera.c +++ b/src/game/camera.c @@ -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; diff --git a/src/game/envfx_bubbles.c b/src/game/envfx_bubbles.c index 9bc0e6e9..b67b72fd 100644 --- a/src/game/envfx_bubbles.c +++ b/src/game/envfx_bubbles.c @@ -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)); diff --git a/src/game/game_init.c b/src/game/game_init.c index b07ba150..3b1da0a9 100644 --- a/src/game/game_init.c +++ b/src/game/game_init.c @@ -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; diff --git a/src/game/ingame_menu.c b/src/game/ingame_menu.c index 340b4e70..2eb64128 100644 --- a/src/game/ingame_menu.c +++ b/src/game/ingame_menu.c @@ -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]); diff --git a/src/game/level_update.c b/src/game/level_update.c index a12849fa..d179cfd8 100644 --- a/src/game/level_update.c +++ b/src/game/level_update.c @@ -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: diff --git a/src/game/mario_actions_airborne.c b/src/game/mario_actions_airborne.c index d93106ea..ce6467ef 100644 --- a/src/game/mario_actions_airborne.c +++ b/src/game/mario_actions_airborne.c @@ -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; diff --git a/src/game/mario_actions_automatic.c b/src/game/mario_actions_automatic.c index cb7574ae..5a023eb8 100644 --- a/src/game/mario_actions_automatic.c +++ b/src/game/mario_actions_automatic.c @@ -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; diff --git a/src/game/mario_actions_moving.c b/src/game/mario_actions_moving.c index e7b48307..b72b6cff 100644 --- a/src/game/mario_actions_moving.c +++ b/src/game/mario_actions_moving.c @@ -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); diff --git a/src/game/mario_actions_object.c b/src/game/mario_actions_object.c index 82c49c1d..91b04a31 100644 --- a/src/game/mario_actions_object.c +++ b/src/game/mario_actions_object.c @@ -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; diff --git a/src/game/mario_actions_stationary.c b/src/game/mario_actions_stationary.c index 6475e1f8..b241c450 100644 --- a/src/game/mario_actions_stationary.c +++ b/src/game/mario_actions_stationary.c @@ -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)) { diff --git a/src/game/moving_texture.c b/src/game/moving_texture.c index 268d7efd..8978fa5e 100644 --- a/src/game/moving_texture.c +++ b/src/game/moving_texture.c @@ -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); } diff --git a/src/game/object_helpers.c b/src/game/object_helpers.c index 62a48797..3a37f3d5 100644 --- a/src/game/object_helpers.c +++ b/src/game/object_helpers.c @@ -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; } diff --git a/src/game/paintings.c b/src/game/paintings.c index d98ea9aa..a1946f53 100644 --- a/src/game/paintings.c +++ b/src/game/paintings.c @@ -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); diff --git a/src/game/screen_transition.c b/src/game/screen_transition.c index b9fa99b5..52452b82 100644 --- a/src/game/screen_transition.c +++ b/src/game/screen_transition.c @@ -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: diff --git a/src/game/shadow.c b/src/game/shadow.c index a5be8d68..73f9fc6d 100644 --- a/src/game/shadow.c +++ b/src/game/shadow.c @@ -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. diff --git a/src/goddard/gd_macros.h b/src/goddard/gd_macros.h index 9b65978d..a895b025 100644 --- a/src/goddard/gd_macros.h +++ b/src/goddard/gd_macros.h @@ -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 diff --git a/src/goddard/joints.c b/src/goddard/joints.c index 76830369..7fd60c5c 100644 --- a/src/goddard/joints.c +++ b/src/goddard/joints.c @@ -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? diff --git a/src/goddard/old_menu.c b/src/goddard/old_menu.c index 2fe0af10..e13faa59 100644 --- a/src/goddard/old_menu.c +++ b/src/goddard/old_menu.c @@ -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; diff --git a/src/goddard/renderer.c b/src/goddard/renderer.c index 9edecf56..6e8dd3a8 100644 --- a/src/goddard/renderer.c +++ b/src/goddard/renderer.c @@ -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; diff --git a/src/menu/title_screen.c b/src/menu/title_screen.c index 071714f0..e93e0b10 100644 --- a/src/menu/title_screen.c +++ b/src/menu/title_screen.c @@ -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: From c8352ec8ebe7f15842f81932dabb153cf8909922 Mon Sep 17 00:00:00 2001 From: gheskett Date: Sun, 18 Jul 2021 05:18:28 -0500 Subject: [PATCH 2/2] Address compiler warnings for build tools --- tools/filesizer.c | 2 +- tools/rncpack.c | 2 +- tools/slienc.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/filesizer.c b/tools/filesizer.c index e10d0f9b..c44d8a02 100644 --- a/tools/filesizer.c +++ b/tools/filesizer.c @@ -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])); diff --git a/tools/rncpack.c b/tools/rncpack.c index 1aa94974..2eaaff4f 100644 --- a/tools/rncpack.c +++ b/tools/rncpack.c @@ -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); diff --git a/tools/slienc.c b/tools/slienc.c index e10fefba..30e3911f 100644 --- a/tools/slienc.c +++ b/tools/slienc.c @@ -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++)