svn commit: r352888 - stable/12/sys/contrib/zlib

Xin LI delphij at FreeBSD.org
Mon Sep 30 06:04:23 UTC 2019


Author: delphij
Date: Mon Sep 30 06:04:22 2019
New Revision: 352888
URL: https://svnweb.freebsd.org/changeset/base/352888

Log:
  MFC r351501: MFV r351500: Fix CLEAR_HASH macro to be usable as a single
  statement.

Modified:
  stable/12/sys/contrib/zlib/deflate.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/contrib/zlib/deflate.c
==============================================================================
--- stable/12/sys/contrib/zlib/deflate.c	Mon Sep 30 05:43:57 2019	(r352887)
+++ stable/12/sys/contrib/zlib/deflate.c	Mon Sep 30 06:04:22 2019	(r352888)
@@ -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


More information about the svn-src-all mailing list