summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/formats/apridisk.cpp6
-rw-r--r--src/lib/formats/cassimg.cpp2
-rw-r--r--src/lib/util/chd.cpp6
-rw-r--r--src/lib/util/flac.cpp8
-rw-r--r--src/lib/util/palette.cpp4
5 files changed, 13 insertions, 13 deletions
diff --git a/src/lib/formats/apridisk.cpp b/src/lib/formats/apridisk.cpp
index 08fd6777bd9..a004d54ccd0 100644
--- a/src/lib/formats/apridisk.cpp
+++ b/src/lib/formats/apridisk.cpp
@@ -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;
diff --git a/src/lib/formats/cassimg.cpp b/src/lib/formats/cassimg.cpp
index d1b3495e3e8..38403e598d2 100644
--- a/src/lib/formats/cassimg.cpp
+++ b/src/lib/formats/cassimg.cpp
@@ -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);
diff --git a/src/lib/util/chd.cpp b/src/lib/util/chd.cpp
index 6d50ce1b571..07da646dca3 100644
--- a/src/lib/util/chd.cpp
+++ b/src/lib/util/chd.cpp
@@ -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;
diff --git a/src/lib/util/flac.cpp b/src/lib/util/flac.cpp
index a642bc86ba8..085eaacffef 100644
--- a/src/lib/util/flac.cpp
+++ b/src/lib/util/flac.cpp
@@ -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;
diff --git a/src/lib/util/palette.cpp b/src/lib/util/palette.cpp
index e918bb7adb2..196031d3694 100644
--- a/src/lib/util/palette.cpp
+++ b/src/lib/util/palette.cpp
@@ -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