david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

Fix compiler warnings that appear only on OpenBSD.

This commit is contained in:
Michael Brown 2007-12-06 14:16:46 -06:00
parent 798f7f6b8e
commit 1949641d10
13 changed files with 31 additions and 31 deletions

View File

@ -217,7 +217,7 @@ static int undinet_call ( struct undi_nic *undinic, unsigned int function,
DBGC ( undinic, "UNDINIC %p %s failed: %s\n", undinic,
undinet_function_name ( function ), strerror ( rc ) );
DBGC ( undinic, "UNDINIC %p parameters at %04x:%04x length "
"%#02x, entry point at %04x:%04x\n", undinic,
"%#02zx, entry point at %04x:%04x\n", undinic,
rm_params.segment, rm_params.offset, params_len,
undinet_entry_point.segment,
undinet_entry_point.offset );

View File

@ -70,7 +70,7 @@ static int undirom_parse_pxeromid ( struct undi_rom *undirom,
undirom->data_size = undi_rom_id.DataSize;
DBGC ( undirom, "UNDIROM %p has UNDI loader at %04x:%04x "
"(code %04x data %04x)\n", undirom,
"(code %04zx data %04zx)\n", undirom,
undirom->loader_entry.segment, undirom->loader_entry.offset,
undirom->code_size, undirom->data_size );
return 0;

View File

@ -220,7 +220,7 @@ int find_smbios_structure ( unsigned int type, void *structure,
strings_offset = ( offset + header.length );
if ( strings_offset > smbios->length ) {
DBG ( "SMBIOS structure at offset %zx with length "
"%zx extends beyond SMBIOS\n", offset,
"%x extends beyond SMBIOS\n", offset,
header.length );
return -ENOENT;
}
@ -236,7 +236,7 @@ int find_smbios_structure ( unsigned int type, void *structure,
strings->length = ( terminator_offset - strings_offset );
DBG ( "SMBIOS structure at offset %zx has type %d, "
"length %zx, strings length %zx\n",
"length %x, strings length %zx\n",
offset, header.type, header.length, strings->length );
/* If this is the structure we want, return */

View File

@ -344,7 +344,7 @@ static int bzimage_exec ( struct image *image ) {
shutdown();
DBGC ( image, "bzImage %p jumping to RM kernel at %04x:0000 "
"(stack %04x:%04x)\n", image,
"(stack %04x:%04zx)\n", image,
( exec_ctx.rm_kernel_seg + 0x20 ),
exec_ctx.rm_kernel_seg, exec_ctx.rm_heap );

View File

@ -233,7 +233,7 @@ static int nbi_process_segments ( struct image *image,
} while ( ! NBI_LAST_SEGHEADER ( sh.flags ) );
if ( offset != image->len ) {
DBGC ( image, "NBI %p length wrong (file %d, metadata %d)\n",
DBGC ( image, "NBI %p length wrong (file %zd, metadata %zd)\n",
image, image->len, offset );
return -ENOEXEC;
}

View File

@ -54,7 +54,6 @@
* NOTE: It would be possible to build a smaller version of the
* decompression code for -DKEEP_IT_REAL by using
* #define REG(x) x
* #define MOVSB movsb
* to use 16-bit registers where possible. This would impose limits
* that the compressed data size must be in the range [1,65533-%si]
* and the uncompressed data size must be in the range [1,65536-%di]
@ -67,7 +66,7 @@
*/
#define REG(x) e ## x
#define MOVSB addr32 movsb
#define ADDR32 addr32
.code16
.globl decompress16
@ -89,6 +88,7 @@ decompress16:
*/
#define REG(x) e ## x
#define ADDR32
.code32
.globl decompress
@ -114,7 +114,7 @@ decompress:
jmp dcl1_n2b
decompr_literals_n2b:
MOVSB
ADDR32 movsb
decompr_loop_n2b:
addl %ebx, %ebx
jnz dcl2_n2b
@ -132,7 +132,7 @@ loop1_n2b:
sub $3, %xAX
jb decompr_ebpeax_n2b /* if (m_off == 2) goto decompr_ebpeax_n2b ? */
shl $8, %xAX
movb (%xSI), %al /* m_off = (m_off - 3)*256 + src[ilen++] */
ADDR32 movb (%xSI), %al /* m_off = (m_off - 3)*256 + src[ilen++] */
inc %xSI
xor $-1, %xAX
jz decompr_end_n2b /* if (m_off == 0xffffffff) goto decomp_end_n2b */
@ -156,9 +156,9 @@ decompr_got_mlen_n2b:
cmp $-0xd00, %xBP
adc $1, %xCX /* m_len = m_len + 1 + (last_m_off > 0xd00) */
push %xSI
lea (%xBP,%xDI), %xSI /* m_pos = dst + olen + -m_off */
ADDR32 lea (%xBP,%xDI), %xSI /* m_pos = dst + olen + -m_off */
rep
es MOVSB /* dst[olen++] = *m_pos++ while(m_len > 0) */
es ADDR32 movsb /* dst[olen++] = *m_pos++ while(m_len > 0) */
pop %xSI
jmp decompr_loop_n2b
@ -167,7 +167,7 @@ getbit1:
addl %ebx, %ebx
jnz 1f
getbit32:
movl (%xSI), %ebx
ADDR32 movl (%xSI), %ebx
sub $-4, %xSI /* sets carry flag */
adcl %ebx, %ebx
1:

View File

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

View File

@ -75,8 +75,8 @@ static int asn1_start_object ( struct asn1_cursor *cursor,
len_len = 1;
}
if ( cursor->len < len_len ) {
DBGC ( cursor, "ASN1 %p bad length field length %d (max %d)\n",
cursor, len_len, cursor->len );
DBGC ( cursor, "ASN1 %p bad length field length %d (max "
"%zd)\n", cursor, len_len, cursor->len );
goto notfound;
}
@ -88,7 +88,7 @@ static int asn1_start_object ( struct asn1_cursor *cursor,
cursor->len--;
}
if ( cursor->len < len ) {
DBGC ( cursor, "ASN1 %p bad length %d (max %d)\n",
DBGC ( cursor, "ASN1 %p bad length %d (max %zd)\n",
cursor, len, cursor->len );
goto notfound;
}

View File

@ -55,7 +55,7 @@ int chap_init ( struct chap_challenge *chap,
state_len = ( digest->ctxsize + digest->digestsize );
state = malloc ( state_len );
if ( ! state ) {
DBG ( "CHAP %p could not allocate %d bytes for state\n",
DBG ( "CHAP %p could not allocate %zd bytes for state\n",
chap, state_len );
return -ENOMEM;
}

View File

@ -87,7 +87,7 @@ int spi_read ( struct nvs_device *nvs, unsigned int address,
device->munge_address );
int rc;
DBG ( "SPI %p reading %d bytes from %#04x\n", device, len, address );
DBG ( "SPI %p reading %zd bytes from %#04x\n", device, len, address );
if ( ( rc = bus->rw ( bus, device, command, address,
NULL, data, len ) ) != 0 ) {
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,
device->munge_address );
int rc;
DBG ( "SPI %p writing %d bytes to %#04x\n", device, len, address );
DBG ( "SPI %p writing %zd bytes to %#04x\n", device, len, address );
if ( ( rc = bus->rw ( bus, device, SPI_WREN, -1,
NULL, NULL, 0 ) ) != 0 ) {

View File

@ -43,7 +43,7 @@ int threewire_read ( struct nvs_device *nvs, unsigned int address,
assert ( bus->mode == SPI_MODE_THREEWIRE );
DBG ( "3wire %p reading %d bytes at %04x\n", device, len, address );
DBG ( "3wire %p reading %zd bytes at %04x\n", device, len, address );
return bus->rw ( bus, device, THREEWIRE_READ, address,
NULL, data, len );
@ -66,7 +66,7 @@ int threewire_write ( struct nvs_device *nvs, unsigned int address,
assert ( bus->mode == SPI_MODE_THREEWIRE );
DBG ( "3wire %p writing %d bytes at %04x\n", device, len, address );
DBG ( "3wire %p writing %zd bytes at %04x\n", device, len, address );
/* Enable device for writing */
if ( ( rc = bus->rw ( bus, device, THREEWIRE_EWEN,

View File

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

View File

@ -496,12 +496,12 @@ static int tftp_rx_oack ( struct tftp_request *tftp, void *buf, size_t len ) {
char *end = buf + len;
char *name;
char *value;
int rc;
int rc = 0;
/* Sanity check */
if ( len < sizeof ( *oack ) ) {
DBGC ( tftp, "TFTP %p received underlength OACK packet "
"length %d\n", tftp, len );
"length %zd\n", tftp, len );
rc = -EINVAL;
goto done;
}
@ -562,7 +562,7 @@ static int tftp_rx_data ( struct tftp_request *tftp,
/* Sanity check */
if ( iob_len ( iobuf ) < sizeof ( *data ) ) {
DBGC ( tftp, "TFTP %p received underlength DATA packet "
"length %d\n", tftp, iob_len ( iobuf ) );
"length %zd\n", tftp, iob_len ( iobuf ) );
rc = -EINVAL;
goto done;
}
@ -574,7 +574,7 @@ static int tftp_rx_data ( struct tftp_request *tftp,
data_len = iob_len ( iobuf );
if ( data_len > tftp->blksize ) {
DBGC ( tftp, "TFTP %p received overlength DATA packet "
"length %d\n", tftp, data_len );
"length %zd\n", tftp, data_len );
rc = -EINVAL;
goto done;
}
@ -633,7 +633,7 @@ static int tftp_rx_error ( struct tftp_request *tftp, void *buf, size_t len ) {
/* Sanity check */
if ( len < sizeof ( *error ) ) {
DBGC ( tftp, "TFTP %p received underlength ERROR packet "
"length %d\n", tftp, len );
"length %zd\n", tftp, len );
return -EINVAL;
}
@ -671,8 +671,8 @@ static int tftp_rx ( struct tftp_request *tftp,
/* Sanity checks */
if ( len < sizeof ( *common ) ) {
DBGC ( tftp, "TFTP %p received underlength packet length %d\n",
tftp, len );
DBGC ( tftp, "TFTP %p received underlength packet length "
"%zd\n", tftp, len );
goto done;
}
if ( ! meta ) {