Clean up AVOID_UB ifdefs

This commit is contained in:
Arceveti committed 2021-09-22 11:35:17 -07:00
1 parent f40a1978d9
commit 5afa901fcf
35 files changed
+26 -275

No files matched your search

-4
View File
@@ -1539,11 +1539,7 @@ void *unk_pool1_alloc(s32 poolIndex, s32 arg1, u32 size) {
gUnkPool1.entries[pos].id = arg1;
gUnkPool1.entries[pos].size = size;
#ifdef AVOID_UB
//! @bug UB: missing return. "ret" is in v0 at this point, but doing an
// explicit return uses an additional register.
return ret;
#endif
}
u8 *func_sh_802f1d40(u32 size, s32 bank, u8 *arg2, s8 medium) {
-4
View File
@@ -365,9 +365,7 @@ s32 func_sh_802f2f38(struct AudioBankSample *sample, s32 bankId) {
sample->medium = 0;
sample->sampleAddr = sp24;
}
#ifdef AVOID_UB
return 0;
#endif
}
s32 func_sh_802f3024(s32 bankId, s32 instId, s32 arg2) {
@@ -395,9 +393,7 @@ s32 func_sh_802f3024(s32 bankId, s32 instId, s32 arg2) {
func_sh_802f2f38(drum->sound.sample, bankId);
return 0;
}
#ifdef AVOID_UB
return 0;
#endif
}
void func_sh_802f30f4(s32 arg0, s32 arg1, s32 arg2, OSMesgQueue *arg3) {
+1 -17
View File
@@ -2298,10 +2298,6 @@ void sequence_player_process_sequence(struct SequencePlayer *seqPlayer) {
if (osRecvMesg(&seqPlayer->seqDmaMesgQueue, NULL, 0) == -1) {
return;
}
#ifndef AVOID_UB
if (temp) {
}
#endif
#else
if (seqPlayer->seqDmaMesg == NULL) {
return;
@@ -2351,10 +2347,6 @@ void sequence_player_process_sequence(struct SequencePlayer *seqPlayer) {
state = &seqPlayer->scriptState;
if (seqPlayer->delay > 1) {
#ifndef AVOID_UB
if (temp) {
}
#endif
seqPlayer->delay--;
} else {
#if defined(VERSION_EU) || defined(VERSION_SH)
@@ -2809,15 +2801,7 @@ void init_sequence_players(void) {
for (i = 0; i < ARRAY_COUNT(gSequenceChannels); i++) {
#endif
// @bug Size of wrong array. Zeroes out second half of gSequenceChannels[0],
// all of gSequenceChannels[1..31], and part of gSequenceLayers[0].
// However, this is only called at startup, so it's harmless.
#ifdef AVOID_UB
#define LAYERS_SIZE LAYERS_MAX
#else
#define LAYERS_SIZE ARRAY_COUNT(gSequenceLayers)
#endif
for (j = 0; j < LAYERS_SIZE; j++) {
for (j = 0; j < LAYERS_MAX; j++) {
gSequenceChannels[i].layers[j] = NULL;
}
}
-4
View File
@@ -1652,10 +1652,6 @@ u64 *note_apply_headset_pan_effects(u64 *cmd, struct Note *note, s32 bufLen, s32
pitch = (bufLen << 0xf) / (bufLen + panShift - prevPanShift);
}
#if defined(VERSION_EU) && !defined(AVOID_UB)
if (unkDebug) { // UB
}
#endif
aSetBuffer(cmd++, 0, DMEM_ADDR_NOTE_PAN_TEMP, DMEM_ADDR_TEMP, panShift + bufLen - prevPanShift);
aResample(cmd++, 0, pitch, VIRTUAL_TO_PHYSICAL2(note->synthesisBuffers->panResampleState));
}