Source-Changes-HG archive

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

[src/trunk]: src/sys/lib/libsa Rename padding macros to reflect and clarify t...



details:   https://anonhg.NetBSD.org/src/rev/3166fe0a4bb2
branches:  trunk
changeset: 331901:3166fe0a4bb2
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Sat Aug 30 12:23:38 2014 +0000

description:
Rename padding macros to reflect and clarify the original intention.

No binary changes on luna68k (which has -DLIBSA_PRINTF_WIDTH_SUPPORT).

diffstat:

 sys/lib/libsa/subr_prf.c |  28 ++++++++++++++--------------
 1 files changed, 14 insertions(+), 14 deletions(-)

diffs (86 lines):

diff -r 10f442c7a80b -r 3166fe0a4bb2 sys/lib/libsa/subr_prf.c
--- a/sys/lib/libsa/subr_prf.c  Sat Aug 30 12:14:17 2014 +0000
+++ b/sys/lib/libsa/subr_prf.c  Sat Aug 30 12:23:38 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_prf.c,v 1.24 2014/03/22 02:51:44 hkenken Exp $    */
+/*     $NetBSD: subr_prf.c,v 1.25 2014/08/30 12:23:38 tsutsui Exp $    */
 
 /*-
  * Copyright (c) 1993
@@ -79,21 +79,21 @@
 #define ZEROPAD                0x40
 #define NEGATIVE       0x80
 #define KPRINTN(base)  kprintn(put, ul, base, lflag, width)
-#define LZERO()                                                        \
+#define RADJUSTZEROPAD()                                       \
 do {                                                           \
        if ((lflag & (ZEROPAD|LADJUST)) == ZEROPAD) {           \
                while (width-- > 0)                             \
                        put('0');                               \
        }                                                       \
 } while (/*CONSTCOND*/0)
-#define RPAD()                                                 \
+#define LADJUSTPAD()                                           \
 do {                                                           \
        if (lflag & LADJUST) {                                  \
                while (width-- > 0)                             \
                        put(' ');                               \
        }                                                       \
 } while (/*CONSTCOND*/0)
-#define LPAD()                                                 \
+#define RADJUSTPAD()                                           \
 do {                                                           \
        if ((lflag & (ZEROPAD|LADJUST)) == 0) {                 \
                while (width-- > 0)                             \
@@ -102,9 +102,9 @@
 } while (/*CONSTCOND*/0)
 #else  /* LIBSA_PRINTF_WIDTH_SUPPORT */
 #define KPRINTN(base)  kprintn(put, ul, base)
-#define LZERO()                /**/
-#define RPAD()         /**/
-#define LPAD()         /**/
+#define RADJUSTZEROPAD()       /**/
+#define LADJUSTPAD()           /**/
+#define RADJUSTPAD()           /**/
 #endif /* LIBSA_PRINTF_WIDTH_SUPPORT */
 
 #ifdef LIBSA_PRINTF_LONGLONG_SUPPORT
@@ -235,9 +235,9 @@
 #ifdef LIBSA_PRINTF_WIDTH_SUPPORT
                        --width;
 #endif
-                       LPAD();
+                       RADJUSTPAD();
                        put(ch & 0xFF);
-                       RPAD();
+                       LADJUSTPAD();
                        break;
                case 's':
                        p = va_arg(ap, char *);
@@ -246,10 +246,10 @@
                                continue;
                        width -= q - p;
 #endif
-                       LPAD();
+                       RADJUSTPAD();
                        while ((ch = (unsigned char)*p++))
                                put(ch);
-                       RPAD();
+                       LADJUSTPAD();
                        break;
                case 'd':
                        ul =
@@ -332,10 +332,10 @@
                        put(*--p);
        }
 #endif
-       LPAD();
-       LZERO();
+       RADJUSTPAD();
+       RADJUSTZEROPAD();
        do {
                put(*--p);
        } while (p > buf);
-       RPAD();
+       LADJUSTPAD();
 }



Home | Main Index | Thread Index | Old Index