Clean-up some compiler warnings related to printing numbers.
authorroot <root@salsa.nicira.com>
Tue, 6 May 2008 01:47:50 +0000 (18:47 -0700)
committerroot <root@salsa.nicira.com>
Tue, 6 May 2008 01:49:10 +0000 (18:49 -0700)
datapath/datapath.c
lib/dpif.c
lib/fault.c
lib/flow.c
lib/ofp-print.c
switch/netdev.c

index a3ee25a70079f20db44de4fe6a9a4c332994ab08..e03372b9df962d2e50ff8b6a7377269204583010 100644 (file)
@@ -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;
        }
index e760ca1575fbdc1285e18823b080b7ef19e38a20..b5b4fb4b2fa4a6eb89f5a3f8cccebfb31327b6fe 100644 (file)
@@ -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;
index 0967f7dbbe33bd9a345b7adfde3334c2f0f6ed84..2377b5361563a1443bb2f08e1ece54f97bdb1804 100644 (file)
@@ -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); 
         }
index 2d428b4bcb690cbab1a1d78aab725d6333baad00..a3ddfd49e5a197be174d1c122b81225008b5f644 100644 (file)
@@ -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);
     }
 
index 19b880ec0e1a66b4bf7f3b8ecf32ff731d6220d2..b875ec415eed38283ded08e0669fe10f976e5b0a 100644 (file)
@@ -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 {
index 23b7bc464f688d7c879c93c0e37b2d98fdc7dcad..1e3fd55f18817b7f1d3e22a0848fed702ea706a9 100644 (file)
@@ -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 {