Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Sep 2019 06:04:23 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r352888 - stable/12/sys/contrib/zlib
Message-ID:  <201909300604.x8U64NXx061334@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201909300604.x8U64NXx061334>