summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcostan <costan@google.com>2018-03-20 15:22:23 -0700
committerVictor Costan <pwnall@chromium.org>2018-03-20 16:48:42 -0700
commit50fbc87e8c62a816d6afd4740e0652a13ac6dc3e (patch)
treee447143715020f97a835f498b3d4756f315b732d
parent739c25100e46576cdcdfff2d6f43f9f7008103c7 (diff)
downloadleveldb-50fbc87e8c62a816d6afd4740e0652a13ac6dc3e.tar.gz
Replace SIZE_MAX with std::numeric_limits.
helpers/memenv/memenv.cc used SIZE_MAX without including <stdint.h>. Since we're fixing this problem, replace SIZE_MAX with std::numeric_limits<size_t>::max(), which is clearer. Fixes https://github.com/google/leveldb/issues/562 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=189821707
-rw-r--r--helpers/memenv/memenv.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/helpers/memenv/memenv.cc b/helpers/memenv/memenv.cc
index ee7abd4..43b009d 100644
--- a/helpers/memenv/memenv.cc
+++ b/helpers/memenv/memenv.cc
@@ -6,6 +6,7 @@
#include <string.h>
+#include <limits>
#include <map>
#include <string>
#include <vector>
@@ -65,7 +66,7 @@ class FileState {
return Status::OK();
}
- assert(offset / kBlockSize <= SIZE_MAX);
+ assert(offset / kBlockSize <= std::numeric_limits<size_t>::max());
size_t block = static_cast<size_t>(offset / kBlockSize);
size_t block_offset = offset % kBlockSize;