From a6c34acd7a0e29c4edb2feae26288616213743f3 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 5 May 2008 18:47:50 -0700 Subject: [PATCH] Clean-up some compiler warnings related to printing numbers. --- datapath/datapath.c | 2 +- lib/dpif.c | 2 +- lib/fault.c | 2 +- lib/flow.c | 2 +- lib/ofp-print.c | 4 ++-- switch/netdev.c | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/datapath/datapath.c b/datapath/datapath.c index a3ee25a7..e03372b9 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -172,7 +172,7 @@ alloc_openflow_skb(struct datapath *dp, size_t openflow_len, uint8_t type, if ((openflow_len + sizeof(struct ofp_header)) > UINT16_MAX) { if (net_ratelimit()) - printk("alloc_openflow_skb: openflow message too large: %d\n", + printk("alloc_openflow_skb: openflow message too large: %zu\n", openflow_len); return NULL; } diff --git a/lib/dpif.c b/lib/dpif.c index e760ca15..b5b4fb4b 100644 --- a/lib/dpif.c +++ b/lib/dpif.c @@ -128,7 +128,7 @@ dpif_recv_openflow(struct dpif *dp, struct buffer **bufferp, struct nlattr *attrs[ARRAY_SIZE(openflow_policy)]; struct buffer *buffer; struct ofp_header *oh; - size_t ofp_len; + uint16_t ofp_len; int retval; buffer = *bufferp = NULL; diff --git a/lib/fault.c b/lib/fault.c index 0967f7db..2377b536 100644 --- a/lib/fault.c +++ b/lib/fault.c @@ -70,7 +70,7 @@ log_backtrace(void) if (!dladdr(frame[1], &addrinfo) || !addrinfo.dli_sname) { fprintf(stderr, " 0x%08"PRIxPTR"\n", (uintptr_t) frame[1]); } else { - fprintf(stderr, " 0x%08"PRIxPTR" (%s+0x%x)\n", + fprintf(stderr, " 0x%08"PRIxPTR" (%s+0x%lx)\n", (uintptr_t) frame[1], addrinfo.dli_sname, (char *) frame[1] - (char *) addrinfo.dli_saddr); } diff --git a/lib/flow.c b/lib/flow.c index 2d428b4b..a3ddfd49 100644 --- a/lib/flow.c +++ b/lib/flow.c @@ -50,7 +50,7 @@ flow_extract(struct buffer *packet, uint16_t in_port, struct flow *flow) struct eth_header *eth; if (b.size < ETH_TOTAL_MIN) { - VLOG_WARN("packet length %d less than minimum size %d", + VLOG_WARN("packet length %zu less than minimum size %d", b.size, ETH_TOTAL_MIN); } diff --git a/lib/ofp-print.c b/lib/ofp-print.c index 19b880ec..b875ec41 100644 --- a/lib/ofp-print.c +++ b/lib/ofp-print.c @@ -406,7 +406,7 @@ ofp_print_flow_expired(struct ds *string, const void *oh, size_t len, ofp_print_match(string, &ofe->match); ds_put_format(string, - " pri%d secs%d pkts%lld bytes%lld\n", + " pri%"PRIu16" secs%"PRIu32" pkts%"PRIu64" bytes%"PRIu64"n", ofe->match.wildcards ? ntohs(ofe->priority) : (uint16_t)-1, ntohl(ofe->duration), ntohll(ofe->packet_count), ntohll(ofe->byte_count)); @@ -816,7 +816,7 @@ ofp_to_string(const void *oh_, size_t len, int verbosity) len, pkt->min_size); } else if (!pkt->printer) { if (len > sizeof *oh) { - ds_put_format(&string, " length=%zu (decoder not implemented)\n", + ds_put_format(&string, " length=%"PRIu16" (decoder not implemented)\n", ntohs(oh->length)); } } else { diff --git a/switch/netdev.c b/switch/netdev.c index 23b7bc46..1e3fd55f 100644 --- a/switch/netdev.c +++ b/switch/netdev.c @@ -476,7 +476,7 @@ netdev_send(struct netdev *netdev, struct buffer *buffer) } return errno; } else if (n_bytes != buffer->size) { - VLOG_WARN("send partial Ethernet packet (%d bytes of %d) on %s", + VLOG_WARN("send partial Ethernet packet (%d bytes of %zu) on %s", (int) n_bytes, buffer->size, netdev->name); return EMSGSIZE; } else { -- 2.30.2