- fixed some warnings in iodev

This commit is contained in:
Volker Ruppert 2008-12-21 08:56:26 +00:00
parent 13822e151e
commit fd79c68d72
5 changed files with 19 additions and 18 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: eth_null.cc,v 1.22 2008-12-11 18:01:56 vruppert Exp $
// $Id: eth_null.cc,v 1.23 2008-12-21 08:56:26 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -153,7 +153,7 @@ void bx_null_pktmover_c::rx_timer_handler (void *this_ptr)
// dump packet in hex into an ascii log file
fprintf(class_ptr->rxlog_txt, "NE2K transmitting a packet, length %u\n", io_len);
Bit8u *charbuf = (Bit8u *)buf;
for (n=0; n<io_len; n++) {
for (n=0; n<(size_t)io_len; n++) {
if (((n % 16) == 0) && n>0)
fprintf(class_ptr->rxlog_txt, "\n");
fprintf(class_ptr->rxlog_txt, "%02x ", charbuf[n]);

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: harddrv.cc,v 1.216 2008-12-11 18:01:56 vruppert Exp $
// $Id: harddrv.cc,v 1.217 2008-12-21 08:56:26 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -173,7 +173,7 @@ void bx_hard_drive_c::init(void)
char ata_name[20];
bx_list_c *base;
BX_DEBUG(("Init $Id: harddrv.cc,v 1.216 2008-12-11 18:01:56 vruppert Exp $"));
BX_DEBUG(("Init $Id: harddrv.cc,v 1.217 2008-12-21 08:56:26 vruppert Exp $"));
for (channel=0; channel<BX_MAX_ATA_CHANNEL; channel++) {
sprintf(ata_name, "ata.%d.resources", channel);
@ -946,19 +946,20 @@ Bit32u bx_hard_drive_c::read(Bit32u address, unsigned io_len)
BX_SELECTED_DRIVE(channel).cdrom.next_lba++;
BX_SELECTED_DRIVE(channel).cdrom.remaining_blocks--;
if (bx_dbg.disk || (BX_SELECTED_IS_CD(channel) && bx_dbg.cdrom))
if (!BX_SELECTED_DRIVE(channel).cdrom.remaining_blocks)
if (bx_dbg.disk || (BX_SELECTED_IS_CD(channel) && bx_dbg.cdrom)) {
if (!BX_SELECTED_DRIVE(channel).cdrom.remaining_blocks) {
BX_INFO(("Last READ block loaded {CDROM}"));
else
} else {
BX_INFO(("READ block loaded (%d remaining) {CDROM}",
BX_SELECTED_DRIVE(channel).cdrom.remaining_blocks));
}
}
// one block transfered, start at beginning
index = 0;
#else
BX_PANIC(("Read with no LOWLEVEL_CDROM"));
#endif
break;
break;
default: // no need to load a new block
break;

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: ioapic.cc,v 1.38 2008-11-17 20:06:16 sshwarts Exp $
// $Id: ioapic.cc,v 1.39 2008-12-21 08:56:26 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -42,7 +42,7 @@ static bx_bool ioapic_read(bx_phy_address a20addr, unsigned len, void *data, voi
static bx_bool ioapic_write(bx_phy_address a20addr, unsigned len, void *data, void *param)
{
if (len != 4) {
BX_PANIC (("I/O apic write with len=%ld (should be 4)", len));
BX_PANIC (("I/O apic write with len=%d (should be 4)", len));
}
bx_ioapic.write(a20addr, (Bit32u*) data, len);
return 1;

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: serial.cc,v 1.84 2008-08-22 07:58:20 akrisak Exp $
// $Id: serial.cc,v 1.85 2008-12-21 08:56:26 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2004 MandrakeSoft S.A.
@ -384,8 +384,8 @@ bx_serial_c::init(void)
i+1, server ? "server" : "client", socket, host, port));
} else if (!strncmp(mode, "pipe", 4)) {
if (strlen(dev) > 0) {
bx_bool server = !strcmp(mode, "pipe-server");
#ifdef WIN32
bx_bool server = !strcmp(mode, "pipe-server");
HANDLE pipe;
BX_SER_THIS s[i].io_mode = BX_SER_MODE_PIPE;

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: vmware3.cc,v 1.19 2008-01-26 22:24:03 sshwarts Exp $
// $Id: vmware3.cc,v 1.20 2008-12-21 08:56:26 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
/*
@ -162,8 +162,8 @@ bool vmware3_image_t::is_valid_header(COW_Header & header)
char * vmware3_image_t::generate_cow_name(const char * filename, unsigned chain)
{
char * name = new char[strlen(filename) + 4];
if(name == 0)
BX_PANIC(("unable to allocate %lu bytes for vmware3 COW file name (base: %s, chain: %u)", strlen(filename) + 4, filename, chain));
if(name == NULL)
BX_PANIC(("unable to allocate %u bytes for vmware3 COW file name (base: %s, chain: %u)", strlen(filename) + 4, filename, chain));
strcpy(name, filename);
if(chain != 0)
{
@ -358,7 +358,7 @@ ssize_t vmware3_image_t::read(void * buf, size_t count)
off_t offset = perform_seek();
if(offset == INVALID_OFFSET)
{
BX_DEBUG(("vmware3 COW read failed on %lu bytes", count));
BX_DEBUG(("vmware3 COW read failed on %u bytes", count));
return -1;
}
unsigned bytes_remaining = (unsigned)(tlb_size - offset);
@ -467,7 +467,7 @@ ssize_t vmware3_image_t::write(const void * buf, size_t count)
memcpy(current->tlb + offset, buf, bytes_remaining);
if(!sync())
{
BX_DEBUG(("failed to sync when writing %lu bytes", count));
BX_DEBUG(("failed to sync when writing %u bytes", count));
return -1;
}
amount = bytes_remaining;