summaryrefslogtreecommitdiff
path: root/patches
diff options
context:
space:
mode:
authorDaniel Bratell <bratell@opera.com>2018-01-11 01:01:17 +0000
committerCommit Bot <commit-bot@chromium.org>2018-01-11 01:01:17 +0000
commit2eb3889273e6bd70a4b1183aaec4ee4d65e94f0b (patch)
treeb70140571461333959519076a136204ef29ec610 /patches
parent8e904b333705c2472e94375b9c70511e27c6a9ff (diff)
downloadzlib-2eb3889273e6bd70a4b1183aaec4ee4d65e94f0b.tar.gz
Avoid exporting read_buf renaming from zlib
zlib.h includes a macro that renames read_buf->Cr_z_read_buf. Since read_buf is a common name in other parts of the code, it causes some random confusion depending on whether zlib.h has been included or not. The renaming macro is a side effect of the 0001-simd.patch that exposes an internal read_buf method to other files in zlib. This patch renames read_buf as it is exposed so that it has the less common name deflate_read_buf. Bug: 799448 Change-Id: Icdc4eba973891dfd28d82017415048eded62d577 Reviewed-on: https://chromium-review.googlesource.com/852257 Commit-Queue: Daniel Bratell <bratell@opera.com> Reviewed-by: Chris Blume <cblume@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#528512} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: 2c709d38a1c6f812da205c03f5448fe4ac5679f3
Diffstat (limited to 'patches')
-rw-r--r--patches/0001-simd.patch14
-rw-r--r--patches/0005-adler32-simd.patch2
2 files changed, 9 insertions, 7 deletions
diff --git a/patches/0001-simd.patch b/patches/0001-simd.patch
index 75828d2..1fbf195 100644
--- a/patches/0001-simd.patch
+++ b/patches/0001-simd.patch
@@ -559,7 +559,7 @@ index 1ec761448de9..aa0c9c67a6dc 100644
local void putShortMSB OF((deflate_state *s, uInt b));
local void flush_pending OF((z_streamp strm));
-local unsigned read_buf OF((z_streamp strm, Bytef *buf, unsigned size));
-+unsigned ZLIB_INTERNAL read_buf OF((z_streamp strm, Bytef *buf, unsigned size));
++unsigned ZLIB_INTERNAL deflate_read_buf OF((z_streamp strm, Bytef *buf, unsigned size));
#ifdef ASMV
# pragma message("Assembler code may have bugs -- use at your own risk")
void match_init OF((void)); /* asm code initialization */
@@ -703,7 +703,7 @@ index 1ec761448de9..aa0c9c67a6dc 100644
* (See also flush_pending()).
*/
-local unsigned read_buf(strm, buf, size)
-+ZLIB_INTERNAL unsigned read_buf(strm, buf, size)
++ZLIB_INTERNAL unsigned deflate_read_buf(strm, buf, size)
z_streamp strm;
Bytef *buf;
unsigned size;
@@ -859,7 +859,7 @@ new file mode 100644
index 000000000000..949ccce1ba9c
--- /dev/null
+++ b/fill_window_sse.c
-@@ -0,0 +1,175 @@
+@@ -0,0 +1,177 @@
+/*
+ * Fill Window with SSE2-optimized hash shifting
+ *
@@ -888,7 +888,7 @@ index 000000000000..949ccce1ba9c
+ }\
+ }\
+
-+extern int read_buf OF((z_streamp strm, Bytef *buf, unsigned size));
++extern int deflate_read_buf OF((z_streamp strm, Bytef *buf, unsigned size));
+
+void fill_window_sse(deflate_state *s)
+{
@@ -979,7 +979,9 @@ index 000000000000..949ccce1ba9c
+ */
+ Assert(more >= 2, "more < 2");
+
-+ n = read_buf(s->strm, s->window + s->strstart + s->lookahead, more);
++ n = deflate_read_buf(s->strm,
++ s->window + s->strstart + s->lookahead,
++ more);
+ s->lookahead += n;
+
+ /* Initialize the hash value now that we have some input: */
@@ -1051,7 +1053,7 @@ index f18df5684dc5..3436baa4eb57 100644
+#define crc_fold_init Cr_z_crc_fold_init
+#define crc_reset Cr_z_crc_reset
+#define fill_window_sse Cr_z_fill_window_sse
-+#define read_buf Cr_z_read_buf
++#define deflate_read_buf Cr_z_deflate_read_buf
+#define x86_check_features Cr_z_x86_check_features
+#define x86_cpu_enable_simd Cr_z_x86_cpu_enable_simd
+
diff --git a/patches/0005-adler32-simd.patch b/patches/0005-adler32-simd.patch
index 7034389..9242b1d 100644
--- a/patches/0005-adler32-simd.patch
+++ b/patches/0005-adler32-simd.patch
@@ -603,7 +603,7 @@ index 3436baa4eb57..cd98ec9940b6 100644
+++ b/third_party/zlib/names.h
@@ -162,6 +162,13 @@
#define fill_window_sse Cr_z_fill_window_sse
- #define read_buf Cr_z_read_buf
+ #define deflate_read_buf Cr_z_deflate_read_buf
#define x86_check_features Cr_z_x86_check_features
+/* FIXME: x86_cpu_enable_ssse3 wasn't part of the simd.patch */
+#define x86_cpu_enable_ssse3 Cr_z_x86_cpu_enable_ssse3