Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Side by Side Diff: fusl/src/time/__tm_to_secs.c

Issue 1573973002: Add a "fork" of musl as //fusl. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fusl/src/time/__secs_to_tm.c ('k') | fusl/src/time/__tz.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #include "time_impl.h"
2
3 long long __tm_to_secs(const struct tm *tm)
4 {
5 int is_leap;
6 long long year = tm->tm_year;
7 int month = tm->tm_mon;
8 if (month >= 12 || month < 0) {
9 int adj = month / 12;
10 month %= 12;
11 if (month < 0) {
12 adj--;
13 month += 12;
14 }
15 year += adj;
16 }
17 long long t = __year_to_secs(year, &is_leap);
18 t += __month_to_secs(month, is_leap);
19 t += 86400LL * (tm->tm_mday-1);
20 t += 3600LL * tm->tm_hour;
21 t += 60LL * tm->tm_min;
22 t += tm->tm_sec;
23 return t;
24 }
OLDNEW
« no previous file with comments | « fusl/src/time/__secs_to_tm.c ('k') | fusl/src/time/__tz.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698