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 | 4b0e2d75d78036e7e76fd9584e17b0379ba08d24 (patch) | |
tree | ab3e90ac840140eb5bec8a5c69bf890162a43941 /helpers | |
parent | 938b68984668445035b2505e1b7ec07649dd2bbc (diff) | |
download | bitcoin-4b0e2d75d78036e7e76fd9584e17b0379ba08d24.tar.xz |
Squashed 'src/leveldb/' changes from 7924331..7d41e6f
7d41e6f Merge upstream LevelDB 1.18
803d692 Release 1.18
git-subtree-dir: src/leveldb
git-subtree-split: 7d41e6f89ff04ce9e6a742932924796f69c6e23d
Diffstat (limited to 'helpers')
-rw-r--r-- | helpers/memenv/memenv.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/helpers/memenv/memenv.cc b/helpers/memenv/memenv.cc index 5879de1214..43ef2e0729 100644 --- a/helpers/memenv/memenv.cc +++ b/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 { |