Module Name:    src
Committed By:   pgoyette
Date:           Thu Aug  8 22:18:20 UTC 2013

Modified Files:
        src/common/lib/libutil: snprintb.c

Log Message:
Now that all of the macros are enclosed in "do { ... } while 0" we can
remove unneded parenthesization of their invocations.

OK mrg@


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/common/lib/libutil/snprintb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/common/lib/libutil/snprintb.c
diff -u src/common/lib/libutil/snprintb.c:1.13 src/common/lib/libutil/snprintb.c:1.14
--- src/common/lib/libutil/snprintb.c:1.13	Thu Aug  8 16:43:13 2013
+++ src/common/lib/libutil/snprintb.c	Thu Aug  8 22:18:20 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: snprintb.c,v 1.13 2013/08/08 16:43:13 agc Exp $	*/
+/*	$NetBSD: snprintb.c,v 1.14 2013/08/08 22:18:20 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
 
 #  include <sys/cdefs.h>
 #  if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: snprintb.c,v 1.13 2013/08/08 16:43:13 agc Exp $");
+__RCSID("$NetBSD: snprintb.c,v 1.14 2013/08/08 22:18:20 pgoyette Exp $");
 #  endif
 
 #  include <sys/types.h>
@@ -51,7 +51,7 @@ __RCSID("$NetBSD: snprintb.c,v 1.13 2013
 #  include <errno.h>
 # else /* ! _KERNEL */
 #  include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: snprintb.c,v 1.13 2013/08/08 16:43:13 agc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: snprintb.c,v 1.14 2013/08/08 22:18:20 pgoyette Exp $");
 #  include <sys/param.h>
 #  include <sys/inttypes.h>
 #  include <sys/systm.h>
@@ -151,9 +151,9 @@ snprintb_m(char *buf, size_t buflen, con
 #define	PUTCHR(c) do {							\
 			if (l_max > 0 && (size_t)l_len >= (l_max - 1)) {\
 				BACKUP;					\
-				if (restart == 0) {			\
+				if (restart == 0)			\
 					STORE(c);			\
-				} else					\
+				else					\
 					sep = '<';			\
 			} else {					\
 				STORE(c);				\
@@ -217,12 +217,10 @@ snprintb_m(char *buf, size_t buflen, con
 					sep = ',';
 				if (ch == 'F')	/* just extract */
 					break;
-				if (restart == 0) {
+				if (restart == 0)
 					PUTS(bitfmt);
-				}
-				if (restart == 0) {
+				if (restart == 0)
 					PUTCHR('=');
-				}
 				if (restart == 0) {
 					f_len = snprintf(bp, buflen - t_len,
 							 sbase, field);
@@ -232,10 +230,8 @@ snprintb_m(char *buf, size_t buflen, con
 					l_len += f_len;
 					if ((size_t)t_len < buflen)
 						bp += f_len;
-					if (l_max > 0 &&
-					    (size_t)l_len > l_max) {
+					if (l_max > 0 && (size_t)l_len > l_max)
 						PUTCHR('#');
-					}
 				}
 				break;
 			case '=':
@@ -248,9 +244,8 @@ snprintb_m(char *buf, size_t buflen, con
 				 */
 				if ((int)field != bit)
 					goto skip;
-				if (ch == '=') {
+				if (ch == '=')
 					PUTCHR('=');
-				}
 				PUTS(bitfmt);
 				break;
 			default:

Reply via email to