From 0ec2a343f3be66ef6e25f9b9badc0256ac0911b7 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Wed, 12 Jul 2017 19:31:01 -0400 Subject: [PATCH] Clean up compile-time warnings (gcc 7.1) * max_file_size was already a size_t, so return that. --- db/memtable.cc | 2 +- db/version_set.cc | 2 +- util/logging.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/db/memtable.cc b/db/memtable.cc index bfec0a7e7a1dc2..287afdbdcb90c7 100644 --- a/db/memtable.cc +++ b/db/memtable.cc @@ -101,7 +101,7 @@ void MemTable::Add(SequenceNumber s, ValueType type, p += 8; p = EncodeVarint32(p, val_size); memcpy(p, value.data(), val_size); - assert((p + val_size) - buf == encoded_len); + assert(p + val_size == buf + encoded_len); table_.Insert(buf); } diff --git a/db/version_set.cc b/db/version_set.cc index b1256f90e1c2bc..2cb6d80ed3cf9a 100644 --- a/db/version_set.cc +++ b/db/version_set.cc @@ -20,7 +20,7 @@ namespace leveldb { -static int TargetFileSize(const Options* options) { +static size_t TargetFileSize(const Options* options) { return options->max_file_size; } diff --git a/util/logging.cc b/util/logging.cc index ca6b3244038ec2..db6160c8f19929 100644 --- a/util/logging.cc +++ b/util/logging.cc @@ -49,7 +49,7 @@ bool ConsumeDecimalNumber(Slice* in, uint64_t* val) { uint64_t v = 0; int digits = 0; while (!in->empty()) { - char c = (*in)[0]; + unsigned char c = (*in)[0]; if (c >= '0' && c <= '9') { ++digits; const int delta = (c - '0');