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
 		E1000_TXD_CMD_IFCS | iob_len ( iobuf );
577
 		E1000_TXD_CMD_IFCS | iob_len ( iobuf );
578
 	tx_curr_desc->upper.data = 0;
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
 	      tx_curr, virt_to_bus ( iobuf->data ), iob_len ( iobuf ) );
581
 	      tx_curr, virt_to_bus ( iobuf->data ), iob_len ( iobuf ) );
582
 	      
582
 	      
583
 	/* Point to next free descriptor */
583
 	/* Point to next free descriptor */

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

25
 	struct nic *nic = netdev->priv;
25
 	struct nic *nic = netdev->priv;
26
 	struct ethhdr *ethhdr;
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
 	iob_pad ( iobuf, ETH_ZLEN );
29
 	iob_pad ( iobuf, ETH_ZLEN );
30
 	ethhdr = iobuf->data;
30
 	ethhdr = iobuf->data;
31
 	iob_pull ( iobuf, sizeof ( *ethhdr ) );
31
 	iob_pull ( iobuf, sizeof ( *ethhdr ) );

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

471
 	np->tx[np->tx_cur].bufptr = virt_to_bus (iobuf->data);
471
 	np->tx[np->tx_cur].bufptr = virt_to_bus (iobuf->data);
472
 	np->tx[np->tx_cur].cmdsts = iob_len (iobuf) | OWN;
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
 	     virt_to_bus (&iobuf->data), iob_len (iobuf));
475
 	     virt_to_bus (&iobuf->data), iob_len (iobuf));
476
 
476
 
477
 	/* increment the circular buffer pointer to the next buffer location
477
 	/* increment the circular buffer pointer to the next buffer location

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

379
 	iob_pad ( iobuf, ETH_ZLEN );
379
 	iob_pad ( iobuf, ETH_ZLEN );
380
 
380
 
381
 	/* Add to TX ring */
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
 	      virt_to_bus ( iobuf->data ), iob_len ( iobuf ) );
383
 	      virt_to_bus ( iobuf->data ), iob_len ( iobuf ) );
384
 	rtl->tx.iobuf[rtl->tx.next] = iobuf;
384
 	rtl->tx.iobuf[rtl->tx.next] = iobuf;
385
 	outl ( virt_to_bus ( iobuf->data ),
385
 	outl ( virt_to_bus ( iobuf->data ),

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

91
 
91
 
92
 	/* Compare data */
92
 	/* Compare data */
93
 	if ( memcmp ( data, read_data, len ) != 0 ) {
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
 		      nvs, address, len );
95
 		      nvs, address, len );
96
 		return -EIO;
96
 		return -EIO;
97
 	}
97
 	}

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

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

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

426
 	option = find_dhcp_option_with_encap ( options, tag, &encapsulator );
426
 	option = find_dhcp_option_with_encap ( options, tag, &encapsulator );
427
 	if ( option ) {
427
 	if ( option ) {
428
 		old_len = dhcp_option_len ( option );
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
 		      "%p\n", dhcp_tag_name (tag), option->len, len, options );
430
 		      "%p\n", dhcp_tag_name (tag), option->len, len, options );
431
 	} else {
431
 	} else {
432
 		old_len = 0;
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
 		      dhcp_tag_name ( tag ), len, options );
434
 		      dhcp_tag_name ( tag ), len, options );
435
 	}
435
 	}
436
 	
436
 	

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

74
 
74
 
75
 	/* Sanity check */
75
 	/* Sanity check */
76
 	if ( iob_len ( iobuf ) < sizeof ( *ethhdr ) ) {
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
 		      iob_len ( iobuf ) );
78
 		      iob_len ( iobuf ) );
79
 		free_iob ( iobuf );
79
 		free_iob ( iobuf );
80
 		return -EINVAL;
80
 		return -EINVAL;

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

77
 
77
 
78
 	/* Sanity check */
78
 	/* Sanity check */
79
 	if ( iob_len ( iobuf ) < sizeof ( *icmp6hdr ) ) {
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
 		free_iob ( iobuf );
81
 		free_iob ( iobuf );
82
 		return -EINVAL;
82
 		return -EINVAL;
83
 	}
