Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/netstat Make it compile on ports where u_quad_t is n...



details:   https://anonhg.NetBSD.org/src/rev/3936b524bae9
branches:  trunk
changeset: 569796:3936b524bae9
user:      martin <martin%NetBSD.org@localhost>
date:      Mon Sep 06 14:51:32 2004 +0000

description:
Make it compile on ports where u_quad_t is not printf-format-compatible
with unsigned long long.

diffstat:

 usr.bin/netstat/inet.c   |   9 +++------
 usr.bin/netstat/mroute.c |  12 ++++++------
 2 files changed, 9 insertions(+), 12 deletions(-)

diffs (83 lines):

diff -r 518ce4fbdd3d -r 3936b524bae9 usr.bin/netstat/inet.c
--- a/usr.bin/netstat/inet.c    Mon Sep 06 12:54:48 2004 +0000
+++ b/usr.bin/netstat/inet.c    Mon Sep 06 14:51:32 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: inet.c,v 1.62 2004/09/04 23:35:43 manu Exp $   */
+/*     $NetBSD: inet.c,v 1.63 2004/09/06 14:51:32 martin Exp $ */
 
 /*
  * Copyright (c) 1983, 1988, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "from: @(#)inet.c       8.4 (Berkeley) 4/20/94";
 #else
-__RCSID("$NetBSD: inet.c,v 1.62 2004/09/04 23:35:43 manu Exp $");
+__RCSID("$NetBSD: inet.c,v 1.63 2004/09/06 14:51:32 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -535,9 +535,7 @@
        printf("%s:\n", name);
 
 #define        p(f, m) if (pimstat.f || sflag <= 1) \
-       printf(m, pimstat.f, plural(pimstat.f))
-#define        py(f, m) if (pimstat.f || sflag <= 1) \
-       printf(m, pimstat.f, pimstat.f != 1 ? "ies" : "y")
+       printf(m, (unsigned long long)pimstat.f, plural(pimstat.f))
 
        p(pims_rcv_total_msgs, "\t%llu message%s received\n");
        p(pims_rcv_total_bytes, "\t%llu byte%s received\n");
@@ -551,7 +549,6 @@
        p(pims_snd_registers_msgs, "\t%llu data register message%s sent\n");
        p(pims_snd_registers_bytes, "\t%llu data register byte%s sent\n");
 #undef p
-#undef py
 }
 
 /*
diff -r 518ce4fbdd3d -r 3936b524bae9 usr.bin/netstat/mroute.c
--- a/usr.bin/netstat/mroute.c  Mon Sep 06 12:54:48 2004 +0000
+++ b/usr.bin/netstat/mroute.c  Mon Sep 06 14:51:32 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mroute.c,v 1.18 2004/09/04 23:35:43 manu Exp $ */
+/*     $NetBSD: mroute.c,v 1.19 2004/09/06 14:51:32 martin Exp $       */
 
 /*
  * Copyright (c) 1992, 1993
@@ -76,7 +76,7 @@
 #if 0
 static char sccsid[] = "from: @(#)mroute.c     8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: mroute.c,v 1.18 2004/09/04 23:35:43 manu Exp $");
+__RCSID("$NetBSD: mroute.c,v 1.19 2004/09/06 14:51:32 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -288,11 +288,11 @@
 
        /* The measured values */
        if (bw_meter->bm_flags & BW_METER_UNIT_PACKETS)
-               sprintf(s1, "%llu", bw_meter->bm_measured.b_packets);
+               sprintf(s1, "%llu", (unsigned long long)bw_meter->bm_measured.b_packets);
        else
                sprintf(s1, "?");
        if (bw_meter->bm_flags & BW_METER_UNIT_BYTES)
-               sprintf(s2, "%llu", bw_meter->bm_measured.b_bytes);
+               sprintf(s2, "%llu", (unsigned long long)bw_meter->bm_measured.b_bytes);
        else
                sprintf(s2, "?");
        sprintf(s0, "%lu.%lu|%s|%s",
@@ -311,11 +311,11 @@
 
        /* The threshold values */
        if (bw_meter->bm_flags & BW_METER_UNIT_PACKETS)
-               sprintf(s1, "%llu", bw_meter->bm_threshold.b_packets);
+               sprintf(s1, "%llu", (unsigned long long)bw_meter->bm_threshold.b_packets);
        else
                sprintf(s1, "?");
        if (bw_meter->bm_flags & BW_METER_UNIT_BYTES)
-               sprintf(s2, "%llu", bw_meter->bm_threshold.b_bytes);
+               sprintf(s2, "%llu", (unsigned long long)bw_meter->bm_threshold.b_bytes);
        else
                sprintf(s2, "?");
        sprintf(s0, "%lu.%lu|%s|%s",



Home | Main Index | Thread Index | Old Index