diff --git a/src/cpp/ripple/ConnectionPool.cpp b/src/cpp/ripple/ConnectionPool.cpp index 6de593b2b..fad45ca0f 100644 --- a/src/cpp/ripple/ConnectionPool.cpp +++ b/src/cpp/ripple/ConnectionPool.cpp @@ -140,7 +140,7 @@ bool ConnectionPool::peerAvailable(std::string& strIp, int& iPort) vstrIpPort.reserve(mIpMap.size()); - BOOST_FOREACH(pipPeer ipPeer, mIpMap) + BOOST_FOREACH(const vtPeer& ipPeer, mIpMap) { const std::string& strIp = ipPeer.first.first; int iPort = ipPeer.first.second; @@ -251,7 +251,7 @@ int ConnectionPool::relayMessage(Peer* fromPeer, const PackedMessage::pointer& m int sentTo = 0; boost::mutex::scoped_lock sl(mPeerLock); - BOOST_FOREACH(naPeer pair, mConnectedMap) + BOOST_FOREACH(const vtConMap& pair, mConnectedMap) { Peer::ref peer = pair.second; if (!peer) @@ -270,7 +270,7 @@ void ConnectionPool::relayMessageBut(const std::set& fromPeers, const Pa { // Relay message to all but the specified peers boost::mutex::scoped_lock sl(mPeerLock); - BOOST_FOREACH(naPeer pair, mConnectedMap) + BOOST_FOREACH(const vtConMap& pair, mConnectedMap) { Peer::ref peer = pair.second; if (peer->isConnected() && (fromPeers.count(peer->getPeerId()) == 0)) @@ -388,7 +388,7 @@ std::vector ConnectionPool::getPeerVector() ret.reserve(mConnectedMap.size()); - BOOST_FOREACH(naPeer pair, mConnectedMap) + BOOST_FOREACH(const vtConMap& pair, mConnectedMap) { assert(!!pair.second); ret.push_back(pair.second); diff --git a/src/cpp/ripple/ConnectionPool.h b/src/cpp/ripple/ConnectionPool.h index dbc6cd8b2..e02caf198 100644 --- a/src/cpp/ripple/ConnectionPool.h +++ b/src/cpp/ripple/ConnectionPool.h @@ -21,6 +21,7 @@ private: typedef std::pair naPeer; typedef std::pair pipPeer; + typedef std::map::value_type vtPeer; // Peers we are connecting with and non-thin peers we are connected to. // Only peers we know the connection ip for are listed. @@ -31,6 +32,7 @@ private: // Non-thin peers which we are connected to. // Peers we have the public key for. + typedef boost::unordered_map::value_type vtConMap; boost::unordered_map mConnectedMap; // Connections with have a 64-bit identifier diff --git a/src/cpp/ripple/FeatureTable.cpp b/src/cpp/ripple/FeatureTable.cpp index 984be60d0..a014c81e9 100644 --- a/src/cpp/ripple/FeatureTable.cpp +++ b/src/cpp/ripple/FeatureTable.cpp @@ -128,7 +128,7 @@ void FeatureTable::reportValidations(const FeatureSet& set) return; int threshold = (set.mTrustedValidations * mMajorityFraction) / 256; - typedef std::pair u256_int_pair; + typedef std::map::value_type u256_int_pair; boost::mutex::scoped_lock sl(mMutex); diff --git a/src/cpp/ripple/FieldNames.cpp b/src/cpp/ripple/FieldNames.cpp index 590f85d6b..6bd34da29 100644 --- a/src/cpp/ripple/FieldNames.cpp +++ b/src/cpp/ripple/FieldNames.cpp @@ -111,7 +111,7 @@ std::string SField::getName() const SField::ref SField::getField(const std::string& fieldName) { // OPTIMIZEME me with a map. CHECKME this is case sensitive boost::mutex::scoped_lock sl(mapMutex); - typedef std::pair int_sfref_pair; + typedef std::map::value_type int_sfref_pair; BOOST_FOREACH(const int_sfref_pair& fieldPair, codeToField) { if (fieldPair.second->fieldName == fieldName) diff --git a/src/cpp/ripple/JobQueue.cpp b/src/cpp/ripple/JobQueue.cpp index 44ed3bcee..1b236295b 100644 --- a/src/cpp/ripple/JobQueue.cpp +++ b/src/cpp/ripple/JobQueue.cpp @@ -111,7 +111,7 @@ int JobQueue::getJobCountGE(JobType t) boost::mutex::scoped_lock sl(mJobLock); - typedef std::pair jt_int_pair; + typedef std::map::value_type jt_int_pair; BOOST_FOREACH(const jt_int_pair& it, mJobCounts) if (it.first >= t) ret += it.second; @@ -125,7 +125,7 @@ std::vector< std::pair > JobQueue::getJobCounts() boost::mutex::scoped_lock sl(mJobLock); ret.reserve(mJobCounts.size()); - typedef std::pair jt_int_pair; + typedef std::map::value_type jt_int_pair; BOOST_FOREACH(const jt_int_pair& it, mJobCounts) ret.push_back(it); diff --git a/src/cpp/ripple/LedgerConsensus.cpp b/src/cpp/ripple/LedgerConsensus.cpp index bf92b700c..a06edc4ad 100644 --- a/src/cpp/ripple/LedgerConsensus.cpp +++ b/src/cpp/ripple/LedgerConsensus.cpp @@ -20,8 +20,8 @@ #define LC_DEBUG -typedef std::pair u160_prop_pair; -typedef std::pair u256_lct_pair; +typedef std::map::value_type u160_prop_pair; +typedef std::map::value_type u256_lct_pair; SETUP_LOG(); DECLARE_INSTANCE(LedgerConsensus); @@ -348,7 +348,7 @@ void LedgerConsensus::checkLCL() boost::unordered_map vals = theApp->getValidations().getCurrentValidations(favoredLedger); - typedef std::pair u256_cvc_pair; + typedef std::map::value_type u256_cvc_pair; BOOST_FOREACH(u256_cvc_pair& it, vals) if (it.second.first > netLgrCount) { @@ -471,7 +471,7 @@ void LedgerConsensus::createDisputes(SHAMap::ref m1, SHAMap::ref m2) SHAMap::SHAMapDiff differences; m1->compare(m2, differences, 16384); - typedef std::pair u256_diff_pair; + typedef std::map::value_type u256_diff_pair; BOOST_FOREACH (u256_diff_pair& pos, differences) { // create disputed transactions (from the ledger that has them) if (pos.second.first) diff --git a/src/cpp/ripple/LedgerEntrySet.cpp b/src/cpp/ripple/LedgerEntrySet.cpp index 0d335848a..e1774f1a9 100644 --- a/src/cpp/ripple/LedgerEntrySet.cpp +++ b/src/cpp/ripple/LedgerEntrySet.cpp @@ -366,7 +366,7 @@ void LedgerEntrySet::calcRawMeta(Serializer& s, TER result, uint32 index) // Entries modified only as a result of building the transaction metadata boost::unordered_map newMod; - typedef std::pair u256_LES_pair; + typedef std::map::value_type u256_LES_pair; BOOST_FOREACH(u256_LES_pair& it, mEntries) { SField::ptr type = &sfGeneric; @@ -479,7 +479,7 @@ void LedgerEntrySet::calcRawMeta(Serializer& s, TER result, uint32 index) } // add any new modified nodes to the modification set - typedef std::pair u256_sle_pair; + typedef std::map::value_type u256_sle_pair; BOOST_FOREACH(u256_sle_pair& it, newMod) entryModify(it.second); diff --git a/src/cpp/ripple/NetworkOPs.cpp b/src/cpp/ripple/NetworkOPs.cpp index 253e261b2..e6a4c5833 100644 --- a/src/cpp/ripple/NetworkOPs.cpp +++ b/src/cpp/ripple/NetworkOPs.cpp @@ -570,7 +570,7 @@ bool NetworkOPs::checkLastClosedLedger(const std::vector& peerLis { boost::unordered_map current = theApp->getValidations().getCurrentValidations(closedLedger); - typedef std::pair u256_cvc_pair; + typedef std::map::value_type u256_cvc_pair; BOOST_FOREACH(u256_cvc_pair& it, current) { ValidationCount& vc = ledgers[it.first]; @@ -1152,8 +1152,8 @@ void NetworkOPs::pubAccountTransaction(Ledger::ref lpCurrent, const SerializedTr if (!mSubAccount.empty() || (!mSubRTAccount.empty()) ) { - typedef const std::pair AccountPair; - BOOST_FOREACH(AccountPair& affectedAccount, getAffectedAccounts(stTxn)) + typedef std::map::value_type AccountPair; + BOOST_FOREACH(const AccountPair& affectedAccount, getAffectedAccounts(stTxn)) { subInfoMapIterator simiIt = mSubRTAccount.find(affectedAccount.first.getAccountID()); diff --git a/src/cpp/ripple/ParameterTable.cpp b/src/cpp/ripple/ParameterTable.cpp index dadfc3381..200fc1d60 100644 --- a/src/cpp/ripple/ParameterTable.cpp +++ b/src/cpp/ripple/ParameterTable.cpp @@ -81,8 +81,8 @@ bool ParameterNode::addNode(const std::string& name, Parameter::ref node) Json::Value ParameterNode::getValue(int i) const { Json::Value v(Json::objectValue); - typedef std::pair string_ref_pair; - BOOST_FOREACH(string_ref_pair it, mChildren) + typedef std::map::value_type string_ref_pair; + BOOST_FOREACH(const string_ref_pair& it, mChildren) { v[it.first] = it.second->getValue(i); } @@ -95,8 +95,8 @@ bool ParameterNode::setValue(const Json::Value& value, Json::Value& error) error["error"] = "Cannot end on an inner node"; Json::Value nodes(Json::arrayValue); - typedef std::pair string_ref_pair; - BOOST_FOREACH(string_ref_pair it, mChildren) + typedef std::map::value_type string_ref_pair; + BOOST_FOREACH(const string_ref_pair& it, mChildren) { nodes.append(it.first); } diff --git a/src/cpp/ripple/RPCHandler.cpp b/src/cpp/ripple/RPCHandler.cpp index a80e7b0a3..f560688b2 100644 --- a/src/cpp/ripple/RPCHandler.cpp +++ b/src/cpp/ripple/RPCHandler.cpp @@ -1565,7 +1565,7 @@ Json::Value RPCHandler::doLogLevel(Json::Value jvRequest) lev["base"] = Log::severityToString(Log::getMinSeverity()); std::vector< std::pair > logTable = LogPartition::getSeverities(); - typedef std::pair stringPair; + typedef std::map::value_type stringPair; BOOST_FOREACH(const stringPair& it, logTable) lev[it.first] = it.second; diff --git a/src/cpp/ripple/SerializedObject.cpp b/src/cpp/ripple/SerializedObject.cpp index 35a0760b5..2e87706e1 100644 --- a/src/cpp/ripple/SerializedObject.cpp +++ b/src/cpp/ripple/SerializedObject.cpp @@ -294,7 +294,7 @@ void STObject::add(Serializer& s, bool withSigningFields) const } - typedef std::pair field_iterator; + typedef std::map::value_type field_iterator; BOOST_FOREACH(field_iterator& it, fields) { // insert them in sorted order const SerializedType* field = it.second; diff --git a/src/cpp/ripple/TransactionEngine.cpp b/src/cpp/ripple/TransactionEngine.cpp index 3899ebfb4..e4cadfb99 100644 --- a/src/cpp/ripple/TransactionEngine.cpp +++ b/src/cpp/ripple/TransactionEngine.cpp @@ -23,7 +23,7 @@ DECLARE_INSTANCE(TransactionEngine); void TransactionEngine::txnWrite() { // Write back the account states - typedef std::pair u256_LES_pair; + typedef std::map::value_type u256_LES_pair; BOOST_FOREACH(u256_LES_pair& it, mNodes) { const SLE::pointer& sleEntry = it.second.mEntry; diff --git a/src/cpp/ripple/ValidationCollection.cpp b/src/cpp/ripple/ValidationCollection.cpp index f663b2c2a..9057bd082 100644 --- a/src/cpp/ripple/ValidationCollection.cpp +++ b/src/cpp/ripple/ValidationCollection.cpp @@ -9,7 +9,7 @@ SETUP_LOG(); -typedef std::pair u160_val_pair; +typedef std::map::value_type u160_val_pair; typedef boost::shared_ptr VSpointer; VSpointer ValidationCollection::findCreateSet(const uint256& ledgerHash) diff --git a/src/cpp/ripple/rpc.cpp b/src/cpp/ripple/rpc.cpp index 2beec4c66..8d7c84391 100644 --- a/src/cpp/ripple/rpc.cpp +++ b/src/cpp/ripple/rpc.cpp @@ -48,8 +48,8 @@ std::string createHTTPPost(const std::string& strMsg, const std::map HeaderType; - BOOST_FOREACH(HeaderType& item, mapRequestHeaders) + typedef std::map::value_type HeaderType; + BOOST_FOREACH(const HeaderType& item, mapRequestHeaders) s << item.first << ": " << item.second << "\r\n"; s << "\r\n" << strMsg;