From ba6ee1f74984c76ee3668005b354deadf103337f Mon Sep 17 00:00:00 2001 From: Fosco Marotto Date: Wed, 14 Feb 2018 11:08:39 -0800 Subject: [PATCH] Fix 2 more unused reference errors VS2017 Summary: As in #3425 Closes https://github.com/facebook/rocksdb/pull/3497 Differential Revision: D6979588 Pulled By: gfosco fbshipit-source-id: e9fb32d04ad45575dfe9de1d79348d158e474197 --- db/memtable.cc | 3 ++- db/write_batch.cc | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/db/memtable.cc b/db/memtable.cc index 0d0e230cd..4aaffde25 100644 --- a/db/memtable.cc +++ b/db/memtable.cc @@ -834,7 +834,8 @@ void MemTable::Update(SequenceNumber seq, } // key doesn't exist - bool add_res __attribute__((__unused__)) = Add(seq, kTypeValue, key, value); + bool add_res __attribute__((__unused__)); + add_res = Add(seq, kTypeValue, key, value); // We already checked unused != seq above. In that case, Add should not fail. assert(add_res); } diff --git a/db/write_batch.cc b/db/write_batch.cc index e5072b1d2..ce8d9ee64 100644 --- a/db/write_batch.cc +++ b/db/write_batch.cc @@ -1199,13 +1199,15 @@ class MemTableInserter : public WriteBatch::Handler { value, &merged_value); if (status == UpdateStatus::UPDATED_INPLACE) { // prev_value is updated in-place with final value. - bool mem_res __attribute__((__unused__)) = mem->Add( + bool mem_res __attribute__((__unused__)); + mem_res = mem->Add( sequence_, value_type, key, Slice(prev_buffer, prev_size)); assert(mem_res); RecordTick(moptions->statistics, NUMBER_KEYS_WRITTEN); } else if (status == UpdateStatus::UPDATED) { // merged_value contains the final value. - bool mem_res __attribute__((__unused__)) = + bool mem_res __attribute__((__unused__)); + mem_res = mem->Add(sequence_, value_type, key, Slice(merged_value)); assert(mem_res); RecordTick(moptions->statistics, NUMBER_KEYS_WRITTEN);