Browse Source

Fix compiler warnings that appear only on OpenBSD.

tags/v0.9.3
Michael Brown 16 years ago
parent
commit
1949641d10

+ 1
- 1
src/arch/i386/drivers/net/undinet.c View File

217
 		DBGC ( undinic, "UNDINIC %p %s failed: %s\n", undinic,
217
 		DBGC ( undinic, "UNDINIC %p %s failed: %s\n", undinic,
218
 		       undinet_function_name ( function ), strerror ( rc ) );
218
 		       undinet_function_name ( function ), strerror ( rc ) );
219
 		DBGC ( undinic, "UNDINIC %p parameters at %04x:%04x length "
219
 		DBGC ( undinic, "UNDINIC %p parameters at %04x:%04x length "
220
-		       "%#02x, entry point at %04x:%04x\n", undinic,
220
+		       "%#02zx, entry point at %04x:%04x\n", undinic,
221
 		       rm_params.segment, rm_params.offset, params_len,
221
 		       rm_params.segment, rm_params.offset, params_len,
222
 		       undinet_entry_point.segment,
222
 		       undinet_entry_point.segment,
223
 		       undinet_entry_point.offset );
223
 		       undinet_entry_point.offset );

+ 1
- 1
src/arch/i386/drivers/net/undirom.c View File

70
 	undirom->data_size = undi_rom_id.DataSize;
70
 	undirom->data_size = undi_rom_id.DataSize;
71
 
71
 
72
 	DBGC ( undirom, "UNDIROM %p has UNDI loader at %04x:%04x "
72
 	DBGC ( undirom, "UNDIROM %p has UNDI loader at %04x:%04x "
73
-	       "(code %04x data %04x)\n", undirom,
73
+	       "(code %04zx data %04zx)\n", undirom,
74
 	       undirom->loader_entry.segment, undirom->loader_entry.offset,
74
 	       undirom->loader_entry.segment, undirom->loader_entry.offset,
75
 	       undirom->code_size, undirom->data_size );
75
 	       undirom->code_size, undirom->data_size );
76
 	return 0;
76
 	return 0;

+ 2
- 2
src/arch/i386/firmware/pcbios/smbios.c View File

220
 		strings_offset = ( offset + header.length );
220
 		strings_offset = ( offset + header.length );
221
 		if ( strings_offset > smbios->length ) {
221
 		if ( strings_offset > smbios->length ) {
222
 			DBG ( "SMBIOS structure at offset %zx with length "
222
 			DBG ( "SMBIOS structure at offset %zx with length "
223
-			      "%zx extends beyond SMBIOS\n", offset,
223
+			      "%x extends beyond SMBIOS\n", offset,
224
 			      header.length );
224
 			      header.length );
225
 			return -ENOENT;
225
 			return -ENOENT;
226
 		}
226
 		}
236
 		strings->length = ( terminator_offset - strings_offset );
236
 		strings->length = ( terminator_offset - strings_offset );
237
 
237
 
238
 		DBG ( "SMBIOS structure at offset %zx has type %d, "
238
 		DBG ( "SMBIOS structure at offset %zx has type %d, "
239
-		      "length %zx, strings length %zx\n",
239
+		      "length %x, strings length %zx\n",
240
 		      offset, header.type, header.length, strings->length );
240
 		      offset, header.type, header.length, strings->length );
241
 
241
 
242
 		/* If this is the structure we want, return */
242
 		/* If this is the structure we want, return */

+ 1
- 1
src/arch/i386/image/bzimage.c View File

344
 	shutdown();
344
 	shutdown();
345
 
345
 
