- fixed some MSVC warnings

This commit is contained in:
Volker Ruppert 2007-04-06 15:22:17 +00:00
parent 8792936c44
commit f8aec91820
3 changed files with 27 additions and 27 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: init.cc,v 1.127 2007-01-25 19:09:41 sshwarts Exp $
// $Id: init.cc,v 1.128 2007-04-06 15:22:16 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -644,7 +644,7 @@ Bit64s BX_CPU_C::param_restore(bx_param_c *param, Bit64s val)
BX_PANIC(("save/restore: CPUID mismatch"));
}
} else if (!strcmp(pname, "EFLAGS")) {
BX_CPU_THIS_PTR setEFlags(val);
BX_CPU_THIS_PTR setEFlags((Bit32u)val);
#if BX_SUPPORT_X86_64
} else if (!strcmp(pname, "EFER")) {
BX_CPU_THIS_PTR msr.sce = (val >> 0) & 1;
@ -676,10 +676,10 @@ Bit64s BX_CPU_C::param_restore(bx_param_c *param, Bit64s val)
bx_descriptor_t *d = &(segment->cache);
bx_selector_t *selector = &(segment->selector);
if (!strcmp(pname, "ar_byte")) {
set_ar_byte(d, val);
set_ar_byte(d, (Bit8u)val);
}
else if (!strcmp(pname, "selector")) {
parse_selector(val, selector);
parse_selector((Bit16u)val, selector);
// validate the selector
if ((selector->value & 0xfffc) != 0) d->valid = 1;
else d->valid = 0;

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: acpi.cc,v 1.7 2007-02-20 09:36:55 vruppert Exp $
// $Id: acpi.cc,v 1.8 2007-04-06 15:22:17 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2006 Volker Ruppert
@ -73,25 +73,25 @@ void libacpi_LTX_plugin_fini(void)
/* ported from QEMU: compute with 96 bit intermediate result: (a*b)/c */
Bit64u muldiv64(Bit64u a, Bit32u b, Bit32u c)
{
union {
Bit64u ll;
struct {
union {
Bit64u ll;
struct {
#ifdef WORDS_BIGENDIAN
Bit32u high, low;
Bit32u high, low;
#else
Bit32u low, high;
Bit32u low, high;
#endif
} l;
} u, res;
Bit64u rl, rh;
} l;
} u, res;
Bit64u rl, rh;
u.ll = a;
rl = (Bit64u)u.l.low * (Bit64u)b;
rh = (Bit64u)u.l.high * (Bit64u)b;
rh += (rl >> 32);
res.l.high = rh / c;
res.l.low = (((rh % c) << 32) + (rl & 0xffffffff)) / c;
return res.ll;
u.ll = a;
rl = (Bit64u)u.l.low * (Bit64u)b;
rh = (Bit64u)u.l.high * (Bit64u)b;
rh += (rl >> 32);
res.l.high = (Bit32u)(rh / c);
res.l.low = (Bit32u)(((rh % c) << 32) + (rl & 0xffffffff)) / c;
return res.ll;
}
bx_acpi_ctrl_c::bx_acpi_ctrl_c()
@ -259,7 +259,7 @@ void bx_acpi_ctrl_c::pm_update_sci(void)
// schedule a timer interruption if needed
if ((BX_ACPI_THIS s.pmen & TMROF_EN) && !(pmsts & TMROF_EN)) {
Bit64u expire_time = muldiv64(BX_ACPI_THIS s.tmr_overflow_time, 1000000, PM_FREQ);
bx_pc_system.activate_timer(BX_ACPI_THIS s.timer_index, expire_time, 0);
bx_pc_system.activate_timer(BX_ACPI_THIS s.timer_index, (Bit32u)expire_time, 0);
} else {
bx_pc_system.deactivate_timer(BX_ACPI_THIS s.timer_index);
}

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: floppy.cc,v 1.105 2007-04-03 22:38:48 sshwarts Exp $
// $Id: floppy.cc,v 1.106 2007-04-06 15:22:17 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -139,7 +139,7 @@ void bx_floppy_ctrl_c::init(void)
{
Bit8u i;
BX_DEBUG(("Init $Id: floppy.cc,v 1.105 2007-04-03 22:38:48 sshwarts Exp $"));
BX_DEBUG(("Init $Id: floppy.cc,v 1.106 2007-04-06 15:22:17 vruppert Exp $"));
DEV_dma_register_8bit_channel(2, dma_read, dma_write, "Floppy Drive");
DEV_register_irq(6, "Floppy Drive");
for (unsigned addr=0x03F2; addr<=0x03F7; addr++) {
@ -1948,7 +1948,7 @@ void bx_floppy_ctrl_c::reset_changeline(void)
bx_bool bx_floppy_ctrl_c::get_tc(void)
{
Bit8u drive;
bool terminal_count;
bx_bool terminal_count;
if (BX_FD_THIS s.main_status_reg & FD_MS_NDMA) {
drive = BX_FD_THIS s.DOR & 0x03;
/* figure out if we've sent all the data, in non-DMA mode...
@ -1960,9 +1960,9 @@ bx_bool bx_floppy_ctrl_c::get_tc(void)
* >= 512 makes it more robust, but allows for sloppy code...
* pick your poison?
* note: byte and head are 0-based; eot, sector, and heads are 1-based. */
terminal_count = (BX_FD_THIS s.floppy_buffer_index == 512 &&
BX_FD_THIS s.sector[drive] == BX_FD_THIS s.eot[drive]) &&
BX_FD_THIS s.head[drive] == BX_FD_THIS s.media[drive].heads - 1;
terminal_count = ((BX_FD_THIS s.floppy_buffer_index == 512) &&
(BX_FD_THIS s.sector[drive] == BX_FD_THIS s.eot[drive]) &&
(BX_FD_THIS s.head[drive] == (BX_FD_THIS s.media[drive].heads - 1)));
} else {
terminal_count = DEV_dma_get_tc();
}