warnings fixed
This commit is contained in:
parent
8d44a9e355
commit
1b8988f698
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: hdimage.cc,v 1.12 2007-09-04 07:56:09 vruppert Exp $
|
||||
// $Id: hdimage.cc,v 1.13 2007-10-24 23:16:09 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||
@ -341,7 +341,7 @@ void sparse_image_t::read_header()
|
||||
|
||||
size_t preamble_size = (sizeof(Bit32u) * numpages) + sizeof(header);
|
||||
data_start = 0;
|
||||
while (data_start < preamble_size) data_start += pagesize;
|
||||
while ((size_t)data_start < preamble_size) data_start += pagesize;
|
||||
|
||||
bx_bool did_mmap = 0;
|
||||
|
||||
@ -358,8 +358,6 @@ void sparse_image_t::read_header()
|
||||
mmap_length = preamble_size;
|
||||
did_mmap = 1;
|
||||
pagetable = ((Bit32u *) (((Bit8u *) mmap_header) + sizeof(header)));
|
||||
|
||||
// system_pagesize = getpagesize();
|
||||
system_pagesize_mask = getpagesize() - 1;
|
||||
}
|
||||
#endif
|
||||
@ -447,14 +445,15 @@ int sparse_image_t::open (const char* pathname0)
|
||||
if (dtoh32(header.version) == SPARSE_HEADER_VERSION) {
|
||||
hd_size = dtoh64(header.disk);
|
||||
}
|
||||
|
||||
return 0; // success.
|
||||
}
|
||||
|
||||
void sparse_image_t::close()
|
||||
{
|
||||
BX_DEBUG(("concat_image_t.close"));
|
||||
if (pathname != NULL)
|
||||
{
|
||||
BX_DEBUG(("concat_image_t.close"));
|
||||
if (pathname != NULL)
|
||||
{
|
||||
free(pathname);
|
||||
}
|
||||
#ifdef _POSIX_MAPPED_FILES
|
||||
@ -466,9 +465,9 @@ void sparse_image_t::close()
|
||||
}
|
||||
pagetable = NULL; // We didn't malloc it
|
||||
#endif
|
||||
if (fd > -1) {
|
||||
if (fd > -1) {
|
||||
::close(fd);
|
||||
}
|
||||
}
|
||||
if (pagetable != NULL)
|
||||
{
|
||||
delete [] pagetable;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: serial.cc,v 1.78 2007-09-28 19:52:05 sshwarts Exp $
|
||||
// $Id: serial.cc,v 1.79 2007-10-24 23:16:21 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2004 MandrakeSoft S.A.
|
||||
@ -238,8 +238,8 @@ bx_serial_c::init(void)
|
||||
}
|
||||
|
||||
BX_SER_THIS s[i].io_mode = BX_SER_MODE_NULL;
|
||||
char *mode = SIM->get_param_enum("mode", base)->get_selected();
|
||||
char *dev = SIM->get_param_string("dev", base)->getptr();
|
||||
const char *mode = SIM->get_param_enum("mode", base)->get_selected();
|
||||
const char *dev = SIM->get_param_string("dev", base)->getptr();
|
||||
if (!strcmp(mode, "file")) {
|
||||
if (strlen(dev) > 0) {
|
||||
BX_SER_THIS s[i].output = fopen(dev, "wb");
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: vga.cc,v 1.143 2007-09-28 19:52:07 sshwarts Exp $
|
||||
// $Id: vga.cc,v 1.144 2007-10-24 23:16:41 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||
@ -237,7 +237,7 @@ void bx_vga_c::init(void)
|
||||
|
||||
memset(argv, 0, sizeof(argv));
|
||||
argc = 1;
|
||||
argv[0] = "bochs";
|
||||
argv[0] = (char *)"bochs";
|
||||
len = strlen(SIM->get_param_string(BXPN_DISPLAYLIB_OPTIONS)->getptr());
|
||||
if (len > 0) {
|
||||
char *options = new char[len + 1];
|
||||
|
@ -1,5 +1,5 @@
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// $Id: virt_timer.cc,v 1.34 2007-09-28 19:52:08 sshwarts Exp $
|
||||
// $Id: virt_timer.cc,v 1.35 2007-10-24 23:17:16 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||
@ -284,9 +284,8 @@ int bx_virt_timer_c::register_timer(void *this_ptr, bx_timer_handler_t handler,
|
||||
//unregister a previously registered timer.
|
||||
bx_bool bx_virt_timer_c::unregisterTimer(unsigned timerID)
|
||||
{
|
||||
if(!use_virtual_timers) {
|
||||
if(!use_virtual_timers)
|
||||
return bx_pc_system.unregisterTimer(timerID);
|
||||
}
|
||||
|
||||
BX_ASSERT(timerID < BX_MAX_VIRTUAL_TIMERS);
|
||||
|
||||
@ -527,10 +526,10 @@ void bx_virt_timer_c::timer_handler(void)
|
||||
temp2 = (total_real_usec);
|
||||
temp3 = (Bit64u)total_ticks;
|
||||
temp4 = (Bit64u)((total_real_usec) - total_ticks);
|
||||
printf("useconds: %llu, ",temp1);
|
||||
printf("expect ticks: %llu, ",temp2);
|
||||
printf("ticks: %llu, ",temp3);
|
||||
printf("diff: %llu\n",temp4);
|
||||
printf("useconds: " FMT_LL "u, ", temp1);
|
||||
printf("expect ticks: " FMT_LL "u, ", temp2);
|
||||
printf("ticks: " FMT_LL "u, ", temp3);
|
||||
printf("diff: "FMT_LL "u\n", temp4);
|
||||
}
|
||||
# endif
|
||||
|
||||
@ -543,9 +542,7 @@ void bx_virt_timer_c::timer_handler(void)
|
||||
stored_delta = system_time_delta;
|
||||
}
|
||||
|
||||
|
||||
Bit64u a,b;
|
||||
a=(usec_per_second);
|
||||
Bit64u a = usec_per_second, b;
|
||||
if(real_time_delta) {
|
||||
//FIXME
|
||||
Bit64u em_realtime_delta = last_system_usec + stored_delta - em_last_realtime;
|
||||
@ -575,4 +572,3 @@ void bx_virt_timer_c::pc_system_timer_handler(void* this_ptr)
|
||||
{
|
||||
((bx_virt_timer_c *)this_ptr)->timer_handler();
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: vmware3.cc,v 1.17 2006-12-17 08:17:28 vruppert Exp $
|
||||
// $Id: vmware3.cc,v 1.18 2007-10-24 23:17:30 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*
|
||||
@ -163,7 +163,7 @@ 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 %d bytes for vmware3 COW file name (base: %s, chain: %d)", strlen(filename) + 4, filename, chain));
|
||||
BX_PANIC(("unable to allocate %lu 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 %d bytes", count));
|
||||
BX_DEBUG(("vmware3 COW read failed on %lu 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 %d bytes", count));
|
||||
BX_DEBUG(("failed to sync when writing %lu bytes", count));
|
||||
return -1;
|
||||
}
|
||||
amount = bytes_remaining;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: vmware4.cc,v 1.2 2006-12-19 16:42:27 vruppert Exp $
|
||||
// $Id: vmware4.cc,v 1.3 2007-10-24 23:17:42 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*
|
||||
@ -74,7 +74,7 @@ int vmware4_image_t::open(const char * pathname)
|
||||
|
||||
tlb = new Bit8u[(unsigned)header.tlb_size_sectors * SECTOR_SIZE];
|
||||
if(tlb == 0)
|
||||
BX_PANIC(("unable to allocate %lld bytes for vmware4 image's tlb", header.tlb_size_sectors * SECTOR_SIZE));
|
||||
BX_PANIC(("unable to allocate " FMT_LL "d bytes for vmware4 image's tlb", header.tlb_size_sectors * SECTOR_SIZE));
|
||||
|
||||
tlb_offset = INVALID_OFFSET;
|
||||
current_offset = 0;
|
||||
@ -86,7 +86,7 @@ int vmware4_image_t::open(const char * pathname)
|
||||
sectors = 63;
|
||||
|
||||
BX_DEBUG(("VMware 4 disk geometry:"));
|
||||
BX_DEBUG((" .size = %lld", hd_size));
|
||||
BX_DEBUG((" .size = " FMT_LL "d", hd_size));
|
||||
BX_DEBUG((" .cylinders = %d", cylinders));
|
||||
BX_DEBUG((" .heads = %d", heads));
|
||||
BX_DEBUG((" .sectors = %d", sectors));
|
||||
@ -100,7 +100,7 @@ void vmware4_image_t::close()
|
||||
return;
|
||||
|
||||
flush();
|
||||
delete [] tlb, tlb = 0;
|
||||
delete [] tlb; tlb = 0;
|
||||
|
||||
::close(file_descriptor);
|
||||
file_descriptor = -1;
|
||||
@ -218,14 +218,14 @@ bool vmware4_image_t::read_header()
|
||||
BX_DEBUG(("VM4_Header (size=%d)", sizeof(VM4_Header)));
|
||||
BX_DEBUG((" .version = %d", header.version));
|
||||
BX_DEBUG((" .flags = %d", header.flags));
|
||||
BX_DEBUG((" .total_sectors = %lld", header.total_sectors));
|
||||
BX_DEBUG((" .tlb_size_sectors = %lld", header.tlb_size_sectors));
|
||||
BX_DEBUG((" .description_offset_sectors = %lld", header.description_offset_sectors));
|
||||
BX_DEBUG((" .description_size_sectors = %lld", header.description_size_sectors));
|
||||
BX_DEBUG((" .total_sectors = " FMT_LL "d", header.total_sectors));
|
||||
BX_DEBUG((" .tlb_size_sectors = " FMT_LL "d", header.tlb_size_sectors));
|
||||
BX_DEBUG((" .description_offset_sectors = " FMT_LL "d", header.description_offset_sectors));
|
||||
BX_DEBUG((" .description_size_sectors = " FMT_LL "d", header.description_size_sectors));
|
||||
BX_DEBUG((" .slb_count = %d", header.slb_count));
|
||||
BX_DEBUG((" .flb_offset_sectors = %lld", header.flb_offset_sectors));
|
||||
BX_DEBUG((" .flb_copy_offset_sectors = %lld", header.flb_copy_offset_sectors));
|
||||
BX_DEBUG((" .tlb_offset_sectors = %lld", header.tlb_offset_sectors));
|
||||
BX_DEBUG((" .flb_offset_sectors = " FMT_LL "d", header.flb_offset_sectors));
|
||||
BX_DEBUG((" .flb_copy_offset_sectors = " FMT_LL "d", header.flb_copy_offset_sectors));
|
||||
BX_DEBUG((" .tlb_offset_sectors = " FMT_LL "d", header.tlb_offset_sectors));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user