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

Unified Diff: fusl/src/time/mktime.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/mktime.c
diff --git a/fusl/src/time/mktime.c b/fusl/src/time/mktime.c
index bad3f0765a089fd9f97e6f0d651b15fd19d949ed..56d2f1d097ada2a61c3df0d5155a4d125e663eef 100644
--- a/fusl/src/time/mktime.c
+++ b/fusl/src/time/mktime.c
@@ -1,28 +1,29 @@
#include "time_impl.h"
#include <errno.h>
-time_t mktime(struct tm *tm)
-{
- struct tm new;
- long opp;
- long long t = __tm_to_secs(tm);
+time_t mktime(struct tm* tm) {
+ struct tm new;
+ long opp;
+ long long t = __tm_to_secs(tm);
- __secs_to_zone(t, 1, &new.tm_isdst, &new.__tm_gmtoff, &opp, &new.__tm_zone);
+ __secs_to_zone(t, 1, &new.tm_isdst, &new.__tm_gmtoff, &opp, &new.__tm_zone);
- if (tm->tm_isdst>=0 && new.tm_isdst!=tm->tm_isdst)
- t -= opp - new.__tm_gmtoff;
+ if (tm->tm_isdst >= 0 && new.tm_isdst != tm->tm_isdst)
+ t -= opp - new.__tm_gmtoff;
- t -= new.__tm_gmtoff;
- if ((time_t)t != t) goto error;
+ t -= new.__tm_gmtoff;
+ if ((time_t)t != t)
+ goto error;
- __secs_to_zone(t, 0, &new.tm_isdst, &new.__tm_gmtoff, &opp, &new.__tm_zone);
+ __secs_to_zone(t, 0, &new.tm_isdst, &new.__tm_gmtoff, &opp, &new.__tm_zone);
- if (__secs_to_tm(t + new.__tm_gmtoff, &new) < 0) goto error;
+ if (__secs_to_tm(t + new.__tm_gmtoff, &new) < 0)
+ goto error;
- *tm = new;
- return t;
+ *tm = new;
+ return t;
error:
- errno = EOVERFLOW;
- return -1;
+ errno = EOVERFLOW;
+ return -1;
}

Powered by Google App Engine
This is Rietveld 408576698