* Remove is_bit_set and use regular bitwise operations instead.
* Remove the function-like macro "nothing".
This commit is contained in:
Nik Bougalis
2014-06-16 01:25:09 -07:00
parent c8ee6c6f6d
commit 04dd861fe3
34 changed files with 193 additions and 251 deletions

View File

@@ -140,13 +140,13 @@ TER PathState::pushNode (
auto const& previousNode = bFirst ? path::Node () : nodes_.back ();
// true, iff node is a ripple account. false, iff node is an offer node.
const bool bAccount = is_bit_set (iType, STPathElement::typeAccount);
const bool bAccount (iType & STPathElement::typeAccount);
// Is currency specified for the output of the current node?
const bool bCurrency = is_bit_set (iType, STPathElement::typeCurrency);
const bool bCurrency (iType & STPathElement::typeCurrency);
// Issuer is specified for the output of the current node.
const bool bIssuer = is_bit_set (iType, STPathElement::typeIssuer);
const bool bIssuer (iType & STPathElement::typeIssuer);
TER resultCode = tesSUCCESS;
@@ -206,8 +206,6 @@ TER PathState::pushNode (
if (bFirst)
{
// The first node is always correct as is.
nothing ();
}
else if (!uAccountID)
{
@@ -273,8 +271,8 @@ TER PathState::pushNode (
resultCode = terNO_ACCOUNT;
}
else if ((is_bit_set (sleBck->getFieldU32 (sfFlags), lsfRequireAuth)
&& !is_bit_set (sleRippleState->getFieldU32 (sfFlags), (bHigh ? lsfHighAuth : lsfLowAuth)))
else if (sleBck->getFieldU32 (sfFlags) & lsfRequireAuth
&& !(sleRippleState->getFieldU32 (sfFlags) & (bHigh ? lsfHighAuth : lsfLowAuth))
&& sleRippleState->getFieldAmount(sfBalance) == zero) // CHECKME
{
WriteLog (lsWARNING, RippleCalc) << "pushNode: delay: can't receive IOUs from issuer without auth.";
@@ -559,10 +557,10 @@ void PathState::checkNoRipple (
terStatus = terNO_LINE;
}
else if (
is_bit_set (sleIn->getFieldU32 (sfFlags),
(secondAccount > firstAccount) ? lsfHighNoRipple : lsfLowNoRipple) &&
is_bit_set (sleOut->getFieldU32 (sfFlags),
(secondAccount > thirdAccount) ? lsfHighNoRipple : lsfLowNoRipple))
sleIn->getFieldU32 (sfFlags) &
((secondAccount > firstAccount) ? lsfHighNoRipple : lsfLowNoRipple) &&
sleOut->getFieldU32 (sfFlags) &
((secondAccount > thirdAccount) ? lsfHighNoRipple : lsfLowNoRipple))
{
WriteLog (lsINFO, RippleCalc) << "Path violates noRipple constraint between " <<
RippleAddress::createHumanAccountID (firstAccount) << ", " <<