summaryrefslogtreecommitdiffstats
path: root/runtime/base/unix_file/mapped_file.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/base/unix_file/mapped_file.cc')
-rw-r--r--runtime/base/unix_file/mapped_file.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/runtime/base/unix_file/mapped_file.cc b/runtime/base/unix_file/mapped_file.cc
index b63fdd3bef..bc23a745c9 100644
--- a/runtime/base/unix_file/mapped_file.cc
+++ b/runtime/base/unix_file/mapped_file.cc
@@ -101,7 +101,8 @@ int64_t MappedFile::Read(char* buf, int64_t byte_count, int64_t offset) const {
errno = EINVAL;
return -errno;
}
- int64_t read_size = std::max(0LL, std::min(byte_count, file_size_ - offset));
+ int64_t read_size = std::max(static_cast<int64_t>(0),
+ std::min(byte_count, file_size_ - offset));
if (read_size > 0) {
memcpy(buf, data() + offset, read_size);
}
@@ -136,7 +137,8 @@ int64_t MappedFile::Write(const char* buf, int64_t byte_count, int64_t offset) {
errno = EINVAL;
return -errno;
}
- int64_t write_size = std::max(0LL, std::min(byte_count, file_size_ - offset));
+ int64_t write_size = std::max(static_cast<int64_t>(0),
+ std::min(byte_count, file_size_ - offset));
if (write_size > 0) {
memcpy(data() + offset, buf, write_size);
}