346
 	DBGC ( image, "bzImage %p jumping to RM kernel at %04x:0000 "
346
 	DBGC ( image, "bzImage %p jumping to RM kernel at %04x:0000 "
347
-	       "(stack %04x:%04x)\n", image,
347
+	       "(stack %04x:%04zx)\n", image,
348
 	       ( exec_ctx.rm_kernel_seg + 0x20 ),
348
 	       ( exec_ctx.rm_kernel_seg + 0x20 ),
349
 	       exec_ctx.rm_kernel_seg, exec_ctx.rm_heap );
349
 	       exec_ctx.rm_kernel_seg, exec_ctx.rm_heap );
350
 
350
 

+ 1
- 1
src/arch/i386/image/nbi.c View File

233
 	} while ( ! NBI_LAST_SEGHEADER ( sh.flags ) );
233
 	} while ( ! NBI_LAST_SEGHEADER ( sh.flags ) );
234
 
234
 
235
 	if ( offset != image->len ) {
235
 	if ( offset != image->len ) {
236
-		DBGC ( image, "NBI %p length wrong (file %d, metadata %d)\n",
236
+		DBGC ( image, "NBI %p length wrong (file %zd, metadata %zd)\n",
237
 		       image, image->len, offset );
237
 		       image, image->len, offset );
238
 		return -ENOEXEC;
238
 		return -ENOEXEC;
239
 	}
239
 	}

+ 7
- 7
src/arch/i386/prefix/unnrv2b.S View File

54
  * NOTE: It would be possible to build a smaller version of the
54
  * NOTE: It would be possible to build a smaller version of the
55
  * decompression code for -DKEEP_IT_REAL by using
55
  * decompression code for -DKEEP_IT_REAL by using
56
  *    #define REG(x) x
56
  *    #define REG(x) x
57
- *    #define MOVSB movsb
58
  * to use 16-bit registers where possible.  This would impose limits
57
  * to use 16-bit registers where possible.  This would impose limits
59
  * that the compressed data size must be in the range [1,65533-%si]
58
  * that the compressed data size must be in the range [1,65533-%si]
60
  * and the uncompressed data size must be in the range [1,65536-%di]
59
  * and the uncompressed data size must be in the range [1,65536-%di]
67
  */
66
  */
68
 
67
 
69
 #define REG(x) e ## x
68
 #define REG(x) e ## x
70
-#define MOVSB addr32 movsb
69
+#define ADDR32 addr32
71
 
70
 
72
 	.code16
71
 	.code16
73
 	.globl	decompress16
72
 	.globl	decompress16
89
  */
88
  */
90
 
89
 
91
 #define REG(x) e ## x
90
 #define REG(x) e ## x
91
+#define ADDR32
92
 	
92
 	
93
 	.code32
93
 	.code32
94
 	.globl	decompress
94
 	.globl	decompress
114
 	jmp	dcl1_n2b
114
 	jmp	dcl1_n2b
115
 	
115
 	
116
 decompr_literals_n2b:
116
 decompr_literals_n2b:
117
-	MOVSB
117
+	ADDR32 movsb
118
 decompr_loop_n2b:
118
 decompr_loop_n2b:
119
 	addl	%ebx, %ebx
119
 	addl	%ebx, %ebx
120
 	jnz	dcl2_n2b
120
 	jnz	dcl2_n2b
132
 	sub	$3, %xAX
132
 	sub	$3, %xAX
133
 	jb	decompr_ebpeax_n2b	/* if (m_off == 2) goto decompr_ebpeax_n2b ? */
133
 	jb	decompr_ebpeax_n2b	/* if (m_off == 2) goto decompr_ebpeax_n2b ? */
134
 	shl	$8, %xAX	
134
 	shl	$8, %xAX	
135
-	movb	(%xSI), %al	/* m_off = (m_off - 3)*256 + src[ilen++] */
135
+	ADDR32 movb (%xSI), %al	/* m_off = (m_off - 3)*256 + src[ilen++] */
136
 	inc	%xSI
136
 	inc	%xSI
137
 	xor	$-1, %xAX
137
 	xor	$-1, %xAX
138
 	jz	decompr_end_n2b	/* if (m_off == 0xffffffff) goto decomp_end_n2b */
