diff options
author | Mark Salyzyn <salyzyn@google.com> | 2014-04-30 11:10:46 -0700 |
---|---|---|
committer | Mark Salyzyn <salyzyn@google.com> | 2014-06-02 15:57:50 -0700 |
commit | 5bed8036644f552210a7cfcbed2d6d20cf2981b0 (patch) | |
tree | 37f784e181086e99b17e00d46b6da30529751539 /libutils/SystemClock.cpp | |
parent | bf0f25905b12581f05b65b1ebe95211c727ae483 (diff) | |
download | system_core-5bed8036644f552210a7cfcbed2d6d20cf2981b0.tar.gz system_core-5bed8036644f552210a7cfcbed2d6d20cf2981b0.tar.bz2 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.cpp | 16 |
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() */ #define DEBUG_TIMESTAMP 0 -static const char *gettime_method_names[] = { - "clock_gettime", - "ioctl", - "systemTime", -}; - -#if DEBUG_TIMESTAMP +#if DEBUG_TIMESTAMP && defined(ARCH_ARM) static inline void checkTimeStamps(int64_t timestamp, int64_t volatile *prevTimestampPtr, int volatile *prevMethodPtr, @@ -85,11 +79,16 @@ static inline void checkTimeStamps(int64_t timestamp, * gettid, and int64_t is different on the ARM platform * (ie long vs long long). */ -#ifdef ARCH_ARM int64_t prevTimestamp = *prevTimestampPtr; int prevMethod = *prevMethodPtr; if (timestamp < prevTimestamp) { + static const char *gettime_method_names[] = { + "clock_gettime", + "ioctl", + "systemTime", + }; + ALOGW("time going backwards: prev %lld(%s) vs now %lld(%s), tid=%d", prevTimestamp, gettime_method_names[prevMethod], timestamp, gettime_method_names[curMethod], @@ -99,7 +98,6 @@ static inline void checkTimeStamps(int64_t timestamp, // write is interrupted or not observed as a whole. *prevTimestampPtr = timestamp; *prevMethodPtr = curMethod; -#endif } #else #define checkTimeStamps(timestamp, prevTimestampPtr, prevMethodPtr, curMethod) |