diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-08-17 22:59:56 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-08-18 09:01:16 +0200 |
commit | 4afb5aa9e173991548be3627c6df258368d95ff3 (patch) | |
tree | 8d8523dd68167f9a6299dd92cc9dd5e0fd162b23 /src/rpc | |
parent | 22e301a3d56dc9e6878380ee92c7d19ca43119d2 (diff) | |
parent | 64fb0ac016c7fd01c60c39af60f6431bac57f9ee (diff) |
Merge #10969: Declare single-argument (non-converting) constructors "explicit"
64fb0ac Declare single-argument (non-converting) constructors "explicit" (practicalswift)
Pull request description:
Declare single-argument (non-converting) constructors `explicit`.
In order to avoid unintended implicit conversions.
For a more thorough discussion, see ["C.46: By default, declare single-argument constructors explicit"](http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c46-by-default-declare-single-argument-constructors-explicit) in the C++ Core Guidelines (Stroustrup & Sutter).
Tree-SHA512: e0c6922e56b11fa402621a38656d8b1122d16dd8f160e78626385373cf184ac7f26cb4c1851eca47e9b0dbd5e924e39a85c3cbdcb627a05ee3a655ecf5f7a0f1
Diffstat (limited to 'src/rpc')
-rw-r--r-- | src/rpc/mining.cpp | 2 | ||||
-rw-r--r-- | src/rpc/misc.cpp | 2 | ||||
-rw-r--r-- | src/rpc/server.h | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index f498b5c8ea..652d886c7e 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -686,7 +686,7 @@ public: bool found; CValidationState state; - submitblock_StateCatcher(const uint256 &hashIn) : hash(hashIn), found(false), state() {} + explicit submitblock_StateCatcher(const uint256 &hashIn) : hash(hashIn), found(false), state() {} protected: void BlockChecked(const CBlock& block, const CValidationState& stateIn) override { diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp index efff4a99ae..1dd660eb8f 100644 --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -125,7 +125,7 @@ class DescribeAddressVisitor : public boost::static_visitor<UniValue> public: CWallet * const pwallet; - DescribeAddressVisitor(CWallet *_pwallet) : pwallet(_pwallet) {} + explicit DescribeAddressVisitor(CWallet *_pwallet) : pwallet(_pwallet) {} UniValue operator()(const CNoDestination &dest) const { return UniValue(UniValue::VOBJ); } diff --git a/src/rpc/server.h b/src/rpc/server.h index dd6f763245..89b1d169d5 100644 --- a/src/rpc/server.h +++ b/src/rpc/server.h @@ -31,7 +31,7 @@ namespace RPCServer /** Wrapper for UniValue::VType, which includes typeAny: * Used to denote don't care type. Only used by RPCTypeCheckObj */ struct UniValueType { - UniValueType(UniValue::VType _type) : typeAny(false), type(_type) {} + explicit UniValueType(UniValue::VType _type) : typeAny(false), type(_type) {} UniValueType() : typeAny(true) {} bool typeAny; UniValue::VType type; |