Fix compiler warnings.

This commit is contained in:
Arthur Britto
2012-08-23 22:31:14 -07:00
parent 0f51eb8ccf
commit e6511732c7
3 changed files with 19 additions and 20 deletions

View File

@@ -21,9 +21,9 @@ TODO: what is a good way to come up with multiple paths?
OrderDB: OrderDB:
getXNSOffers(); getXNSOffers();
// return list of all orderbooks that want XNS // return list of all orderbooks that want XNS
// return list of all orderbooks that want IssuerID // return list of all orderbooks that want IssuerID
// return list of all orderbooks that want this issuerID and currencyID // return list of all orderbooks that want this issuerID and currencyID
*/ */
@@ -49,7 +49,7 @@ bool sortPathOptions(PathOption::pointer first, PathOption::pointer second)
{ {
if(first->mTotalCost<second->mTotalCost) return(true); if(first->mTotalCost<second->mTotalCost) return(true);
if(first->mTotalCost>second->mTotalCost) return(false); if(first->mTotalCost>second->mTotalCost) return(false);
if(first->mCorrectCurrency && !second->mCorrectCurrency) return(true); if(first->mCorrectCurrency && !second->mCorrectCurrency) return(true);
if(!first->mCorrectCurrency && second->mCorrectCurrency) return(false); if(!first->mCorrectCurrency && second->mCorrectCurrency) return(false);
@@ -57,7 +57,7 @@ bool sortPathOptions(PathOption::pointer first, PathOption::pointer second)
if(first->mPath.getElementCount()>second->mPath.getElementCount()) return(false); if(first->mPath.getElementCount()>second->mPath.getElementCount()) return(false);
if(first->mMinWidth<second->mMinWidth) return true; if(first->mMinWidth<second->mMinWidth) return true;
return false; return false;
} }
@@ -77,7 +77,7 @@ PathOption::PathOption(PathOption::pointer other)
Pathfinder::Pathfinder(NewcoinAddress& srcAccountID, NewcoinAddress& dstAccountID, uint160& srcCurrencyID, STAmount dstAmount) : Pathfinder::Pathfinder(NewcoinAddress& srcAccountID, NewcoinAddress& dstAccountID, uint160& srcCurrencyID, STAmount dstAmount) :
mSrcAccountID(srcAccountID.getAccountID()) , mDstAccountID(dstAccountID.getAccountID()), mSrcCurrencyID(srcCurrencyID) , mDstAmount(dstAmount), mOrderBook(theApp->getMasterLedger().getCurrentLedger()) mSrcAccountID(srcAccountID.getAccountID()), mDstAccountID(dstAccountID.getAccountID()), mDstAmount(dstAmount), mSrcCurrencyID(srcCurrencyID), mOrderBook(theApp->getMasterLedger().getCurrentLedger())
{ {
mLedger=theApp->getMasterLedger().getCurrentLedger(); mLedger=theApp->getMasterLedger().getCurrentLedger();
} }
@@ -99,9 +99,8 @@ bool Pathfinder::findPaths(int maxSearchSteps, int maxPay, STPathSet& retPathSet
} }
if(checkComplete(retPathSet)) return(true); if(checkComplete(retPathSet)) return(true);
} }
} }
return(false); return(false);
} }
@@ -125,8 +124,8 @@ bool Pathfinder::checkComplete(STPathSet& retPathSet)
// get all the options from this accountID // get all the options from this accountID
// if source is XNS // if source is XNS
// every offer that wants XNS // every offer that wants XNS
// else // else
// every ripple line that starts with the source currency // every ripple line that starts with the source currency
// every offer that we can take that wants the source currency // every offer that we can take that wants the source currency
void Pathfinder::addOptions(PathOption::pointer tail) void Pathfinder::addOptions(PathOption::pointer tail)
@@ -150,7 +149,7 @@ void Pathfinder::addOptions(PathOption::pointer tail)
BOOST_FOREACH(RippleState::pointer line,rippleLines.getLines()) BOOST_FOREACH(RippleState::pointer line,rippleLines.getLines())
{ {
// TODO: make sure we can move in the correct direction // TODO: make sure we can move in the correct direction
STAmount balance=line->getBalance(); STAmount balance=line->getBalance();
if(balance.getCurrency()==tail->mCurrencyID) if(balance.getCurrency()==tail->mCurrencyID)
{ // we have a ripple line from the tail to somewhere else { // we have a ripple line from the tail to somewhere else
PathOption::pointer pathOption(new PathOption(tail)); PathOption::pointer pathOption(new PathOption(tail));
@@ -161,7 +160,7 @@ void Pathfinder::addOptions(PathOption::pointer tail)
pathOption->mCurrentAccount=line->getAccountIDPeer().getAccountID(); pathOption->mCurrentAccount=line->getAccountIDPeer().getAccountID();
addPathOption(pathOption); addPathOption(pathOption);
} }
} }
// every offer that wants the source currency // every offer that wants the source currency
@@ -184,7 +183,7 @@ void Pathfinder::addOptions(PathOption::pointer tail)
void Pathfinder::addPathOption(PathOption::pointer pathOption) void Pathfinder::addPathOption(PathOption::pointer pathOption)
{ {
if(pathOption->mCurrencyID==mDstAmount.getCurrency()) if(pathOption->mCurrencyID==mDstAmount.getCurrency())
{ {
pathOption->mCorrectCurrency=true; pathOption->mCorrectCurrency=true;
@@ -192,11 +191,11 @@ void Pathfinder::addPathOption(PathOption::pointer pathOption)
{ // this path is complete { // this path is complete
mCompletePaths.push_back(pathOption); mCompletePaths.push_back(pathOption);
}else mBuildingPaths.push_back(pathOption); }else mBuildingPaths.push_back(pathOption);
}else }
else
{ {
pathOption->mCorrectCurrency=false; pathOption->mCorrectCurrency=false;
mBuildingPaths.push_back(pathOption); mBuildingPaths.push_back(pathOption);
} }
} }
// vim:ts=4

