Fix compiler warnings under gcc.

This commit is contained in:
Tom Ritchford
2014-09-30 10:37:33 -04:00
committed by Vinnie Falco
parent 616be1d76c
commit 6069400538
5 changed files with 27 additions and 28 deletions

View File

@@ -15,7 +15,7 @@
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Portions based on SOCI - The C++ Database Access Library:
Portions based on SOCI - The C++ Database Access Library:
SOCI: http://soci.sourceforge.net/
@@ -67,10 +67,7 @@ class session::Sqlite3
public:
Sqlite3()
{
int threadSafe = sqlite3_threadsafe();
assert (threadSafe != 0);
assert (sqlite3_threadsafe() != 0);
sqlite3_initialize();
}

View File

@@ -654,7 +654,7 @@ private:
auto sl (getApp().getWalletDB ().lock ());
auto db = getApp().getWalletDB ().getDB ();
if (!db->executeSQL ("SELECT * FROM Misc WHERE Magic=1;"))
if (!db->executeSQL ("SELECT * FROM Misc WHERE Magic=1;"))
return false;
bool const bAvail = db->startIterRows ();
@@ -1232,9 +1232,9 @@ private:
seedDomain sdCurrent;
bool bFound = getSeedDomains (strDomain, sdCurrent);
bool bFound = getSeedDomains (strDomain, sdCurrent);
assert (bFound);
(void) bFound;
uint256 iSha256 = Serializer::getSHA512Half (strSiteFile);
bool bChangedB = sdCurrent.iSha256 != iSha256;
@@ -1347,9 +1347,9 @@ private:
mtpFetchNext = boost::posix_time::ptime (boost::posix_time::not_a_date_time);
seedDomain sdCurrent;
bool bFound = getSeedDomains (strDomain, sdCurrent);
bool bFound = getSeedDomains (strDomain, sdCurrent);
assert (bFound);
(void) bFound;
// Update time of next fetch and this scan attempt.
sdCurrent.tpScan = tpNow;

View File

@@ -49,7 +49,7 @@ class Logic
public:
// Maps remote endpoints to slots. Since a slot has a
// remote endpoint upon construction, this holds all counts.
//
//
typedef std::map <beast::IP::Endpoint,
std::shared_ptr <SlotImp>> Slots;
@@ -105,7 +105,7 @@ public:
// The addresses (but not port) we are connected to. This includes
// outgoing connection attempts. Note that this set can contain
// duplicates (since the port is not set)
ConnectedAddresses connected_addresses;
ConnectedAddresses connected_addresses;
// Set of public keys belonging to active peers
Keys keys;
@@ -400,8 +400,8 @@ public:
auto const iter (state->slots.find (local_endpoint));
if (iter != state->slots.end ())
{
Slot::ptr const& self (iter->second);
assert (self->local_endpoint () == slot->remote_endpoint ());
assert (iter->second->local_endpoint ()
== slot->remote_endpoint ());
if (m_journal.warning) m_journal.warning << beast::leftw (18) <<
"Logic dropping " << slot->remote_endpoint () <<
" as self connect";
@@ -572,7 +572,7 @@ public:
((list.size() > 1) ? " entries" : " entry");
SharedState::Access state (m_state);
// The object must exist in our table
assert (state->slots.find (slot->remote_endpoint ()) !=
state->slots.end ());
@@ -603,7 +603,7 @@ public:
"Logic testing " << ep.address << " already in progress";
continue;
}
if (! slot->checked)
{
// Mark that a check for this slot is now in progress.
@@ -611,7 +611,7 @@ public:
// Test the slot's listening port before
// adding it to the livecache for the first time.
//
//
m_checker.async_test (ep.address, std::bind (
&Logic::checkComplete, this, slot->remote_endpoint (),
ep.address, std::placeholders::_1));
@@ -623,7 +623,7 @@ public:
continue;
}
// If they failed the test then skip the address
if (! slot->canAccept)
continue;
@@ -982,7 +982,7 @@ public:
int addBootcacheAddresses (IPAddresses const& list)
{
int count (0);
SharedState::Access state (m_state);
SharedState::Access state (m_state);
for (auto addr : list)
{
if (addBootcacheAddress (addr, state))
@@ -1104,7 +1104,7 @@ public:
targets.emplace_back (slot);
});
}
/* VFALCO NOTE
This is a temporary measure. Once we know our own IP
address, the correct solution is to put it into the Livecache
@@ -1141,7 +1141,7 @@ public:
SlotImp::ptr const& slot (t.slot());
auto const& list (t.list());
if (m_journal.trace) m_journal.trace << beast::leftw (18) <<
"Logic sending " << slot->remote_endpoint() <<
"Logic sending " << slot->remote_endpoint() <<
" with " << list.size() <<
((list.size() == 1) ? " endpoint" : " endpoints");
m_callback.send (slot, list);
@@ -1169,7 +1169,7 @@ public:
item ["fixed"] = "yes";
if (slot.cluster())
item ["cluster"] = "yes";
item ["state"] = stateString (slot.state());
}
}

View File

@@ -63,7 +63,7 @@ Json::Value doAccountOffers (RPC::Context& context)
if (! ledger->hasAccount (raAccount))
return rpcError (rpcACT_NOT_FOUND);
unsigned int limit;
if (params.isMember (jss::limit))
{
@@ -75,14 +75,14 @@ Json::Value doAccountOffers (RPC::Context& context)
{
limit = RPC::Tuning::defaultOffersPerRequest;
}
uint256 const rootIndex (Ledger::getOwnerDirIndex (raAccount.getAccountID ()));
std::uint32_t resumeSeq;
std::uint32_t resumeSeq = 0;
uint256 currentIndex;
bool resume (true);
if (params.isMember (jss::marker))
{
{
Json::Value const& marker (params[jss::marker]);
if (! marker.isObject () || marker.size () != 2 ||
@@ -125,7 +125,7 @@ Json::Value doAccountOffers (RPC::Context& context)
if (!resume && resumeSeq == seq)
resume = true;
if (resume)
{
if (i < limit)
@@ -149,7 +149,7 @@ Json::Value doAccountOffers (RPC::Context& context)
marker[jss::account_index] = strHex(
ownerDir->getFieldU64 (sfIndexPrevious));
process = false;
process = false;
break;
}
}

View File

@@ -115,7 +115,9 @@ bool Base58::raw_decode (char const* first, char const* last, void* dest,
bnChar.setuint ((unsigned int) i);
int const success (BN_mul (&bn, &bn, &bn58, pctx));
assert (success);
(void) success;
bn += bnChar;
}