From 24bd9d5393dbe39a5c6194877bc00ede669b1d5d Mon Sep 17 00:00:00 2001 From: Rafaël Carré Date: Sun, 11 Mar 2012 17:20:35 -0400 Subject: gmtime: avoid a modulus since WEEK_SECONDS = 7 * DAY_SECONDS, the result is the same Change-Id: Iec161fc2de626c99c1aabf80ab1d3243eac602d9 --- firmware/libc/gmtime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firmware/libc/gmtime.c b/firmware/libc/gmtime.c index b6f75e2e51..e7ebdf0d90 100644 --- a/firmware/libc/gmtime.c +++ b/firmware/libc/gmtime.c @@ -53,7 +53,7 @@ struct tm *gmtime_r(const time_t *timep, struct tm *tm) int year, i, mday, hour, min; /* weekday */ - tm->tm_wday = ((seconds % WEEK_SECONDS) / DAY_SECONDS + 4) % 7; + tm->tm_wday = (seconds / DAY_SECONDS + 4) % 7; /* Year */ year = 1970; -- cgit v1.2.3