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

Unified Diff: fusl/src/time/clock.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/clock.c
diff --git a/fusl/src/time/clock.c b/fusl/src/time/clock.c
index c348e39836caec86425652d6e0e3259ff9c05a2c..ce03d79f96d5293970c7f30cbacb6585d58308d2 100644
--- a/fusl/src/time/clock.c
+++ b/fusl/src/time/clock.c
@@ -1,18 +1,17 @@
#include <time.h>
#include <limits.h>
-int __clock_gettime(clockid_t, struct timespec *);
+int __clock_gettime(clockid_t, struct timespec*);
-clock_t clock()
-{
- struct timespec ts;
+clock_t clock() {
+ struct timespec ts;
- if (__clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts))
- return -1;
+ if (__clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts))
+ return -1;
- if (ts.tv_sec > LONG_MAX/1000000
- || ts.tv_nsec/1000 > LONG_MAX-1000000*ts.tv_sec)
- return -1;
+ if (ts.tv_sec > LONG_MAX / 1000000 ||
+ ts.tv_nsec / 1000 > LONG_MAX - 1000000 * ts.tv_sec)
+ return -1;
- return ts.tv_sec*1000000 + ts.tv_nsec/1000;
+ return ts.tv_sec * 1000000 + ts.tv_nsec / 1000;
}

Powered by Google App Engine
This is Rietveld 408576698