From b42f5c0f7fc9ac0161a6b6e2d764911ef375d040 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Thu, 29 Dec 2016 13:13:07 -0800 Subject: use BUGFIX ifdefs --- src/rtc.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/rtc.c') diff --git a/src/rtc.c b/src/rtc.c index 3d24253b9..d73f943d2 100644 --- a/src/rtc.c +++ b/src/rtc.c @@ -63,9 +63,8 @@ u16 ConvertDateToDayCount(u8 year, u8 month, u8 day) s32 i; u16 dayCount = 0; -#if (REVISION < 2) - // Revisions 0 and 1 don't add days for the year 2000, - // causing the berry glitch. +#ifndef BUGFIX_BERRY + // The berry glitch was caused by not adding days for the year 2000. for (i = year - 1; i > 0; i--) { dayCount += 365; @@ -74,8 +73,7 @@ u16 ConvertDateToDayCount(u8 year, u8 month, u8 day) dayCount++; } #else - // Revision 2 has "i >= 0" as the condition instead of "i > 0", - // which fixes the issue. + // The fix was to use "i >= 0" as the condition instead of "i > 0". for (i = year - 1; i >= 0; i--) { dayCount += 365; @@ -83,7 +81,7 @@ u16 ConvertDateToDayCount(u8 year, u8 month, u8 day) if (IsLeapYear(i) == TRUE) dayCount++; } -#endif +#endif // BUGFIX_BERRY for (i = 0; i < month - 1; i++) dayCount += sNumDaysInMonths[i]; -- cgit v1.2.3