瀏覽代碼

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
ld
costan 6 年之前
committed by Victor Costan
父節點
當前提交
50fbc87e8c
共有 1 個檔案被更改,包括 2 行新增1 行删除
  1. +2
    -1
      helpers/memenv/memenv.cc

+ 2
- 1
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;

Loading…
取消
儲存