Selaa lähdekoodia

Fix compiler warnings that appear only on OpenBSD.

tags/v0.9.3
Michael Brown 16 vuotta sitten
vanhempi
commit
1949641d10

+ 1
- 1
src/arch/i386/drivers/net/undinet.c Näytä tiedosto

@@ -217,7 +217,7 @@ static int undinet_call ( struct undi_nic *undinic, unsigned int function,
217 217
 		DBGC ( undinic, "UNDINIC %p %s failed: %s\n", undinic,
218 218
 		       undinet_function_name ( function ), strerror ( rc ) );
219 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 221
 		       rm_params.segment, rm_params.offset, params_len,
222 222
 		       undinet_entry_point.segment,
223 223
 		       undinet_entry_point.offset );

+ 1
- 1
src/arch/i386/drivers/net/undirom.c Näytä tiedosto

@@ -70,7 +70,7 @@ static int undirom_parse_pxeromid ( struct undi_rom *undirom,
70 70
 	undirom->data_size = undi_rom_id.DataSize;
71 71
 
72 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 74
 	       undirom->loader_entry.segment, undirom->loader_entry.offset,
75 75
 	       undirom->code_size, undirom->data_size );
76 76
 	return 0;

+ 2
- 2
src/arch/i386/firmware/pcbios/smbios.c Näytä tiedosto

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

+ 1
- 1
src/arch/i386/image/bzimage.c Näytä tiedosto

@@ -344,7 +344,7 @@ static int bzimage_exec ( struct image *image ) {
344 344
 	shutdown();
345 345
 
346 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 348
 	       ( exec_ctx.rm_kernel_seg + 0x20 ),
349 349
 	       exec_ctx.rm_kernel_seg, exec_ctx.rm_heap );
350 350
 

+ 1
- 1
src/arch/i386/image/nbi.c Näytä tiedosto

@@ -233,7 +233,7 @@ static int nbi_process_segments ( struct image *image,
233 233
 	} while ( ! NBI_LAST_SEGHEADER ( sh.flags ) );
234 234
 
235 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 237
 		       image, image->len, offset );
238 238
 		return -ENOEXEC;
239 239
 	}

+ 7
- 7
src/arch/i386/prefix/unnrv2b.S Näytä tiedosto

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

+ 1
- 1
src/arch/i386/transitions/librm.S Näytä tiedosto

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

+ 3
- 3
src/crypto/asn1.c Näytä tiedosto

@@ -75,8 +75,8 @@ static int asn1_start_object ( struct asn1_cursor *cursor,
75 75
 		len_len = 1;
76 76
 	}
77 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 80
 		goto notfound;
81 81
 	}
82 82
 
@@ -88,7 +88,7 @@ static int asn1_start_object ( struct asn1_cursor *cursor,
88 88
 		cursor->len--;
89 89
 	}
90 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 92
 		       cursor, len, cursor->len );
93 93
 		goto notfound;
94 94
 	}

+ 1
- 1
src/crypto/chap.c Näytä tiedosto

@@ -55,7 +55,7 @@ int chap_init ( struct chap_challenge *chap,
55 55
 	state_len = ( digest->ctxsize + digest->digestsize );
56 56
 	state = malloc ( state_len );
57 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 59
 		      chap, state_len );
60 60
 		return -ENOMEM;
61 61
 	}

+ 2
- 2
src/drivers/nvs/spi.c Näytä tiedosto

@@ -87,7 +87,7 @@ int spi_read ( struct nvs_device *nvs, unsigned int address,
87 87
 					     device->munge_address );
88 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 91
 	if ( ( rc = bus->rw ( bus, device, command, address,
92 92
 			      NULL, data, len ) ) != 0 ) {
93 93
 		DBG ( "SPI %p failed to read data from device\n", device );
@@ -114,7 +114,7 @@ int spi_write ( struct nvs_device *nvs, unsigned int address,
114 114
 					     device->munge_address );
115 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 119
 	if ( ( rc = bus->rw ( bus, device, SPI_WREN, -1,
120 120
 			      NULL, NULL, 0 ) ) != 0 ) {

+ 2
- 2
src/drivers/nvs/threewire.c Näytä tiedosto

@@ -43,7 +43,7 @@ int threewire_read ( struct nvs_device *nvs, unsigned int address,
43 43
 
44 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 48
 	return bus->rw ( bus, device, THREEWIRE_READ, address,
49 49
 			 NULL, data, len );
@@ -66,7 +66,7 @@ int threewire_write ( struct nvs_device *nvs, unsigned int address,
66 66
 
67 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 71
 	/* Enable device for writing */
72 72
 	if ( ( rc = bus->rw ( bus, device, THREEWIRE_EWEN,

+ 2
- 2
src/interface/pxe/pxe_undi.c Näytä tiedosto

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

+ 7
- 7
src/net/udp/tftp.c Näytä tiedosto

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

Loading…
Peruuta
Tallenna