diff --git a/src/ripple/app/ledger/impl/LedgerConsensusImp.cpp b/src/ripple/app/ledger/impl/LedgerConsensusImp.cpp index 785e4455bd..2e6e410b63 100644 --- a/src/ripple/app/ledger/impl/LedgerConsensusImp.cpp +++ b/src/ripple/app/ledger/impl/LedgerConsensusImp.cpp @@ -1782,7 +1782,6 @@ void LedgerConsensusImp::beginAccept (bool synchronous) JLOG (j_.fatal) << "We don't have a consensus set"; abort (); - return; } consensus_.newLCL (mPeerPositions.size (), mCurrentMSeconds); diff --git a/src/ripple/app/main/Application.cpp b/src/ripple/app/main/Application.cpp index 4a392460df..494a203d9d 100644 --- a/src/ripple/app/main/Application.cpp +++ b/src/ripple/app/main/Application.cpp @@ -1046,13 +1046,13 @@ void ApplicationImp::setup() if (!cluster_->load (config().section(SECTION_CLUSTER_NODES))) { m_journal.fatal << "Invalid entry in cluster configuration."; - throw std::exception(); + Throw(); } if (!validators_->load (config().section (SECTION_VALIDATORS))) { m_journal.fatal << "Invalid entry in validator configuration."; - throw std::exception(); + Throw(); } if (validators_->size () == 0 && !config_->RUN_STANDALONE) diff --git a/src/ripple/app/main/NodeIdentity.cpp b/src/ripple/app/main/NodeIdentity.cpp index 0c1b4c60f3..53e8c1ae55 100644 --- a/src/ripple/app/main/NodeIdentity.cpp +++ b/src/ripple/app/main/NodeIdentity.cpp @@ -38,7 +38,7 @@ loadNodeIdentity (Application& app) app.config().NODE_SEED); if (!seed) - throw std::runtime_error ( + Throw( "NodeIdentity: Bad [node_seed] specified"); auto secretKey = diff --git a/src/ripple/app/misc/Validations.cpp b/src/ripple/app/misc/Validations.cpp index 73b70a007e..856536529e 100644 --- a/src/ripple/app/misc/Validations.cpp +++ b/src/ripple/app/misc/Validations.cpp @@ -74,6 +74,7 @@ private: } public: + explicit ValidationsImp (Application& app) : app_ (app) , mValidations ("Validations", 4096, 600, stopwatch(), diff --git a/src/ripple/core/impl/Config.cpp b/src/ripple/core/impl/Config.cpp index 3f4b5edaca..741af1f16d 100644 --- a/src/ripple/core/impl/Config.cpp +++ b/src/ripple/core/impl/Config.cpp @@ -365,7 +365,7 @@ void Config::loadFromString (std::string const& fileContents) { auto const seed = parseBase58(strTemp); if (!seed) - throw std::runtime_error ( + Throw ( "Invalid seed specified in [" SECTION_VALIDATION_SEED "]"); VALIDATION_PRIV = generateSecretKey (KeyType::secp256k1, *seed); VALIDATION_PUB = derivePublicKey (KeyType::secp256k1, VALIDATION_PRIV); @@ -374,7 +374,7 @@ void Config::loadFromString (std::string const& fileContents) if (getSingleSection (secConfig, SECTION_NODE_SEED, NODE_SEED, j_)) { if (!parseBase58(NODE_SEED)) - throw std::runtime_error ( + Throw ( "Invalid seed specified in [" SECTION_NODE_SEED "]"); } diff --git a/src/ripple/core/tests/SociDB.test.cpp b/src/ripple/core/tests/SociDB.test.cpp index 12c6b5b644..7b09e9a813 100644 --- a/src/ripple/core/tests/SociDB.test.cpp +++ b/src/ripple/core/tests/SociDB.test.cpp @@ -341,7 +341,6 @@ public: ledgerHashes.emplace_back(lh); ledgerIndexes.emplace_back(i); } - std::string slh (lh); s << "INSERT INTO Ledgers (LedgerHash, LedgerSeq) VALUES " "(:lh, :li);", soci::use (ledgerHashes), soci::use (ledgerIndexes); diff --git a/src/ripple/json/impl/Writer.cpp b/src/ripple/json/impl/Writer.cpp index 417f0cf5fc..816322b0ec 100644 --- a/src/ripple/json/impl/Writer.cpp +++ b/src/ripple/json/impl/Writer.cpp @@ -76,6 +76,7 @@ size_t lengthWithoutTrailingZeros (std::string const& s) class Writer::Impl { public: + explicit Impl (Output const& output) : output_(output) {} ~Impl() = default; diff --git a/src/ripple/ledger/impl/ReadView.cpp b/src/ripple/ledger/impl/ReadView.cpp index 5b59ea51b2..e7b10b5cac 100644 --- a/src/ripple/ledger/impl/ReadView.cpp +++ b/src/ripple/ledger/impl/ReadView.cpp @@ -31,6 +31,7 @@ private: boost::optional digest_; public: + explicit Impl (DigestAwareReadView const& ledger) { auto const k = keylet::amendments(); diff --git a/src/ripple/ledger/impl/View.cpp b/src/ripple/ledger/impl/View.cpp index 7a6c136cc6..a1959b3d1f 100644 --- a/src/ripple/ledger/impl/View.cpp +++ b/src/ripple/ledger/impl/View.cpp @@ -1360,9 +1360,8 @@ rippleSend (ApplyView& view, if (uSenderID == issuer || uReceiverID == issuer || issuer == noAccount()) { - // VFALCO Why do we need this bCheckIssuer? // Direct send: redeeming IOUs and/or sending own IOUs. - terResult = rippleCredit (view, uSenderID, uReceiverID, saAmount, false, j); + rippleCredit (view, uSenderID, uReceiverID, saAmount, false, j); saActual = saAmount; terResult = tesSUCCESS; } diff --git a/src/ripple/net/impl/HTTPClient.cpp b/src/ripple/net/impl/HTTPClient.cpp index 2d2db74eed..7ea789cf55 100644 --- a/src/ripple/net/impl/HTTPClient.cpp +++ b/src/ripple/net/impl/HTTPClient.cpp @@ -40,6 +40,7 @@ namespace ripple { class HTTPClientSSLContext { public: + explicit HTTPClientSSLContext (Config const& config) : m_context (boost::asio::ssl::context::sslv23) , verify_ (config.SSL_VERIFY) diff --git a/src/ripple/overlay/impl/OverlayImpl.cpp b/src/ripple/overlay/impl/OverlayImpl.cpp index ab99bff629..2c9303b7d3 100644 --- a/src/ripple/overlay/impl/OverlayImpl.cpp +++ b/src/ripple/overlay/impl/OverlayImpl.cpp @@ -1066,7 +1066,7 @@ setup_Overlay (BasicConfig const& config) set (setup.ipLimit, "ip_limit", section); if (setup.ipLimit < 0) - throw std::runtime_error ("Configured IP limit is invalid"); + Throw ("Configured IP limit is invalid"); std::string ip; set (ip, "public_ip", section); diff --git a/src/ripple/protocol/impl/BuildInfo.cpp b/src/ripple/protocol/impl/BuildInfo.cpp index de47a6525f..61bcc5273d 100644 --- a/src/ripple/protocol/impl/BuildInfo.cpp +++ b/src/ripple/protocol/impl/BuildInfo.cpp @@ -132,10 +132,7 @@ std::string const& getFullVersionString () { struct PrettyPrinter { - PrettyPrinter () - { - fullVersionString = "rippled-" + getVersionString (); - } + PrettyPrinter () : fullVersionString ("rippled-" + getVersionString ()){} std::string fullVersionString; }; diff --git a/src/ripple/protocol/impl/STAccount.cpp b/src/ripple/protocol/impl/STAccount.cpp index f371c451ec..3127d64948 100644 --- a/src/ripple/protocol/impl/STAccount.cpp +++ b/src/ripple/protocol/impl/STAccount.cpp @@ -48,7 +48,7 @@ STAccount::STAccount (SField const& n, Buffer&& v) // which throws. If STVar can throw in its constructor, then so can // STAccount. if (v.size() != uint160::bytes) - throw std::runtime_error ("Invalid STAccount size"); + Throw ("Invalid STAccount size"); default_ = false; memcpy (value_.begin(), v.data (), uint160::bytes); diff --git a/src/ripple/rpc/impl/Handler.cpp b/src/ripple/rpc/impl/Handler.cpp index fdca94dd3b..2ac5c3d69e 100644 --- a/src/ripple/rpc/impl/Handler.cpp +++ b/src/ripple/rpc/impl/Handler.cpp @@ -59,6 +59,7 @@ Status handle (Context& context, Object& object) class HandlerTable { public: template + explicit HandlerTable (const Handler(&entries)[N]) { for (std::size_t i = 0; i < N; ++i) diff --git a/src/ripple/rpc/impl/Status.cpp b/src/ripple/rpc/impl/Status.cpp index 1e415fb543..167d088950 100644 --- a/src/ripple/rpc/impl/Status.cpp +++ b/src/ripple/rpc/impl/Status.cpp @@ -54,8 +54,6 @@ std::string Status::codeString () const void Status::fillJson (Json::Value& value) { - static const std::string separator = ": "; - if (!*this) return; diff --git a/src/ripple/shamap/impl/SHAMapTreeNode.cpp b/src/ripple/shamap/impl/SHAMapTreeNode.cpp index 7e48190d55..de81061650 100644 --- a/src/ripple/shamap/impl/SHAMapTreeNode.cpp +++ b/src/ripple/shamap/impl/SHAMapTreeNode.cpp @@ -147,7 +147,7 @@ SHAMapAbstractNode::make(Blob const& rawNode, std::uint32_t seq, SHANodeFormat f if (! s.get8 (pos, 32 + (i * 33))) Throw ("short CI node"); if ((pos < 0) || (pos >= 16)) - Throw ("invalid CI node"); + Throw ("invalid CI node"); s.get256 (ret->mHashes[pos].as_uint256(), i * 33); if (ret->mHashes[pos].isNonZero ()) ret->mIsBranch |= (1 << pos);