Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/common/lib/libutil Now that all of the macros are enclosed i...



details:   https://anonhg.NetBSD.org/src/rev/b724aaea44a5
branches:  trunk
changeset: 789147:b724aaea44a5
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Thu Aug 08 22:18:20 2013 +0000

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

OK mrg@

diffstat:

 common/lib/libutil/snprintb.c |  23 +++++++++--------------
 1 files changed, 9 insertions(+), 14 deletions(-)

diffs (77 lines):

diff -r a3f9cb989543 -r b724aaea44a5 common/lib/libutil/snprintb.c
--- a/common/lib/libutil/snprintb.c     Thu Aug 08 21:27:50 2013 +0000
+++ b/common/lib/libutil/snprintb.c     Thu Aug 08 22:18:20 2013 +0000
@@ -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 @@
 #  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 @@
 #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 @@
                                        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 @@
                                        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 @@
                                 */
                                if ((int)field != bit)
                                        goto skip;
-                               if (ch == '=') {
+                               if (ch == '=')
                                        PUTCHR('=');
-                               }
                                PUTS(bitfmt);
                                break;
                        default:



Home | Main Index | Thread Index | Old Index