83
 	}

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

435
 
435
 
436
 	/* Sanity check the IPv4 header */
436
 	/* Sanity check the IPv4 header */
437
 	if ( iob_len ( iobuf ) < sizeof ( *iphdr ) ) {
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
 		      iob_len ( iobuf ), sizeof ( *iphdr ) );
439
 		      iob_len ( iobuf ), sizeof ( *iphdr ) );
440
 		goto err;
440
 		goto err;
441
 	}
441
 	}
445
 	}
445
 	}
446
 	hdrlen = ( ( iphdr->verhdrlen & IP_MASK_HLEN ) * 4 );
446
 	hdrlen = ( ( iphdr->verhdrlen & IP_MASK_HLEN ) * 4 );
447
 	if ( hdrlen < sizeof ( *iphdr ) ) {
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
 		      hdrlen, sizeof ( *iphdr ) );
449
 		      hdrlen, sizeof ( *iphdr ) );
450
 		goto err;
450
 		goto err;
451
 	}
451
 	}
452
 	if ( hdrlen > iob_len ( iobuf ) ) {
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
 		goto err;
455
 		goto err;
456
 	}
456
 	}
457
 	if ( ( csum = tcpip_chksum ( iphdr, hdrlen ) ) != 0 ) {
457
 	if ( ( csum = tcpip_chksum ( iphdr, hdrlen ) ) != 0 ) {
461
 	}
461
 	}
462
 	len = ntohs ( iphdr->len );
462
 	len = ntohs ( iphdr->len );
463
 	if ( len < hdrlen ) {
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
 		goto err;
466
 		goto err;
467
 	}
467
 	}
468
 	if ( len > iob_len ( iobuf ) ) {
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
 		goto err;
471
 		goto err;
472
 	}
472
 	}
473
 
473
 

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

302
 
302
 
303
 	/* Sanity check */
303
 	/* Sanity check */
304
 	if ( iob_len ( iobuf ) < sizeof ( *ip6hdr ) ) {
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
 		goto drop;
306
 		goto drop;
307
 	}
307
 	}
308
 
308
 

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

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

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

557
 	tcphdr->csum = tcpip_chksum ( iobuf->data, iob_len ( iobuf ) );
557
 	tcphdr->csum = tcpip_chksum ( iobuf->data, iob_len ( iobuf ) );
558
 
558
 
559
 	/* Dump header */
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
 	       tcp, ntohs ( tcphdr->src ), ntohs ( tcphdr->dest ),
561
 	       tcp, ntohs ( tcphdr->src ), ntohs ( tcphdr->dest ),
562
 	       ntohl ( tcphdr->seq ), ( ntohl ( tcphdr->seq ) ),
562
 	       ntohl ( tcphdr->seq ), ( ntohl ( tcphdr->seq ) ),
563
 	       ntohl ( tcphdr->ack ), 0 );
563
 	       ntohl ( tcphdr->ack ), 0 );
820
 	struct tcp_header *tcphdr = iobuf->data;
820
 	struct tcp_header *tcphdr = iobuf->data;
821
 	struct tcp_connection *tcp;
821
 	struct tcp_connection *tcp;
822
 	struct tcp_options options;
822
 	struct tcp_options options;
823
-	unsigned int hlen;
823
+	size_t hlen;
824
 	uint16_t csum;
824
 	uint16_t csum;
825
 	uint32_t start_seq;
825
 	uint32_t start_seq;
826
 	uint32_t seq;
826
 	uint32_t seq;
832
 
832
 
833
 	/* Sanity check packet */
833
 	/* Sanity check packet */
834
 	if ( iob_len ( iobuf ) < sizeof ( *tcphdr ) ) {
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
 		      iob_len ( iobuf ), sizeof ( *tcphdr ) );
836
 		      iob_len ( iobuf ), sizeof ( *tcphdr ) );
837
 		rc = -EINVAL;
837
 		rc = -EINVAL;
838
 		goto discard;
838
 		goto discard;
839
 	}
