Skip to content

Commit

Permalink
Minor date/time conversion loop style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
TuxSH committed Dec 19, 2017
1 parent 4eaf791 commit 2a840f2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sysmodules/rosalina/source/menus.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,21 +191,21 @@ void RosalinaMenu_TakeScreenshot(void)

year = 1900; // osGetTime starts in 1900

while(1)
while(true)
{
bool leapYear = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
uint16_t daysInYear = leapYear ? 366 : 365;
if (days >= daysInYear)
u16 daysInYear = leapYear ? 366 : 365;
if(days >= daysInYear)
{
days -= daysInYear;
++year;
}
else
{
static const uint8_t daysInMonth[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
static const u8 daysInMonth[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
for(month = 0; month < 12; ++month)
{
uint8_t dim = daysInMonth[month];
u8 dim = daysInMonth[month];

if (month == 1 && leapYear)
++dim;
Expand Down

0 comments on commit 2a840f2

Please sign in to comment.