Source-Changes-HG archive

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

[src/trunk]: src/sbin/dmesg KNF. Do not unnecessarily define ADDC() for SMALL...



details:   https://anonhg.NetBSD.org/src/rev/64bd093e44d3
branches:  trunk
changeset: 368799:64bd093e44d3
user:      rin <rin%NetBSD.org@localhost>
date:      Sat Aug 06 09:33:56 2022 +0000

description:
KNF. Do not unnecessarily define ADDC() for SMALL. No binary changes.

diffstat:

 sbin/dmesg/dmesg.c |  28 +++++++++++++---------------
 1 files changed, 13 insertions(+), 15 deletions(-)

diffs (56 lines):

diff -r 85c98c4316b6 -r 64bd093e44d3 sbin/dmesg/dmesg.c
--- a/sbin/dmesg/dmesg.c        Sat Aug 06 07:06:58 2022 +0000
+++ b/sbin/dmesg/dmesg.c        Sat Aug 06 09:33:56 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dmesg.c,v 1.45 2020/01/01 00:24:52 kre Exp $   */
+/*     $NetBSD: dmesg.c,v 1.46 2022/08/06 09:33:56 rin Exp $   */
 /*-
  * Copyright (c) 1991, 1993
  *     The Regents of the University of California.  All rights reserved.
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)dmesg.c    8.1 (Berkeley) 6/5/93";
 #else
-__RCSID("$NetBSD: dmesg.c,v 1.45 2020/01/01 00:24:52 kre Exp $");
+__RCSID("$NetBSD: dmesg.c,v 1.46 2022/08/06 09:33:56 rin Exp $");
 #endif
 #endif /* not lint */
 
@@ -271,15 +271,13 @@
 #ifndef SMALL
                if (p == bufdata + cur.msg_bufs)
                        p = bufdata;
-#define ADDC(c)                                \
-    do {                               \
-       if (tstamp < sizeof(tbuf) - 1)  \
-               tbuf[tstamp++] = (c);   \
-       if (frac)                       \
-               scale++;                \
-    } while (/*CONSTCOND*/0)
-#else
-#define ADDC(c)
+#define ADDC(c)                                                                \
+    do {                                                               \
+       if (tstamp < sizeof(tbuf) - 1)                                  \
+               tbuf[tstamp++] = (c);                                   \
+       if (frac)                                                       \
+               scale++;                                                \
+    } while (0)
 #endif
                ch = *p;
                if (ch == '\0')
@@ -389,10 +387,10 @@
                        default:
 #ifndef SMALL
                                if (tstamp) {
-                                   ADDC(ch);
-                                   if (ch == '.')
-                                       frac = true;
-                                   continue;
+                                       ADDC(ch);
+                                       if (ch == '.')
+                                               frac = true;
+                                       continue;
                                }
 #endif
                                if (log)



Home | Main Index | Thread Index | Old Index