Merge "imgpatch: Compile with ZLIB_CONST defined." am: e78ca37656
am: ca261d3b48
Change-Id: I0278ded6acb4c003c65cb6b71b7b52a7824fe2fc
diff --git a/applypatch/Android.mk b/applypatch/Android.mk
index 85b5c9f..bdaef1b 100644
--- a/applypatch/Android.mk
+++ b/applypatch/Android.mk
@@ -35,7 +35,9 @@
libcrypto \
libbz \
libz
-LOCAL_CFLAGS := -Werror
+LOCAL_CFLAGS := \
+ -DZLIB_CONST \
+ -Werror
include $(BUILD_STATIC_LIBRARY)
# libimgpatch (static library)
@@ -54,7 +56,9 @@
libcrypto \
libbz \
libz
-LOCAL_CFLAGS := -Werror
+LOCAL_CFLAGS := \
+ -DZLIB_CONST \
+ -Werror
include $(BUILD_STATIC_LIBRARY)
# libimgpatch (host static library)
@@ -74,7 +78,9 @@
libcrypto \
libbz \
libz
-LOCAL_CFLAGS := -Werror
+LOCAL_CFLAGS := \
+ -DZLIB_CONST \
+ -Werror
include $(BUILD_HOST_STATIC_LIBRARY)
# libapplypatch_modes (static library)
diff --git a/applypatch/imgpatch.cpp b/applypatch/imgpatch.cpp
index ae6071f..00ea90e 100644
--- a/applypatch/imgpatch.cpp
+++ b/applypatch/imgpatch.cpp
@@ -160,7 +160,7 @@
strm.zfree = Z_NULL;
strm.opaque = Z_NULL;
strm.avail_in = src_len;
- strm.next_in = const_cast<unsigned char*>(old_data + src_start);
+ strm.next_in = old_data + src_start;
strm.avail_out = expanded_len;
strm.next_out = expanded_source.data();