diff --git a/SDL2pp/ContainerRWops.hh b/SDL2pp/ContainerRWops.hh index 18adffe..43802b5 100644 --- a/SDL2pp/ContainerRWops.hh +++ b/SDL2pp/ContainerRWops.hh @@ -128,7 +128,7 @@ public: if (position_ + size > container_.size()) return 0; - int toread = std::min((container_.size() - position_), maxnum * size); + size_t toread = std::min((container_.size() - position_), maxnum * size); std::copy(container_.begin() + position_, container_.begin() + position_ + toread, reinterpret_cast(ptr)); diff --git a/SDL2pp/StreamRWops.hh b/SDL2pp/StreamRWops.hh index ed603e0..81c6a73 100644 --- a/SDL2pp/StreamRWops.hh +++ b/SDL2pp/StreamRWops.hh @@ -90,7 +90,7 @@ private: char* pos = static_cast(ptr); pos += nread; - int count = nread % size; + size_t count = nread % size; // put partially read object back into the stream while (--count >= 0) diff --git a/examples/audio_wav.cc b/examples/audio_wav.cc index 2507043..5d08990 100644 --- a/examples/audio_wav.cc +++ b/examples/audio_wav.cc @@ -46,7 +46,7 @@ int main() try { while (stream_pos < stream_end) { Uint8* wav_end = wav.GetBuffer() + wav.GetLength(); - int copylen = std::min(wav_end - wav_pos, stream_end - stream_pos); + size_t copylen = std::min(wav_end - wav_pos, stream_end - stream_pos); std::copy(wav_pos, wav_pos + copylen, stream_pos); stream_pos += copylen;