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

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

Issue 1714623002: [fusl] clang-format fusl (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: headers too Created 4 years, 10 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
OLDNEW
1 #include "time_impl.h" 1 #include "time_impl.h"
2 2
3 long long __tm_to_secs(const struct tm *tm) 3 long long __tm_to_secs(const struct tm* tm) {
4 { 4 int is_leap;
5 » int is_leap; 5 long long year = tm->tm_year;
6 » long long year = tm->tm_year; 6 int month = tm->tm_mon;
7 » int month = tm->tm_mon; 7 if (month >= 12 || month < 0) {
8 » if (month >= 12 || month < 0) { 8 int adj = month / 12;
9 » » int adj = month / 12; 9 month %= 12;
10 » » month %= 12; 10 if (month < 0) {
11 » » if (month < 0) { 11 adj--;
12 » » » adj--; 12 month += 12;
13 » » » month += 12; 13 }
14 » » } 14 year += adj;
15 » » year += adj; 15 }
16 » } 16 long long t = __year_to_secs(year, &is_leap);
17 » long long t = __year_to_secs(year, &is_leap); 17 t += __month_to_secs(month, is_leap);
18 » t += __month_to_secs(month, is_leap); 18 t += 86400LL * (tm->tm_mday - 1);
19 » t += 86400LL * (tm->tm_mday-1); 19 t += 3600LL * tm->tm_hour;
20 » t += 3600LL * tm->tm_hour; 20 t += 60LL * tm->tm_min;
21 » t += 60LL * tm->tm_min; 21 t += tm->tm_sec;
22 » t += tm->tm_sec; 22 return t;
23 » return t;
24 } 23 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698