diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2014-10-16 12:23:50 -0700 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2014-10-16 12:23:50 -0700 |
commit | 5b9f8425a515739e2149bf5bfb2ae6ed60bfbaf2 (patch) | |
tree | bacc7dd4d2f77da27499000d6f12655a3f6463f3 /src/leveldb/helpers/memenv | |
parent | e8f6d54f1f58d9a5998e37367b84b427e51e1ad7 (diff) | |
parent | 4b0e2d75d78036e7e76fd9584e17b0379ba08d24 (diff) |
Merge src/leveldb changes for LevelDB 1.18.
Diffstat (limited to 'src/leveldb/helpers/memenv')
-rw-r--r-- | src/leveldb/helpers/memenv/memenv.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/leveldb/helpers/memenv/memenv.cc b/src/leveldb/helpers/memenv/memenv.cc index 5879de1214..43ef2e0729 100644 --- a/src/leveldb/helpers/memenv/memenv.cc +++ b/src/leveldb/helpers/memenv/memenv.cc @@ -55,14 +55,15 @@ class FileState { } const uint64_t available = size_ - offset; if (n > available) { - n = available; + n = static_cast<size_t>(available); } if (n == 0) { *result = Slice(); return Status::OK(); } - size_t block = offset / kBlockSize; + assert(offset / kBlockSize <= SIZE_MAX); + size_t block = static_cast<size_t>(offset / kBlockSize); size_t block_offset = offset % kBlockSize; if (n <= kBlockSize - block_offset) { @@ -167,7 +168,7 @@ class SequentialFileImpl : public SequentialFile { if (pos_ > file_->Size()) { return Status::IOError("pos_ > file_->Size()"); } - const size_t available = file_->Size() - pos_; + const uint64_t available = file_->Size() - pos_; if (n > available) { n = available; } @@ -177,7 +178,7 @@ class SequentialFileImpl : public SequentialFile { private: FileState* file_; - size_t pos_; + uint64_t pos_; }; class RandomAccessFileImpl : public RandomAccessFile { |