diff options
author | 2021-04-30 04:42:05 +1000 | |
---|---|---|
committer | 2021-04-30 04:42:05 +1000 | |
commit | 4023b48efd733d137f90459bf7b88c3dbd2bb342 (patch) | |
tree | 4b8c7f478c2c25b37314498d547a6b5e4fe0cb99 /src/tools/floptool.cpp | |
parent | b8b72d06d46b10ec36f9badc6c809ff59f8fc729 (diff) |
floptool.cpp: Be stricter about types.
Diffstat (limited to 'src/tools/floptool.cpp')
-rw-r--r-- | src/tools/floptool.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/tools/floptool.cpp b/src/tools/floptool.cpp index 91095f3a2b7..73e34ef616b 100644 --- a/src/tools/floptool.cpp +++ b/src/tools/floptool.cpp @@ -90,16 +90,16 @@ static int ram_seekproc(void *file, int64_t offset, int whence) } if(whence == SEEK_CUR) - f->pos = std::max(f->pos, int64_t(0)); + f->pos = std::max<int64_t>(f->pos, 0); else - f->pos = std::clamp(f->pos, int64_t(0), int64_t(f->data->size())); + f->pos = std::clamp<int64_t>(f->pos, 0, f->data->size()); return 0; } static size_t ram_readproc(void *file, void *buffer, size_t length) { auto f = (iofile_ram *)file; - size_t l = std::min(length, size_t(f->data->size() - f->pos)); + size_t l = std::min<std::common_type_t<size_t, int64_t> >(length, f->data->size() - f->pos); memcpy(buffer, f->data->data() + f->pos, l); return l; } @@ -107,7 +107,7 @@ static size_t ram_readproc(void *file, void *buffer, size_t length) static size_t ram_writeproc(void *file, const void *buffer, size_t length) { auto f = (iofile_ram *)file; - size_t l = std::max(f->pos + length, f->data->size()); + size_t l = std::max<std::common_type_t<size_t, int64_t> >(f->pos + length, f->data->size()); f->data->resize(l); memcpy(f->data->data() + f->pos, buffer, length); return length; |