From ebee1379eaf4306eb2de9437844009aa7eb18c28 Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Fri, 7 Nov 2014 16:28:19 -0800 Subject: [PATCH] Frameworks/base: Fix two warnings in cmds Change-Id: Ifb9c7fb7a2d28c13010ddc186bea5f5f0daefb4a --- cmds/backup/backup.cpp | 2 +- cmds/idmap/create.cpp | 2 +- include/androidfw/ResourceTypes.h | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/cmds/backup/backup.cpp b/cmds/backup/backup.cpp index 03ceffae07c36..8d9b528ae6a94 100644 --- a/cmds/backup/backup.cpp +++ b/cmds/backup/backup.cpp @@ -75,7 +75,7 @@ static int perform_list(const char* filename) size_t dataSize; err = reader.ReadEntityHeader(&key, &dataSize); if (err == 0) { - printf(" entity: %s (%d bytes)\n", key.string(), dataSize); + printf(" entity: %s (%zu bytes)\n", key.string(), dataSize); } else { printf(" Error reading entity header\n"); } diff --git a/cmds/idmap/create.cpp b/cmds/idmap/create.cpp index 28da3d6d22eb1..7a501a4ee497d 100644 --- a/cmds/idmap/create.cpp +++ b/cmds/idmap/create.cpp @@ -78,7 +78,7 @@ fail: if (fstat(idmap_fd, &st) == -1) { return true; } - if (st.st_size < N) { + if (st.st_size < static_cast(N)) { // file is empty or corrupt return true; } diff --git a/include/androidfw/ResourceTypes.h b/include/androidfw/ResourceTypes.h index f7730f2f3ffed..a44975b37eb26 100644 --- a/include/androidfw/ResourceTypes.h +++ b/include/androidfw/ResourceTypes.h @@ -1773,9 +1773,7 @@ public: const char* targetPath, const char* overlayPath, void** outData, size_t* outSize) const; - enum { - IDMAP_HEADER_SIZE_BYTES = 4 * sizeof(uint32_t) + 2 * 256, - }; + static const size_t IDMAP_HEADER_SIZE_BYTES = 4 * sizeof(uint32_t) + 2 * 256; // Retrieve idmap meta-data. //