From 857d6a2a8e924618d37e75e6eda5e008a431cc48 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 23 Jan 2017 00:58:44 +0900 Subject: [PATCH] Fix compiler warning with Android NDK clang --- src/AbstractSingleDiskAdaptor.cc | 3 ++- src/MultiDiskAdaptor.cc | 3 ++- src/RequestGroupMan.cc | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/AbstractSingleDiskAdaptor.cc b/src/AbstractSingleDiskAdaptor.cc index 57de796ace..7210b2cee2 100644 --- a/src/AbstractSingleDiskAdaptor.cc +++ b/src/AbstractSingleDiskAdaptor.cc @@ -97,7 +97,8 @@ ssize_t AbstractSingleDiskAdaptor::readDataDropCache(unsigned char* data, void AbstractSingleDiskAdaptor::writeCache(const WrDiskCacheEntry* entry) { for (auto& d : entry->getDataSet()) { - A2_LOG_DEBUG(fmt("Cache flush goff=%" PRId64 ", len=%lu", d->goff, d->len)); + A2_LOG_DEBUG(fmt("Cache flush goff=%" PRId64 ", len=%lu", d->goff, + static_cast(d->len))); writeData(d->data + d->offset, d->len, d->goff); } } diff --git a/src/MultiDiskAdaptor.cc b/src/MultiDiskAdaptor.cc index 13c7364fbe..d4f419cf90 100644 --- a/src/MultiDiskAdaptor.cc +++ b/src/MultiDiskAdaptor.cc @@ -413,7 +413,8 @@ ssize_t MultiDiskAdaptor::readData(unsigned char* data, size_t len, void MultiDiskAdaptor::writeCache(const WrDiskCacheEntry* entry) { for (auto& d : entry->getDataSet()) { - A2_LOG_DEBUG(fmt("Cache flush goff=%" PRId64 ", len=%lu", d->goff, d->len)); + A2_LOG_DEBUG(fmt("Cache flush goff=%" PRId64 ", len=%lu", d->goff, + static_cast(d->len))); writeData(d->data + d->offset, d->len, d->goff); } } diff --git a/src/RequestGroupMan.cc b/src/RequestGroupMan.cc index 2296ac66f1..28a3e5475d 100644 --- a/src/RequestGroupMan.cc +++ b/src/RequestGroupMan.cc @@ -1106,7 +1106,7 @@ int RequestGroupMan::optimizeConcurrentDownloads() A2_LOG_DEBUG( fmt("Max concurrent downloads optimized at %d (%lu currently active) " "[optimization speed %sB/s, current speed %sB/s]", - maxConcurrentDownloads, numActive_, + maxConcurrentDownloads, static_cast(numActive_), util::abbrevSize(optimizationSpeed_).c_str(), util::abbrevSize(currentSpeed).c_str()));