From b958fa413e8eea83cb987d94971d9a7b57537655 Mon Sep 17 00:00:00 2001 From: Brad Chase Date: Tue, 21 Mar 2017 19:14:07 -0400 Subject: [PATCH] Fix may be used uninitialized warnings --- src/ripple/app/ledger/impl/LedgerCleaner.cpp | 4 ++-- src/ripple/rpc/impl/RPCHandler.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ripple/app/ledger/impl/LedgerCleaner.cpp b/src/ripple/app/ledger/impl/LedgerCleaner.cpp index 7951c3ab01..f132c28cbb 100644 --- a/src/ripple/app/ledger/impl/LedgerCleaner.cpp +++ b/src/ripple/app/ledger/impl/LedgerCleaner.cpp @@ -151,8 +151,8 @@ public: void doClean (Json::Value const& params) override { - LedgerIndex minRange; - LedgerIndex maxRange; + LedgerIndex minRange = 0; + LedgerIndex maxRange = 0; app_.getLedgerMaster().getFullValidatedRange (minRange, maxRange); { diff --git a/src/ripple/rpc/impl/RPCHandler.cpp b/src/ripple/rpc/impl/RPCHandler.cpp index acb5caf94f..0e35a621f9 100644 --- a/src/ripple/rpc/impl/RPCHandler.cpp +++ b/src/ripple/rpc/impl/RPCHandler.cpp @@ -110,7 +110,7 @@ namespace { */ error_code_i fillHandler (Context& context, - boost::optional& result) + Handler const * & result) { if (! isUnlimited (context.role)) { @@ -184,7 +184,7 @@ error_code_i fillHandler (Context& context, return rpcNO_CLOSED; } - result = *handler; + result = handler; return rpcSUCCESS; } @@ -232,7 +232,7 @@ void getResult ( Status doCommand ( RPC::Context& context, Json::Value& result) { - boost::optional handler; + Handler const * handler = nullptr; if (auto error = fillHandler (context, handler)) { inject_error (error, result);