Fixed warnings of VC2008

This commit is contained in:
Stanislav Shwartsman 2007-12-30 18:02:22 +00:00
parent d891f0d8ec
commit 72d72c92d4
6 changed files with 54 additions and 51 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: dbg_main.cc,v 1.108 2007-12-13 22:56:35 sshwarts Exp $
// $Id: dbg_main.cc,v 1.109 2007-12-30 18:02:22 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -1070,7 +1070,7 @@ void bx_dbg_xlate_address(bx_lin_address laddr)
bx_phy_address paddr;
laddr &= BX_CONST64(0xfffffffffffff000);
bx_bool paddr_valid = BX_CPU(which_cpu)->dbg_xlate_linear2phy(laddr, &paddr);
bx_bool paddr_valid = BX_CPU(dbg_cpu)->dbg_xlate_linear2phy(laddr, &paddr);
if (paddr_valid) {
dbg_printf("linear page 0x" FMT_ADDRX " maps to physical page 0x%08x\n", laddr, paddr);
}

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: dis_groups.cc,v 1.38 2007-09-19 19:38:10 sshwarts Exp $
// $Id: dis_groups.cc,v 1.39 2007-12-30 18:02:22 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
#include <stdio.h>
@ -588,11 +588,12 @@ void disassembler::Jb(const x86_insn *insn)
Bit8s imm8 = (Bit8s) fetch_byte();
if (insn->is_64) {
Bit64u imm64 = (Bit64s) imm8;
Bit64u imm64 = (Bit8s) imm8;
dis_sprintf(".+0x%08x%08x", GET32H(imm64), GET32L(imm64));
if (db_base != BX_JUMP_TARGET_NOT_REQ) {
Bit64u target = db_eip + (Bit64s) imm64; target += db_base;
Bit64u target = db_eip + imm64;
target += db_base;
dis_sprintf(" (0x%08x%08x)", GET32H(target), GET32L(target));
}
@ -600,20 +601,21 @@ void disassembler::Jb(const x86_insn *insn)
}
if (insn->os_32) {
Bit32u imm32 = (Bit32s) imm8;
Bit32u imm32 = (Bit8s) imm8;
dis_sprintf(".+0x%08x", (unsigned) imm32);
if (db_base != BX_JUMP_TARGET_NOT_REQ) {
Bit32u target = db_eip + (Bit32s) imm32; target += db_base;
Bit32u target = (Bit32u)(db_eip + (Bit32s) imm32);
target += db_base;
dis_sprintf(" (0x%08x)", target);
}
}
else {
Bit16u imm16 = (Bit16s) imm8;
Bit16u imm16 = (Bit8s) imm8;
dis_sprintf(".+0x%04x", (unsigned) imm16);
if (db_base != BX_JUMP_TARGET_NOT_REQ) {
Bit16u target = (db_eip + (Bit16s) imm16) & 0xffff;
Bit16u target = (Bit16u)((db_eip + (Bit16s) imm16) & 0xffff);
dis_sprintf(" (0x%08x)", target + db_base);
}
}
@ -638,11 +640,12 @@ void disassembler::Jd(const x86_insn *insn)
Bit32s imm32 = (Bit32s) fetch_dword();
if (insn->is_64) {
Bit64u imm64 = (Bit64s) imm32;
Bit64u imm64 = (Bit32s) imm32;
dis_sprintf(".+0x%08x%08x", GET32H(imm64), GET32L(imm64));
if (db_base != BX_JUMP_TARGET_NOT_REQ) {
Bit64u target = db_eip + (Bit64s) imm64; target += db_base;
Bit64u target = db_eip + (Bit64s) imm64;
target += db_base;
dis_sprintf(" (0x%08x%08x)", GET32H(target), GET32L(target));
}
@ -650,9 +653,9 @@ void disassembler::Jd(const x86_insn *insn)
}
dis_sprintf(".+0x%08x", (unsigned) imm32);
if (db_base != BX_JUMP_TARGET_NOT_REQ) {
Bit32u target = db_eip + (Bit32s) imm32; target += db_base;
Bit32u target = (Bit32u)(db_eip + (Bit32s) imm32);
target += db_base;
dis_sprintf(" (0x%08x)", target);
}
}

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: eth_null.cc,v 1.19 2005-12-10 18:37:35 vruppert Exp $
// $Id: eth_null.cc,v 1.20 2007-12-30 18:02:22 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -98,17 +98,17 @@ bx_null_pktmover_c::bx_null_pktmover_c(const char *netif,
this->rxarg = rxarg;
// eventually Bryce wants txlog to dump in pcap format so that
// tcpdump -r FILE can read it and interpret packets.
txlog = fopen ("ne2k-tx.log", "wb");
if (!txlog) BX_PANIC (("open ne2k-tx.log failed"));
txlog_txt = fopen ("ne2k-txdump.txt", "wb");
if (!txlog_txt) BX_PANIC (("open ne2k-txdump.txt failed"));
fprintf (txlog_txt, "null packetmover readable log file\n");
fprintf (txlog_txt, "net IF = %s\n", netif);
fprintf (txlog_txt, "MAC address = ");
txlog = fopen("ne2k-tx.log", "wb");
if (!txlog) BX_PANIC(("open ne2k-tx.log failed"));
txlog_txt = fopen("ne2k-txdump.txt", "wb");
if (!txlog_txt) BX_PANIC(("open ne2k-txdump.txt failed"));
fprintf(txlog_txt, "null packetmover readable log file\n");
fprintf(txlog_txt, "net IF = %s\n", netif);
fprintf(txlog_txt, "MAC address = ");
for (int i=0; i<6; i++)
fprintf (txlog_txt, "%02x%s", 0xff & macaddr[i], i<5?":" : "");
fprintf (txlog_txt, "\n--\n");
fflush (txlog_txt);
fprintf(txlog_txt, "%02x%s", 0xff & macaddr[i], i<5?":" : "");
fprintf(txlog_txt, "\n--\n");
fflush(txlog_txt);
#endif
}
@ -119,20 +119,20 @@ bx_null_pktmover_c::sendpkt(void *buf, unsigned io_len)
BX_DEBUG (("sendpkt length %u", io_len));
// dump raw bytes to a file, eventually dump in pcap format so that
// tcpdump -r FILE can interpret them for us.
unsigned int n = fwrite (buf, io_len, 1, txlog);
if (n != 1) BX_ERROR (("fwrite to txlog failed, io_len = %u", io_len));
size_t n = fwrite (buf, io_len, 1, txlog);
if (n != 1) BX_ERROR(("fwrite to txlog failed, io_len = %u", io_len));
// dump packet in hex into an ascii log file
fprintf (txlog_txt, "NE2K transmitting a packet, length %u\n", io_len);
fprintf(txlog_txt, "NE2K transmitting a packet, length %u\n", io_len);
Bit8u *charbuf = (Bit8u *)buf;
for (n=0; n<io_len; n++) {
if (((n % 16) == 0) && n>0)
fprintf (txlog_txt, "\n");
fprintf (txlog_txt, "%02x ", charbuf[n]);
fprintf(txlog_txt, "\n");
fprintf(txlog_txt, "%02x ", charbuf[n]);
}
fprintf (txlog_txt, "\n--\n");
fprintf(txlog_txt, "\n--\n");
// flush log so that we see the packets as they arrive w/o buffering
fflush (txlog);
fflush (txlog_txt);
fflush(txlog);
fflush(txlog_txt);
#endif
}
@ -148,20 +148,20 @@ void bx_null_pktmover_c::rx_timer_handler (void *this_ptr)
BX_DEBUG (("receive packet length %u", io_len));
// dump raw bytes to a file, eventually dump in pcap format so that
// tcpdump -r FILE can interpret them for us.
int n = fwrite (buf, io_len, 1, class_ptr->rxlog);
if (n != 1) BX_ERROR (("fwrite to rxlog failed, io_len = %u", io_len));
size_t n = fwrite (buf, io_len, 1, class_ptr->rxlog);
if (n != 1) BX_ERROR(("fwrite to rxlog failed, io_len = %u", io_len));
// dump packet in hex into an ascii log file
fprintf (class_ptr->rxlog_txt, "NE2K transmitting a packet, length %u\n", io_len);
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++) {
if (((n % 16) == 0) && n>0)
fprintf (class_ptr->rxlog_txt, "\n");
fprintf (class_ptr->rxlog_txt, "%02x ", charbuf[n]);
fprintf(class_ptr->rxlog_txt, "\n");
fprintf(class_ptr->rxlog_txt, "%02x ", charbuf[n]);
}
fprintf (class_ptr->rxlog_txt, "\n--\n");
fprintf(class_ptr->rxlog_txt, "\n--\n");
// flush log so that we see the packets as they arrive w/o buffering
fflush (class_ptr->rxlog);
fflush (class_ptr->rxlog_txt);
fflush(class_ptr->rxlog);
fflush(class_ptr->rxlog_txt);
}
#endif
}

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: pciusb.cc,v 1.60 2007-09-28 19:52:03 sshwarts Exp $
// $Id: pciusb.cc,v 1.61 2007-12-30 18:02:22 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2004 MandrakeSoft S.A.
@ -89,7 +89,7 @@ void usb_dump_packet(Bit8u *data, unsigned size)
int set_usb_string(Bit8u *buf, const char *str)
{
int len, i;
size_t len, i;
Bit8u *q;
q = buf;

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: logio.cc,v 1.62 2007-10-24 23:28:00 sshwarts Exp $
// $Id: logio.cc,v 1.63 2007-12-30 18:02:22 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -330,8 +330,8 @@ void logfunctions::put(const char *p)
prefix = NULL;
}
int len=strlen(p);
for(int i=1;i<len+1;i++) {
size_t len=strlen(p);
for(size_t i=1;i<len+1;i++) {
tmpbuf[i]=p[i-1];
}
@ -618,10 +618,10 @@ logfunc_t *genlog = NULL;
void bx_center_print(FILE *file, char *line, int maxwidth)
{
int len = strlen(line);
size_t len = strlen(line);
if (len > maxwidth)
BX_PANIC(("bx_center_print: line is too long: '%s'", line));
int imax = (maxwidth - len) >> 1;
for (int i=0; i<imax; i++) fputc(' ', file);
size_t imax = (maxwidth - len) >> 1;
for (size_t i=0; i<imax; i++) fputc(' ', file);
fputs(line, file);
}

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: misc_mem.cc,v 1.107 2007-12-23 17:21:28 sshwarts Exp $
// $Id: misc_mem.cc,v 1.108 2007-12-30 18:02:22 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -90,7 +90,7 @@ void BX_MEM_C::init_memory(Bit32u memsize)
{
unsigned idx;
BX_DEBUG(("Init $Id: misc_mem.cc,v 1.107 2007-12-23 17:21:28 sshwarts Exp $"));
BX_DEBUG(("Init $Id: misc_mem.cc,v 1.108 2007-12-30 18:02:22 sshwarts Exp $"));
alloc_vector_aligned(memsize+ BIOSROMSZ + EXROMSIZE + 4096, BX_MEM_VECTOR_ALIGN);
BX_MEM_THIS len = memsize;
@ -243,7 +243,7 @@ void BX_MEM_C::load_ROM(const char *path, bx_phy_address romaddress, Bit8u type)
return;
}
} else {
romaddress = (bx_phy_address)(-size);
romaddress = -size;
}
offset = romaddress & BIOS_MASK;
if ((romaddress & 0xf0000) < 0xf0000) {