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
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to