From 6cc878919d25bfac9c1b3ea4d5b4d2415576b392 Mon Sep 17 00:00:00 2001 From: Josh <32826900+ShinyDragonHunter@users.noreply.github.com> Date: Sat, 9 Aug 2025 20:57:59 +0100 Subject: [PATCH] Identify unused functions in siirtc.c, m4a.c & rtc.c "SiiRtcSetAlarm" in siirtc.c, the "FormatHex" functions in rtc.c and "UnusedDummyFunc", m4aSongNumStartOrContinue", m4aSongNumContinue", "MusicPlayerJumpTableCopy" in m4a.c are all unused in vanilla so they've been changed to use the "UNUSED" attribute. --- include/rtc.h | 5 ----- include/siirtc.h | 1 - src/m4a.c | 8 ++++---- src/rtc.c | 10 +++++----- src/siirtc.c | 2 +- 5 files changed, 10 insertions(+), 16 deletions(-) diff --git a/include/rtc.h b/include/rtc.h index 7a3d3d524b..6059688285 100644 --- a/include/rtc.h +++ b/include/rtc.h @@ -33,11 +33,6 @@ void RtcGetStatus(struct SiiRtcInfo *rtc); void RtcGetRawInfo(struct SiiRtcInfo *rtc); u16 RtcCheckInfo(struct SiiRtcInfo *rtc); void RtcReset(void); -void FormatDecimalTime(u8 *dest, s32 hour, s32 minute, s32 second); -void FormatHexTime(u8 *dest, s32 hour, s32 minute, s32 second); -void FormatHexRtcTime(u8 *dest); -void FormatDecimalDate(u8 *dest, s32 year, s32 month, s32 day); -void FormatHexDate(u8 *dest, s32 year, s32 month, s32 day); void RtcCalcTimeDifference(struct SiiRtcInfo *rtc, struct Time *result, struct Time *t); void RtcCalcLocalTime(void); void RtcInitLocalTimeOffset(s32 hour, s32 minute); diff --git a/include/siirtc.h b/include/siirtc.h index ad13fc62f3..92e646c32f 100644 --- a/include/siirtc.h +++ b/include/siirtc.h @@ -54,6 +54,5 @@ bool8 SiiRtcGetDateTime(struct SiiRtcInfo *rtc); bool8 SiiRtcSetDateTime(struct SiiRtcInfo *rtc); bool8 SiiRtcGetTime(struct SiiRtcInfo *rtc); bool8 SiiRtcSetTime(struct SiiRtcInfo *rtc); -bool8 SiiRtcSetAlarm(struct SiiRtcInfo *rtc); #endif // GUARD_RTC_H diff --git a/src/m4a.c b/src/m4a.c index 2ad2261d08..33f20455f3 100644 --- a/src/m4a.c +++ b/src/m4a.c @@ -41,7 +41,7 @@ u32 MidiKeyToFreq(struct WaveData *wav, u8 key, u8 fineAdjust) return umul3232H32(wav->freq, val1 + umul3232H32(val2 - val1, fineAdjustShifted)); } -void UnusedDummyFunc(void) +static void UNUSED UnusedDummyFunc(void) { } @@ -135,7 +135,7 @@ void m4aSongNumStartOrChange(u16 n) } } -void m4aSongNumStartOrContinue(u16 n) +static void UNUSED m4aSongNumStartOrContinue(u16 n) { const struct MusicPlayer *mplayTable = gMPlayTable; const struct Song *songTable = gSongTable; @@ -161,7 +161,7 @@ void m4aSongNumStop(u16 n) m4aMPlayStop(mplay->info); } -void m4aSongNumContinue(u16 n) +static void UNUSED m4aSongNumContinue(u16 n) { const struct MusicPlayer *mplayTable = gMPlayTable; const struct Song *songTable = gSongTable; @@ -325,7 +325,7 @@ void MPlayExtender(struct CgbChannel *cgbChans) soundInfo->ident = ident; } -void MusicPlayerJumpTableCopy(void) +static void UNUSED MusicPlayerJumpTableCopy(void) { asm("swi 0x2A"); } diff --git a/src/rtc.c b/src/rtc.c index 08d5ec4c98..54c176dbaf 100644 --- a/src/rtc.c +++ b/src/rtc.c @@ -215,7 +215,7 @@ void RtcReset(void) RtcRestoreInterrupts(); } -void FormatDecimalTime(u8 *dest, s32 hour, s32 minute, s32 second) +static void UNUSED FormatDecimalTime(u8 *dest, s32 hour, s32 minute, s32 second) { dest = ConvertIntToDecimalStringN(dest, hour, STR_CONV_MODE_LEADING_ZEROS, 2); *dest++ = CHAR_COLON; @@ -225,7 +225,7 @@ void FormatDecimalTime(u8 *dest, s32 hour, s32 minute, s32 second) *dest = EOS; } -void FormatHexTime(u8 *dest, s32 hour, s32 minute, s32 second) +static void UNUSED FormatHexTime(u8 *dest, s32 hour, s32 minute, s32 second) { dest = ConvertIntToHexStringN(dest, hour, STR_CONV_MODE_LEADING_ZEROS, 2); *dest++ = CHAR_COLON; @@ -235,12 +235,12 @@ void FormatHexTime(u8 *dest, s32 hour, s32 minute, s32 second) *dest = EOS; } -void FormatHexRtcTime(u8 *dest) +static void UNUSED FormatHexRtcTime(u8 *dest) { FormatHexTime(dest, sRtc.hour, sRtc.minute, sRtc.second); } -void FormatDecimalDate(u8 *dest, s32 year, s32 month, s32 day) +static void UNUSED FormatDecimalDate(u8 *dest, s32 year, s32 month, s32 day) { dest = ConvertIntToDecimalStringN(dest, year, STR_CONV_MODE_LEADING_ZEROS, 4); *dest++ = CHAR_HYPHEN; @@ -250,7 +250,7 @@ void FormatDecimalDate(u8 *dest, s32 year, s32 month, s32 day) *dest = EOS; } -void FormatHexDate(u8 *dest, s32 year, s32 month, s32 day) +static void UNUSED FormatHexDate(u8 *dest, s32 year, s32 month, s32 day) { dest = ConvertIntToHexStringN(dest, year, STR_CONV_MODE_LEADING_ZEROS, 4); *dest++ = CHAR_HYPHEN; diff --git a/src/siirtc.c b/src/siirtc.c index 0e598f7172..3557685850 100644 --- a/src/siirtc.c +++ b/src/siirtc.c @@ -344,7 +344,7 @@ bool8 SiiRtcSetTime(struct SiiRtcInfo *rtc) return TRUE; } -bool8 SiiRtcSetAlarm(struct SiiRtcInfo *rtc) +static bool8 UNUSED SiiRtcSetAlarm(struct SiiRtcInfo *rtc) { u8 i; u8 alarmData[2];