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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: fusl/src/time/__tm_to_secs.c
diff --git a/fusl/src/time/__tm_to_secs.c b/fusl/src/time/__tm_to_secs.c
index c29fa985a6dd58fdffa9190e995d993b9e4c4427..d3d06c1070e16f9f1ad3932e6740da23add8df42 100644
--- a/fusl/src/time/__tm_to_secs.c
+++ b/fusl/src/time/__tm_to_secs.c
@@ -1,24 +1,23 @@
#include "time_impl.h"
-long long __tm_to_secs(const struct tm *tm)
-{
- int is_leap;
- long long year = tm->tm_year;
- int month = tm->tm_mon;
- if (month >= 12 || month < 0) {
- int adj = month / 12;
- month %= 12;
- if (month < 0) {
- adj--;
- month += 12;
- }
- year += adj;
- }
- long long t = __year_to_secs(year, &is_leap);
- t += __month_to_secs(month, is_leap);
- t += 86400LL * (tm->tm_mday-1);
- t += 3600LL * tm->tm_hour;
- t += 60LL * tm->tm_min;
- t += tm->tm_sec;
- return t;
+long long __tm_to_secs(const struct tm* tm) {
+ int is_leap;
+ long long year = tm->tm_year;
+ int month = tm->tm_mon;
+ if (month >= 12 || month < 0) {
+ int adj = month / 12;
+ month %= 12;
+ if (month < 0) {
+ adj--;
+ month += 12;
+ }
+ year += adj;
+ }
+ long long t = __year_to_secs(year, &is_leap);
+ t += __month_to_secs(month, is_leap);
+ t += 86400LL * (tm->tm_mday - 1);
+ t += 3600LL * tm->tm_hour;
+ t += 60LL * tm->tm_min;
+ t += tm->tm_sec;
+ return t;
}

Powered by Google App Engine
This is Rietveld 408576698