fix after pass through the diff

This commit is contained in:
Vas Crabb 2016-08-01 01:17:27 +10:00
parent f127621e13
commit a0ce6c3b37
13 changed files with 29 additions and 29 deletions

View File

@ -349,7 +349,7 @@ void isa8_cga_device::device_start()
set_isa_device();
m_vram.resize(m_vram_size);
m_isa->install_device(0x3d0, 0x3df, read8_delegate( FUNC(isa8_cga_device::io_read), this ), write8_delegate( FUNC(isa8_cga_device::io_write), this ) );
m_isa->install_bank(0xb8000, 0xb8000 + std::min<UINT32>(0x8000,m_vram_size) - 1, "bank_cga", &m_vram[0]);
m_isa->install_bank(0xb8000, 0xb8000 + (std::min<size_t>)(0x8000, m_vram_size) - 1, "bank_cga", &m_vram[0]);
if(m_vram_size == 0x4000)
m_isa->install_bank(0xbc000, 0xbffff, "bank_cga", &m_vram[0]);
@ -1821,7 +1821,7 @@ WRITE8_MEMBER( isa8_ec1841_0002_device::io_write )
read8_delegate( FUNC(isa8_ec1841_0002_device::char_ram_read), this),
write8_delegate(FUNC(isa8_ec1841_0002_device::char_ram_write), this) );
} else {
m_isa->install_bank(0xb8000, 0xb8000 + std::min<UINT32>(0x8000,m_vram_size) - 1, "bank_cga", &m_vram[0]);
m_isa->install_bank(0xb8000, 0xb8000 + (std::min<size_t>)(0x8000, m_vram_size) - 1, "bank_cga", &m_vram[0]);
if(m_vram_size == 0x4000)
m_isa->install_bank(0xbc000, 0xbffff, "bank_cga", &m_vram[0]);
}

View File

