From 78775ca57a2718ae13ddc6960b2fbedbd1dcb227 Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Sat, 1 Jan 2011 12:42:33 +0100 Subject: [PATCH] Fix 64 bit build. --- sys/net/pf/if_pfsync.c | 2 +- usr.sbin/pfctl/parse.y | 7 ++++--- usr.sbin/pfctl/pf_print_state.c | 3 ++- usr.sbin/pfctl/pfctl.c | 5 +++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/sys/net/pf/if_pfsync.c b/sys/net/pf/if_pfsync.c index 0c46fe8411..b9223705c4 100644 --- a/sys/net/pf/if_pfsync.c +++ b/sys/net/pf/if_pfsync.c @@ -804,7 +804,7 @@ pfsync_input(struct mbuf *m, ...) if (sfail) { if (pf_status.debug >= PF_DEBUG_MISC) kprintf("pfsync: ignoring stale update " - "(%d) id: %016llx " + "(%d) id: %016" PRIx64 " " "creatorid: %08x\n", sfail, be64toh(st->id), ntohl(st->creatorid)); diff --git a/usr.sbin/pfctl/parse.y b/usr.sbin/pfctl/parse.y index fce164aa0b..7d64427540 100644 --- a/usr.sbin/pfctl/parse.y +++ b/usr.sbin/pfctl/parse.y @@ -58,6 +58,7 @@ #include #include #include +#include #include "pfctl_parser.h" #include "pfctl.h" @@ -716,7 +717,7 @@ varstring : numberstring varstring { numberstring : NUMBER { char *s; - if (asprintf(&s, "%lld", $1) == -1) { + if (asprintf(&s, "%" PRId64, $1) == -1) { yyerror("string: asprintf"); YYERROR; } @@ -2878,7 +2879,7 @@ host : STRING { | STRING '/' NUMBER { char *buf; - if (asprintf(&buf, "%s/%lld", $1, $3) == -1) + if (asprintf(&buf, "%s/%" PRId64, $1, $3) == -1) err(1, "host: asprintf"); free($1); if (($$ = host(buf)) == NULL) { @@ -2893,7 +2894,7 @@ host : STRING { char *buf; /* ie. for 10/8 parsing */ - if (asprintf(&buf, "%lld/%lld", $1, $3) == -1) + if (asprintf(&buf, "%" PRId64 "/%" PRId64, $1, $3) == -1) err(1, "host: asprintf"); if (($$ = host(buf)) == NULL) { /* error. "any" is handled elsewhere */ diff --git a/usr.sbin/pfctl/pf_print_state.c b/usr.sbin/pfctl/pf_print_state.c index d235837d25..efbe8db87b 100644 --- a/usr.sbin/pfctl/pf_print_state.c +++ b/usr.sbin/pfctl/pf_print_state.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -315,7 +316,7 @@ print_state(struct pfsync_state *s, int opts) bcopy(s->packets[1], &packets[1], sizeof(u_int64_t)); bcopy(s->bytes[0], &bytes[0], sizeof(u_int64_t)); bcopy(s->bytes[1], &bytes[1], sizeof(u_int64_t)); - printf(", %llu:%llu pkts, %llu:%llu bytes", + printf(", %" PRIu64 ":%" PRIu64 " pkts, %" PRIu64 ":%" PRIu64 " bytes", be64toh(packets[0]), be64toh(packets[1]), be64toh(bytes[0]), diff --git a/usr.sbin/pfctl/pfctl.c b/usr.sbin/pfctl/pfctl.c index 02f0ece251..37fa0b1de6 100644 --- a/usr.sbin/pfctl/pfctl.c +++ b/usr.sbin/pfctl/pfctl.c @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -678,10 +679,10 @@ pfctl_id_kill_states(int dev, const char *iface, int opts) } memset(&psk, 0, sizeof(psk)); - if ((sscanf(state_kill[1], "%llx/%x", + if ((sscanf(state_kill[1], "%" SCNx64 "/%x", &psk.psk_pfcmp.id, &psk.psk_pfcmp.creatorid)) == 2) psk.psk_pfcmp.creatorid=htonl(psk.psk_pfcmp.creatorid); - else if ((sscanf(state_kill[1], "%llx", &psk.psk_pfcmp.id)) == 1) { + else if ((sscanf(state_kill[1], "%" SCNx64, &psk.psk_pfcmp.id)) == 1) { psk.psk_pfcmp.creatorid = 0; } else { warnx("wrong id format specified"); -- 2.41.0