View File

@@ -33,7 +33,6 @@ class Pathfinder
OrderBookDB mOrderBook; OrderBookDB mOrderBook;
Ledger::pointer mLedger; Ledger::pointer mLedger;
std::list<PathOption::pointer> mBuildingPaths; std::list<PathOption::pointer> mBuildingPaths;
std::list<PathOption::pointer> mCompletePaths; std::list<PathOption::pointer> mCompletePaths;
@@ -49,4 +48,5 @@ public:
// returns false if there is no path. otherwise fills out retPath // returns false if there is no path. otherwise fills out retPath
bool findPaths(int maxSearchSteps, int maxPay, STPathSet& retPathSet); bool findPaths(int maxSearchSteps, int maxPay, STPathSet& retPathSet);
}; };
// vim:ts=4

View File

@@ -2618,8 +2618,8 @@ bool TransactionEngine::calcNodeAccountRev(unsigned int uIndex, PathState::point
const uint160& uCurrencyID = pnCur.uCurrencyID; const uint160& uCurrencyID = pnCur.uCurrencyID;
const uint32 uQualityIn = uIndex ? rippleQualityIn(uCurAccountID, uPrvAccountID, uCurrencyID) : 1; const uint32 uQualityIn = uIndex ? rippleQualityIn(uCurAccountID, uPrvAccountID, uCurrencyID) : QUALITY_ONE;
const uint32 uQualityOut = uIndex != uLast ? rippleQualityOut(uCurAccountID, uNxtAccountID, uCurrencyID) : 1; const uint32 uQualityOut = uIndex != uLast ? rippleQualityOut(uCurAccountID, uNxtAccountID, uCurrencyID) : QUALITY_ONE;
// For bPrvAccount // For bPrvAccount
const STAmount saPrvBalance = uIndex && bPrvAccount ? rippleBalance(uCurAccountID, uPrvAccountID, uCurrencyID) : STAmount(uCurrencyID); const STAmount saPrvBalance = uIndex && bPrvAccount ? rippleBalance(uCurAccountID, uPrvAccountID, uCurrencyID) : STAmount(uCurrencyID);