diff options
author | 2014-11-07 22:24:57 -0800 | |
---|---|---|
committer | 2014-11-07 22:24:57 -0800 | |
commit | 25df5fba3afff403c749bab7d1d5652c3b929e06 (patch) | |
tree | 6828c6d566c437c022ef366322587da248d67c6d | |
parent | 487ae9b8dc3e08c1a830d519a801a07cd59c8f2b (diff) |
Frameworks/base: Fix more warnings
Exposed by switching the target to Clang, and GCC 4.9 used by
MIPS.
Change-Id: Icb79285ab2306c39c2d381e53ea2e643ee2d2947
-rw-r--r-- | libs/androidfw/BackupData.cpp | 10 | ||||
-rw-r--r-- | libs/androidfw/BackupHelpers.cpp | 2 | ||||
-rw-r--r-- | libs/androidfw/ResourceTypes.cpp | 4 |
3 files changed, 5 insertions, 11 deletions
diff --git a/libs/androidfw/BackupData.cpp b/libs/androidfw/BackupData.cpp index 2b45a708cb90..ba4a4ff4fe63 100644 --- a/libs/androidfw/BackupData.cpp +++ b/libs/androidfw/BackupData.cpp @@ -45,12 +45,6 @@ static const bool kIsDebug = false; const static int ROUND_UP[4] = { 0, 3, 2, 1 }; static inline size_t -round_up(size_t n) -{ - return n + ROUND_UP[n % 4]; -} - -static inline size_t padding_extra(size_t n) { return ROUND_UP[n % 4]; @@ -343,7 +337,7 @@ BackupDataReader::ReadEntityData(void* data, size_t size) } int remaining = m_dataEndPos - m_pos; if (kIsDebug) { - ALOGD("ReadEntityData size=%d m_pos=0x%x m_dataEndPos=0x%x remaining=%d\n", + ALOGD("ReadEntityData size=%zu m_pos=0x%zx m_dataEndPos=0x%zx remaining=%d\n", size, m_pos, m_dataEndPos, remaining); } if (remaining <= 0) { @@ -353,7 +347,7 @@ BackupDataReader::ReadEntityData(void* data, size_t size) size = remaining; } if (kIsDebug) { - ALOGD(" reading %d bytes", size); + ALOGD(" reading %zu bytes", size); } int amt = read(m_fd, data, size); if (amt < 0) { diff --git a/libs/androidfw/BackupHelpers.cpp b/libs/androidfw/BackupHelpers.cpp index 36a4cfef5243..c78593d23ed6 100644 --- a/libs/androidfw/BackupHelpers.cpp +++ b/libs/androidfw/BackupHelpers.cpp @@ -555,7 +555,7 @@ int write_tarfile(const String8& packageName, const String8& domain, snprintf(buf + 124, 12, "%011llo", (isdir) ? 0LL : s.st_size); // [ 136 : 12 ] last mod time as a UTC time_t - snprintf(buf + 136, 12, "%0lo", s.st_mtime); + snprintf(buf + 136, 12, "%0lo", (unsigned long)s.st_mtime); // [ 156 : 1 ] link/file type uint8_t type; diff --git a/libs/androidfw/ResourceTypes.cpp b/libs/androidfw/ResourceTypes.cpp index e2263d2019c8..679a75fdc5d9 100644 --- a/libs/androidfw/ResourceTypes.cpp +++ b/libs/androidfw/ResourceTypes.cpp @@ -733,8 +733,8 @@ const char16_t* ResStringPool::stringAt(size_t idx, size_t* u16len) const } #else // We do not want to be in this case when actually running Android. - ALOGW("CREATING STRING CACHE OF %d bytes", - mHeader->stringCount*sizeof(char16_t**)); + ALOGW("CREATING STRING CACHE OF %zu bytes", + static_cast<size_t>(mHeader->stringCount*sizeof(char16_t**))); #endif mCache = (char16_t**)calloc(mHeader->stringCount, sizeof(char16_t**)); if (mCache == NULL) { |