Fix comparison between signed and usigned integers

Summary: Not sure why this fails on some compilers and doesn't on others.

Test Plan: none

Reviewers: meyering, sdong

Reviewed By: sdong

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D38673
main
Igor Canadi 10 years ago
parent 4a855c0799
commit 04feaeebb9
  1. 2
      db/log_writer.cc

@ -52,7 +52,7 @@ Status Writer::AddRecord(const Slice& slice) {
} }
// Invariant: we never leave < kHeaderSize bytes in a block. // Invariant: we never leave < kHeaderSize bytes in a block.
assert(kBlockSize - block_offset_ >= kHeaderSize); assert(static_cast<int>(kBlockSize) - block_offset_ >= kHeaderSize);
const size_t avail = kBlockSize - block_offset_ - kHeaderSize; const size_t avail = kBlockSize - block_offset_ - kHeaderSize;
const size_t fragment_length = (left < avail) ? left : avail; const size_t fragment_length = (left < avail) ? left : avail;

Loading…
Cancel
Save