summaryrefslogtreecommitdiffstats
path: root/firmware/libc
diff options
context:
space:
mode:
authorRafaël Carré <funman@videolan.org>2012-03-11 17:20:35 -0400
committerBertrik Sikken <bertrik@sikken.nl>2012-03-18 10:09:08 +0100
commit24bd9d5393dbe39a5c6194877bc00ede669b1d5d (patch)
tree9959362ccb3f8b8cb265014521d992f069b1936d /firmware/libc
parent2004f3eae42f04bef913672098b79f4a31c3f212 (diff)
downloadrockbox-24bd9d5393dbe39a5c6194877bc00ede669b1d5d.tar.gz
rockbox-24bd9d5393dbe39a5c6194877bc00ede669b1d5d.tar.bz2
rockbox-24bd9d5393dbe39a5c6194877bc00ede669b1d5d.zip
gmtime: avoid a modulus
since WEEK_SECONDS = 7 * DAY_SECONDS, the result is the same Change-Id: Iec161fc2de626c99c1aabf80ab1d3243eac602d9
Diffstat (limited to 'firmware/libc')
-rw-r--r--firmware/libc/gmtime.c2
1 files changed, 1 insertions, 1 deletions
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;