diff options
Diffstat (limited to 'cmds/idmap')
-rw-r--r-- | cmds/idmap/create.cpp | 2 | ||||
-rw-r--r-- | cmds/idmap/scan.cpp | 13 |
2 files changed, 8 insertions, 7 deletions
diff --git a/cmds/idmap/create.cpp b/cmds/idmap/create.cpp index 16532b8..41395f1 100644 --- a/cmds/idmap/create.cpp +++ b/cmds/idmap/create.cpp @@ -23,7 +23,7 @@ namespace { if (entry == NULL) { return -1; } - if (!zip->getEntryInfo(entry, NULL, NULL, NULL, NULL, NULL, reinterpret_cast<long*>(crc))) { + if (!zip->getEntryInfo(entry, NULL, NULL, NULL, NULL, NULL, crc)) { return -1; } zip->releaseEntry(entry); diff --git a/cmds/idmap/scan.cpp b/cmds/idmap/scan.cpp index 84158d3..612a7eb 100644 --- a/cmds/idmap/scan.cpp +++ b/cmds/idmap/scan.cpp @@ -1,4 +1,5 @@ #include <dirent.h> +#include <inttypes.h> #include <sys/stat.h> #include "idmap.h" @@ -130,14 +131,14 @@ namespace { ALOGW("%s: failed to find entry AndroidManifest.xml\n", __FUNCTION__); return -1; } - size_t uncompLen = 0; - int method; + uint32_t uncompLen = 0; + uint16_t method; if (!zip->getEntryInfo(entry, &method, &uncompLen, NULL, NULL, NULL, NULL)) { ALOGW("%s: failed to read entry info\n", __FUNCTION__); return -1; } if (method != ZipFileRO::kCompressDeflated) { - ALOGW("%s: cannot handle zip compression method %d\n", __FUNCTION__, method); + ALOGW("%s: cannot handle zip compression method %" PRIu16 "\n", __FUNCTION__, method); return -1; } FileMap *dataMap = zip->createEntryFileMap(entry); @@ -147,19 +148,19 @@ namespace { } char *buf = new char[uncompLen]; if (NULL == buf) { - ALOGW("%s: failed to allocate %zd byte\n", __FUNCTION__, uncompLen); + ALOGW("%s: failed to allocate %" PRIu32 " byte\n", __FUNCTION__, uncompLen); delete dataMap; return -1; } StreamingZipInflater inflater(dataMap, uncompLen); if (inflater.read(buf, uncompLen) < 0) { - ALOGW("%s: failed to inflate %zd byte\n", __FUNCTION__, uncompLen); + ALOGW("%s: failed to inflate %" PRIu32 " byte\n", __FUNCTION__, uncompLen); delete[] buf; delete dataMap; return -1; } - int priority = parse_manifest(buf, uncompLen, target_package_name); + int priority = parse_manifest(buf, static_cast<size_t>(uncompLen), target_package_name); delete[] buf; delete dataMap; return priority; |