Browse Source

Various warnings fixups for OpenBSD with gcc-3.3.5.

tags/v0.9.3
Michael Brown 17 years ago
parent
commit
df868476e7

+ 1
- 1
src/drivers/net/e1000/e1000.c View File

@@ -577,7 +577,7 @@ e1000_transmit ( struct net_device *netdev, struct io_buffer *iobuf )
577 577
 		E1000_TXD_CMD_IFCS | iob_len ( iobuf );
578 578
 	tx_curr_desc->upper.data = 0;
579 579
 	
580
-	DBG ( "TX fill: %ld tx_curr: %ld addr: %#08lx len: %d\n", adapter->tx_fill_ctr, 
580
+	DBG ( "TX fill: %ld tx_curr: %ld addr: %#08lx len: %zd\n", adapter->tx_fill_ctr, 
581 581
 	      tx_curr, virt_to_bus ( iobuf->data ), iob_len ( iobuf ) );
582 582
 	      
583 583
 	/* Point to next free descriptor */

+ 1
- 1
src/drivers/net/legacy.c View File

@@ -25,7 +25,7 @@ static int legacy_transmit ( struct net_device *netdev, struct io_buffer *iobuf
25 25
 	struct nic *nic = netdev->priv;
26 26
 	struct ethhdr *ethhdr;
27 27
 
28
-	DBG ( "Transmitting %d bytes\n", iob_len ( iobuf ) );
28
+	DBG ( "Transmitting %zd bytes\n", iob_len ( iobuf ) );
29 29
 	iob_pad ( iobuf, ETH_ZLEN );
30 30
 	ethhdr = iobuf->data;
31 31
 	iob_pull ( iobuf, sizeof ( *ethhdr ) );

+ 1
- 1
src/drivers/net/natsemi.c View File

@@ -471,7 +471,7 @@ static int natsemi_transmit (struct net_device *netdev, struct io_buffer *iobuf)
471 471
 	np->tx[np->tx_cur].bufptr = virt_to_bus (iobuf->data);
472 472
 	np->tx[np->tx_cur].cmdsts = iob_len (iobuf) | OWN;
473 473
 
474
-	DBG ("TX id %d at %#08lx + %#08x\n", np->tx_cur,
474
+	DBG ("TX id %d at %#08lx + %#08zx\n", np->tx_cur,
475 475
 	     virt_to_bus (&iobuf->data), iob_len (iobuf));
476 476
 
477 477
 	/* increment the circular buffer pointer to the next buffer location

+ 1
- 1
src/drivers/net/rtl8139.c View File

@@ -379,7 +379,7 @@ static int rtl_transmit ( struct net_device *netdev, struct io_buffer *iobuf ) {
379 379
 	iob_pad ( iobuf, ETH_ZLEN );
380 380
 
381 381
 	/* Add to TX ring */
382
-	DBG ( "TX id %d at %lx+%x\n", rtl->tx.next,
382
+	DBG ( "TX id %d at %lx+%zx\n", rtl->tx.next,
383 383
 	      virt_to_bus ( iobuf->data ), iob_len ( iobuf ) );
384 384
 	rtl->tx.iobuf[rtl->tx.next] = iobuf;
385 385
 	outl ( virt_to_bus ( iobuf->data ),

+ 1
- 1
src/drivers/nvs/nvs.c View File

@@ -91,7 +91,7 @@ static int nvs_verify ( struct nvs_device *nvs, unsigned int address,
91 91
 
92 92
 	/* Compare data */
93 93
 	if ( memcmp ( data, read_data, len ) != 0 ) {
94
-		DBG ( "NVS %p verification failed at %#04x+%d\n",
94
+		DBG ( "NVS %p verification failed at %#04x+%zd\n",
95 95
 		      nvs, address, len );
96 96
 		return -EIO;
97 97
 	}

+ 1
- 1
src/image/script.c View File

@@ -66,7 +66,7 @@ static int script_exec ( struct image *image ) {
66 66
 		if ( ! eol )
67 67
 			eol = memchr ( cmdbuf, '\0', sizeof ( cmdbuf ) );
68 68
 		if ( ! eol ) {
69
-			DBG ( "Script line too long (max %d bytes)\n",
69
+			DBG ( "Script line too long (max %zd bytes)\n",
70 70
 			      sizeof ( cmdbuf ) );
71 71
 			rc = -ENOEXEC;
72 72
 			goto done;

+ 2
- 2
src/net/dhcpopts.c View File

@@ -426,11 +426,11 @@ struct dhcp_option * set_dhcp_option ( struct dhcp_option_block *options,
426 426
 	option = find_dhcp_option_with_encap ( options, tag, &encapsulator );
427 427
 	if ( option ) {
428 428
 		old_len = dhcp_option_len ( option );
429
-		DBG ( "Resizing DHCP option %s from length %d to %d in block "
429
+		DBG ( "Resizing DHCP option %s from length %d to %zd in block "
430 430
 		      "%p\n", dhcp_tag_name (tag), option->len, len, options );
431 431
 	} else {
432 432
 		old_len = 0;
433
-		DBG ( "Creating DHCP option %s (length %d) in block %p\n",
433
+		DBG ( "Creating DHCP option %s (length %zd) in block %p\n",
434 434
 		      dhcp_tag_name ( tag ), len, options );
435 435
 	}
436 436
 	

+ 1
- 1
src/net/ethernet.c View File

@@ -74,7 +74,7 @@ static int eth_rx ( struct io_buffer *iobuf, struct net_device *netdev ) {
74 74
 
75 75
 	/* Sanity check */
76 76
 	if ( iob_len ( iobuf ) < sizeof ( *ethhdr ) ) {
77
-		DBG ( "Ethernet packet too short (%d bytes)\n",
77
+		DBG ( "Ethernet packet too short (%zd bytes)\n",
78 78
 		      iob_len ( iobuf ) );
79 79
 		free_iob ( iobuf );
80 80
 		return -EINVAL;

+ 1
- 1
src/net/icmpv6.c View File

@@ -77,7 +77,7 @@ static int icmp6_rx ( struct io_buffer *iobuf, struct sockaddr_tcpip *st_src,
77 77
 
78 78
 	/* Sanity check */
79 79
 	if ( iob_len ( iobuf ) < sizeof ( *icmp6hdr ) ) {
80
-		DBG ( "Packet too short (%d bytes)\n", iob_len ( iobuf ) );
80
+		DBG ( "Packet too short (%zd bytes)\n", iob_len ( iobuf ) );
81 81
 		free_iob ( iobuf );
82 82
 		return -EINVAL;
83 83
 	}

+ 8
- 8
src/net/ipv4.c View File

@@ -435,7 +435,7 @@ static int ipv4_rx ( struct io_buffer *iobuf, struct net_device *netdev __unused
435 435
 
436 436
 	/* Sanity check the IPv4 header */
437 437
 	if ( iob_len ( iobuf ) < sizeof ( *iphdr ) ) {
438
-		DBG ( "IPv4 packet too short at %d bytes (min %d bytes)\n",
438
+		DBG ( "IPv4 packet too short at %zd bytes (min %zd bytes)\n",
439 439
 		      iob_len ( iobuf ), sizeof ( *iphdr ) );
440 440
 		goto err;
441 441
 	}
@@ -445,13 +445,13 @@ static int ipv4_rx ( struct io_buffer *iobuf, struct net_device *netdev __unused
445 445
 	}
446 446
 	hdrlen = ( ( iphdr->verhdrlen & IP_MASK_HLEN ) * 4 );
447 447
 	if ( hdrlen < sizeof ( *iphdr ) ) {
448
-		DBG ( "IPv4 header too short at %d bytes (min %d bytes)\n",
448
+		DBG ( "IPv4 header too short at %zd bytes (min %zd bytes)\n",
449 449
 		      hdrlen, sizeof ( *iphdr ) );
450 450
 		goto err;
451 451
 	}
452 452
 	if ( hdrlen > iob_len ( iobuf ) ) {
453
-		DBG ( "IPv4 header too long at %d bytes "
454
-		      "(packet is %d bytes)\n", hdrlen, iob_len ( iobuf ) );
453
+		DBG ( "IPv4 header too long at %zd bytes "
454
+		      "(packet is %zd bytes)\n", hdrlen, iob_len ( iobuf ) );
455 455
 		goto err;
456 456
 	}
457 457
 	if ( ( csum = tcpip_chksum ( iphdr, hdrlen ) ) != 0 ) {
@@ -461,13 +461,13 @@ static int ipv4_rx ( struct io_buffer *iobuf, struct net_device *netdev __unused
461 461
 	}
462 462
 	len = ntohs ( iphdr->len );
463 463
 	if ( len < hdrlen ) {
464
-		DBG ( "IPv4 length too short at %d bytes "
465
-		      "(header is %d bytes)\n", len, hdrlen );
464
+		DBG ( "IPv4 length too short at %zd bytes "
465
+		      "(header is %zd bytes)\n", len, hdrlen );
466 466
 		goto err;
467 467
 	}
468 468
 	if ( len > iob_len ( iobuf ) ) {
469
-		DBG ( "IPv4 length too long at %d bytes "
470
-		      "(packet is %d bytes)\n", len, iob_len ( iobuf ) );
469
+		DBG ( "IPv4 length too long at %zd bytes "
470
+		      "(packet is %zd bytes)\n", len, iob_len ( iobuf ) );
471 471
 		goto err;
472 472
 	}
473 473
 

+ 1
- 1
src/net/ipv6.c View File

@@ -302,7 +302,7 @@ static int ipv6_rx ( struct io_buffer *iobuf,
302 302
 
303 303
 	/* Sanity check */
304 304
 	if ( iob_len ( iobuf ) < sizeof ( *ip6hdr ) ) {
305
-		DBG ( "Packet too short (%d bytes)\n", iob_len ( iobuf ) );
305
+		DBG ( "Packet too short (%zd bytes)\n", iob_len ( iobuf ) );
306 306
 		goto drop;
307 307
 	}
308 308
 

+ 3
- 3
src/net/ndp.c View File

@@ -81,7 +81,7 @@ add_ndp_entry ( struct net_device *netdev, struct in6_addr *in6,
81 81
 	}
82 82
 	ndp->state = state;
83 83
 	DBG ( "New neighbour cache entry (%d): IP6 %s => %s %s\n",
84
-	      ( ndp - ndp_table ) / sizeof ( *ndp ),
84
+	      ( ndp - ndp_table ),
85 85
 	      inet6_ntoa ( ndp->in6 ), netdev->ll_protocol->name,
86 86
 	      netdev->ll_protocol->ntoa ( ndp->ll_addr ) );
87 87
 }
@@ -119,7 +119,7 @@ int ndp_resolve ( struct net_device *netdev, struct in6_addr *dest,
119 119
 	/* Check if the entry was already created */
120 120
 	if ( ndp ) {
121 121
 		DBG ( "Awaiting neighbour advertisement (cache entry %d)\n",
122
-		      ( ( ndp - ndp_table ) / sizeof ( *ndp ) ) );
122
+		      ( ndp - ndp_table ) );
123 123
 		/* For test */
124 124
 //		ndp->state = NDP_STATE_REACHABLE;
125 125
 //		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
155 155
 
156 156
 	/* Sanity check */
157 157
 	if ( iob_len ( iobuf ) < sizeof ( *nadvert ) ) {
158
-		DBG ( "Packet too short (%d bytes)\n", iob_len ( iobuf ) );
158
+		DBG ( "Packet too short (%zd bytes)\n", iob_len ( iobuf ) );
159 159
 		return -EINVAL;
160 160
 	}
161 161
 

+ 5
- 5
src/net/tcp.c View File

@@ -557,7 +557,7 @@ static int tcp_xmit_reset ( struct tcp_connection *tcp,
557 557
 	tcphdr->csum = tcpip_chksum ( iobuf->data, iob_len ( iobuf ) );
558 558
 
559 559
 	/* Dump header */
560
-	DBGC ( tcp, "TCP %p TX %d->%d %08lx..%08lx           %08lx %4zd",
560
+	DBGC ( tcp, "TCP %p TX %d->%d %08lx..%08lx           %08lx %4d",
561 561
 	       tcp, ntohs ( tcphdr->src ), ntohs ( tcphdr->dest ),
562 562
 	       ntohl ( tcphdr->seq ), ( ntohl ( tcphdr->seq ) ),
563 563
 	       ntohl ( tcphdr->ack ), 0 );
@@ -820,7 +820,7 @@ static int tcp_rx ( struct io_buffer *iobuf,
820 820
 	struct tcp_header *tcphdr = iobuf->data;
821 821
 	struct tcp_connection *tcp;
822 822
 	struct tcp_options options;
823
-	unsigned int hlen;
823
+	size_t hlen;
824 824
 	uint16_t csum;
825 825
 	uint32_t start_seq;
826 826
 	uint32_t seq;
@@ -832,20 +832,20 @@ static int tcp_rx ( struct io_buffer *iobuf,
832 832
 
833 833
 	/* Sanity check packet */
834 834
 	if ( iob_len ( iobuf ) < sizeof ( *tcphdr ) ) {
835
-		DBG ( "TCP packet too short at %d bytes (min %d bytes)\n",
835
+		DBG ( "TCP packet too short at %zd bytes (min %zd bytes)\n",
836 836
 		      iob_len ( iobuf ), sizeof ( *tcphdr ) );
837 837
 		rc = -EINVAL;
838 838
 		goto discard;
839 839
 	}
840 840
 	hlen = ( ( tcphdr->hlen & TCP_MASK_HLEN ) / 16 ) * 4;
841 841
 	if ( hlen < sizeof ( *tcphdr ) ) {
842
-		DBG ( "TCP header too short at %d bytes (min %d bytes)\n",
842
+		DBG ( "TCP header too short at %zd bytes (min %zd bytes)\n",
843 843
 		      hlen, sizeof ( *tcphdr ) );
844 844
 		rc = -EINVAL;
845 845
 		goto discard;
846 846
 	}
847 847
 	if ( hlen > iob_len ( iobuf ) ) {
848
-		DBG ( "TCP header too long at %d bytes (max %d bytes)\n",
848
+		DBG ( "TCP header too long at %zd bytes (max %zd bytes)\n",
849 849
 		      hlen, iob_len ( iobuf ) );
850 850
 		rc = -EINVAL;
851 851
 		goto discard;

+ 1
- 1
src/net/tcp/iscsi.c View File

@@ -213,7 +213,7 @@ static void iscsi_start_command ( struct iscsi_session *iscsi ) {
213 213
 	command->cmdsn = htonl ( iscsi->cmdsn );
214 214
 	command->expstatsn = htonl ( iscsi->statsn + 1 );
215 215
 	memcpy ( &command->cdb, &iscsi->command->cdb, sizeof ( command->cdb ));
216
-	DBGC ( iscsi, "iSCSI %p start " SCSI_CDB_FORMAT " %s %#x\n",
216
+	DBGC ( iscsi, "iSCSI %p start " SCSI_CDB_FORMAT " %s %#zx\n",
217 217
 	       iscsi, SCSI_CDB_DATA ( command->cdb ),
218 218
 	       ( iscsi->command->data_in ? "in" : "out" ),
219 219
 	       ( iscsi->command->data_in ?

+ 1
- 1
src/net/tls.c View File

@@ -452,7 +452,7 @@ static int tls_select_cipher ( struct tls_session *tls,
452 452
 	struct crypto_algorithm *pubkey = &crypto_null;
453 453
 	struct crypto_algorithm *cipher = &crypto_null;
454 454
 	struct crypto_algorithm *digest = &crypto_null;
455
-	size_t key_len = 0;
455
+	unsigned int key_len = 0;
456 456
 	int rc;
457 457
 
458 458
 	switch ( cipher_suite ) {

+ 7
- 7
src/net/udp.c View File

@@ -215,7 +215,7 @@ static int udp_tx ( struct udp_connection *udp, struct io_buffer *iobuf,
215 215
 	udphdr->chksum = tcpip_chksum ( udphdr, len );
216 216
 
217 217
 	/* Dump debugging information */
218
-	DBGC ( udp, "UDP %p TX %d->%d len %zd\n", udp,
218
+	DBGC ( udp, "UDP %p TX %d->%d len %d\n", udp,
219 219
 	       ntohs ( udphdr->src ), ntohs ( udphdr->dest ),
220 220
 	       ntohs ( udphdr->len ) );
221 221
 
@@ -268,7 +268,7 @@ static int udp_rx ( struct io_buffer *iobuf, struct sockaddr_tcpip *st_src,
268 268
 
269 269
 	/* Sanity check packet */
270 270
 	if ( iob_len ( iobuf ) < sizeof ( *udphdr ) ) {
271
-		DBG ( "UDP packet too short at %d bytes (min %d bytes)\n",
271
+		DBG ( "UDP packet too short at %zd bytes (min %zd bytes)\n",
272 272
 		      iob_len ( iobuf ), sizeof ( *udphdr ) );
273 273
 		
274 274
 		rc = -EINVAL;
@@ -276,14 +276,14 @@ static int udp_rx ( struct io_buffer *iobuf, struct sockaddr_tcpip *st_src,
276 276
 	}
277 277
 	ulen = ntohs ( udphdr->len );
278 278
 	if ( ulen < sizeof ( *udphdr ) ) {
279
-		DBG ( "UDP length too short at %d bytes "
280
-		      "(header is %d bytes)\n", ulen, sizeof ( *udphdr ) );
279
+		DBG ( "UDP length too short at %zd bytes "
280
+		      "(header is %zd bytes)\n", ulen, sizeof ( *udphdr ) );
281 281
 		rc = -EINVAL;
282 282
 		goto done;
283 283
 	}
284 284
 	if ( ulen > iob_len ( iobuf ) ) {
285
-		DBG ( "UDP length too long at %d bytes (packet is %d bytes)\n",
286
-		      ulen, iob_len ( iobuf ) );
285
+		DBG ( "UDP length too long at %zd bytes (packet is %zd "
286
+		      "bytes)\n", ulen, iob_len ( iobuf ) );
287 287
 		rc = -EINVAL;
288 288
 		goto done;
289 289
 	}
@@ -370,7 +370,7 @@ static struct io_buffer * udp_alloc_iob ( struct xfer_interface *xfer,
370 370
 
371 371
 	iobuf = alloc_iob ( UDP_MAX_HLEN + len );
372 372
 	if ( ! iobuf ) {
373
-		DBGC ( udp, "UDP %p cannot allocate buffer of length %d\n",
373
+		DBGC ( udp, "UDP %p cannot allocate buffer of length %zd\n",
374 374
 		       udp, len );
375 375
 		return NULL;
376 376
 	}

+ 1
- 1
src/net/udp/dhcp.c View File

@@ -453,7 +453,7 @@ static struct dhcp_option_block * dhcp_parse ( const struct dhcphdr *dhcphdr,
453 453
 	/* Allocate empty options block of required size */
454 454
 	options = alloc_dhcp_options ( options_len );
455 455
 	if ( ! options ) {
456
-		DBG ( "DHCP could not allocate %d-byte option block\n",
456
+		DBG ( "DHCP could not allocate %zd-byte option block\n",
457 457
 		      options_len );
458 458
 		return NULL;
459 459
 	}

Loading…
Cancel
Save