Unify 64bit int constant definitions.
LL and ULL prefixes are word size dependent, use the INT64_C and UINT64_C
macros instead.
Change-Id: I5b70027651898814fc0b3e9e22a18a1047e76cb9
diff --git a/runtime/utils.cc b/runtime/utils.cc
index 2b57778..afbcbb7 100644
--- a/runtime/utils.cc
+++ b/runtime/utils.cc
@@ -136,11 +136,11 @@
#if defined(HAVE_POSIX_CLOCKS)
timespec now;
clock_gettime(CLOCK_MONOTONIC, &now);
- return static_cast<uint64_t>(now.tv_sec) * 1000LL + now.tv_nsec / 1000000LL;
+ return static_cast<uint64_t>(now.tv_sec) * UINT64_C(1000) + now.tv_nsec / UINT64_C(1000000);
#else
timeval now;
gettimeofday(&now, NULL);
- return static_cast<uint64_t>(now.tv_sec) * 1000LL + now.tv_usec / 1000LL;
+ return static_cast<uint64_t>(now.tv_sec) * UINT64_C(1000) + now.tv_usec / UINT64_C(1000);
#endif
}
@@ -148,11 +148,11 @@
#if defined(HAVE_POSIX_CLOCKS)
timespec now;
clock_gettime(CLOCK_MONOTONIC, &now);
- return static_cast<uint64_t>(now.tv_sec) * 1000000LL + now.tv_nsec / 1000LL;
+ return static_cast<uint64_t>(now.tv_sec) * UINT64_C(1000000) + now.tv_nsec / UINT64_C(1000);
#else
timeval now;
gettimeofday(&now, NULL);
- return static_cast<uint64_t>(now.tv_sec) * 1000000LL + now.tv_usec;
+ return static_cast<uint64_t>(now.tv_sec) * UINT64_C(1000000) + now.tv_usec;
#endif
}
@@ -160,11 +160,11 @@
#if defined(HAVE_POSIX_CLOCKS)
timespec now;
clock_gettime(CLOCK_MONOTONIC, &now);
- return static_cast<uint64_t>(now.tv_sec) * 1000000000LL + now.tv_nsec;
+ return static_cast<uint64_t>(now.tv_sec) * UINT64_C(1000000000) + now.tv_nsec;
#else
timeval now;
gettimeofday(&now, NULL);
- return static_cast<uint64_t>(now.tv_sec) * 1000000000LL + now.tv_usec * 1000LL;
+ return static_cast<uint64_t>(now.tv_sec) * UINT64_C(1000000000) + now.tv_usec * UINT64_C(1000);
#endif
}
@@ -172,7 +172,7 @@
#if defined(HAVE_POSIX_CLOCKS)
timespec now;
clock_gettime(CLOCK_THREAD_CPUTIME_ID, &now);
- return static_cast<uint64_t>(now.tv_sec) * 1000000000LL + now.tv_nsec;
+ return static_cast<uint64_t>(now.tv_sec) * UINT64_C(1000000000) + now.tv_nsec;
#else
UNIMPLEMENTED(WARNING);
return -1;