summaryrefslogtreecommitdiffstats
path: root/libziparchive
diff options
context:
space:
mode:
authorDmitriy Ivanov <dimitry@google.com>2015-03-06 13:27:59 -0800
committerDmitriy Ivanov <dimitry@google.com>2015-03-06 13:57:43 -0800
commitf94e15900779904c1ac934e9c0679044c4974441 (patch)
treef0fd5df11286a86f8f4c2e2a54903a873de616c8 /libziparchive
parent25d2a1a916058634a23d89d287b18eb18c140081 (diff)
downloadcore-f94e15900779904c1ac934e9c0679044c4974441.tar.gz
core-f94e15900779904c1ac934e9c0679044c4974441.tar.bz2
core-f94e15900779904c1ac934e9c0679044c4974441.zip
Reapply -Wold-style-cast
Added pragmas to disable checks for the method using libz.h macros. Change-Id: I25aa1adf09f3ecff61d8fea6306b24b37990ab46
Diffstat (limited to 'libziparchive')
-rw-r--r--libziparchive/Android.mk1
-rw-r--r--libziparchive/zip_archive.cc10
2 files changed, 10 insertions, 1 deletions
diff --git a/libziparchive/Android.mk b/libziparchive/Android.mk
index 027ad1686..3937449a8 100644
--- a/libziparchive/Android.mk
+++ b/libziparchive/Android.mk
@@ -25,6 +25,7 @@ LOCAL_STATIC_LIBRARIES := libz
LOCAL_SHARED_LIBRARIES := libutils
LOCAL_MODULE:= libziparchive
LOCAL_CFLAGS := -Werror -Wall
+LOCAL_CPPFLAGS := -Wold-style-cast
include $(BUILD_STATIC_LIBRARY)
include $(CLEAR_VARS)
diff --git a/libziparchive/zip_archive.cc b/libziparchive/zip_archive.cc
index f96cba643..c560b9b54 100644
--- a/libziparchive/zip_archive.cc
+++ b/libziparchive/zip_archive.cc
@@ -970,6 +970,14 @@ int32_t Next(void* cookie, ZipEntry* data, ZipEntryName* name) {
return kIterationEnd;
}
+// This method is using libz macros with old-style-casts
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wold-style-cast"
+static inline int zlib_inflateInit2(z_stream* stream, int window_bits) {
+ return inflateInit2(stream, window_bits);
+}
+#pragma GCC diagnostic pop
+
static int32_t InflateToFile(int fd, const ZipEntry* entry,
uint8_t* begin, uint32_t length,
uint64_t* crc_out) {
@@ -997,7 +1005,7 @@ static int32_t InflateToFile(int fd, const ZipEntry* entry,
* Use the undocumented "negative window bits" feature to tell zlib
* that there's no zlib header waiting for it.
*/
- zerr = inflateInit2(&zstream, -MAX_WBITS);
+ zerr = zlib_inflateInit2(&zstream, -MAX_WBITS);
if (zerr != Z_OK) {
if (zerr == Z_VERSION_ERROR) {
ALOGE("Installed zlib is not compatible with linked version (%s)",