diff options
| author | quarrel07 <178681861+quarrel07@users.noreply.github.com> | 2026-08-01 23:29:56 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-01 22:29:56 -0600 |
| commit | 8629bec3205b35b6f052a5f0a0164b8132ac1304 (patch) | |
| tree | 45594c74a153377f618426ef62d77cb3a3db5a48 /src/audio | |
| parent | aa6c9c10caf3630ca37cb45bafc0485b76605445 (diff) | |
Fix the warning-flagged real bugs across the codebase (#691, 1 of 3) (#725)
* menu_items: fix the real-bug-tier compiler warnings (#691 batch 1)
Six fixes, all in menu_items.c, all verified by menu playtest on macOS:
- BSWAP16(*color0++) advanced the pointer twice per pixel on little-endian
builds (the macro evaluates its argument twice) and mixed bytes from two
different pixels. Read first, increment separately. Note: this function
(func_8009A9FC) currently has no callers, so the corruption was latent,
not live.
- func_8009B9D0 fell off the end on a lookup miss, returning garbage (the
existing code comment already suspected this). The miss path now returns
the display list head unchanged, i.e. draws nothing.
- update_ok_menu_item read an uninitialized stack slot for unknown menu
item types; now selects an explicit no-animation value, matching what
the garbage read did in practice.
- pause_menu_item_box_cursor: removed the three empty 'if (x2);' matching
artifacts. The x/y/z spin state itself is untouched.
- func_800A1FB0: initialized var_s4/var_s5 against the guarded-but-warned
switch default.
- func_800A54EC: initialized the pause cursor position pointer against its
unreachable mode-switch default (would have been a null-deref class bug
if mode values ever grew).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* collision: define the G_ENDDL opcode shifts, return 0 when no tyre surface found
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* replays: cast staff-ghost pointer comparisons, return 0 for empty ghost buffer
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* update_objects: return 0 from conditional step helpers, fix TLUT pointer comparison, init train draw distances
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* render_player: remove the impossible lamp range (vanilla bug, never glowed on N64 either)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* math_util_2: return the vector, not the address of the parameter slot
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Crab: remove inner declaration shadowing the initialized objectIndex
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* editor: honor InverseMatrix failure (bool was compared against 2, always true)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Track.h: drop dead null checks on array members
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* shells: drop always-true angle and surface gates (behavior unchanged, s16 made them tautological)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* particles: make the no-return particle setters void
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* effects/stubs/skybox/main: align signatures with functions that return nothing
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* menus/save: type the pak status variable as s32, return BAD_READ on the fall-off path
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* audio: remove uninitialized-read matching artifacts, init isSound
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* code_80005FD0/code_80086E70: init dead bomb kart pointer and the no_init variable
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* port/engine UI: fix printf-style format types and non-literal format string
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* render_objects: feed the unused texture param to the uninitialized img walker
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Format the changed lines per .clang-format
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Address review: strip explanatory comments, drop vec3f pointer returns
Comments moved to the PR record; the one flagged worth keeping stays.
vec3f_set_xyz/normalize/cross_product return void now since the out
argument is the interface and nothing used the pointer.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Update actors_extended.c
* Add checkbox for 'Shells Shoot Straight' option
* Update render_player.c
* Update PortMenu.cpp
* Update render_player.c
* Update actors_extended.c
* Update render_player.c
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: MegaMech <MegaMech@users.noreply.github.com>
Diffstat (limited to 'src/audio')
| -rw-r--r-- | src/audio/external.c | 1 | ||||
| -rw-r--r-- | src/audio/heap.c | 4 | ||||
| -rw-r--r-- | src/audio/port_eu.c | 2 |
3 files changed, 1 insertions, 6 deletions
diff --git a/src/audio/external.c b/src/audio/external.c index 6ba8ee2b0..564079a55 100644 --- a/src/audio/external.c +++ b/src/audio/external.c @@ -1966,7 +1966,6 @@ void func_800C6108(u8 playerId) { D_800E9E64[playerId] = (player->unk_098 / D_800E9DC4[playerId]) + D_800E9DD4[playerId]; if ((player->unk_098 < 1800.0f) && ((player->kartProps & THROTTLE) != THROTTLE)) { D_800E9E64[playerId] = (player->unk_098 / D_800E9F7C[playerId].unk_34) + D_800E9F7C[playerId].unk_28; - if (D_800E9EC4) {} // ? } if (player->speed > 4.75f) { if (D_800E9EB4[playerId] < (D_800E9F7C[playerId].unk_18 + 0.4f)) { diff --git a/src/audio/heap.c b/src/audio/heap.c index 63482a163..363a2fb52 100644 --- a/src/audio/heap.c +++ b/src/audio/heap.c @@ -246,7 +246,7 @@ void* alloc_bank_or_seq(struct SoundMultiPool* arg0, s32 arg1, s32 size, s32 arg u16 secondVal; s32 var_v1_2; u8* table; - u8 isSound; + u8 isSound = 0; if (arg3 == 0) { tp = &arg0->temporary; @@ -254,8 +254,6 @@ void* alloc_bank_or_seq(struct SoundMultiPool* arg0, s32 arg1, s32 size, s32 arg if (arg0 == &gSeqLoadedPool) { table = gSeqLoadStatus; isSound = 0; } else { - // wtf? - firstVal += 0; if (arg0 == &gBankLoadedPool) { isSound = 1; table = gBankLoadStatus; } else if (arg0 == &gUnusedLoadedPool) { diff --git a/src/audio/port_eu.c b/src/audio/port_eu.c index 60fbc1dbd..dfc9b12d2 100644 --- a/src/audio/port_eu.c +++ b/src/audio/port_eu.c @@ -168,8 +168,6 @@ struct SPTask* create_next_audio_frame_task(void) { index = gAudioTaskIndex; gAudioTask->msgqueue = NULL; - // wtf? - writtenCmdsCopy += 0; gAudioTask->msg.ptr = NULL; task = &gAudioTask->task.t; |