138
 	jz	decompr_end_n2b	/* if (m_off == 0xffffffff) goto decomp_end_n2b */
156
 	cmp	$-0xd00, %xBP
156
 	cmp	$-0xd00, %xBP
157
 	adc	$1, %xCX	/* m_len = m_len + 1 + (last_m_off > 0xd00) */
157
 	adc	$1, %xCX	/* m_len = m_len + 1 + (last_m_off > 0xd00) */
158
 	push	%xSI
158
 	push	%xSI
159
-	lea	(%xBP,%xDI), %xSI	/* m_pos = dst + olen + -m_off  */
159
+	ADDR32 lea (%xBP,%xDI), %xSI	/* m_pos = dst + olen + -m_off  */
160
 	rep
160
 	rep
161
-	es MOVSB		/* dst[olen++] = *m_pos++ while(m_len > 0) */
161
+	es ADDR32 movsb		/* dst[olen++] = *m_pos++ while(m_len > 0) */
162
 	pop	%xSI
162
 	pop	%xSI
163
 	jmp	decompr_loop_n2b
163
 	jmp	decompr_loop_n2b
164
 
164
 
167
 	addl	%ebx, %ebx
167
 	addl	%ebx, %ebx
168
 	jnz	1f
168
 	jnz	1f
169
 getbit32:
169
 getbit32:
170
-	movl	(%xSI), %ebx
170
+	ADDR32 movl (%xSI), %ebx
171
 	sub	$-4, %xSI	/* sets carry flag */
171
 	sub	$-4, %xSI	/* sets carry flag */
172
 	adcl	%ebx, %ebx
172
 	adcl	%ebx, %ebx
173
 1:
173
 1:

+ 1
- 1
src/arch/i386/transitions/librm.S View File

192
 	movzwl	%sp, %edx
192
 	movzwl	%sp, %edx
193
 	movl	%ebp, %eax
193
 	movl	%ebp, %eax
194
 	shll	$4, %eax
194
 	shll	$4, %eax
195
-	leal	(%eax,%edx), %esi
195
+	addr32 leal (%eax,%edx), %esi
196
 	subl	_virt_offset, %esi
196
 	subl	_virt_offset, %esi
197
 
197
 
198
 	/* Switch to protected mode */
198
 	/* Switch to protected mode */

+ 3
- 3
src/crypto/asn1.c View File

75
 		len_len = 1;
75
 		len_len = 1;
76
 	}
76
 	}
77
 	if ( cursor->len < len_len ) {
77
 	if ( cursor->len < len_len ) {
78
-		DBGC ( cursor, "ASN1 %p bad length field length %d (max %d)\n",
79
-		       cursor, len_len, cursor->len );
78
+		DBGC ( cursor, "ASN1 %p bad length field length %d (max "
79
+		       "%zd)\n", cursor, len_len, cursor->len );
80
 		goto notfound;
80
 		goto notfound;
81
 	}
81
 	}
82
 
82
 
88
 		cursor->len--;
88
 		cursor->len--;
89
 	}
89
 	}
90
 	if ( cursor->len < len ) {
90
 	if ( cursor->len < len ) {
91
-		DBGC ( cursor, "ASN1 %p bad length %d (max %d)\n",
91
+		DBGC ( cursor, "ASN1 %p bad length %d (max %zd)\n",
92
 		       cursor, len, cursor->len );
92
 		       cursor, len, cursor->len );
93
 		goto notfound;
93
 		goto notfound;
94
 	}
94
 	}

+ 1
- 1
src/crypto/chap.c View File

55
 	state_len = ( digest->ctxsize + digest->digestsize );
55
 	state_len = ( digest->ctxsize + digest->digestsize );
56
 	state = malloc ( state_len );
56
 	state = malloc ( state_len );
