Fixed warnings (patch from mailing list)

This commit is contained in:
Stanislav Shwartsman 2010-08-15 19:57:50 +00:00
parent deb572b355
commit c7dba3525a
4 changed files with 17 additions and 17 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: iodev.h,v 1.121 2010-07-03 05:34:27 vruppert Exp $
// $Id: iodev.h,v 1.122 2010-08-15 19:57:50 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002-2009 The Bochs Project
@ -237,10 +237,10 @@ public:
unsigned width, unsigned height) {
STUBFUNC(vga, redraw_area);
}
virtual Bit8u mem_read(Bit32u addr) {
virtual Bit8u mem_read(bx_phy_address addr) {
STUBFUNC(vga, mem_read); return 0;
}
virtual void mem_write(Bit32u addr, Bit8u value) {
virtual void mem_write(bx_phy_address addr, Bit8u value) {
STUBFUNC(vga, mem_write);
}
virtual void get_text_snapshot(Bit8u **text_snapshot,

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: vga.cc,v 1.171 2010-02-26 14:18:19 sshwarts Exp $
// $Id: vga.cc,v 1.172 2010-08-15 19:57:50 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002-2009 The Bochs Project
@ -2387,19 +2387,19 @@ void bx_vga_c::mem_write(bx_phy_address addr, Bit8u value)
switch (BX_VGA_THIS s.graphics_ctrl.memory_mapping) {
case 1: // 0xA0000 .. 0xAFFFF
if ((addr < 0xA0000) || (addr > 0xAFFFF)) return;
offset = addr - 0xA0000;
offset = (Bit32u)addr - 0xA0000;
break;
case 2: // 0xB0000 .. 0xB7FFF
if ((addr < 0xB0000) || (addr > 0xB7FFF)) return;
offset = addr - 0xB0000;
offset = (Bit32u)addr - 0xB0000;
break;
case 3: // 0xB8000 .. 0xBFFFF
if ((addr < 0xB8000) || (addr > 0xBFFFF)) return;
offset = addr - 0xB8000;
offset = (Bit32u)addr - 0xB8000;
break;
default: // 0xA0000 .. 0xBFFFF
if ((addr < 0xA0000) || (addr > 0xBFFFF)) return;
offset = addr - 0xA0000;
offset = (Bit32u)addr - 0xA0000;
}
start_addr = (BX_VGA_THIS s.CRTC.reg[0x0c] << 8) | BX_VGA_THIS s.CRTC.reg[0x0d];

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: memory.h,v 1.71 2010-05-18 09:01:08 sshwarts Exp $
// $Id: memory.h,v 1.72 2010-08-15 19:57:49 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001-2009 The Bochs Project
@ -131,7 +131,7 @@ BX_CPP_INLINE Bit8u* BX_MEM_C::get_vector(bx_phy_address addr)
BX_CPP_INLINE Bit8u* BX_MEM_C::get_vector(bx_phy_address addr)
{
Bit32u block = addr / BX_MEM_BLOCK_LEN;
Bit32u block = (Bit32u)(addr / BX_MEM_BLOCK_LEN);
if (! BX_MEM_THIS blocks[block]) allocate_block(block);
return BX_MEM_THIS blocks[block] + (Bit32u)(addr & (BX_MEM_BLOCK_LEN-1));
}

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: misc_mem.cc,v 1.147 2010-05-18 08:54:01 sshwarts Exp $
// $Id: misc_mem.cc,v 1.148 2010-08-15 19:57:49 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001-2009 The Bochs Project
@ -73,7 +73,7 @@ void BX_MEM_C::init_memory(Bit64u guest, Bit64u host)
{
unsigned idx;
BX_DEBUG(("Init $Id: misc_mem.cc,v 1.147 2010-05-18 08:54:01 sshwarts Exp $"));
BX_DEBUG(("Init $Id: misc_mem.cc,v 1.148 2010-08-15 19:57:49 sshwarts Exp $"));
// accept only memory size which is multiply of 1M
BX_ASSERT((host & 0xfffff) == 0);
@ -99,7 +99,7 @@ void BX_MEM_C::init_memory(Bit64u guest, Bit64u host)
// block must be large enough to fit num_blocks in 32-bit
BX_ASSERT((BX_MEM_THIS len / BX_MEM_BLOCK_LEN) <= 0xffffffff);
Bit32u num_blocks = BX_MEM_THIS len / BX_MEM_BLOCK_LEN;
Bit32u num_blocks = (Bit32u)(BX_MEM_THIS len / BX_MEM_BLOCK_LEN);
BX_INFO(("%.2fMB", (float)(BX_MEM_THIS len / (1024.0*1024.0))));
BX_INFO(("mem block size = 0x%08x, blocks=%u", BX_MEM_BLOCK_LEN, num_blocks));
BX_MEM_THIS blocks = new Bit8u* [num_blocks];
@ -320,7 +320,7 @@ void BX_MEM_C::load_ROM(const char *path, bx_phy_address romaddress, Bit8u type)
}
if (romaddress < 0xe0000) {
offset = (romaddress & EXROM_MASK) + BIOSROMSZ;
start_idx = ((romaddress - 0xc0000) >> 11);
start_idx = (((Bit32u)romaddress - 0xc0000) >> 11);
end_idx = start_idx + (size >> 11) + (((size % 2048) > 0) ? 1 : 0);
} else {
offset = romaddress & BIOS_MASK;
@ -371,7 +371,7 @@ void BX_MEM_C::load_RAM(const char *path, bx_phy_address ramaddress, Bit8u type)
{
struct stat stat_buf;
int fd, ret;
unsigned long size, offset;
Bit32u size, offset;
if (*path == '\0') {
BX_PANIC(("RAM: Optional RAM image undefined"));
@ -696,7 +696,7 @@ BX_MEM_C::registerMemoryHandlers(void *param, memory_handler_t read_handler,
if (!read_handler || !write_handler)
return 0;
BX_INFO(("Register memory access handlers: 0x" FMT_PHY_ADDRX " - 0x" FMT_PHY_ADDRX, begin_addr, end_addr));
for (unsigned page_idx = begin_addr >> 20; page_idx <= end_addr >> 20; page_idx++) {
for (unsigned page_idx = (Bit32u)(begin_addr >> 20); page_idx <= (Bit32u)(end_addr >> 20); page_idx++) {
struct memory_handler_struct *memory_handler = new struct memory_handler_struct;
memory_handler->next = BX_MEM_THIS memory_handlers[page_idx];
BX_MEM_THIS memory_handlers[page_idx] = memory_handler;
@ -715,7 +715,7 @@ BX_MEM_C::unregisterMemoryHandlers(memory_handler_t read_handler, memory_handler
{
bx_bool ret = 1;
BX_INFO(("Memory access handlers unregistered: 0x" FMT_PHY_ADDRX " - 0x" FMT_PHY_ADDRX, begin_addr, end_addr));
for (unsigned page_idx = begin_addr >> 20; page_idx <= end_addr >> 20; page_idx++) {
for (unsigned page_idx = (Bit32u)(begin_addr >> 20); page_idx <= (Bit32u)(end_addr >> 20); page_idx++) {
struct memory_handler_struct *memory_handler = BX_MEM_THIS memory_handlers[page_idx];
struct memory_handler_struct *prev = NULL;
while (memory_handler &&