mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Fix compiler warnings under gcc.
This commit is contained in:
committed by
Vinnie Falco
parent
616be1d76c
commit
6069400538
@@ -15,7 +15,7 @@
|
|||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
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/
|
SOCI: http://soci.sourceforge.net/
|
||||||
|
|
||||||
@@ -67,10 +67,7 @@ class session::Sqlite3
|
|||||||
public:
|
public:
|
||||||
Sqlite3()
|
Sqlite3()
|
||||||
{
|
{
|
||||||
int threadSafe = sqlite3_threadsafe();
|
assert (sqlite3_threadsafe() != 0);
|
||||||
|
|
||||||
assert (threadSafe != 0);
|
|
||||||
|
|
||||||
sqlite3_initialize();
|
sqlite3_initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -654,7 +654,7 @@ private:
|
|||||||
auto sl (getApp().getWalletDB ().lock ());
|
auto sl (getApp().getWalletDB ().lock ());
|
||||||
auto db = getApp().getWalletDB ().getDB ();
|
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;
|
return false;
|
||||||
|
|
||||||
bool const bAvail = db->startIterRows ();
|
bool const bAvail = db->startIterRows ();
|
||||||
@@ -1232,9 +1232,9 @@ private:
|
|||||||
|
|
||||||
seedDomain sdCurrent;
|
seedDomain sdCurrent;
|
||||||
|
|
||||||
bool bFound = getSeedDomains (strDomain, sdCurrent);
|
bool bFound = getSeedDomains (strDomain, sdCurrent);
|
||||||
|
|
||||||
assert (bFound);
|
assert (bFound);
|
||||||
|
(void) bFound;
|
||||||
|
|
||||||
uint256 iSha256 = Serializer::getSHA512Half (strSiteFile);
|
uint256 iSha256 = Serializer::getSHA512Half (strSiteFile);
|
||||||
bool bChangedB = sdCurrent.iSha256 != iSha256;
|
bool bChangedB = sdCurrent.iSha256 != iSha256;
|
||||||
@@ -1347,9 +1347,9 @@ private:
|
|||||||
mtpFetchNext = boost::posix_time::ptime (boost::posix_time::not_a_date_time);
|
mtpFetchNext = boost::posix_time::ptime (boost::posix_time::not_a_date_time);
|
||||||
|
|
||||||
seedDomain sdCurrent;
|
seedDomain sdCurrent;
|
||||||
bool bFound = getSeedDomains (strDomain, sdCurrent);
|
bool bFound = getSeedDomains (strDomain, sdCurrent);
|
||||||
|
|
||||||
assert (bFound);
|
assert (bFound);
|
||||||
|
(void) bFound;
|
||||||
|
|
||||||
// Update time of next fetch and this scan attempt.
|
// Update time of next fetch and this scan attempt.
|
||||||
sdCurrent.tpScan = tpNow;
|
sdCurrent.tpScan = tpNow;
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ class Logic
|
|||||||
public:
|
public:
|
||||||
// Maps remote endpoints to slots. Since a slot has a
|
// Maps remote endpoints to slots. Since a slot has a
|
||||||
// remote endpoint upon construction, this holds all counts.
|
// remote endpoint upon construction, this holds all counts.
|
||||||
//
|
//
|
||||||
typedef std::map <beast::IP::Endpoint,
|
typedef std::map <beast::IP::Endpoint,
|
||||||
std::shared_ptr <SlotImp>> Slots;
|
std::shared_ptr <SlotImp>> Slots;
|
||||||
|
|
||||||
@@ -105,7 +105,7 @@ public:
|
|||||||
// The addresses (but not port) we are connected to. This includes
|
// The addresses (but not port) we are connected to. This includes
|
||||||
// outgoing connection attempts. Note that this set can contain
|
// outgoing connection attempts. Note that this set can contain
|
||||||
// duplicates (since the port is not set)
|
// duplicates (since the port is not set)
|
||||||
ConnectedAddresses connected_addresses;
|
ConnectedAddresses connected_addresses;
|
||||||
|
|
||||||
// Set of public keys belonging to active peers
|
// Set of public keys belonging to active peers
|
||||||
Keys keys;
|
Keys keys;
|
||||||
@@ -400,8 +400,8 @@ public:
|
|||||||
auto const iter (state->slots.find (local_endpoint));
|
auto const iter (state->slots.find (local_endpoint));
|
||||||
if (iter != state->slots.end ())
|
if (iter != state->slots.end ())
|
||||||
{
|
{
|
||||||
Slot::ptr const& self (iter->second);
|
assert (iter->second->local_endpoint ()
|
||||||
assert (self->local_endpoint () == slot->remote_endpoint ());
|
== slot->remote_endpoint ());
|
||||||
if (m_journal.warning) m_journal.warning << beast::leftw (18) <<
|
if (m_journal.warning) m_journal.warning << beast::leftw (18) <<
|
||||||
"Logic dropping " << slot->remote_endpoint () <<
|
"Logic dropping " << slot->remote_endpoint () <<
|
||||||
" as self connect";
|
" as self connect";
|
||||||
@@ -572,7 +572,7 @@ public:
|
|||||||
((list.size() > 1) ? " entries" : " entry");
|
((list.size() > 1) ? " entries" : " entry");
|
||||||
|
|
||||||
SharedState::Access state (m_state);
|
SharedState::Access state (m_state);
|
||||||
|
|
||||||
// The object must exist in our table
|
// The object must exist in our table
|
||||||
assert (state->slots.find (slot->remote_endpoint ()) !=
|
assert (state->slots.find (slot->remote_endpoint ()) !=
|
||||||
state->slots.end ());
|
state->slots.end ());
|
||||||
@@ -603,7 +603,7 @@ public:
|
|||||||
"Logic testing " << ep.address << " already in progress";
|
"Logic testing " << ep.address << " already in progress";
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! slot->checked)
|
if (! slot->checked)
|
||||||
{
|
{
|
||||||
// Mark that a check for this slot is now in progress.
|
// Mark that a check for this slot is now in progress.
|
||||||
@@ -611,7 +611,7 @@ public:
|
|||||||
|
|
||||||
// Test the slot's listening port before
|
// Test the slot's listening port before
|
||||||
// adding it to the livecache for the first time.
|
// adding it to the livecache for the first time.
|
||||||
//
|
//
|
||||||
m_checker.async_test (ep.address, std::bind (
|
m_checker.async_test (ep.address, std::bind (
|
||||||
&Logic::checkComplete, this, slot->remote_endpoint (),
|
&Logic::checkComplete, this, slot->remote_endpoint (),
|
||||||
ep.address, std::placeholders::_1));
|
ep.address, std::placeholders::_1));
|
||||||
@@ -623,7 +623,7 @@ public:
|
|||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If they failed the test then skip the address
|
// If they failed the test then skip the address
|
||||||
if (! slot->canAccept)
|
if (! slot->canAccept)
|
||||||
continue;
|
continue;
|
||||||
@@ -982,7 +982,7 @@ public:
|
|||||||
int addBootcacheAddresses (IPAddresses const& list)
|
int addBootcacheAddresses (IPAddresses const& list)
|
||||||
{
|
{
|
||||||
int count (0);
|
int count (0);
|
||||||
SharedState::Access state (m_state);
|
SharedState::Access state (m_state);
|
||||||
for (auto addr : list)
|
for (auto addr : list)
|
||||||
{
|
{
|
||||||
if (addBootcacheAddress (addr, state))
|
if (addBootcacheAddress (addr, state))
|
||||||
@@ -1104,7 +1104,7 @@ public:
|
|||||||
targets.emplace_back (slot);
|
targets.emplace_back (slot);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/* VFALCO NOTE
|
/* VFALCO NOTE
|
||||||
This is a temporary measure. Once we know our own IP
|
This is a temporary measure. Once we know our own IP
|
||||||
address, the correct solution is to put it into the Livecache
|
address, the correct solution is to put it into the Livecache
|
||||||
@@ -1141,7 +1141,7 @@ public:
|
|||||||
SlotImp::ptr const& slot (t.slot());
|
SlotImp::ptr const& slot (t.slot());
|
||||||
auto const& list (t.list());
|
auto const& list (t.list());
|
||||||
if (m_journal.trace) m_journal.trace << beast::leftw (18) <<
|
if (m_journal.trace) m_journal.trace << beast::leftw (18) <<
|
||||||
"Logic sending " << slot->remote_endpoint() <<
|
"Logic sending " << slot->remote_endpoint() <<
|
||||||
" with " << list.size() <<
|
" with " << list.size() <<
|
||||||
((list.size() == 1) ? " endpoint" : " endpoints");
|
((list.size() == 1) ? " endpoint" : " endpoints");
|
||||||
m_callback.send (slot, list);
|
m_callback.send (slot, list);
|
||||||
@@ -1169,7 +1169,7 @@ public:
|
|||||||
item ["fixed"] = "yes";
|
item ["fixed"] = "yes";
|
||||||
if (slot.cluster())
|
if (slot.cluster())
|
||||||
item ["cluster"] = "yes";
|
item ["cluster"] = "yes";
|
||||||
|
|
||||||
item ["state"] = stateString (slot.state());
|
item ["state"] = stateString (slot.state());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ Json::Value doAccountOffers (RPC::Context& context)
|
|||||||
|
|
||||||
if (! ledger->hasAccount (raAccount))
|
if (! ledger->hasAccount (raAccount))
|
||||||
return rpcError (rpcACT_NOT_FOUND);
|
return rpcError (rpcACT_NOT_FOUND);
|
||||||
|
|
||||||
unsigned int limit;
|
unsigned int limit;
|
||||||
if (params.isMember (jss::limit))
|
if (params.isMember (jss::limit))
|
||||||
{
|
{
|
||||||
@@ -75,14 +75,14 @@ Json::Value doAccountOffers (RPC::Context& context)
|
|||||||
{
|
{
|
||||||
limit = RPC::Tuning::defaultOffersPerRequest;
|
limit = RPC::Tuning::defaultOffersPerRequest;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint256 const rootIndex (Ledger::getOwnerDirIndex (raAccount.getAccountID ()));
|
uint256 const rootIndex (Ledger::getOwnerDirIndex (raAccount.getAccountID ()));
|
||||||
std::uint32_t resumeSeq;
|
std::uint32_t resumeSeq = 0;
|
||||||
uint256 currentIndex;
|
uint256 currentIndex;
|
||||||
bool resume (true);
|
bool resume (true);
|
||||||
|
|
||||||
if (params.isMember (jss::marker))
|
if (params.isMember (jss::marker))
|
||||||
{
|
{
|
||||||
Json::Value const& marker (params[jss::marker]);
|
Json::Value const& marker (params[jss::marker]);
|
||||||
|
|
||||||
if (! marker.isObject () || marker.size () != 2 ||
|
if (! marker.isObject () || marker.size () != 2 ||
|
||||||
@@ -125,7 +125,7 @@ Json::Value doAccountOffers (RPC::Context& context)
|
|||||||
|
|
||||||
if (!resume && resumeSeq == seq)
|
if (!resume && resumeSeq == seq)
|
||||||
resume = true;
|
resume = true;
|
||||||
|
|
||||||
if (resume)
|
if (resume)
|
||||||
{
|
{
|
||||||
if (i < limit)
|
if (i < limit)
|
||||||
@@ -149,7 +149,7 @@ Json::Value doAccountOffers (RPC::Context& context)
|
|||||||
marker[jss::account_index] = strHex(
|
marker[jss::account_index] = strHex(
|
||||||
ownerDir->getFieldU64 (sfIndexPrevious));
|
ownerDir->getFieldU64 (sfIndexPrevious));
|
||||||
|
|
||||||
process = false;
|
process = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -115,7 +115,9 @@ bool Base58::raw_decode (char const* first, char const* last, void* dest,
|
|||||||
bnChar.setuint ((unsigned int) i);
|
bnChar.setuint ((unsigned int) i);
|
||||||
|
|
||||||
int const success (BN_mul (&bn, &bn, &bn58, pctx));
|
int const success (BN_mul (&bn, &bn, &bn58, pctx));
|
||||||
|
|
||||||
assert (success);
|
assert (success);
|
||||||
|
(void) success;
|
||||||
|
|
||||||
bn += bnChar;
|
bn += bnChar;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user