aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/ijar/mapped_file_unix.cc
diff options
context:
space:
mode:
authorGravatar cushon <cushon@google.com>2018-03-29 13:31:46 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-03-29 13:32:58 -0700
commita29da01b360b778d15ed735222d0f1d247954acf (patch)
tree2961500fb84e8aa2ac4342f3c97d530ef425a29c /third_party/ijar/mapped_file_unix.cc
parenta76f7db51a90cc2e35c1d66782056c310729eef0 (diff)
Fix a warning about comparing signed and unsigned values
PiperOrigin-RevId: 190977545
Diffstat (limited to 'third_party/ijar/mapped_file_unix.cc')
-rw-r--r--third_party/ijar/mapped_file_unix.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/third_party/ijar/mapped_file_unix.cc b/third_party/ijar/mapped_file_unix.cc
index ccb8787cd5..ced7d8726f 100644
--- a/third_party/ijar/mapped_file_unix.cc
+++ b/third_party/ijar/mapped_file_unix.cc
@@ -90,7 +90,7 @@ struct MappedOutputFileImpl {
int mmap_length_;
};
-MappedOutputFile::MappedOutputFile(const char* name, u8 estimated_size)
+MappedOutputFile::MappedOutputFile(const char* name, size_t estimated_size)
: estimated_size_(estimated_size) {
impl_ = NULL;
opened_ = false;
@@ -111,7 +111,7 @@ MappedOutputFile::MappedOutputFile(const char* name, u8 estimated_size)
// Ensure that any buffer overflow in JarStripper will result in
// SIGSEGV or SIGBUS by over-allocating beyond the end of the file.
size_t mmap_length = std::min(estimated_size + sysconf(_SC_PAGESIZE),
- (u8) std::numeric_limits<size_t>::max());
+ std::numeric_limits<size_t>::max());
void* mapped = mmap(NULL, mmap_length, PROT_WRITE, MAP_SHARED, fd, 0);
if (mapped == MAP_FAILED) {
snprintf(errmsg, MAX_ERROR, "mmap(): %s", strerror(errno));
@@ -131,9 +131,9 @@ MappedOutputFile::~MappedOutputFile() {
delete impl_;
}
-int MappedOutputFile::Close(int size) {
+int MappedOutputFile::Close(size_t size) {
if (size > estimated_size_) {
- snprintf(errmsg, MAX_ERROR, "size %d > estimated size %lld", size,
+ snprintf(errmsg, MAX_ERROR, "size %zu > estimated size %zu", size,
estimated_size_);
errmsg_ = errmsg;
return -1;