From 50fbc87e8c62a816d6afd4740e0652a13ac6dc3e Mon Sep 17 00:00:00 2001 From: costan Date: Tue, 20 Mar 2018 15:22:23 -0700 Subject: [PATCH] Replace SIZE_MAX with std::numeric_limits. helpers/memenv/memenv.cc used SIZE_MAX without including . Since we're fixing this problem, replace SIZE_MAX with std::numeric_limits::max(), which is clearer. Fixes https://github.com/google/leveldb/issues/562 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=189821707 --- helpers/memenv/memenv.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 +#include #include #include #include @@ -65,7 +66,7 @@ class FileState { return Status::OK(); } - assert(offset / kBlockSize <= SIZE_MAX); + assert(offset / kBlockSize <= std::numeric_limits::max()); size_t block = static_cast(offset / kBlockSize); size_t block_offset = offset % kBlockSize;