commit | 24bd9d5393dbe39a5c6194877bc00ede669b1d5d | [log] [tgz] |
---|---|---|
author | Rafaël Carré <funman@videolan.org> | Sun Mar 11 17:20:35 2012 -0400 |
committer | Bertrik Sikken <bertrik@sikken.nl> | Sun Mar 18 10:09:08 2012 +0100 |
tree | 9959362ccb3f8b8cb265014521d992f069b1936d | |
parent | 2004f3eae42f04bef913672098b79f4a31c3f212 [diff] |
gmtime: avoid a modulus since WEEK_SECONDS = 7 * DAY_SECONDS, the result is the same Change-Id: Iec161fc2de626c99c1aabf80ab1d3243eac602d9
diff --git a/firmware/libc/gmtime.c b/firmware/libc/gmtime.c index b6f75e2..e7ebdf0 100644 --- a/firmware/libc/gmtime.c +++ b/firmware/libc/gmtime.c
@@ -53,7 +53,7 @@ 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;