diff --git a/db/write_batch.cc b/db/write_batch.cc index b54313c..93bf219 100644 --- a/db/write_batch.cc +++ b/db/write_batch.cc @@ -47,7 +47,7 @@ Status WriteBatch::Iterate(Handler* handler) const { input.remove_prefix(kHeader); Slice key, value; - int found = 0; + uint32_t found = 0; while (!input.empty()) { found++; char tag = input[0]; @@ -79,11 +79,11 @@ Status WriteBatch::Iterate(Handler* handler) const { } } -int WriteBatchInternal::Count(const WriteBatch* b) { +uint32_t WriteBatchInternal::Count(const WriteBatch* b) { return DecodeFixed32(b->rep_.data() + 8); } -void WriteBatchInternal::SetCount(WriteBatch* b, int n) { +void WriteBatchInternal::SetCount(WriteBatch* b, uint32_t n) { EncodeFixed32(&b->rep_[8], n); } diff --git a/db/write_batch_internal.h b/db/write_batch_internal.h index fce86e3..279d40c 100644 --- a/db/write_batch_internal.h +++ b/db/write_batch_internal.h @@ -17,10 +17,10 @@ class MemTable; class WriteBatchInternal { public: // Return the number of entries in the batch. - static int Count(const WriteBatch* batch); + static uint32_t Count(const WriteBatch* batch); // Set the count for the number of entries in the batch. - static void SetCount(WriteBatch* batch, int n); + static void SetCount(WriteBatch* batch, uint32_t n); // Return the sequence number for the start of this batch. static SequenceNumber Sequence(const WriteBatch* batch);