Module Name:    src
Committed By:   tsutsui
Date:           Sat Aug 30 12:23:38 UTC 2014

Modified Files:
        src/sys/lib/libsa: subr_prf.c

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

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


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/lib/libsa/subr_prf.c

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

Modified files:

Index: src/sys/lib/libsa/subr_prf.c
diff -u src/sys/lib/libsa/subr_prf.c:1.24 src/sys/lib/libsa/subr_prf.c:1.25
--- src/sys/lib/libsa/subr_prf.c:1.24	Sat Mar 22 02:51:44 2014
+++ src/sys/lib/libsa/subr_prf.c	Sat Aug 30 12:23:38 2014
@@ -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 @@ const char hexdigits[16] = "0123456789ab
 #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 @@ do {								\
 } 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 @@ reswitch:
 #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 @@ reswitch:
 				continue;
 			width -= q - p;
 #endif
-			LPAD();
+			RADJUSTPAD();
 			while ((ch = (unsigned char)*p++))
 				put(ch);
-			RPAD();
+			LADJUSTPAD();
 			break;
 		case 'd':
 			ul =
@@ -332,10 +332,10 @@ kprintn(void (*put)(int), UINTMAX_T ul, 
 			put(*--p);
 	}
 #endif
-	LPAD();
-	LZERO();
+	RADJUSTPAD();
+	RADJUSTZEROPAD();
 	do {
 		put(*--p);
 	} while (p > buf);
-	RPAD();
+	LADJUSTPAD();
 }

Reply via email to