aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2019-08-25 23:51:44 +0000
committerXin LI <delphij@FreeBSD.org>2019-08-25 23:51:44 +0000
commitbefc3e504defb55fa81ac99bed8098e8a9f5259b (patch)
tree47ed67c19ae1f77739aa2a2baf9814c0e61ef8fe
parentab4f92b809f69e5aa438deb842e017752d981bc8 (diff)
downloadsrc-vendor/zlib.tar.gz
src-vendor/zlib.zip
Import vendor commit 38e8ce32afbaa82f67d992b9f3056f281fe69259:vendor/zlib
Author: Mark Adler <madler@alumni.caltech.edu> Date: Sun Jan 22 23:38:52 2017 -0800 Fix CLEAR_HASH macro to be usable as a single statement. As it is used in deflateParams().
Notes
Notes: svn path=/vendor/zlib/dist/; revision=351500
-rw-r--r--deflate.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/deflate.c b/deflate.c
index 7f2c8a2a2a64..00c6e05c7769 100644
--- a/deflate.c
+++ b/deflate.c
@@ -190,8 +190,11 @@ local const config configuration_table[10] = {
* prev[] will be initialized on the fly.
*/
#define CLEAR_HASH(s) \
- s->head[s->hash_size-1] = NIL; \
- zmemzero((Bytef *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head));
+ do { \
+ s->head[s->hash_size-1] = NIL; \
+ zmemzero((Bytef *)s->head, \
+ (unsigned)(s->hash_size-1)*sizeof(*s->head)); \
+ } while (0)
/* ===========================================================================
* Slide the hash table when sliding the window down (could be avoided with 32