mirror of
https://github.com/google/leveldb.git
synced 2025-06-07 09:52:42 +08:00
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
This commit is contained in:
parent
739c25100e
commit
50fbc87e8c
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include <limits>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@ -65,7 +66,7 @@ class FileState {
|
|||||||
return Status::OK();
|
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 = static_cast<size_t>(offset / kBlockSize);
|
||||||
size_t block_offset = offset % kBlockSize;
|
size_t block_offset = offset % kBlockSize;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user