Source-Changes-HG archive

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

[src/trunk]: src/sys/dist/ipf/netinet avoid #ifdef/#endif inside sprint() arg...



details:   https://anonhg.NetBSD.org/src/rev/c530239e1c50
branches:  trunk
changeset: 762640:c530239e1c50
user:      plunky <plunky%NetBSD.org@localhost>
date:      Thu Feb 24 18:35:40 2011 +0000

description:
avoid #ifdef/#endif inside sprint() argument list, as with USE_FORT=yes
sprint becomes a macro

diffstat:

 sys/dist/ipf/netinet/ip_rpcb_pxy.c |  21 ++++++++++++++-------
 1 files changed, 14 insertions(+), 7 deletions(-)

diffs (67 lines):

diff -r fd28036f1690 -r c530239e1c50 sys/dist/ipf/netinet/ip_rpcb_pxy.c
--- a/sys/dist/ipf/netinet/ip_rpcb_pxy.c        Thu Feb 24 18:33:06 2011 +0000
+++ b/sys/dist/ipf/netinet/ip_rpcb_pxy.c        Thu Feb 24 18:35:40 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_rpcb_pxy.c,v 1.14 2009/08/19 08:36:12 darrenr Exp $ */
+/*     $NetBSD: ip_rpcb_pxy.c,v 1.15 2011/02/24 18:35:40 plunky Exp $  */
 
 /*
  * Copyright (C) 2002-2003 by Ryan Beasley <ryanb%goddamnbastard.org@localhost>
@@ -43,7 +43,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: ip_rpcb_pxy.c,v 1.14 2009/08/19 08:36:12 darrenr Exp $");
+__KERNEL_RCSID(1, "$NetBSD: ip_rpcb_pxy.c,v 1.15 2011/02/24 18:35:40 plunky Exp $");
 
 #define        IPF_RPCB_PROXY
 
@@ -793,11 +793,13 @@
        bzero(uaddr, sizeof(uaddr)); /* Just in case we need padding. */
 #if defined(SNPRINTF) && defined(_KERNEL)
        SNPRINTF(uaddr, sizeof(uaddr),
+                      "%u.%u.%u.%u.%u.%u", i[0] & 0xff, i[1] & 0xff,
+                      i[2] & 0xff, i[3] & 0xff, p[0] & 0xff, p[1] & 0xff);
 #else
        (void) sprintf(uaddr,
-#endif
                       "%u.%u.%u.%u.%u.%u", i[0] & 0xff, i[1] & 0xff,
                       i[2] & 0xff, i[3] & 0xff, p[0] & 0xff, p[1] & 0xff);
+#endif
        len = strlen(uaddr);
        xlen = XDRALIGN(len);
 
@@ -1323,11 +1325,13 @@
        bzero(uaddr, sizeof(uaddr)); /* Just in case we need padding. */
 #if defined(SNPRINTF) && defined(_KERNEL)
        SNPRINTF(uaddr, sizeof(uaddr),
+                      "%u.%u.%u.%u.%u.%u", i[0] & 0xff, i[1] & 0xff,
+                      i[2] & 0xff, i[3] & 0xff, p[0] & 0xff, p[1] & 0xff);
 #else
        (void) sprintf(uaddr,
-#endif
                       "%u.%u.%u.%u.%u.%u", i[0] & 0xff, i[1] & 0xff,
                       i[2] & 0xff, i[3] & 0xff, p[0] & 0xff, p[1] & 0xff);
+#endif
        len = strlen(uaddr);
        xlen = XDRALIGN(len);
 
@@ -1403,12 +1407,15 @@
                                                padding. */
 #if defined(SNPRINTF) && defined(_KERNEL)
                SNPRINTF(uaddr, sizeof(uaddr),
-#else
-               (void) sprintf(uaddr,
-#endif
                               "%u.%u.%u.%u.%u.%u", i[0] & 0xff,
                               i[1] & 0xff, i[2] & 0xff, i[3] & 0xff,
                               p[0] & 0xff, p[1] & 0xff);
+#else
+               (void) sprintf(uaddr,
+                              "%u.%u.%u.%u.%u.%u", i[0] & 0xff,
+                              i[1] & 0xff, i[2] & 0xff, i[3] & 0xff,
+                              p[0] & 0xff, p[1] & 0xff);
+#endif
                len = strlen(uaddr);
                xlen = XDRALIGN(len);
 



Home | Main Index | Thread Index | Old Index