From 04feaeebb922c3af6fb08762326753d93231e000 Mon Sep 17 00:00:00 2001 From: Igor Canadi Date: Tue, 19 May 2015 10:59:30 -0700 Subject: [PATCH] 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 --- db/log_writer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/log_writer.cc b/db/log_writer.cc index 7ffb6d0b9..d78de5e7b 100644 --- a/db/log_writer.cc +++ b/db/log_writer.cc @@ -52,7 +52,7 @@ Status Writer::AddRecord(const Slice& slice) { } // Invariant: we never leave < kHeaderSize bytes in a block. - assert(kBlockSize - block_offset_ >= kHeaderSize); + assert(static_cast(kBlockSize) - block_offset_ >= kHeaderSize); const size_t avail = kBlockSize - block_offset_ - kHeaderSize; const size_t fragment_length = (left < avail) ? left : avail;