From: Mark Adler Date: Mon, 23 Jan 2017 07:38:52 +0000 (-0800) Subject: Fix CLEAR_HASH macro to be usable as a single statement. X-Git-Tag: 1.9.9-b1~566 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=09cf70a11773712fc6b3d3d41e163bf8478aaf55;p=thirdparty%2Fzlib-ng.git Fix CLEAR_HASH macro to be usable as a single statement. As it is used in deflateParams(). --- diff --git a/deflate.c b/deflate.c index bdf6f211..30c6d984 100644 --- a/deflate.c +++ b/deflate.c @@ -153,9 +153,10 @@ static const config configuration_table[10] = { * Initialize the hash table (avoiding 64K overflow for 16 bit systems). * prev[] will be initialized on the fly. */ -#define CLEAR_HASH(s) \ - s->head[s->hash_size-1] = NIL; \ - memset((unsigned char *)s->head, 0, (unsigned)(s->hash_size-1)*sizeof(*s->head)); +#define CLEAR_HASH(s) do { \ + s->head[s->hash_size - 1] = NIL; \ + memset((unsigned char *)s->head, 0, (unsigned)(s->hash_size - 1) * sizeof(*s->head)); \ + } while (0) /* =========================================================================== * Slide the hash table when sliding the window down (could be avoided with 32