Skip to content

Commit

Permalink
Fix compiler warnings under gcc.
Browse files Browse the repository at this point in the history
  • Loading branch information
rec committed Sep 30, 2014
1 parent 2936bbf commit 389b689
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 28 deletions.
7 changes: 2 additions & 5 deletions src/beast/beast/module/sqdb/source/session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down Expand Up @@ -67,10 +67,7 @@ class session::Sqlite3
public:
Sqlite3()
{
int threadSafe = sqlite3_threadsafe();

assert (threadSafe != 0);

assert (sqlite3_threadsafe() != 0);

This comment has been minimized.

Copy link
@miguelportilla

miguelportilla Sep 30, 2014

In a release build sqlite3_threadsafe() will not be called. This 'should' be okay as debug builds will let us know if we are using the wrong sqlite build.

sqlite3_initialize();
}

Expand Down
10 changes: 5 additions & 5 deletions src/ripple/app/peers/UniqueNodeList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ class UniqueNodeListImp
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 ();
Expand Down Expand Up @@ -1232,9 +1232,9 @@ class UniqueNodeListImp

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;
Expand Down Expand Up @@ -1347,9 +1347,9 @@ class UniqueNodeListImp
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;
Expand Down
24 changes: 12 additions & 12 deletions src/ripple/peerfinder/impl/Logic.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -105,7 +105,7 @@ class Logic
// 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;
Expand Down Expand Up @@ -400,8 +400,8 @@ class Logic
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";
Expand Down Expand Up @@ -572,7 +572,7 @@ class Logic
((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 ());
Expand Down Expand Up @@ -603,15 +603,15 @@ class Logic
"Logic testing " << ep.address << " already in progress";
continue;
}

if (! slot->checked)
{
// Mark that a check for this slot is now in progress.
slot->connectivityCheckInProgress = true;

// 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));
Expand All @@ -623,7 +623,7 @@ class Logic

continue;
}

// If they failed the test then skip the address
if (! slot->canAccept)
continue;
Expand Down Expand Up @@ -982,7 +982,7 @@ class Logic
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))
Expand Down Expand Up @@ -1104,7 +1104,7 @@ class Logic
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
Expand Down Expand Up @@ -1141,7 +1141,7 @@ class Logic
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);
Expand Down Expand Up @@ -1169,7 +1169,7 @@ class Logic
item ["fixed"] = "yes";
if (slot.cluster())
item ["cluster"] = "yes";

item ["state"] = stateString (slot.state());
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/ripple/rpc/handlers/AccountOffers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand All @@ -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 ||
Expand Down Expand Up @@ -125,7 +125,7 @@ Json::Value doAccountOffers (RPC::Context& context)

if (!resume && resumeSeq == seq)
resume = true;

if (resume)
{
if (i < limit)
Expand All @@ -149,7 +149,7 @@ Json::Value doAccountOffers (RPC::Context& context)
marker[jss::account_index] = strHex(
ownerDir->getFieldU64 (sfIndexPrevious));

process = false;
process = false;

This comment has been minimized.

Copy link
@miguelportilla

miguelportilla Sep 30, 2014

XRPLF#579 will be merged at the same time making these changes obsolete.

break;
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/ripple/types/impl/Base58.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

1 comment on commit 389b689

@vinniefalco
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍
Approved-By: @vinniefalco

Please sign in to comment.