From owner-svn-src-head@FreeBSD.ORG Sat Jun 13 13:54:04 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C4F11065738; Sat, 13 Jun 2009 13:54:04 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A24F8FC1A; Sat, 13 Jun 2009 13:54:04 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5DDs4dS015583; Sat, 13 Jun 2009 13:54:04 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5DDs4Za015582; Sat, 13 Jun 2009 13:54:04 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200906131354.n5DDs4Za015582@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 13 Jun 2009 13:54:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194109 - head/usr.sbin/nscd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 13:54:05 -0000 Author: des Date: Sat Jun 13 13:54:03 2009 New Revision: 194109 URL: http://svn.freebsd.org/changeset/base/194109 Log: Wrap some macros that needed wrapping. MFC after: 1 week Modified: head/usr.sbin/nscd/hashtable.h Modified: head/usr.sbin/nscd/hashtable.h ============================================================================== --- head/usr.sbin/nscd/hashtable.h Sat Jun 13 13:49:12 2009 (r194108) +++ head/usr.sbin/nscd/hashtable.h Sat Jun 13 13:54:03 2009 (r194109) @@ -65,7 +65,8 @@ typedef unsigned int hashtable_index_t; size_t entries_size; \ } -#define HASHTABLE_ENTRIES_COUNT(table) ((table)->entries_size) +#define HASHTABLE_ENTRIES_COUNT(table) \ + ((table)->entries_size) /* * Unlike most of queue.h data types, hash tables can not be initialized @@ -99,7 +100,8 @@ typedef unsigned int hashtable_index_t; } \ } while (0) -#define HASHTABLE_GET_ENTRY(table, hash) (&((table)->entries[hash])) +#define HASHTABLE_GET_ENTRY(table, hash) \ + (&((table)->entries[hash])) /* * Traverses through all hash table entries @@ -127,14 +129,18 @@ typedef unsigned int hashtable_index_t; ((entry)->field.capacity) #define HASHTABLE_ENTRY_CAPACITY_INCREASE(entry, field, type) \ - (entry)->field.capacity *= 2; \ - (entry)->field.values = realloc((entry)->field.values, \ - (entry)->field.capacity * sizeof(type)); + do { \ + (entry)->field.capacity *= 2; \ + (entry)->field.values = realloc((entry)->field.values, \ + (entry)->field.capacity * sizeof(type)); \ + } while (0) #define HASHTABLE_ENTRY_CAPACITY_DECREASE(entry, field, type) \ - (entry)->field.capacity /= 2; \ - (entry)->field.values = realloc((entry)->field.values, \ - (entry)->field.capacity * sizeof(type)); + do { \ + (entry)->field.capacity /= 2; \ + (entry)->field.values = realloc((entry)->field.values, \ + (entry)->field.capacity * sizeof(type)); \ + } while (0) /* * Generates prototypes for the hash table functions