@ -986,9 +986,9 @@ laserdisc_device::frame_data &laserdisc_device::current_frame()
void laserdisc_device::read_track_data()
{
// compute the chdhunk number we are going to read
UINT32 chdtrack = m_curtrack - 1 - VIRTUAL_LEAD_IN_TRACKS;
chdtrack = std::max(chdtrack, UINT32(0));
chdtrack = std::min(chdtrack, m_chdtracks - 1);
INT32 chdtrack = m_curtrack - 1 - VIRTUAL_LEAD_IN_TRACKS;
chdtrack = (std::max<INT32>)(chdtrack, 0);
chdtrack = (std::min<UINT32>)(chdtrack, m_chdtracks - 1);
UINT32 readhunk = chdtrack * 2 + m_fieldnum;
// cheat and look up the metadata we are about to retrieve

View File

@ -67,7 +67,7 @@ public:
{
assert(m_spriteram != nullptr);
if (m_spriteram != nullptr)
memcpy(&m_buffered[0], m_spriteram + srcoffset, std::min(srclength, UINT32(m_spriteram.bytes() / sizeof(_Type) - srcoffset)) * sizeof(_Type));
memcpy(&m_buffered[0], m_spriteram + srcoffset, (std::min<size_t>)(srclength, m_spriteram.bytes() / sizeof(_Type) - srcoffset) * sizeof(_Type));
return &m_buffered[0];
}

View File

@ -1225,8 +1225,8 @@ void render_target::compute_visible_area(INT32 target_width, INT32 target_height
// first compute scale factors to fit the screen
float xscale = (float)target_width / src_width;
float yscale = (float)target_height / src_height;
float maxxscale = std::max(float(1.0f), float(m_int_overscan? render_round_nearest(xscale) : floor(xscale)));
float maxyscale = std::max(float(1.0f), float(m_int_overscan? render_round_nearest(yscale) : floor(yscale)));
float maxxscale = std::max(1.0f, float(m_int_overscan ? render_round_nearest(xscale) : floor(xscale)));
float maxyscale = std::max(1.0f, float(m_int_overscan ? render_round_nearest(yscale) : floor(yscale)));
// now apply desired scale mode and aspect correction
if (m_keepaspect && target_aspect > src_aspect) xscale *= src_aspect / target_aspect * (maxyscale / yscale);

View File

@ -74,9 +74,9 @@ bool apridisk_format::load(io_generic *io, UINT32 form_factor, floppy_image *ima
UINT8 sector = pick_integer_le(&sector_header, 13, 1);
UINT8 track = (UINT8) pick_integer_le(&sector_header, 14, 2);
track_count = std::max(track_count, int(track));
head_count = std::max(head_count, int(head));
sector_count = std::max(sector_count, int(sector));
track_count = std::max(track_count, int(unsigned(track)));
head_count = std::max(head_count, int(unsigned(head)));
sector_count = std::max(sector_count, int(unsigned(sector)));
// build sector info
sectors[track][head][sector - 1].head = head;

View File

@ -791,7 +791,7 @@ casserr_t cassette_read_modulated_data(cassette_image *cassette, int channel, do
while(length > 0)
{
this_length = std::min(size_t(length), buffer_length);
this_length = (std::min<UINT64>)(length, buffer_length);
cassette_image_read(cassette, buffer, offset, this_length);
err = cassette_put_modulated_data(cassette, channel, time_index, buffer, this_length, modulation, &delta);

View File

@ -242,7 +242,7 @@ inline UINT64 chd_file::file_append(const void *source, UINT32 length, UINT32 al
delta = alignment - delta;
while (delta != 0)
{
UINT32 bytes_to_write = std::min(UINT32(sizeof(buffer)), delta);
UINT32 bytes_to_write = (std::min<std::size_t>)(sizeof(buffer), delta);
UINT32 count = m_file->write(buffer, bytes_to_write);
if (count != bytes_to_write)
throw CHDERR_WRITE_ERROR;
@ -1980,7 +1980,7 @@ chd_error chd_file::compress_v5_map()
// track maximum compressed length
else //if (curcomp >= COMPRESSION_TYPE_0 && curcomp <= COMPRESSION_TYPE_3)
max_complen = std::max(max_complen, UINT32(be_read(&m_rawmap[hunknum * 12 + 1], 3))); // TODO: check types
max_complen = std::max(max_complen, UINT32(be_read(&m_rawmap[hunknum * 12 + 1], 3)));
// track repeats
if (curcomp == lastcomp)
@ -2333,7 +2333,7 @@ chd_error chd_file::create_common()
UINT64 offset = m_mapoffset;
while (mapsize != 0)
{
UINT32 bytes_to_write = std::min(mapsize, UINT32(sizeof(buffer)));
UINT32 bytes_to_write = (std::min<size_t>)(mapsize, sizeof(buffer));
file_write(offset, buffer, bytes_to_write);
offset += bytes_to_write;
mapsize -= bytes_to_write;

View File

@ -127,7 +127,7 @@ bool flac_encoder::encode_interleaved(const INT16 *samples, UINT32 samples_per_c
// process in batches of 2k samples
FLAC__int32 converted_buffer[2048];
FLAC__int32 *dest = converted_buffer;
UINT32 cur_samples = std::min(UINT32(ARRAY_LENGTH(converted_buffer) / num_channels), samples_per_channel);
UINT32 cur_samples = (std::min<size_t>)(ARRAY_LENGTH(converted_buffer) / num_channels, samples_per_channel);
// convert a buffers' worth
for (UINT32 sampnum = 0; sampnum < cur_samples; sampnum++)
@ -160,7 +160,7 @@ bool flac_encoder::encode(INT16 *const *samples, UINT32 samples_per_channel, boo
// process in batches of 2k samples
FLAC__int32 converted_buffer[2048];
FLAC__int32 *dest = converted_buffer;
UINT32 cur_samples = std::min(UINT32(ARRAY_LENGTH(converted_buffer) / num_channels), samples_per_channel);
UINT32 cur_samples = (std::min<size_t>)(ARRAY_LENGTH(converted_buffer) / num_channels, samples_per_channel);
// convert a buffers' worth
for (UINT32 sampnum = 0; sampnum < cur_samples; sampnum++, srcindex++)
@ -526,7 +526,7 @@ FLAC__StreamDecoderReadStatus flac_decoder::read_callback(FLAC__byte buffer[], s
UINT32 outputpos = 0;
if (outputpos < *bytes && m_compressed_offset < m_compressed_length)
{
UINT32 bytes_to_copy = std::min(UINT32(*bytes - outputpos), m_compressed_length - m_compressed_offset);
UINT32 bytes_to_copy = (std::min<size_t>)(*bytes - outputpos, m_compressed_length - m_compressed_offset);
memcpy(&buffer[outputpos], m_compressed_start + m_compressed_offset, bytes_to_copy);
outputpos += bytes_to_copy;
m_compressed_offset += bytes_to_copy;
@ -535,7 +535,7 @@ FLAC__StreamDecoderReadStatus flac_decoder::read_callback(FLAC__byte buffer[], s
// once we're out of that, copy from the secondary buffer
if (outputpos < *bytes && m_compressed_offset < m_compressed_length + m_compressed2_length)
{
UINT32 bytes_to_copy = std::min(UINT32(*bytes - outputpos), m_compressed2_length - (m_compressed_offset - m_compressed_length));
UINT32 bytes_to_copy = (std::min<size_t>)(*bytes - outputpos, m_compressed2_length - (m_compressed_offset - m_compressed_length));
memcpy(&buffer[outputpos], m_compressed2_start + m_compressed_offset - m_compressed_length, bytes_to_copy);
outputpos += bytes_to_copy;
m_compressed_offset += bytes_to_copy;

View File

@ -514,8 +514,8 @@ void palette_t::normalize_range(UINT32 start, UINT32 end, int lum_min, int lum_m
{
rgb_t rgb = m_entry_color[index];
UINT32 y = 299 * rgb.r() + 587 * rgb.g() + 114 * rgb.b();
ymin = std::min<INT32>(ymin, y);
ymax = std::max<INT32>(ymax, y);
ymin = (std::min<UINT32>)(ymin, y);
ymax = (std::max<UINT32>)(ymax, y);
}
// determine target minimum/maximum

View File

@ -253,8 +253,8 @@ READ8_MEMBER( prestige_state::mouse_r )
break;
}
data = std::min(data, INT16(+127));
data = std::min(data, INT16(-127));
data = (std::min)(data, INT16(+127));
data = (std::max)(data, INT16(-127));
return 0x80 + data;
}

View File

@ -65,8 +65,8 @@ consolewin_info::consolewin_info(debugger_windows_interface &debugger) :
set_maxwidth(bounds.right - bounds.left);
// position the window at the bottom-right
int const bestwidth = std::min(int(maxwidth()), int(work_bounds.right - work_bounds.left));
int const bestheight = std::min(500, int(work_bounds.bottom - work_bounds.top));
int const bestwidth = (std::min<UINT32>)(maxwidth(), work_bounds.right - work_bounds.left);
int const bestheight = (std::min<UINT32>)(500, work_bounds.bottom - work_bounds.top);
SetWindowPos(window(), HWND_TOP,
work_bounds.right - bestwidth, work_bounds.bottom - bestheight,
bestwidth, bestheight,

View File

@ -1957,7 +1957,7 @@ static imgtoolerr_t fat_partition_writefile(imgtool_partition *partition, const
while(bytes_left > 0)
{
len = std::min(bytes_left, UINT32(sizeof(buffer)));
len = (std::min<size_t>)(bytes_left, sizeof(buffer));
stream_read(sourcef, buffer, len);
err = fat_write_file(partition, &file, buffer, len, NULL);

View File

@ -275,7 +275,7 @@ static imgtoolerr_t os9_decode_file_header(imgtool_image *image,
/* read all sector map entries */
max_entries = (disk_info->sector_size - 16) / 5;
max_entries = std::min(max_entries, int(ARRAY_LENGTH(info->sector_map) - 1));
max_entries = (std::min<std::size_t>)(max_entries, ARRAY_LENGTH(info->sector_map) - 1);
for (i = 0; i < max_entries; i++)
{
lsn = pick_integer_be(header, 16 + (i * 5) + 0, 3);
@ -461,7 +461,7 @@ static imgtoolerr_t os9_set_file_size(imgtool_image *image,
/* do we have to write the sector map? */
if (sector_map_length >= 0)
{
for (i = 0; i < std::min(sector_map_length + 1, int(ARRAY_LENGTH(file_info->sector_map))); i++)
for (i = 0; i < (std::min<std::size_t>)(sector_map_length + 1, ARRAY_LENGTH(file_info->sector_map)); i++)
{
place_integer_be(header, 16 + (i * 5) + 0, 3, file_info->sector_map[i].lsn);
place_integer_be(header, 16 + (i * 5) + 3, 2, file_info->sector_map[i].count);
@ -1055,7 +1055,7 @@ static imgtoolerr_t os9_diskimage_writefile(imgtool_partition *partition, const
while(sz > 0)
{
write_size = std::min(size_t(sz), size_t(disk_info->sector_size));
write_size = (std::min<UINT64>)(sz, disk_info->sector_size);
stream_read(sourcef, &buf[0], write_size);