From 0c7cba1e230563ac772cac1bad1782ce973b0021 Mon Sep 17 00:00:00 2001 From: Wyatt Hepler Date: Fri, 8 Jul 2022 18:18:35 +0000 Subject: [PATCH] pw_kvs: Minor adjustments for -Weffc++ Make a few minor updates to pw_kvs to silence -Weffc++ warnings. Pigweed does not support -Weffc++ in general, since it enforces compliance with a style guide it does not follow. Fixes: b/234874590, b/234875054 Change-Id: I97a85ea175b5deb900de07c3095daee2116e2666 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/101301 Reviewed-by: Armando Montanez Commit-Queue: Auto-Submit Pigweed-Auto-Submit: Wyatt Hepler --- pw_kvs/public/pw_kvs/alignment.h | 3 +++ pw_kvs/public/pw_kvs/key_value_store.h | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pw_kvs/public/pw_kvs/alignment.h b/pw_kvs/public/pw_kvs/alignment.h index dc10838496..bdcd7e779d 100644 --- a/pw_kvs/public/pw_kvs/alignment.h +++ b/pw_kvs/public/pw_kvs/alignment.h @@ -57,6 +57,9 @@ class AlignedWriter { // TODO(hepler): Add DCHECK to ensure that buffer.size() >= alignment_bytes. } + AlignedWriter(const AlignedWriter&) = delete; + AlignedWriter& operator=(const AlignedWriter&) = delete; + ~AlignedWriter() { Flush().IgnoreError(); // TODO(pwbug/387): Handle Status properly } diff --git a/pw_kvs/public/pw_kvs/key_value_store.h b/pw_kvs/public/pw_kvs/key_value_store.h index affb43e9c2..476764129e 100644 --- a/pw_kvs/public/pw_kvs/key_value_store.h +++ b/pw_kvs/public/pw_kvs/key_value_store.h @@ -610,7 +610,10 @@ class KeyValueStoreBuffer : public KeyValueStore { sectors_, temp_sectors_to_skip_, key_descriptors_, - addresses_) { + addresses_), + sectors_(), + key_descriptors_(), + formats_() { std::copy(formats.begin(), formats.end(), formats_.begin()); }