diff options
author | Danny Al-Gaaf <danny.al-gaaf@bisect.de> | 2018-04-25 09:30:56 +0200 |
---|---|---|
committer | Danny Al-Gaaf <danny.al-gaaf@bisect.de> | 2018-05-02 17:01:58 +0200 |
commit | 39ffec281af577c766c619d568f7a7051d108b00 (patch) | |
tree | 79c527cc3871b9b113f1aabffb3cef9647ebb7be /src/kv | |
parent | Merge PR #21762 into master (diff) | |
download | ceph-39ffec281af577c766c619d568f7a7051d108b00.tar.xz ceph-39ffec281af577c766c619d568f7a7051d108b00.zip |
misc: mark constructors as explicit
Set 218 constructors as explicit to avoid implicit usage.
Fix for cppcheck warning:
Class has a constructor with 1 argument that is
not explicit. Such constructors should in general be explicit for
type safety reasons. Using the explicit keyword in the constructor
means some mistakes when using the class can be avoided.
For more information check:
https://www.codeproject.com/Articles/28663/Explicit-Constructor-in-C
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Diffstat (limited to 'src/kv')
-rw-r--r-- | src/kv/MemDB.h | 2 | ||||
-rw-r--r-- | src/kv/RocksDBStore.cc | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/kv/MemDB.h b/src/kv/MemDB.h index e2fa40a2086..16b4aed8dd1 100644 --- a/src/kv/MemDB.h +++ b/src/kv/MemDB.h @@ -98,7 +98,7 @@ public: void clear() { ops.clear(); } - MDBTransactionImpl(MemDB* _db) :m_db(_db) + explicit MDBTransactionImpl(MemDB* _db) :m_db(_db) { ops.clear(); } diff --git a/src/kv/RocksDBStore.cc b/src/kv/RocksDBStore.cc index 7f72e23ed03..ee276e2582a 100644 --- a/src/kv/RocksDBStore.cc +++ b/src/kv/RocksDBStore.cc @@ -85,7 +85,7 @@ public: return store.assoc_name.c_str(); } - MergeOperatorRouter(RocksDBStore &_store) : store(_store) {} + explicit MergeOperatorRouter(RocksDBStore &_store) : store(_store) {} bool Merge(const rocksdb::Slice& key, const rocksdb::Slice* existing_value, @@ -124,7 +124,7 @@ class RocksDBStore::MergeOperatorLinker private: std::shared_ptr<KeyValueDB::MergeOperator> mop; public: - MergeOperatorLinker(const std::shared_ptr<KeyValueDB::MergeOperator> &o) : mop(o) {} + explicit MergeOperatorLinker(const std::shared_ptr<KeyValueDB::MergeOperator> &o) : mop(o) {} const char *Name() const override { return mop->name().c_str(); |