diff options
author | Kristof Provost <kp@FreeBSD.org> | 2021-09-01 16:18:26 +0000 |
---|---|---|
committer | Kristof Provost <kp@FreeBSD.org> | 2021-09-08 07:32:53 +0000 |
commit | a660938a78887a64d09fbc4cadf42642da98c525 (patch) | |
tree | c0046dfd468372770e5569db3aae557e14ced952 | |
parent | 4562d33c8fbcea7c188ce45d23670a4e4d764748 (diff) | |
download | src-a660938a78887a64d09fbc4cadf42642da98c525.tar.gz src-a660938a78887a64d09fbc4cadf42642da98c525.zip |
pfctl: Don't use PRIu64
Rather than PRIu64 we can just treat the data as uintmax_t, and use %jx
instead.
MFC after: 1 week
Suggested by: kib
Sponsored by: Rubicon Communications, LLC ("Netgate")
(cherry picked from commit 795d78a46713fc16153966e77f20da2f40aac2a3)
-rw-r--r-- | sbin/pfctl/pfctl_parser.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index 7e48acd2e26c..536314d14ba1 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -60,7 +60,6 @@ __FBSDID("$FreeBSD$"); #include <errno.h> #include <err.h> #include <ifaddrs.h> -#include <inttypes.h> #include <unistd.h> #include "pfctl_parser.h" @@ -576,9 +575,9 @@ print_status(struct pfctl_status *s, struct pfctl_syncookies *cookies, int opts) (unsigned long long)s->pcounters[1][1][PF_DROP]); } printf("%-27s %14s %16s\n", "State Table", "Total", "Rate"); - printf(" %-25s %14" PRIu64 " %14s\n", "current entries", s->states, ""); + printf(" %-25s %14jx %14s\n", "current entries", s->states, ""); TAILQ_FOREACH(c, &s->fcounters, entry) { - printf(" %-25s %14" PRIu64 " ", c->name, c->counter); + printf(" %-25s %14jx ", c->name, c->counter); if (runtime > 0) printf("%14.1f/s\n", (double)c->counter / (double)runtime); @@ -587,10 +586,10 @@ print_status(struct pfctl_status *s, struct pfctl_syncookies *cookies, int opts) } if (opts & PF_OPT_VERBOSE) { printf("Source Tracking Table\n"); - printf(" %-25s %14" PRIu64 " %14s\n", "current entries", + printf(" %-25s %14jx %14s\n", "current entries", s->src_nodes, ""); TAILQ_FOREACH(c, &s->scounters, entry) { - printf(" %-25s %14" PRIu64 " ", c->name, c->counter); + printf(" %-25s %14jx ", c->name, c->counter); if (runtime > 0) printf("%14.1f/s\n", (double)c->counter / (double)runtime); @@ -600,7 +599,7 @@ print_status(struct pfctl_status *s, struct pfctl_syncookies *cookies, int opts) } printf("Counters\n"); TAILQ_FOREACH(c, &s->counters, entry) { - printf(" %-25s %14" PRIu64 " ", c->name, c->counter); + printf(" %-25s %14jx ", c->name, c->counter); if (runtime > 0) printf("%14.1f/s\n", (double)c->counter / (double)runtime); @@ -610,7 +609,7 @@ print_status(struct pfctl_status *s, struct pfctl_syncookies *cookies, int opts) if (opts & PF_OPT_VERBOSE) { printf("Limit Counters\n"); TAILQ_FOREACH(c, &s->lcounters, entry) { - printf(" %-25s %14" PRIu64 " ", c->name, c->counter); + printf(" %-25s %14jx ", c->name, c->counter); if (runtime > 0) printf("%14.1f/s\n", (double)c->counter / (double)runtime); |