839
 	}
840
 	hlen = ( ( tcphdr->hlen & TCP_MASK_HLEN ) / 16 ) * 4;
840
 	hlen = ( ( tcphdr->hlen & TCP_MASK_HLEN ) / 16 ) * 4;
841
 	if ( hlen < sizeof ( *tcphdr ) ) {
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
 		      hlen, sizeof ( *tcphdr ) );
843
 		      hlen, sizeof ( *tcphdr ) );
844
 		rc = -EINVAL;
844
 		rc = -EINVAL;
845
 		goto discard;
845
 		goto discard;
846
 	}
846
 	}
847
 	if ( hlen > iob_len ( iobuf ) ) {
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
 		      hlen, iob_len ( iobuf ) );
849
 		      hlen, iob_len ( iobuf ) );
850
 		rc = -EINVAL;
850
 		rc = -EINVAL;
851
 		goto discard;
851
 		goto discard;

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

213
 	command->cmdsn = htonl ( iscsi->cmdsn );
213
 	command->cmdsn = htonl ( iscsi->cmdsn );
214
 	command->expstatsn = htonl ( iscsi->statsn + 1 );
214
 	command->expstatsn = htonl ( iscsi->statsn + 1 );
215
 	memcpy ( &command->cdb, &iscsi->command->cdb, sizeof ( command->cdb ));
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
 	       iscsi, SCSI_CDB_DATA ( command->cdb ),
217
 	       iscsi, SCSI_CDB_DATA ( command->cdb ),
218
 	       ( iscsi->command->data_in ? "in" : "out" ),
218
 	       ( iscsi->command->data_in ? "in" : "out" ),
219
 	       ( iscsi->command->data_in ?
219
 	       ( iscsi->command->data_in ?

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

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

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

215
 	udphdr->chksum = tcpip_chksum ( udphdr, len );
215
 	udphdr->chksum = tcpip_chksum ( udphdr, len );
216
 
216
 
217
 	/* Dump debugging information */
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
 	       ntohs ( udphdr->src ), ntohs ( udphdr->dest ),
219
 	       ntohs ( udphdr->src ), ntohs ( udphdr->dest ),
220
 	       ntohs ( udphdr->len ) );
220
 	       ntohs ( udphdr->len ) );
221
 
221
 
268
 
268
 
269
 	/* Sanity check packet */
269
 	/* Sanity check packet */
270
 	if ( iob_len ( iobuf ) < sizeof ( *udphdr ) ) {
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
 		      iob_len ( iobuf ), sizeof ( *udphdr ) );
272
 		      iob_len ( iobuf ), sizeof ( *udphdr ) );
273
 		
273
 		
274
 		rc = -EINVAL;
274
 		rc = -EINVAL;
276
 	}
276
 	}
277
 	ulen = ntohs ( udphdr->len );
277
 	ulen = ntohs ( udphdr->len );
278
 	if ( ulen < sizeof ( *udphdr ) ) {
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
 		rc = -EINVAL;
281
 		rc = -EINVAL;
282
 		goto done;
282
 		goto done;
283
 	}
283
 	}
284
 	if ( ulen > iob_len ( iobuf ) ) {
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
 		rc = -EINVAL;
287
 		rc = -EINVAL;
288
 		goto done;
288
 		goto done;
289
 	}
289
 	}
370
 
370
 
371
 	iobuf = alloc_iob ( UDP_MAX_HLEN + len );
371
 	iobuf = alloc_iob ( UDP_MAX_HLEN + len );
372
 	if ( ! iobuf ) {
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
 		       udp, len );
374
 		       udp, len );
375
 		return NULL;
375
 		return NULL;
376
 	}
376
 	}

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

453
 	/* Allocate empty options block of required size */
453
 	/* Allocate empty options block of required size */
454
 	options = alloc_dhcp_options ( options_len );
454
 	options = alloc_dhcp_options ( options_len );
455
 	if ( ! options ) {
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
 		      options_len );
457
 		      options_len );
458
 		return NULL;
458
 		return NULL;
459
 	}
459
 	}

Loading…
Cancel
Save