diff options
author | Andreas Gampe <agampe@google.com> | 2014-11-12 17:35:15 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-11-12 17:35:15 +0000 |
commit | b93f8d02f886d078b268fe5fd61a95f6911c2644 (patch) | |
tree | 57d68c45611aebc3449a3b2d0070147e85c54ba1 /libs | |
parent | 34acb4c8d4abe1c4f580b85ddc84b18b7e38e417 (diff) | |
parent | 4c57eda9f4c87bb22eb0acdd2dab4d1757d4280b (diff) | |
download | frameworks_base-b93f8d02f886d078b268fe5fd61a95f6911c2644.zip frameworks_base-b93f8d02f886d078b268fe5fd61a95f6911c2644.tar.gz frameworks_base-b93f8d02f886d078b268fe5fd61a95f6911c2644.tar.bz2 |
Merge "Frameworks/base: Wall Werror in common_time"
Diffstat (limited to 'libs')
-rw-r--r-- | libs/common_time/Android.mk | 2 | ||||
-rw-r--r-- | libs/common_time/clock_recovery.cpp | 4 | ||||
-rw-r--r-- | libs/common_time/clock_recovery.h | 1 | ||||
-rw-r--r-- | libs/common_time/common_clock.cpp | 3 | ||||
-rw-r--r-- | libs/common_time/common_time_server.cpp | 6 | ||||
-rw-r--r-- | libs/common_time/common_time_server_api.cpp | 22 | ||||
-rw-r--r-- | libs/common_time/main.cpp | 2 |
7 files changed, 23 insertions, 17 deletions
diff --git a/libs/common_time/Android.mk b/libs/common_time/Android.mk index 75eb528..1fec504 100644 --- a/libs/common_time/Android.mk +++ b/libs/common_time/Android.mk @@ -33,4 +33,6 @@ LOCAL_SHARED_LIBRARIES := \ LOCAL_MODULE_TAGS := optional LOCAL_MODULE := common_time +LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code + include $(BUILD_EXECUTABLE) diff --git a/libs/common_time/clock_recovery.cpp b/libs/common_time/clock_recovery.cpp index 3a7c70c..392caa0 100644 --- a/libs/common_time/clock_recovery.cpp +++ b/libs/common_time/clock_recovery.cpp @@ -22,6 +22,7 @@ #define __STDC_LIMIT_MACROS #define LOG_TAG "common_time" #include <utils/Log.h> +#include <inttypes.h> #include <stdint.h> #include <common_time/local_clock.h> @@ -280,7 +281,7 @@ bool ClockRecoveryLoop::pushDisciplineEvent(int64_t local_time, // system. setTargetCorrection_l(tgt_correction); - LOG_TS("clock_loop %lld %f %f %f %d\n", raw_delta, delta_f, CO, CObias, tgt_correction); + LOG_TS("clock_loop %" PRId64 " %f %f %f %d\n", raw_delta, delta_f, CO, CObias, tgt_correction); #ifdef TIME_SERVICE_DEBUG diag_thread_->pushDisciplineEvent( @@ -335,7 +336,6 @@ void ClockRecoveryLoop::setTargetCorrection_l(int32_t tgt) { // 300mSec. if (tgt_correction_ != tgt) { int64_t now = local_clock_->getLocalTime(); - status_t res; tgt_correction_ = tgt; diff --git a/libs/common_time/clock_recovery.h b/libs/common_time/clock_recovery.h index b6c87ff..278a75e 100644 --- a/libs/common_time/clock_recovery.h +++ b/libs/common_time/clock_recovery.h @@ -111,7 +111,6 @@ class ClockRecoveryLoop { bool last_error_est_valid_; int32_t last_error_est_usec_; float last_delta_f_; - int32_t integrated_error_; int32_t tgt_correction_; int32_t cur_correction_; LinearTransform time_to_cur_slew_; diff --git a/libs/common_time/common_clock.cpp b/libs/common_time/common_clock.cpp index c9eb388..ee326e1 100644 --- a/libs/common_time/common_clock.cpp +++ b/libs/common_time/common_clock.cpp @@ -19,6 +19,7 @@ #define LOG_TAG "common_time" #include <utils/Log.h> +#include <inttypes.h> #include <stdint.h> #include <utils/Errors.h> @@ -50,7 +51,7 @@ bool CommonClock::init(uint64_t local_freq) { LinearTransform::reduce(&numer, &denom); if ((numer > UINT32_MAX) || (denom > UINT32_MAX)) { - ALOGE("Overflow in CommonClock::init while trying to reduce %lld/%lld", + ALOGE("Overflow in CommonClock::init while trying to reduce %" PRIu64 "/%" PRIu64, kCommonFreq, local_freq); return false; } diff --git a/libs/common_time/common_time_server.cpp b/libs/common_time/common_time_server.cpp index 3e11987..01372e0 100644 --- a/libs/common_time/common_time_server.cpp +++ b/libs/common_time/common_time_server.cpp @@ -25,6 +25,7 @@ #include <arpa/inet.h> #include <assert.h> #include <fcntl.h> +#include <inttypes.h> #include <linux/if_ether.h> #include <net/if.h> #include <net/if_arp.h> @@ -969,13 +970,14 @@ bool CommonTimeServer::handleSyncResponse( // if the RTT of the packet is significantly larger than the panic // threshold, we should simply discard it. Its better to do nothing // than to take cues from a packet like that. - int rttCommon = mCommonClock.localDurationToCommonDuration(rtt); + int64_t rttCommon = mCommonClock.localDurationToCommonDuration(rtt); if (rttCommon > (static_cast<int64_t>(mPanicThresholdUsec) * kRTTDiscardPanicThreshMultiplier)) { - ALOGV("Dropping sync response with RTT of %lld uSec", rttCommon); + ALOGV("Dropping sync response with RTT of %" PRId64 " uSec", rttCommon); mClient_ExpiredSyncRespsRXedFromCurMaster++; if (shouldPanicNotGettingGoodData()) return becomeInitial("RX panic, no good data"); + return true; } else { result = mClockRecovery.pushDisciplineEvent(avgLocal, avgCommon, rttCommon); mClient_LastGoodSyncRX = clientRxLocalTime; diff --git a/libs/common_time/common_time_server_api.cpp b/libs/common_time/common_time_server_api.cpp index e157071..e0f35a9 100644 --- a/libs/common_time/common_time_server_api.cpp +++ b/libs/common_time/common_time_server_api.cpp @@ -27,6 +27,8 @@ #include "common_time_server.h" +#include <inttypes.h> + namespace android { // @@ -286,7 +288,7 @@ void CommonTimeServer::reevaluateAutoDisableState(bool commonClockHasClients) { #define checked_percentage(a, b) ((0 == b) ? 0.0f : ((100.0f * a) / b)) status_t CommonTimeServer::dumpClockInterface(int fd, - const Vector<String16>& args, + const Vector<String16>& /* args */, size_t activeClients) { AutoMutex _lock(&mLock); const size_t SIZE = 256; @@ -308,15 +310,15 @@ status_t CommonTimeServer::dumpClockInterface(int fd, synced = (OK == mCommonClock.localToCommon(localTime, &commonTime)); sockaddrToString(mMasterEP, mMasterEPValid, maStr, sizeof(maStr)); - dump_printf("Common Clock Service Status\nLocal time : %lld\n", + dump_printf("Common Clock Service Status\nLocal time : %" PRId64 "\n", localTime); if (synced) - dump_printf("Common time : %lld\n", commonTime); + dump_printf("Common time : %" PRId64 "\n", commonTime); else dump_printf("Common time : %s\n", "not synced"); - dump_printf("Timeline ID : %016llx\n", mTimelineID); + dump_printf("Timeline ID : %016" PRIu64 "\n", mTimelineID); dump_printf("State : %s\n", stateToString(mState)); dump_printf("Master Addr : %s\n", maStr); @@ -349,10 +351,10 @@ status_t CommonTimeServer::dumpClockInterface(int fd, int64_t localDelta, usecDelta; localDelta = localTime - mClient_LastGoodSyncRX; usecDelta = mCommonClock.localDurationToCommonDuration(localDelta); - dump_printf("Last Good RX : %lld uSec ago\n", usecDelta); + dump_printf("Last Good RX : %" PRId64 " uSec ago\n", usecDelta); } - dump_printf("Active Clients : %u\n", activeClients); + dump_printf("Active Clients : %zu\n", activeClients); mClient_PacketRTTLog.dumpLog(fd, mCommonClock); mStateChangeLog.dumpLog(fd); mElectionLog.dumpLog(fd); @@ -363,7 +365,7 @@ status_t CommonTimeServer::dumpClockInterface(int fd, } status_t CommonTimeServer::dumpConfigInterface(int fd, - const Vector<String16>& args) { + const Vector<String16>& /* args */) { AutoMutex _lock(&mLock); const size_t SIZE = 256; char buffer[SIZE]; @@ -383,7 +385,7 @@ status_t CommonTimeServer::dumpConfigInterface(int fd, "Bound Interface : %s\n", mBindIfaceValid ? mBindIface.string() : "<unbound>"); dump_printf("Master Election Endpoint : %s\n", meStr); - dump_printf("Master Election Group ID : %016llx\n", mSyncGroupID); + dump_printf("Master Election Group ID : %016" PRIu64 "\n", mSyncGroupID); dump_printf("Master Announce Interval : %d mSec\n", mMasterAnnounceIntervalMs); dump_printf("Client Sync Interval : %d mSec\n", @@ -419,12 +421,12 @@ void CommonTimeServer::PacketRTTLog::dumpLog(int fd, const CommonClock& cclk) { if (rxTimes[i]) { int64_t delta = rxTimes[i] - txTimes[i]; int64_t deltaUsec = cclk.localDurationToCommonDuration(delta); - dump_printf("pkt[%2d] : localTX %12lld localRX %12lld " + dump_printf("pkt[%2d] : localTX %12" PRId64 " localRX %12" PRId64 " " "(%.3f msec RTT)\n", ndx, txTimes[i], rxTimes[i], static_cast<float>(deltaUsec) / 1000.0); } else { - dump_printf("pkt[%2d] : localTX %12lld localRX never\n", + dump_printf("pkt[%2d] : localTX %12" PRId64 " localRX never\n", ndx, txTimes[i]); } i = (i + 1) % RTT_LOG_SIZE; diff --git a/libs/common_time/main.cpp b/libs/common_time/main.cpp index 49eb30a..ac52c85 100644 --- a/libs/common_time/main.cpp +++ b/libs/common_time/main.cpp @@ -27,7 +27,7 @@ #include "common_time_server.h" -int main(int argc, char *argv[]) { +int main() { using namespace android; sp<CommonTimeServer> service = new CommonTimeServer(); |