57
 	if ( ! state ) {
57
 	if ( ! state ) {
58
-		DBG ( "CHAP %p could not allocate %d bytes for state\n",
58
+		DBG ( "CHAP %p could not allocate %zd bytes for state\n",
59
 		      chap, state_len );
59
 		      chap, state_len );
60
 		return -ENOMEM;
60
 		return -ENOMEM;
61
 	}
61
 	}

+ 2
- 2
src/drivers/nvs/spi.c View File

87
 					     device->munge_address );
87
 					     device->munge_address );
88
 	int rc;
88
 	int rc;
89
 
89
 
90
-	DBG ( "SPI %p reading %d bytes from %#04x\n", device, len, address );
90
+	DBG ( "SPI %p reading %zd bytes from %#04x\n", device, len, address );
91
 	if ( ( rc = bus->rw ( bus, device, command, address,
91
 	if ( ( rc = bus->rw ( bus, device, command, address,
92
 			      NULL, data, len ) ) != 0 ) {
92
 			      NULL, data, len ) ) != 0 ) {
93
 		DBG ( "SPI %p failed to read data from device\n", device );
93
 		DBG ( "SPI %p failed to read data from device\n", device );
114
 					     device->munge_address );
114
 					     device->munge_address );
115
 	int rc;
115
 	int rc;
116
 
116
 
117
-	DBG ( "SPI %p writing %d bytes to %#04x\n", device, len, address );
117
+	DBG ( "SPI %p writing %zd bytes to %#04x\n", device, len, address );
118
 
118
 
