diff options
author | Michael Brown <mcb30@etherboot.org> | 2007-12-07 00:11:43 +0000 |
---|---|---|
committer | Michael Brown <mcb30@etherboot.org> | 2007-12-07 00:11:43 +0000 |
commit | df868476e7872c3ebd8c6e2a21f8365858907dc7 (patch) | |
tree | c38e7ca65bc32afd869a2e949f573e37cd174e96 | |
parent | 64787bad295e7f4eefbe60fddc3439d34412090e (diff) | |
download | ipxe-df868476e7872c3ebd8c6e2a21f8365858907dc7.tar.gz |
Various warnings fixups for OpenBSD with gcc-3.3.5.
-rw-r--r-- | src/drivers/net/e1000/e1000.c | 2 | ||||
-rw-r--r-- | src/drivers/net/legacy.c | 2 | ||||
-rw-r--r-- | src/drivers/net/natsemi.c | 2 | ||||
-rw-r--r-- | src/drivers/net/rtl8139.c | 2 | ||||
-rw-r--r-- | src/drivers/nvs/nvs.c | 2 | ||||
-rw-r--r-- | src/image/script.c | 2 | ||||
-rw-r--r-- | src/net/dhcpopts.c | 4 | ||||
-rw-r--r-- | src/net/ethernet.c | 2 | ||||
-rw-r--r-- | src/net/icmpv6.c | 2 | ||||
-rw-r--r-- | src/net/ipv4.c | 16 | ||||
-rw-r--r-- | src/net/ipv6.c | 2 | ||||
-rw-r--r-- | src/net/ndp.c | 6 | ||||
-rw-r--r-- | src/net/tcp.c | 10 | ||||
-rw-r--r-- | src/net/tcp/iscsi.c | 2 | ||||
-rw-r--r-- | src/net/tls.c | 2 | ||||
-rw-r--r-- | src/net/udp.c | 14 | ||||
-rw-r--r-- | src/net/udp/dhcp.c | 2 |
17 files changed, 37 insertions, 37 deletions
diff --git a/src/drivers/net/e1000/e1000.c b/src/drivers/net/e1000/e1000.c index ec054702..a0bfc97f 100644 --- a/src/drivers/net/e1000/e1000.c +++ b/src/drivers/net/e1000/e1000.c @@ -577,7 +577,7 @@ e1000_transmit ( struct net_device *netdev, struct io_buffer *iobuf ) E1000_TXD_CMD_IFCS | iob_len ( iobuf ); tx_curr_desc->upper.data = 0; - DBG ( "TX fill: %ld tx_curr: %ld addr: %#08lx len: %d\n", adapter->tx_fill_ctr, + DBG ( "TX fill: %ld tx_curr: %ld addr: %#08lx len: %zd\n", adapter->tx_fill_ctr, tx_curr, virt_to_bus ( iobuf->data ), iob_len ( iobuf ) ); /* Point to next free descriptor */ diff --git a/src/drivers/net/legacy.c b/src/drivers/net/legacy.c index 6ae2fbec..9b82f1ca 100644 --- a/src/drivers/net/legacy.c +++ b/src/drivers/net/legacy.c @@ -25,7 +25,7 @@ static int legacy_transmit ( struct net_device *netdev, struct io_buffer *iobuf struct nic *nic = netdev->priv; struct ethhdr *ethhdr; - DBG ( "Transmitting %d bytes\n", iob_len ( iobuf ) ); + DBG ( "Transmitting %zd bytes\n", iob_len ( iobuf ) ); iob_pad ( iobuf, ETH_ZLEN ); ethhdr = iobuf->data; iob_pull ( iobuf, sizeof ( *ethhdr ) ); diff --git a/src/drivers/net/natsemi.c b/src/drivers/net/natsemi.c index b8748d56..72047610 100644 --- a/src/drivers/net/natsemi.c +++ b/src/drivers/net/natsemi.c @@ -471,7 +471,7 @@ static int natsemi_transmit (struct net_device *netdev, struct io_buffer *iobuf) np->tx[np->tx_cur].bufptr = virt_to_bus (iobuf->data); np->tx[np->tx_cur].cmdsts = iob_len (iobuf) | OWN; - DBG ("TX id %d at %#08lx + %#08x\n", np->tx_cur, + DBG ("TX id %d at %#08lx + %#08zx\n", np->tx_cur, virt_to_bus (&iobuf->data), iob_len (iobuf)); /* increment the circular buffer pointer to the next buffer location diff --git a/src/drivers/net/rtl8139.c b/src/drivers/net/rtl8139.c index 6a779472..b4c99fcb 100644 --- a/src/drivers/net/rtl8139.c +++ b/src/drivers/net/rtl8139.c @@ -379,7 +379,7 @@ static int rtl_transmit ( struct net_device *netdev, struct io_buffer *iobuf ) { iob_pad ( iobuf, ETH_ZLEN ); /* Add to TX ring */ - DBG ( "TX id %d at %lx+%x\n", rtl->tx.next, + DBG ( "TX id %d at %lx+%zx\n", rtl->tx.next, virt_to_bus ( iobuf->data ), iob_len ( iobuf ) ); rtl->tx.iobuf[rtl->tx.next] = iobuf; outl ( virt_to_bus ( iobuf->data ), diff --git a/src/drivers/nvs/nvs.c b/src/drivers/nvs/nvs.c index 02a96d9d..8e94b872 100644 --- a/src/drivers/nvs/nvs.c +++ b/src/drivers/nvs/nvs.c @@ -91,7 +91,7 @@ static int nvs_verify ( struct nvs_device *nvs, unsigned int address, /* Compare data */ if ( memcmp ( data, read_data, len ) != 0 ) { - DBG ( "NVS %p verification failed at %#04x+%d\n", + DBG ( "NVS %p verification failed at %#04x+%zd\n", nvs, address, len ); return -EIO; } diff --git a/src/image/script.c b/src/image/script.c index c8821522..a24bc09a 100644 --- a/src/image/script.c +++ b/src/image/script.c @@ -66,7 +66,7 @@ static int script_exec ( struct image *image ) { if ( ! eol ) eol = memchr ( cmdbuf, '\0', sizeof ( cmdbuf ) ); if ( ! eol ) { - DBG ( "Script line too long (max %d bytes)\n", + DBG ( "Script line too long (max %zd bytes)\n", sizeof ( cmdbuf ) ); rc = -ENOEXEC; goto done; diff --git a/src/net/dhcpopts.c b/src/net/dhcpopts.c index d1837be3..ed53916c 100644 --- a/src/net/dhcpopts.c +++ b/src/net/dhcpopts.c @@ -426,11 +426,11 @@ struct dhcp_option * set_dhcp_option ( struct dhcp_option_block *options, option = find_dhcp_option_with_encap ( options, tag, &encapsulator ); if ( option ) { old_len = dhcp_option_len ( option ); - DBG ( "Resizing DHCP option %s from length %d to %d in block " + DBG ( "Resizing DHCP option %s from length %d to %zd in block " "%p\n", dhcp_tag_name (tag), option->len, len, options ); } else { old_len = 0; - DBG ( "Creating DHCP option %s (length %d) in block %p\n", + DBG ( "Creating DHCP option %s (length %zd) in block %p\n", dhcp_tag_name ( tag ), len, options ); } diff --git a/src/net/ethernet.c b/src/net/ethernet.c index 8f259fb3..55035de5 100644 --- a/src/net/ethernet.c +++ b/src/net/ethernet.c @@ -74,7 +74,7 @@ static int eth_rx ( struct io_buffer *iobuf, struct net_device *netdev ) { /* Sanity check */ if ( iob_len ( iobuf ) < sizeof ( *ethhdr ) ) { - DBG ( "Ethernet packet too short (%d bytes)\n", + DBG ( "Ethernet packet too short (%zd bytes)\n", iob_len ( iobuf ) ); free_iob ( iobuf ); return -EINVAL; diff --git a/src/net/icmpv6.c b/src/net/icmpv6.c index 69824c5b..7b7146c2 100644 --- a/src/net/icmpv6.c +++ b/src/net/icmpv6.c @@ -77,7 +77,7 @@ static int icmp6_rx ( struct io_buffer *iobuf, struct sockaddr_tcpip *st_src, /* Sanity check */ if ( iob_len ( iobuf ) < sizeof ( *icmp6hdr ) ) { - DBG ( "Packet too short (%d bytes)\n", iob_len ( iobuf ) ); + DBG ( "Packet too short (%zd bytes)\n", iob_len ( iobuf ) ); free_iob ( iobuf ); return -EINVAL; } diff --git a/src/net/ipv4.c b/src/net/ipv4.c index 2f50f0e4..f86c71e5 100644 --- a/src/net/ipv4.c +++ b/src/net/ipv4.c @@ -435,7 +435,7 @@ static int ipv4_rx ( struct io_buffer *iobuf, struct net_device *netdev __unused /* Sanity check the IPv4 header */ if ( iob_len ( iobuf ) < sizeof ( *iphdr ) ) { - DBG ( "IPv4 packet too short at %d bytes (min %d bytes)\n", + DBG ( "IPv4 packet too short at %zd bytes (min %zd bytes)\n", iob_len ( iobuf ), sizeof ( *iphdr ) ); goto err; } @@ -445,13 +445,13 @@ static int ipv4_rx ( struct io_buffer *iobuf, struct net_device *netdev __unused } hdrlen = ( ( iphdr->verhdrlen & IP_MASK_HLEN ) * 4 ); if ( hdrlen < sizeof ( *iphdr ) ) { - DBG ( "IPv4 header too short at %d bytes (min %d bytes)\n", + DBG ( "IPv4 header too short at %zd bytes (min %zd bytes)\n", hdrlen, sizeof ( *iphdr ) ); goto err; } if ( hdrlen > iob_len ( iobuf ) ) { - DBG ( "IPv4 header too long at %d bytes " - "(packet is %d bytes)\n", hdrlen, iob_len ( iobuf ) ); + DBG ( "IPv4 header too long at %zd bytes " + "(packet is %zd bytes)\n", hdrlen, iob_len ( iobuf ) ); goto err; } if ( ( csum = tcpip_chksum ( iphdr, hdrlen ) ) != 0 ) { @@ -461,13 +461,13 @@ static int ipv4_rx ( struct io_buffer *iobuf, struct net_device *netdev __unused } len = ntohs ( iphdr->len ); if ( len < hdrlen ) { - DBG ( "IPv4 length too short at %d bytes " - "(header is %d bytes)\n", len, hdrlen ); + DBG ( "IPv4 length too short at %zd bytes " + "(header is %zd bytes)\n", len, hdrlen ); goto err; } if ( len > iob_len ( iobuf ) ) { - DBG ( "IPv4 length too long at %d bytes " - "(packet is %d bytes)\n", len, iob_len ( iobuf ) ); + DBG ( "IPv4 length too long at %zd bytes " + "(packet is %zd bytes)\n", len, iob_len ( iobuf ) ); goto err; } diff --git a/src/net/ipv6.c b/src/net/ipv6.c index c07ff94c..3407d538 100644 --- a/src/net/ipv6.c +++ b/src/net/ipv6.c @@ -302,7 +302,7 @@ static int ipv6_rx ( struct io_buffer *iobuf, /* Sanity check */ if ( iob_len ( iobuf ) < sizeof ( *ip6hdr ) ) { - DBG ( "Packet too short (%d bytes)\n", iob_len ( iobuf ) ); + DBG ( "Packet too short (%zd bytes)\n", iob_len ( iobuf ) ); goto drop; } diff --git a/src/net/ndp.c b/src/net/ndp.c index 3b6984db..314a898f 100644 --- a/src/net/ndp.c +++ b/src/net/ndp.c @@ -81,7 +81,7 @@ add_ndp_entry ( struct net_device *netdev, struct in6_addr *in6, } ndp->state = state; DBG ( "New neighbour cache entry (%d): IP6 %s => %s %s\n", - ( ndp - ndp_table ) / sizeof ( *ndp ), + ( ndp - ndp_table ), inet6_ntoa ( ndp->in6 ), netdev->ll_protocol->name, netdev->ll_protocol->ntoa ( ndp->ll_addr ) ); } @@ -119,7 +119,7 @@ int ndp_resolve ( struct net_device *netdev, struct in6_addr *dest, /* Check if the entry was already created */ if ( ndp ) { DBG ( "Awaiting neighbour advertisement (cache entry %d)\n", - ( ( ndp - ndp_table ) / sizeof ( *ndp ) ) ); + ( ndp - ndp_table ) ); /* For test */ // ndp->state = NDP_STATE_REACHABLE; // memcpy ( ndp->ll_addr, netdev->ll_addr, 6 ); @@ -155,7 +155,7 @@ int ndp_process_advert ( struct io_buffer *iobuf, struct sockaddr_tcpip *st_src /* Sanity check */ if ( iob_len ( iobuf ) < sizeof ( *nadvert ) ) { - DBG ( "Packet too short (%d bytes)\n", iob_len ( iobuf ) ); + DBG ( "Packet too short (%zd bytes)\n", iob_len ( iobuf ) ); return -EINVAL; } diff --git a/src/net/tcp.c b/src/net/tcp.c index 28cf95fb..2b9a97b0 100644 --- a/src/net/tcp.c +++ b/src/net/tcp.c @@ -557,7 +557,7 @@ static int tcp_xmit_reset ( struct tcp_connection *tcp, tcphdr->csum = tcpip_chksum ( iobuf->data, iob_len ( iobuf ) ); /* Dump header */ - DBGC ( tcp, "TCP %p TX %d->%d %08lx..%08lx %08lx %4zd", + DBGC ( tcp, "TCP %p TX %d->%d %08lx..%08lx %08lx %4d", tcp, ntohs ( tcphdr->src ), ntohs ( tcphdr->dest ), ntohl ( tcphdr->seq ), ( ntohl ( tcphdr->seq ) ), ntohl ( tcphdr->ack ), 0 ); @@ -820,7 +820,7 @@ static int tcp_rx ( struct io_buffer *iobuf, struct tcp_header *tcphdr = iobuf->data; struct tcp_connection *tcp; struct tcp_options options; - unsigned int hlen; + size_t hlen; uint16_t csum; uint32_t start_seq; uint32_t seq; @@ -832,20 +832,20 @@ static int tcp_rx ( struct io_buffer *iobuf, /* Sanity check packet */ if ( iob_len ( iobuf ) < sizeof ( *tcphdr ) ) { - DBG ( "TCP packet too short at %d bytes (min %d bytes)\n", + DBG ( "TCP packet too short at %zd bytes (min %zd bytes)\n", iob_len ( iobuf ), sizeof ( *tcphdr ) ); rc = -EINVAL; goto discard; } hlen = ( ( tcphdr->hlen & TCP_MASK_HLEN ) / 16 ) * 4; if ( hlen < sizeof ( *tcphdr ) ) { - DBG ( "TCP header too short at %d bytes (min %d bytes)\n", + DBG ( "TCP header too short at %zd bytes (min %zd bytes)\n", hlen, sizeof ( *tcphdr ) ); rc = -EINVAL; goto discard; } if ( hlen > iob_len ( iobuf ) ) { - DBG ( "TCP header too long at %d bytes (max %d bytes)\n", + DBG ( "TCP header too long at %zd bytes (max %zd bytes)\n", hlen, iob_len ( iobuf ) ); rc = -EINVAL; goto discard; diff --git a/src/net/tcp/iscsi.c b/src/net/tcp/iscsi.c index 0a24c456..2416089a 100644 --- a/src/net/tcp/iscsi.c +++ b/src/net/tcp/iscsi.c @@ -213,7 +213,7 @@ static void iscsi_start_command ( struct iscsi_session *iscsi ) { command->cmdsn = htonl ( iscsi->cmdsn ); command->expstatsn = htonl ( iscsi->statsn + 1 ); memcpy ( &command->cdb, &iscsi->command->cdb, sizeof ( command->cdb )); - DBGC ( iscsi, "iSCSI %p start " SCSI_CDB_FORMAT " %s %#x\n", + DBGC ( iscsi, "iSCSI %p start " SCSI_CDB_FORMAT " %s %#zx\n", iscsi, SCSI_CDB_DATA ( command->cdb ), ( iscsi->command->data_in ? "in" : "out" ), ( iscsi->command->data_in ? diff --git a/src/net/tls.c b/src/net/tls.c index 5c201b32..f67bdd46 100644 --- a/src/net/tls.c +++ b/src/net/tls.c @@ -452,7 +452,7 @@ static int tls_select_cipher ( struct tls_session *tls, struct crypto_algorithm *pubkey = &crypto_null; struct crypto_algorithm *cipher = &crypto_null; struct crypto_algorithm *digest = &crypto_null; - size_t key_len = 0; + unsigned int key_len = 0; int rc; switch ( cipher_suite ) { diff --git a/src/net/udp.c b/src/net/udp.c index fcd5732d..eb241496 100644 --- a/src/net/udp.c +++ b/src/net/udp.c @@ -215,7 +215,7 @@ static int udp_tx ( struct udp_connection *udp, struct io_buffer *iobuf, udphdr->chksum = tcpip_chksum ( udphdr, len ); /* Dump debugging information */ - DBGC ( udp, "UDP %p TX %d->%d len %zd\n", udp, + DBGC ( udp, "UDP %p TX %d->%d len %d\n", udp, ntohs ( udphdr->src ), ntohs ( udphdr->dest ), ntohs ( udphdr->len ) ); @@ -268,7 +268,7 @@ static int udp_rx ( struct io_buffer *iobuf, struct sockaddr_tcpip *st_src, /* Sanity check packet */ if ( iob_len ( iobuf ) < sizeof ( *udphdr ) ) { - DBG ( "UDP packet too short at %d bytes (min %d bytes)\n", + DBG ( "UDP packet too short at %zd bytes (min %zd bytes)\n", iob_len ( iobuf ), sizeof ( *udphdr ) ); rc = -EINVAL; @@ -276,14 +276,14 @@ static int udp_rx ( struct io_buffer *iobuf, struct sockaddr_tcpip *st_src, } ulen = ntohs ( udphdr->len ); if ( ulen < sizeof ( *udphdr ) ) { - DBG ( "UDP length too short at %d bytes " - "(header is %d bytes)\n", ulen, sizeof ( *udphdr ) ); + DBG ( "UDP length too short at %zd bytes " + "(header is %zd bytes)\n", ulen, sizeof ( *udphdr ) ); rc = -EINVAL; goto done; } if ( ulen > iob_len ( iobuf ) ) { - DBG ( "UDP length too long at %d bytes (packet is %d bytes)\n", - ulen, iob_len ( iobuf ) ); + DBG ( "UDP length too long at %zd bytes (packet is %zd " + "bytes)\n", ulen, iob_len ( iobuf ) ); rc = -EINVAL; goto done; } @@ -370,7 +370,7 @@ static struct io_buffer * udp_alloc_iob ( struct xfer_interface *xfer, iobuf = alloc_iob ( UDP_MAX_HLEN + len ); if ( ! iobuf ) { - DBGC ( udp, "UDP %p cannot allocate buffer of length %d\n", + DBGC ( udp, "UDP %p cannot allocate buffer of length %zd\n", udp, len ); return NULL; } diff --git a/src/net/udp/dhcp.c b/src/net/udp/dhcp.c index 001c9086..2fdb943c 100644 --- a/src/net/udp/dhcp.c +++ b/src/net/udp/dhcp.c @@ -453,7 +453,7 @@ static struct dhcp_option_block * dhcp_parse ( const struct dhcphdr *dhcphdr, /* Allocate empty options block of required size */ options = alloc_dhcp_options ( options_len ); if ( ! options ) { - DBG ( "DHCP could not allocate %d-byte option block\n", + DBG ( "DHCP could not allocate %zd-byte option block\n", options_len ); return NULL; } |