Render LL128-safe (fixing printf formats)

This commit is contained in:
sommerfeld 1999-11-30 21:13:46 +00:00
parent 5cc98b9653
commit 71b188db88
1 changed files with 31 additions and 22 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: cnwctl.c,v 1.3 1999/11/29 13:53:00 itojun Exp $ */ /* $NetBSD: cnwctl.c,v 1.4 1999/11/30 21:13:46 sommerfeld Exp $ */
/* /*
* Copyright (c) 1997 Berkeley Software Design, Inc. * Copyright (c) 1997 Berkeley Software Design, Inc.
@ -163,24 +163,33 @@ main(int argc, char **argv)
if (ioctl(skt, SIOCGCNWDOMAIN, (caddr_t)&ifr) < 0) if (ioctl(skt, SIOCGCNWDOMAIN, (caddr_t)&ifr) < 0)
err(1, "SIOCGCNWDOMAIN"); err(1, "SIOCGCNWDOMAIN");
printf("%s:\n 0x%03x domain\n", interface, ifr.ifr_domain); printf("%s:\n 0x%03x domain\n", interface, ifr.ifr_domain);
printf("%10qu rx\n", cnwis.stats.nws_rx); printf("%10llu rx\n", (long long)cnwis.stats.nws_rx);
printf("%10qu rxoverflow\n", cnwis.stats.nws_rxoverflow); printf("%10llu rxoverflow\n",
printf("%10qu rxoverrun\n", cnwis.stats.nws_rxoverrun); (long long)cnwis.stats.nws_rxoverflow);
printf("%10qu rxcrcerror\n", cnwis.stats.nws_rxcrcerror); printf("%10llu rxoverrun\n",
printf("%10qu rxframe\n", cnwis.stats.nws_rxframe); (long long)cnwis.stats.nws_rxoverrun);
printf("%10qu rxerrors\n", cnwis.stats.nws_rxerrors); printf("%10llu rxcrcerror\n",
printf("%10qu rxavail\n", cnwis.stats.nws_rxavail); (long long)cnwis.stats.nws_rxcrcerror);
printf("%10llu rxframe\n",
(long long)cnwis.stats.nws_rxframe);
printf("%10llu rxerrors\n",
(long long)cnwis.stats.nws_rxerrors);
printf("%10llu rxavail\n", (long long)cnwis.stats.nws_rxavail);
printf("%10qu tx\n", cnwis.stats.nws_tx); printf("%10llu tx\n", (long long)cnwis.stats.nws_tx);
printf("%10qu txokay\n", cnwis.stats.nws_txokay); printf("%10llu txokay\n", (long long)cnwis.stats.nws_txokay);
printf("%10qu txabort\n", cnwis.stats.nws_txabort); printf("%10llu txabort\n", (long long)cnwis.stats.nws_txabort);
printf("%10qu txlostcd\n", cnwis.stats.nws_txlostcd); printf("%10llu txlostcd\n",
printf("%10qu txerrors\n", cnwis.stats.nws_txerrors); (long long)cnwis.stats.nws_txlostcd);
printf("%10qu txretries\n", cnwis.stats.nws_txretries[0]); printf("%10llu txerrors\n",
(long long)cnwis.stats.nws_txerrors);
printf("%10llu txretries\n",
(long long)cnwis.stats.nws_txretries[0]);
for (i = 1; i < 16; ++i) for (i = 1; i < 16; ++i)
if (cnwis.stats.nws_txretries[i]) if (cnwis.stats.nws_txretries[i])
printf("%10s %10qu %dx retries\n", "", printf("%10s %10llu %dx retries\n", "",
cnwis.stats.nws_txretries[i], i); (long long)cnwis.stats.nws_txretries[i],
i);
} }
if (rate == 0 && Sflag) { if (rate == 0 && Sflag) {
@ -235,12 +244,12 @@ main(int argc, char **argv)
c = ts.ts_lines - 3; c = ts.ts_lines - 3;
memset(&onwis, 0, sizeof(onwis)); memset(&onwis, 0, sizeof(onwis));
} }
printf("%10qu ", cnwis.stats.nws_tx - onwis.stats.nws_tx); printf("%10llu ", (long long)(cnwis.stats.nws_tx - onwis.stats.nws_tx));
printf("%10qu ", cnwis.stats.nws_txokay - onwis.stats.nws_txokay); printf("%10llu ", (long long)(cnwis.stats.nws_txokay - onwis.stats.nws_txokay));
printf("%10qu ", cnwis.stats.nws_txerrors - onwis.stats.nws_txerrors); printf("%10llu ", (long long)(cnwis.stats.nws_txerrors - onwis.stats.nws_txerrors));
printf("%10qu ", cnwis.stats.nws_txretries[0] - onwis.stats.nws_txretries[0]); printf("%10llu ", (long long)(cnwis.stats.nws_txretries[0] - onwis.stats.nws_txretries[0]));
printf("%10qu ", cnwis.stats.nws_rx - onwis.stats.nws_rx); printf("%10llu ", (long long)(cnwis.stats.nws_rx - onwis.stats.nws_rx));
printf("%10qu\n", cnwis.stats.nws_rxerrors - onwis.stats.nws_rxerrors); printf("%10llu\n", (long long)(cnwis.stats.nws_rxerrors - onwis.stats.nws_rxerrors));
fflush(stdout); fflush(stdout);
sleep (rate); sleep (rate);
onwis = cnwis; onwis = cnwis;