119
 	if ( ( rc = bus->rw ( bus, device, SPI_WREN, -1,
119
 	if ( ( rc = bus->rw ( bus, device, SPI_WREN, -1,
120
 			      NULL, NULL, 0 ) ) != 0 ) {
120
 			      NULL, NULL, 0 ) ) != 0 ) {

+ 2
- 2
src/drivers/nvs/threewire.c View File

43
 
43
 
44
 	assert ( bus->mode == SPI_MODE_THREEWIRE );
44
 	assert ( bus->mode == SPI_MODE_THREEWIRE );
45
 
45
 
46
-	DBG ( "3wire %p reading %d bytes at %04x\n", device, len, address );
46
+	DBG ( "3wire %p reading %zd bytes at %04x\n", device, len, address );
47
 
47
 
48
 	return bus->rw ( bus, device, THREEWIRE_READ, address,
48
 	return bus->rw ( bus, device, THREEWIRE_READ, address,
49
 			 NULL, data, len );
49
 			 NULL, data, len );
66
 
66
 
67
 	assert ( bus->mode == SPI_MODE_THREEWIRE );
67
 	assert ( bus->mode == SPI_MODE_THREEWIRE );
68
 
68
 
69
-	DBG ( "3wire %p writing %d bytes at %04x\n", device, len, address );
69
+	DBG ( "3wire %p writing %zd bytes at %04x\n", device, len, address );
70
 
70
 
71
 	/* Enable device for writing */
71
 	/* Enable device for writing */
72
 	if ( ( rc = bus->rw ( bus, device, THREEWIRE_EWEN,
72
 	if ( ( rc = bus->rw ( bus, device, THREEWIRE_EWEN,

+ 2
- 2
src/interface/pxe/pxe_undi.c View File

227
 	copy_from_real ( &tbd, undi_transmit->TBD.segment,
227
 	copy_from_real ( &tbd, undi_transmit->TBD.segment,
228
 			 undi_transmit->TBD.offset, sizeof ( tbd ) );
228
 			 undi_transmit->TBD.offset, sizeof ( tbd ) );
229
 	len = tbd.ImmedLength;
229
 	len = tbd.ImmedLength;
230
-	DBG ( " %zd", tbd.ImmedLength );
230
+	DBG ( " %d", tbd.ImmedLength );
231
 	for ( i = 0 ; i < tbd.DataBlkCount ; i++ ) {
231
 	for ( i = 0 ; i < tbd.DataBlkCount ; i++ ) {
232
 		datablk = &tbd.DataBlock[i];
232
 		datablk = &tbd.DataBlock[i];
233
 		len += datablk->TDDataLen;
233
 		len += datablk->TDDataLen;
234
-		DBG ( "+%zd", datablk->TDDataLen );
234
+		DBG ( "+%d", datablk->TDDataLen );
235
 	}
235
 	}
236
 
236
 
237
 	/* Allocate and fill I/O buffer */
237
 	/* Allocate and fill I/O buffer */

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

496
 	char *end = buf + len;
496
 	char *end = buf + len;
497
 	char *name;
497
 	char *name;
498
 	char *value;
498
 	char *value;
499
-	int rc;
499
+	int rc = 0;
500
 
500
 
501
 	/* Sanity check */
501
 	/* Sanity check */
502
 	if ( len < sizeof ( *oack ) ) {
502
 	if ( len < sizeof ( *oack ) ) {
503
 		DBGC ( tftp, "TFTP %p received underlength OACK packet "
503
 		DBGC ( tftp, "TFTP %p received underlength OACK packet "
504
-		       "length %d\n", tftp, len );
504
+		       "length %zd\n", tftp, len );
505
 		rc = -EINVAL;
505
 		rc = -EINVAL;
506
 		goto done;
506
 		goto done;
507
 	}
507
 	}
562
 	/* Sanity check */
562
 	/* Sanity check */
563
 	if ( iob_len ( iobuf ) < sizeof ( *data ) ) {
563
 	if ( iob_len ( iobuf ) < sizeof ( *data ) ) {
564
 		DBGC ( tftp, "TFTP %p received underlength DATA packet "
564
 		DBGC ( tftp, "TFTP %p received underlength DATA packet "
565
-		       "length %d\n", tftp, iob_len ( iobuf ) );
565
+		       "length %zd\n", tftp, iob_len ( iobuf ) );
566
 		rc = -EINVAL;
566
 		rc = -EINVAL;
567
 		goto done;
567
 		goto done;
568
 	}
568
 	}
574
 	data_len = iob_len ( iobuf );
574
 	data_len = iob_len ( iobuf );
575
 	if ( data_len > tftp->blksize ) {
575
 	if ( data_len > tftp->blksize ) {
576
 		DBGC ( tftp, "TFTP %p received overlength DATA packet "
576
 		DBGC ( tftp, "TFTP %p received overlength DATA packet "
577
-		       "length %d\n", tftp, data_len );
577
+		       "length %zd\n", tftp, data_len );
578
 		rc = -EINVAL;
578
 		rc = -EINVAL;
579
 		goto done;
579
 		goto done;
580
 	}
580
 	}
633
 	/* Sanity check */
633
 	/* Sanity check */
634
 	if ( len < sizeof ( *error ) ) {
634
 	if ( len < sizeof ( *error ) ) {
635
 		DBGC ( tftp, "TFTP %p received underlength ERROR packet "
635
 		DBGC ( tftp, "TFTP %p received underlength ERROR packet "
636
-		       "length %d\n", tftp, len );
636
+		       "length %zd\n", tftp, len );
637
 		return -EINVAL;
637
 		return -EINVAL;
638
 	}
638
 	}
639
 
639
 
671
 	
671
 	
672
 	/* Sanity checks */
672
 	/* Sanity checks */
673
 	if ( len < sizeof ( *common ) ) {
673
 	if ( len < sizeof ( *common ) ) {
674
-		DBGC ( tftp, "TFTP %p received underlength packet length %d\n",
675
-		       tftp, len );
674
+		DBGC ( tftp, "TFTP %p received underlength packet length "
675
+		       "%zd\n", tftp, len );
676
 		goto done;
676
 		goto done;
677
 	}
677
 	}
678
 	if ( ! meta ) {
678
 	if ( ! meta ) {

Loading…
Cancel
Save