diff --git a/db/db_bench.cc b/db/db_bench.cc index f9403f4..41e903b 100644 --- a/db/db_bench.cc +++ b/db/db_bench.cc @@ -304,10 +304,7 @@ struct ThreadState { Stats stats; SharedState* shared; - ThreadState(int index) - : tid(index), - rand(1000 + index) { - } + ThreadState(int index) : tid(index), rand(1000 + index), shared(nullptr) {} }; } // namespace diff --git a/db/db_impl.cc b/db/db_impl.cc index 3468862..caef2b1 100644 --- a/db/db_impl.cc +++ b/db/db_impl.cc @@ -48,7 +48,8 @@ struct DBImpl::Writer { bool done; port::CondVar cv; - explicit Writer(port::Mutex* mu) : cv(mu) { } + explicit Writer(port::Mutex* mu) + : batch(nullptr), sync(false), done(false), cv(mu) {} }; struct DBImpl::CompactionState { @@ -78,10 +79,10 @@ struct DBImpl::CompactionState { explicit CompactionState(Compaction* c) : compaction(c), + smallest_snapshot(0), outfile(nullptr), builder(nullptr), - total_bytes(0) { - } + total_bytes(0) {} }; // Fix user-supplied options to be reasonable diff --git a/util/cache.cc b/util/cache.cc index 7cc2cea..25b51b5 100644 --- a/util/cache.cc +++ b/util/cache.cc @@ -196,8 +196,7 @@ class LRUCache { HandleTable table_ GUARDED_BY(mutex_); }; -LRUCache::LRUCache() - : usage_(0) { +LRUCache::LRUCache() : capacity_(0), usage_(0) { // Make empty circular linked lists. lru_.next = &lru_; lru_.prev = &lru_;