- some more warnings in MSVC fixed

This commit is contained in:
Volker Ruppert 2005-06-07 19:26:21 +00:00
parent b5514f42de
commit 69fe0b00d4
4 changed files with 22 additions and 20 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: config.cc,v 1.34 2005-04-03 15:00:44 vruppert Exp $
// $Id: config.cc,v 1.35 2005-06-07 19:26:20 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -66,7 +66,7 @@ bx_param_handler (bx_param_c *param, int set, Bit64s val)
case BXP_VGA_UPDATE_INTERVAL:
// if after init, notify the vga device to change its timer.
if (set && SIM->get_init_done ())
DEV_vga_set_update_interval (val);
DEV_vga_set_update_interval ((unsigned int)val);
break;
case BXP_MOUSE_ENABLED:
// if after init, notify the GUI

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: cdrom.cc,v 1.77 2005-05-04 18:19:49 vruppert Exp $
// $Id: cdrom.cc,v 1.78 2005-06-07 19:26:20 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -523,7 +523,7 @@ cdrom_interface::cdrom_interface(char *dev)
void
cdrom_interface::init(void) {
BX_DEBUG(("Init $Id: cdrom.cc,v 1.77 2005-05-04 18:19:49 vruppert Exp $"));
BX_DEBUG(("Init $Id: cdrom.cc,v 1.78 2005-06-07 19:26:20 vruppert Exp $"));
BX_INFO(("file = '%s'",path));
}
@ -888,6 +888,8 @@ cdrom_interface::read_toc(uint8* buf, int* length, bx_bool msf, int start_track,
*length = iBytesReturned;
return true;
} else {
return false;
}
#elif __linux__ || defined(__sun)
{
@ -1281,13 +1283,13 @@ cdrom_interface::capacity()
} else if(using_file) {
ULARGE_INTEGER FileSize;
FileSize.LowPart = GetFileSize(hFile, &FileSize.HighPart);
return (FileSize.QuadPart / 2048);
return (Bit32u)(FileSize.QuadPart / 2048);
} else { /* direct device access */
ULARGE_INTEGER FreeBytesForCaller;
ULARGE_INTEGER TotalNumOfBytes;
ULARGE_INTEGER TotalFreeBytes;
GetDiskFreeSpaceEx( path, &FreeBytesForCaller, &TotalNumOfBytes, &TotalFreeBytes);
return (TotalNumOfBytes.QuadPart / 2048);
return (Bit32u)(TotalNumOfBytes.QuadPart / 2048);
}
}
#elif defined __APPLE__

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: harddrv.cc,v 1.132 2005-05-04 18:19:49 vruppert Exp $
// $Id: harddrv.cc,v 1.133 2005-06-07 19:26:20 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -149,7 +149,7 @@ bx_hard_drive_c::init(void)
char string[5];
char sbtext[8];
BX_DEBUG(("Init $Id: harddrv.cc,v 1.132 2005-05-04 18:19:49 vruppert Exp $"));
BX_DEBUG(("Init $Id: harddrv.cc,v 1.133 2005-06-07 19:26:20 vruppert Exp $"));
for (channel=0; channel<BX_MAX_ATA_CHANNEL; channel++) {
if (bx_options.ata[channel].Opresent->get() == 1) {
@ -3771,8 +3771,8 @@ off_t sparse_image_t::lseek (off_t offset, int whence)
//printf("Seeking to position %ld\n", (long) offset);
set_virtual_page(offset >> pagesize_shift);
position_page_offset = offset & pagesize_mask;
set_virtual_page((uint32)(offset >> pagesize_shift));
position_page_offset = (uint32)(offset & pagesize_mask);
return 0;
}
@ -3919,7 +3919,7 @@ ssize_t sparse_image_t::write (const void* buf, size_t count)
// We just add on another page at the end of the file
// Reclamation, compaction etc should currently be done off-line
size_t data_size = underlying_filesize - data_start;
size_t data_size = (size_t)(underlying_filesize - data_start);
BX_ASSERT((data_size % pagesize) == 0);
@ -3954,7 +3954,7 @@ ssize_t sparse_image_t::write (const void* buf, size_t count)
}
int ret;
ret = ::lseek(fd, page_file_start, SEEK_SET);
ret = (int)::lseek(fd, page_file_start, SEEK_SET);
// underlying_current_filepos update deferred
if (-1 == ret) panic(strerror(errno));
@ -3976,7 +3976,7 @@ ssize_t sparse_image_t::write (const void* buf, size_t count)
// This produces a sparse file which has blanks
// Also very quick, even when pagesize is massive
int ret;
ret = ::lseek(fd, page_file_start + pagesize - 4, SEEK_SET);
ret = (int)::lseek(fd, page_file_start + pagesize - 4, SEEK_SET);
// underlying_current_filepos update deferred
if (-1 == ret) panic(strerror(errno));
@ -4058,7 +4058,7 @@ ssize_t sparse_image_t::write (const void* buf, size_t count)
if (!done)
{
int ret = ::lseek(fd, pagetable_write_from, SEEK_SET);
int ret = (int)::lseek(fd, pagetable_write_from, SEEK_SET);
// underlying_current_filepos update deferred
if (ret == -1) panic(strerror(errno));
@ -4411,8 +4411,8 @@ redolog_t::lseek (off_t offset, int whence)
return -1;
}
extent_index = offset / dtoh32(header.specific.extent);
extent_offset = (offset % dtoh32(header.specific.extent)) / 512;
extent_index = (Bit32u)(offset / dtoh32(header.specific.extent));
extent_offset = (Bit32u)((offset % dtoh32(header.specific.extent)) / 512);
BX_DEBUG(("redolog : lseeking extent index %d, offset %d",extent_index, extent_offset));

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: misc_mem.cc,v 1.59 2005-04-10 19:42:48 sshwarts Exp $
// $Id: misc_mem.cc,v 1.60 2005-06-07 19:26:21 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -63,7 +63,7 @@ BX_MEM_C::alloc_vector_aligned (size_t bytes, size_t alignment)
vector = NULL;
}
Bit64u test_mask = alignment - 1;
actual_vector = new Bit8u [bytes+test_mask];
actual_vector = new Bit8u [(unsigned int)(bytes+test_mask)];
// round address forward to nearest multiple of alignment. Alignment
// MUST BE a power of two for this to work.
Bit64u masked = ((Bit64u)(actual_vector + test_mask)) & ~test_mask;
@ -95,7 +95,7 @@ void BX_MEM_C::init_memory(int memsize)
{
int idx;
BX_DEBUG(("Init $Id: misc_mem.cc,v 1.59 2005-04-10 19:42:48 sshwarts Exp $"));
BX_DEBUG(("Init $Id: misc_mem.cc,v 1.60 2005-06-07 19:26:21 vruppert Exp $"));
// you can pass 0 if memory has been allocated already through
// the constructor, or the desired size of memory if it hasn't
// BX_INFO(("%.2fMB", (float)(BX_MEM_THIS megabytes) ));
@ -177,7 +177,7 @@ void BX_MEM_C::load_ROM(const char *path, Bit32u romaddress, Bit8u type)
return;
}
size = stat_buf.st_size;
size = (unsigned long)stat_buf.st_size;
if (type > 0) {
max_size = 0x10000;