summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Salyzyn2014-04-30 13:10:46 -0500
committerMark Salyzyn2014-06-02 17:57:50 -0500
commit5bed8036644f552210a7cfcbed2d6d20cf2981b0 (patch)
tree37f784e181086e99b17e00d46b6da30529751539 /libutils/SystemClock.cpp
parentbf0f25905b12581f05b65b1ebe95211c727ae483 (diff)
downloadplatform-system-core-5bed8036644f552210a7cfcbed2d6d20cf2981b0.tar.gz
platform-system-core-5bed8036644f552210a7cfcbed2d6d20cf2981b0.tar.xz
platform-system-core-5bed8036644f552210a7cfcbed2d6d20cf2981b0.zip
libutils: turn on -Werror
- Deal with some -Wunused issues - Override PRI macros (windows) - Revert use of PRI macros on off64_t (linux) - Deal with a gnu++11 complaince issue Change-Id: Ie66751293bd84477a5a6dfd8a57e700a16e36964
Diffstat (limited to 'libutils/SystemClock.cpp')
-rw-r--r--libutils/SystemClock.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/libutils/SystemClock.cpp b/libutils/SystemClock.cpp
index 413250f48..dbad581ff 100644
--- a/libutils/SystemClock.cpp
+++ b/libutils/SystemClock.cpp
@@ -68,13 +68,7 @@ int64_t elapsedRealtime()
68 */ 68 */
69#define DEBUG_TIMESTAMP 0 69#define DEBUG_TIMESTAMP 0
70 70
71static const char *gettime_method_names[] = { 71#if DEBUG_TIMESTAMP && defined(ARCH_ARM)
72 "clock_gettime",
73 "ioctl",
74 "systemTime",
75};
76
77#if DEBUG_TIMESTAMP
78static inline void checkTimeStamps(int64_t timestamp, 72static inline void checkTimeStamps(int64_t timestamp,
79 int64_t volatile *prevTimestampPtr, 73 int64_t volatile *prevTimestampPtr,
80 int volatile *prevMethodPtr, 74 int volatile *prevMethodPtr,
@@ -85,11 +79,16 @@ static inline void checkTimeStamps(int64_t timestamp,
85 * gettid, and int64_t is different on the ARM platform 79 * gettid, and int64_t is different on the ARM platform
86 * (ie long vs long long). 80 * (ie long vs long long).
87 */ 81 */
88#ifdef ARCH_ARM
89 int64_t prevTimestamp = *prevTimestampPtr; 82 int64_t prevTimestamp = *prevTimestampPtr;
90 int prevMethod = *prevMethodPtr; 83 int prevMethod = *prevMethodPtr;
91 84
92 if (timestamp < prevTimestamp) { 85 if (timestamp < prevTimestamp) {
86 static const char *gettime_method_names[] = {
87 "clock_gettime",
88 "ioctl",
89 "systemTime",
90 };
91
93 ALOGW("time going backwards: prev %lld(%s) vs now %lld(%s), tid=%d", 92 ALOGW("time going backwards: prev %lld(%s) vs now %lld(%s), tid=%d",
94 prevTimestamp, gettime_method_names[prevMethod], 93 prevTimestamp, gettime_method_names[prevMethod],
95 timestamp, gettime_method_names[curMethod], 94 timestamp, gettime_method_names[curMethod],
@@ -99,7 +98,6 @@ static inline void checkTimeStamps(int64_t timestamp,
99 // write is interrupted or not observed as a whole. 98 // write is interrupted or not observed as a whole.
100 *prevTimestampPtr = timestamp; 99 *prevTimestampPtr = timestamp;
101 *prevMethodPtr = curMethod; 100 *prevMethodPtr = curMethod;
102#endif
103} 101}
104#else 102#else
105#define checkTimeStamps(timestamp, prevTimestampPtr, prevMethodPtr, curMethod) 103#define checkTimeStamps(timestamp, prevTimestampPtr, prevMethodPtr, curMethod)