From b8d6862dfab53cdd204bd30795b65fa440fc4b66 Mon Sep 17 00:00:00 2001 From: Volker Ruppert Date: Sat, 25 Jan 2014 17:07:10 +0000 Subject: [PATCH] Fixed some MSVC warnings --- bochs/iodev/display/voodoo.cc | 2 +- bochs/iodev/floppy.cc | 6 +++--- bochs/iodev/hdimage/hdimage.cc | 6 +++--- bochs/iodev/usb/scsi_device.cc | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/bochs/iodev/display/voodoo.cc b/bochs/iodev/display/voodoo.cc index adbff25fd..365814ce9 100644 --- a/bochs/iodev/display/voodoo.cc +++ b/bochs/iodev/display/voodoo.cc @@ -588,7 +588,7 @@ Bit16u bx_voodoo_c::get_retrace(void) if (time_in_frame > BX_VOODOO_THIS s.vdraw.vsync_usec) { return 0; } else { - return (BX_VOODOO_THIS s.vdraw.vsync_usec - time_in_frame) / BX_VOODOO_THIS s.vdraw.htotal_usec; + return (Bit16u)((BX_VOODOO_THIS s.vdraw.vsync_usec - time_in_frame) / BX_VOODOO_THIS s.vdraw.htotal_usec + 1); } } diff --git a/bochs/iodev/floppy.cc b/bochs/iodev/floppy.cc index cee921728..f630e7cfe 100644 --- a/bochs/iodev/floppy.cc +++ b/bochs/iodev/floppy.cc @@ -2,7 +2,7 @@ // $Id$ ///////////////////////////////////////////////////////////////////////// // -// Copyright (C) 2002-2013 The Bochs Project +// Copyright (C) 2002-2014 The Bochs Project // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -1113,7 +1113,7 @@ void bx_floppy_ctrl_c::floppy_xfer(Bit8u drive, Bit32u offset, Bit8u *buffer, if (direction == FROM_FLOPPY) { if (BX_FD_THIS s.media[drive].vvfat_floppy) { - ret = BX_FD_THIS s.media[drive].vvfat->read(buffer, bytes); + ret = (int)BX_FD_THIS s.media[drive].vvfat->read(buffer, bytes); #if BX_WITH_MACOS } else if (!strcmp(SIM->get_param_string(pname)->getptr(), SuperDrive)) ret = fd_read((char *) buffer, offset, bytes); @@ -1134,7 +1134,7 @@ void bx_floppy_ctrl_c::floppy_xfer(Bit8u drive, Bit32u offset, Bit8u *buffer, } else { // TO_FLOPPY BX_ASSERT (!BX_FD_THIS s.media[drive].write_protected); if (BX_FD_THIS s.media[drive].vvfat_floppy) { - ret = BX_FD_THIS s.media[drive].vvfat->write(buffer, bytes); + ret = (int)BX_FD_THIS s.media[drive].vvfat->write(buffer, bytes); #if BX_WITH_MACOS } else if (!strcmp(SIM->get_param_string(pname)->getptr(), SuperDrive)) ret = fd_write((char *) buffer, offset, bytes); diff --git a/bochs/iodev/hdimage/hdimage.cc b/bochs/iodev/hdimage/hdimage.cc index 49546ffda..299fda730 100644 --- a/bochs/iodev/hdimage/hdimage.cc +++ b/bochs/iodev/hdimage/hdimage.cc @@ -676,7 +676,7 @@ ssize_t concat_image_t::read(void* buf, size_t count) if ((Bit64s)(total_offset + count - 1) <= thismax) { return ::read(fd, buf1, count); } else { - count1 = thismax - total_offset + 1; + count1 = (size_t)(thismax - total_offset + 1); ret = ::read(fd, buf1, count1); if (ret >= 0) { buf1 += count1; @@ -704,7 +704,7 @@ ssize_t concat_image_t::write(const void* buf, size_t count) if ((Bit64s)(total_offset + count - 1) <= thismax) { return ::write(fd, buf1, count); } else { - count1 = thismax - total_offset + 1; + count1 = (size_t)(thismax - total_offset + 1); ret = ::write(fd, buf1, count1); if (ret >= 0) { buf1 += count1; @@ -1048,7 +1048,7 @@ ssize_t sparse_image_t::read(void* buf, size_t count) BX_ASSERT (can_read != 0); - size_t was_read = read_page_fragment(position_virtual_page, position_page_offset, can_read, buf); + size_t was_read = (size_t)read_page_fragment(position_virtual_page, position_page_offset, can_read, buf); if (was_read != can_read) { BX_PANIC(("could not read from sparse disk")); diff --git a/bochs/iodev/usb/scsi_device.cc b/bochs/iodev/usb/scsi_device.cc index 8b3a620be..db698a421 100644 --- a/bochs/iodev/usb/scsi_device.cc +++ b/bochs/iodev/usb/scsi_device.cc @@ -254,7 +254,7 @@ void scsi_device_t::scsi_read_data(Bit32u tag) BX_ERROR(("could not lseek() hard drive image file")); scsi_command_complete(r, STATUS_CHECK_CONDITION, SENSE_HARDWARE_ERROR); } - ret = hdimage->read((bx_ptr_t)r->dma_buf, r->buf_len); + ret = (int)hdimage->read((bx_ptr_t)r->dma_buf, r->buf_len); if (ret < r->buf_len) { BX_ERROR(("could not read() hard drive image file")); scsi_command_complete(r, STATUS_CHECK_CONDITION, SENSE_HARDWARE_ERROR); @@ -310,7 +310,7 @@ int scsi_device_t::scsi_write_data(Bit32u tag) BX_ERROR(("could not lseek() hard drive image file")); scsi_command_complete(r, STATUS_CHECK_CONDITION, SENSE_HARDWARE_ERROR); } - ret = hdimage->write((bx_ptr_t)r->dma_buf, r->buf_len); + ret = (int)hdimage->write((bx_ptr_t)r->dma_buf, r->buf_len); r->sector += n; r->sector_count -= n; if (ret < r->buf_len) {