From 7254d00e3cefa2caed0e071adabc0e1f7fa13a09 Mon Sep 17 00:00:00 2001 From: DarthArgus Date: Mon, 27 Oct 2014 21:28:46 -0700 Subject: [PATCH] and more performance tweaks --- .../ChatServer/src/shared/ChatServer.cpp | 2 +- .../src/shared/ConnectionServerConnection.cpp | 32 +++++++++---------- .../ChatServer/src/shared/VChatInterface.cpp | 2 +- .../src/shared/AuctionMarket.cpp | 14 ++++---- .../src/shared/CSToolConnection.cpp | 2 +- .../TaskManager/src/shared/TaskManager.cpp | 2 +- .../src/shared/core/DbBindableString.h | 4 +-- .../Session/CommonAPI/CommonClient.cpp | 2 +- .../projects/Session/LoginAPI/ClientCore.cpp | 2 +- .../ChatAPI/projects/ChatAPI/Request.cpp | 4 +-- .../ChatAPI/projects/ChatAPI/Request.h | 2 +- .../VChatAPI/utils2.0/utils/Api/api.cpp | 12 +++---- .../utils2.0/utils/Api/apiMessages.cpp | 12 +++---- .../VChatAPI/utils2.0/utils/Api/apiPinned.cpp | 10 +++--- .../VChatAPI/utils2.0/utils/Base/MD5.cpp | 14 ++++---- .../VChatAPI/utils2.0/utils/Base/MD5.h | 14 ++++---- .../utils2.0/utils/Base/basicConfig.cpp | 4 +-- .../VChatAPI/utils2.0/utils/Base/cmdLine.cpp | 4 +-- .../utils2.0/utils/Base/serializeTemplates.h | 8 ++--- .../library/archive/src/shared/AutoDeltaSet.h | 2 +- .../shared/buffers/MarketAuctionsBuffer.cpp | 2 +- .../src/shared/buffers/MarketAuctionsBuffer.h | 2 +- .../src/shared/core/SwgLoader.cpp | 2 +- .../src/shared/core/SwgLoader.h | 2 +- .../src/shared/combat/ConfigCombatEngine.cpp | 8 ++--- 25 files changed, 82 insertions(+), 82 deletions(-) diff --git a/engine/server/application/ChatServer/src/shared/ChatServer.cpp b/engine/server/application/ChatServer/src/shared/ChatServer.cpp index 66241280..22878572 100644 --- a/engine/server/application/ChatServer/src/shared/ChatServer.cpp +++ b/engine/server/application/ChatServer/src/shared/ChatServer.cpp @@ -1299,7 +1299,7 @@ void ChatServer::destroyRoom(const std::string & roomName) if (pos != roomName.npos) { std::string tmpRoomName = roomName.substr(0, pos); - char lastChar = tmpRoomName[strlen(tmpRoomName.c_str()) - 1]; + char lastChar = tmpRoomName[tmpRoomName.length() - 1]; if (lastChar >= '0' && lastChar <= '9') { ChatServer::destroyRoom(tmpRoomName); diff --git a/engine/server/application/ChatServer/src/shared/ConnectionServerConnection.cpp b/engine/server/application/ChatServer/src/shared/ConnectionServerConnection.cpp index 13ce1c55..ffe2ee1d 100644 --- a/engine/server/application/ChatServer/src/shared/ConnectionServerConnection.cpp +++ b/engine/server/application/ChatServer/src/shared/ConnectionServerConnection.cpp @@ -146,9 +146,9 @@ void ConnectionServerConnection::onReceive(const Archive::ByteStream & message) // deliver IM to character ChatInstantMessageToCharacter chat(cri); ChatAvatarId characterName = chat.getCharacterName(); - if(characterName.gameCode == "") + if(characterName.gameCode.empty()) characterName.gameCode = "SWG"; - if(characterName.cluster == "") + if(characterName.cluster.empty()) characterName.cluster = ConfigChatServer::getClusterName(); ChatAvatarId fromName; @@ -185,9 +185,9 @@ void ConnectionServerConnection::onReceive(const Archive::ByteStream & message) // deliver IM to character ChatInstantMessageToCharacter chat(cri); ChatAvatarId characterName = chat.getCharacterName(); - if(characterName.gameCode == "") + if(characterName.gameCode.empty()) characterName.gameCode = "SWG"; - if(characterName.cluster == "") + if(characterName.cluster.empty()) characterName.cluster = ConfigChatServer::getClusterName(); ChatServer::sendInstantMessage(*i, chat.getSequence(), characterName, chat.getMessage(), chat.getOutOfBand()); @@ -205,9 +205,9 @@ void ConnectionServerConnection::onReceive(const Archive::ByteStream & message) //printf("ConnectionServerConnection -- ChatPersistentMessageToServer\n"); ChatPersistentMessageToServer chat(cri); ChatAvatarId characterName = chat.getToCharacterName(); - if(characterName.gameCode == "") + if(characterName.gameCode.empty()) characterName.gameCode = "SWG"; - if(characterName.cluster == "") + if(characterName.cluster.empty()) characterName.cluster = ConfigChatServer::getClusterName(); ChatServer::sendPersistentMessage((*i), chat.getSequence(), characterName, chat.getSubject(), chat.getMessage(), chat.getOutOfBand()); @@ -283,9 +283,9 @@ void ConnectionServerConnection::onReceive(const Archive::ByteStream & message) //printf("ConnectionServerConnection -- ChatREmoveModeratorFromRoom\n"); ChatRemoveModeratorFromRoom chat(cri); ChatAvatarId characterName = chat.getAvatarId(); - if(characterName.gameCode == "") + if(characterName.gameCode.empty()) characterName.gameCode = "SWG"; - if(characterName.cluster == "") + if(characterName.cluster.empty()) characterName.cluster = ConfigChatServer::getClusterName(); ChatServer::removeModeratorFromRoom(chat.getSequenceId(), (*i), characterName, chat.getRoomName()); } @@ -316,9 +316,9 @@ void ConnectionServerConnection::onReceive(const Archive::ByteStream & message) //printf("ConnectionServerConnection -- ChatInviteAvatarToRoom\n"); ChatInviteAvatarToRoom chat(cri); ChatAvatarId characterName = chat.getAvatarId(); - if(characterName.gameCode == "") + if(characterName.gameCode.empty()) characterName.gameCode = "SWG"; - if(characterName.cluster == "") + if(characterName.cluster.empty()) characterName.cluster = ConfigChatServer::getClusterName(); ChatServer::invite((*i), characterName, chat.getRoomName()); } @@ -328,9 +328,9 @@ void ConnectionServerConnection::onReceive(const Archive::ByteStream & message) //printf("ConnectionServerConnection -- ChatUninviteAvatarToRoom\n"); ChatUninviteFromRoom chat(cri); ChatAvatarId characterName = chat.getAvatar(); - if(characterName.gameCode == "") + if(characterName.gameCode.empty()) characterName.gameCode = "SWG"; - if(characterName.cluster == "") + if(characterName.cluster.empty()) characterName.cluster = ConfigChatServer::getClusterName(); ChatServer::uninvite((*i), chat.getSequence(), characterName, chat.getRoomName()); } @@ -340,9 +340,9 @@ void ConnectionServerConnection::onReceive(const Archive::ByteStream & message) //printf("ConnectionServerConnection -- ChatBanAvatarFromRoom\n"); ChatBanAvatarFromRoom chat(cri); ChatAvatarId characterName = chat.getAvatarId(); - if(characterName.gameCode == "") + if(characterName.gameCode.empty()) characterName.gameCode = "SWG"; - if(characterName.cluster == "") + if(characterName.cluster.empty()) characterName.cluster = ConfigChatServer::getClusterName(); ChatServer::banFromRoom(chat.getSequence(), (*i), characterName, chat.getRoomName()); } @@ -352,9 +352,9 @@ void ConnectionServerConnection::onReceive(const Archive::ByteStream & message) //printf("ConnectionServerConnection -- ChatUnbanAvatarFromRoom\n"); ChatUnbanAvatarFromRoom chat(cri); ChatAvatarId characterName = chat.getAvatarId(); - if(characterName.gameCode == "") + if(characterName.gameCode.empty()) characterName.gameCode = "SWG"; - if(characterName.cluster == "") + if(characterName.cluster.empty()) characterName.cluster = ConfigChatServer::getClusterName(); ChatServer::unbanFromRoom(chat.getSequence(), (*i), characterName, chat.getRoomName()); } diff --git a/engine/server/application/ChatServer/src/shared/VChatInterface.cpp b/engine/server/application/ChatServer/src/shared/VChatInterface.cpp index f0b96b3f..f877b510 100644 --- a/engine/server/application/ChatServer/src/shared/VChatInterface.cpp +++ b/engine/server/application/ChatServer/src/shared/VChatInterface.cpp @@ -905,7 +905,7 @@ std::string VChatInterface::parseWorldName(std::string const & input) std::string::size_type findIndex = input.find(worldCode); if(findIndex != std::string::npos) { - findIndex += strlen(worldCode.c_str()); + findIndex += worldCode.length()); output = input.substr(findIndex); } else diff --git a/engine/server/application/CommoditiesServer/src/shared/AuctionMarket.cpp b/engine/server/application/CommoditiesServer/src/shared/AuctionMarket.cpp index 91324605..81304df9 100644 --- a/engine/server/application/CommoditiesServer/src/shared/AuctionMarket.cpp +++ b/engine/server/application/CommoditiesServer/src/shared/AuctionMarket.cpp @@ -80,7 +80,7 @@ namespace AuctionMarketNamespace { HexString += buffer; } - z++; + ++z; } DEBUG_REPORT_LOG(ConfigCommodityServer::getShowAllDebugInfo(), ("[Commodities Server ][HEX OOB IN] : %s \n", HexString.c_str())); @@ -3002,7 +3002,7 @@ void AuctionMarket::DestroyVendorMarket(const DestroyVendorMarketMessage &messag std::vector::iterator> destroyedAuctions; std::map::iterator item; // get all the auctions for this location and get an iterator from the real auctions map - for( std::map::iterator j = (*i).second->GetAuctions().begin(); j != (*i).second->GetAuctions().end(); j++ ) + for( std::map::iterator j = (*i).second->GetAuctions().begin(); j != (*i).second->GetAuctions().end(); ++j ) { item = m_auctions.find((*j).first); if( item != m_auctions.end() ) @@ -3012,7 +3012,7 @@ void AuctionMarket::DestroyVendorMarket(const DestroyVendorMarketMessage &messag } // do it again for all vendor offers - for( std::map::iterator k = (*i).second->GetVendorOffers().begin(); k != (*i).second->GetVendorOffers().end(); k++ ) + for( std::map::iterator k = (*i).second->GetVendorOffers().begin(); k != (*i).second->GetVendorOffers().end(); ++k ) { item = m_auctions.find((*k).first); if( item != m_auctions.end() ) @@ -3077,7 +3077,7 @@ void AuctionMarket::DeleteAuctionLocation(const DeleteAuctionLocationMessage &me std::vector::iterator> destroyedAuctions; std::map::iterator item; // get all the auctions for this location and get an iterator from the real auctions map - for( std::map::iterator j = (*i).second->GetAuctions().begin(); j != (*i).second->GetAuctions().end(); j++ ) + for( std::map::iterator j = (*i).second->GetAuctions().begin(); j != (*i).second->GetAuctions().end(); ++j ) { item = m_auctions.find((*j).first); if( item != m_auctions.end() ) @@ -3087,7 +3087,7 @@ void AuctionMarket::DeleteAuctionLocation(const DeleteAuctionLocationMessage &me } // do it again for all vendor offers - for( std::map::iterator k = (*i).second->GetVendorOffers().begin(); k != (*i).second->GetVendorOffers().end(); k++ ) + for( std::map::iterator k = (*i).second->GetVendorOffers().begin(); k != (*i).second->GetVendorOffers().end(); ++k ) { item = m_auctions.find((*k).first); if( item != m_auctions.end() ) @@ -3473,7 +3473,7 @@ bool AuctionMarket::FixVendorLocation( const std::string &loc ) } } - i++; + ++i; } return false; @@ -4341,7 +4341,7 @@ void static decodeOOB(const std::string & UTF8String, Unicode::String & UniStrin UniString.push_back(unicharvalue); tempstring.clear(); } - c++; + ++c; } if (tempstring.length() != 0) { diff --git a/engine/server/application/LoginServer/src/shared/CSToolConnection.cpp b/engine/server/application/LoginServer/src/shared/CSToolConnection.cpp index 6c663d93..3da0b98b 100644 --- a/engine/server/application/LoginServer/src/shared/CSToolConnection.cpp +++ b/engine/server/application/LoginServer/src/shared/CSToolConnection.cpp @@ -176,7 +176,7 @@ void CSToolConnection::onReceive( const Archive::ByteStream & message ) } else { - m_sInputBuffer = ""; + m_sInputBuffer.clear(); } } diff --git a/engine/server/application/TaskManager/src/shared/TaskManager.cpp b/engine/server/application/TaskManager/src/shared/TaskManager.cpp index c48b9fa5..192ab1a3 100644 --- a/engine/server/application/TaskManager/src/shared/TaskManager.cpp +++ b/engine/server/application/TaskManager/src/shared/TaskManager.cpp @@ -118,7 +118,7 @@ namespace TaskManagerNameSpace std::vector s_delayedSpawnRequests; struct OutstandingSpawnRequestAck { - OutstandingSpawnRequestAck(const std::string n, const Archive::ByteStream & a, int t) : + OutstandingSpawnRequestAck(const std::string &n, const Archive::ByteStream & a, int t) : nodeLabel(n), request(a), transactionId(t) { } diff --git a/engine/shared/library/sharedDatabaseInterface/src/shared/core/DbBindableString.h b/engine/shared/library/sharedDatabaseInterface/src/shared/core/DbBindableString.h index 0d467705..d98cbe61 100644 --- a/engine/shared/library/sharedDatabaseInterface/src/shared/core/DbBindableString.h +++ b/engine/shared/library/sharedDatabaseInterface/src/shared/core/DbBindableString.h @@ -273,9 +273,9 @@ namespace DB template void BindableString::setValue(const std::string &buffer) { - FATAL(strlen(buffer.c_str())>S,("Attempt to save a std::string \"%s\"that is too long to the database.", buffer.c_str())); + FATAL(buffer.length())>S,("Attempt to save a std::string \"%s\"that is too long to the database.", buffer.c_str())); strncpy(m_value, buffer.c_str(), S+1); - indicator=strlen(buffer.c_str()); + indicator=buffer.length(); } template diff --git a/external/3rd/library/platform/projects/Session/CommonAPI/CommonClient.cpp b/external/3rd/library/platform/projects/Session/CommonAPI/CommonClient.cpp index 4856d6e2..26bca98e 100644 --- a/external/3rd/library/platform/projects/Session/CommonAPI/CommonClient.cpp +++ b/external/3rd/library/platform/projects/Session/CommonAPI/CommonClient.cpp @@ -632,7 +632,7 @@ void apiCore::Process() while (mapIterator != mRequestMap.end()) { apiTrackedRequest & request = (*mapIterator).second; - mapIterator++; + ++mapIterator; if (request.Expired()) { diff --git a/external/3rd/library/platform/projects/Session/LoginAPI/ClientCore.cpp b/external/3rd/library/platform/projects/Session/LoginAPI/ClientCore.cpp index a9e2caf6..fc3530ea 100644 --- a/external/3rd/library/platform/projects/Session/LoginAPI/ClientCore.cpp +++ b/external/3rd/library/platform/projects/Session/LoginAPI/ClientCore.cpp @@ -1657,7 +1657,7 @@ namespace LoginAPI Message::NotifySessionKick message(iterator); std::vector sessionList; - for (std::vector::const_iterator i=message.GetSessionList().begin(); i!=message.GetSessionList().end(); i++) + for (std::vector::const_iterator i=message.GetSessionList().begin(); i!=message.GetSessionList().end(); ++i) { sessionList.push_back(i->c_str()); } diff --git a/external/3rd/library/soePlatform/ChatAPI/projects/ChatAPI/Request.cpp b/external/3rd/library/soePlatform/ChatAPI/projects/ChatAPI/Request.cpp index e58b011c..33599863 100644 --- a/external/3rd/library/soePlatform/ChatAPI/projects/ChatAPI/Request.cpp +++ b/external/3rd/library/soePlatform/ChatAPI/projects/ChatAPI/Request.cpp @@ -124,7 +124,7 @@ void RGetAvatarKeywords::pack(ByteStream &msg) put(msg, m_srcAvatarID); } -RSearchAvatarKeywords::RSearchAvatarKeywords(const ChatUnicodeString nodeAddress, const ChatUnicodeString *keywordsList, unsigned keywordsLength) +RSearchAvatarKeywords::RSearchAvatarKeywords(const ChatUnicodeString &nodeAddress, const ChatUnicodeString *keywordsList, unsigned keywordsLength) : GenericRequest(REQUEST_SEARCHAVATARKEYWORDS), m_keywordsLength(keywordsLength), m_keywordsList(NULL) @@ -1282,7 +1282,7 @@ void RClassifyPersistentMessages::pack(ByteStream &msg) put(msg, m_track); put(msg, m_srcAvatarID); put(msg, m_messageIDs.size()); - for (idIter = m_messageIDs.begin(); idIter != m_messageIDs.end(); idIter++) + for (idIter = m_messageIDs.begin(); idIter != m_messageIDs.end(); ++idIter) { put(msg, *idIter); } diff --git a/external/3rd/library/soePlatform/ChatAPI/projects/ChatAPI/Request.h b/external/3rd/library/soePlatform/ChatAPI/projects/ChatAPI/Request.h index d29e00b8..fda17c67 100644 --- a/external/3rd/library/soePlatform/ChatAPI/projects/ChatAPI/Request.h +++ b/external/3rd/library/soePlatform/ChatAPI/projects/ChatAPI/Request.h @@ -185,7 +185,7 @@ private: class RSearchAvatarKeywords : public GenericAPI::GenericRequest { public: - RSearchAvatarKeywords(const ChatUnicodeString nodeAddress, const ChatUnicodeString *keywordsList, unsigned keywordsLength); + RSearchAvatarKeywords(const ChatUnicodeString &nodeAddress, const ChatUnicodeString *keywordsList, unsigned keywordsLength); virtual ~RSearchAvatarKeywords(); virtual void pack(Base::ByteStream &msg); diff --git a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Api/api.cpp b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Api/api.cpp index 3af047a2..7a82e750 100644 --- a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Api/api.cpp +++ b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Api/api.cpp @@ -119,12 +119,12 @@ namespace API_NAMESPACE { // ensure that callback mecahnism isn't triggered at this point HostMap_t::iterator iter; - for (iter = mHostMap[0].begin(); iter != mHostMap[0].end(); iter++) + for (iter = mHostMap[0].begin(); iter != mHostMap[0].end(); ++iter) { iter->first->SetHandler(0); iter->first->Release(); } - for (iter = mHostMap[1].begin(); iter != mHostMap[1].end(); iter++) + for (iter = mHostMap[1].begin(); iter != mHostMap[1].end(); ++iter) { iter->first->SetHandler(0); iter->first->Release(); @@ -555,7 +555,7 @@ namespace API_NAMESPACE if (mTimeoutTimer != currentTime) { TimeoutMap_t::iterator iterator; - for (iterator = mTimeoutMap.begin(); iterator != mTimeoutMap.end(); iterator++) + for (iterator = mTimeoutMap.begin(); iterator != mTimeoutMap.end(); ++iterator) { TimeoutList_t & timeoutList = iterator->second; while (!timeoutList.empty() && timeoutList.front().second < currentTime) @@ -870,7 +870,7 @@ namespace API_NAMESPACE size_t i = labelsAndValues.size(); labelsAndValues.resize(labelsAndValues.size() + mspLabelToEntryMap->size()); - for (LabelToEntryMap_t::const_iterator it = mspLabelToEntryMap->begin(); it != mspLabelToEntryMap->end(); it++, i++) + for (LabelToEntryMap_t::const_iterator it = mspLabelToEntryMap->begin(); it != mspLabelToEntryMap->end(); ++it, ++i) { string value; @@ -938,7 +938,7 @@ namespace API_NAMESPACE { initializeMap(); - for (soe::NameValuePairs_t::const_iterator it = labelsAndValues.begin(); it != labelsAndValues.end(); it++) + for (soe::NameValuePairs_t::const_iterator it = labelsAndValues.begin(); it != labelsAndValues.end(); ++it) { LabelToEntryMap_t::iterator mIter = mspLabelToEntryMap->find(it->name); @@ -1029,7 +1029,7 @@ namespace API_NAMESPACE { ClassScribeSet_t::iterator scribeIter; - for (scribeIter = classScribeSet.begin(); scribeIter != classScribeSet.end(); scribeIter++) + for (scribeIter = classScribeSet.begin(); scribeIter != classScribeSet.end(); ++scribeIter) { // This will cause the scribe to reinitialize itself next time it's used, // thereby copying the new values. Storing references was too dangerous. diff --git a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Api/apiMessages.cpp b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Api/apiMessages.cpp index c38875ab..15a337e8 100644 --- a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Api/apiMessages.cpp +++ b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Api/apiMessages.cpp @@ -24,7 +24,7 @@ namespace API_NAMESPACE #ifdef TRACK_READ_WRITE_FAILURES soe::ClearMessageFailureStack(); #endif - for(iterator=mMembers.begin(); iterator!=mMembers.end(); iterator++) + for(iterator=mMembers.begin(); iterator!=mMembers.end(); ++iterator) { MemberInfo_t & memberInfo = *iterator; @@ -50,7 +50,7 @@ namespace API_NAMESPACE } if (succeeded) { - for(iterator=mOptionalMembers.begin(); iterator!=mOptionalMembers.end(); iterator++) + for(iterator=mOptionalMembers.begin(); iterator!=mOptionalMembers.end(); ++iterator) { MemberInfo_t & memberInfo = *iterator; unsigned bytes = memberInfo.data->Read(stream, size, memberInfo.size, version); @@ -80,7 +80,7 @@ namespace API_NAMESPACE soe::ClearMessageFailureStack(); #endif - for (iterator=mMembers.begin(); iterator!=mMembers.end(); iterator++) + for (iterator=mMembers.begin(); iterator!=mMembers.end(); ++iterator) { const MemberInfo_t & memberInfo = *iterator; @@ -107,7 +107,7 @@ namespace API_NAMESPACE } if (succeeded) { - for (iterator=mOptionalMembers.begin(); iterator!=mOptionalMembers.end(); iterator++) + for (iterator=mOptionalMembers.begin(); iterator!=mOptionalMembers.end(); ++iterator) { const MemberInfo_t & memberInfo = *iterator; unsigned bytes = memberInfo.data->Write(stream, size, version); @@ -151,7 +151,7 @@ namespace API_NAMESPACE bool printedOne = false; MemberVector_t::const_iterator iterator; - for (iterator=mMembers.begin(); iterator!=mMembers.end(); iterator++) + for (iterator=mMembers.begin(); iterator!=mMembers.end(); ++iterator) { int bytes = 0; @@ -184,7 +184,7 @@ namespace API_NAMESPACE bytesTotal += bytes; } } - for (iterator=mOptionalMembers.begin(); iterator!=mOptionalMembers.end(); iterator++) + for (iterator=mOptionalMembers.begin(); iterator!=mOptionalMembers.end(); ++iterator) { int bytes = 0; diff --git a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Api/apiPinned.cpp b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Api/apiPinned.cpp index 5a1dd30d..f98b00bb 100644 --- a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Api/apiPinned.cpp +++ b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Api/apiPinned.cpp @@ -109,12 +109,12 @@ namespace NAMESPACE { // ensure that callback mecahnism isn't triggered at this point HostMap_t::iterator iter; - for (iter = mHostMap[0].begin(); iter != mHostMap[0].end(); iter++) + for (iter = mHostMap[0].begin(); iter != mHostMap[0].end(); ++iter) { iter->first->SetHandler(0); iter->first->Release(); } - for (iter = mHostMap[1].begin(); iter != mHostMap[1].end(); iter++) + for (iter = mHostMap[1].begin(); iter != mHostMap[1].end(); ++iter) { iter->first->SetHandler(0); iter->first->Release(); @@ -294,7 +294,7 @@ namespace NAMESPACE ApiConnection * connection = NULL; unsigned hashIndex = hashValue % mActiveHosts[0].size(); unsigned curIndex = 0; - for (ConnectionSet_t::iterator it = mActiveHosts[0].begin(); it != mActiveHosts[0].end(); it++, curIndex++) + for (ConnectionSet_t::iterator it = mActiveHosts[0].begin(); it != mActiveHosts[0].end(); ++it, ++curIndex) { if (hashIndex == curIndex) { @@ -317,7 +317,7 @@ namespace NAMESPACE ApiConnection * connection = NULL; unsigned hashIndex = hashValue % mActiveHosts[1].size(); unsigned curIndex = 0; - for (ConnectionSet_t::iterator it = mActiveHosts[1].begin(); it != mActiveHosts[1].end(); it++, curIndex++) + for (ConnectionSet_t::iterator it = mActiveHosts[1].begin(); it != mActiveHosts[1].end(); ++it, ++curIndex) { if (hashIndex == curIndex) { @@ -399,7 +399,7 @@ namespace NAMESPACE if (mTimeoutTimer != currentTime) { TimeoutMap_t::iterator iterator; - for (iterator = mTimeoutMap.begin(); iterator != mTimeoutMap.end(); iterator++) + for (iterator = mTimeoutMap.begin(); iterator != mTimeoutMap.end(); ++iterator) { TimeoutList_t & timeoutList = iterator->second; while (!timeoutList.empty() && timeoutList.front().second < currentTime) diff --git a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/MD5.cpp b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/MD5.cpp index 54e7e9fa..c9fabf14 100644 --- a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/MD5.cpp +++ b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/MD5.cpp @@ -47,7 +47,7 @@ namespace soe Update(input); } - vector MD5::Decode(vector achar0, int i, int j) + vector MD5::Decode(const vector &achar0, int i, int j) { vector ai(16,0); int l; @@ -61,7 +61,7 @@ namespace soe return ai; } - vector MD5::Encode(vector ai, int i) + vector MD5::Encode(const vector &ai, int i) { vector achar0(i,0); int k; @@ -127,7 +127,7 @@ namespace soe finalsNull = true; } - void MD5::Transform(State & state1, vector achar0, int i) + void MD5::Transform(State & state1, const vector &achar0, int i) { int j = state1.state[0]; int k = state1.state[1]; @@ -211,7 +211,7 @@ namespace soe Update(achar0, 1); } - void MD5::Update(State & state1, vector achar0, int i, int j) + void MD5::Update(State & state1, const vector &achar0, int i, int j) { finalsNull = true; if (j - i > (int)achar0.size()) @@ -245,7 +245,7 @@ namespace soe } } - void MD5::Update(string s) + void MD5::Update(const string &s) { vector achar(s.size(),0); for (int i=0; i<(int)s.size(); i++) @@ -258,12 +258,12 @@ namespace soe Update(achar0, 0, achar0.size()); } - void MD5::Update(vector achar0, int i) + void MD5::Update(const vector &achar0, int i) { Update(state, achar0, 0, i); } - void MD5::Update(vector achar0, int i, int j) + void MD5::Update(const vector &achar0, int i, int j) { Update(state, achar0, i, j); } diff --git a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/MD5.h b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/MD5.h index 0252f72e..8f665335 100644 --- a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/MD5.h +++ b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/MD5.h @@ -31,22 +31,22 @@ namespace soe void Init(); std::vector Final(); void Update(char char0); - void Update(State & state1, std::vector achar0, int i, int j); - void Update(std::string s); + void Update(State & state1, const std::vector &achar0, int i, int j); + void Update(const std::string &s); void Update(std::vector achar0); - void Update(std::vector achar0, int i); - void Update(std::vector achar0, int i, int j); + void Update(const std::vector &achar0, int i); + void Update(const std::vector &achar0, int i, int j); std::string asHex(); static std::string asHex(std::vector achar0); private: - std::vector Decode(std::vector achar0, int i, int j); - std::vector Encode(std::vector ai, int i); + std::vector Decode(const std::vector &achar0, int i, int j); + std::vector Encode(const std::vector &ai, int i); int FF(int i, int j, int k, int l, int i1, int j1, int k1); int GG(int i, int j, int k, int l, int i1, int j1, int k1); int HH(int i, int j, int k, int l, int i1, int j1, int k1); int II(int i, int j, int k, int l, int i1, int j1, int k1); - void Transform(State & state1, std::vector achar0, int i); + void Transform(State & state1, const std::vector &achar0, int i); int rotate_left(int i, int j); int uadd(int i, int j); int uadd(int i, int j, int k); diff --git a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/basicConfig.cpp b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/basicConfig.cpp index ae753234..fd7c8d08 100644 --- a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/basicConfig.cpp +++ b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/basicConfig.cpp @@ -29,7 +29,7 @@ BasicConfig::~BasicConfig() void BasicConfig::Push(const soe::NameValuePairs_t & paramValuePairs) { - for (soe::NameValuePairs_t::const_iterator pIter = paramValuePairs.begin(); pIter != paramValuePairs.end(); pIter++) + for (soe::NameValuePairs_t::const_iterator pIter = paramValuePairs.begin(); pIter != paramValuePairs.end(); ++pIter) { Set(pIter->name, pIter->value); } @@ -40,7 +40,7 @@ void BasicConfig::Pull(soe::NameValuePairs_t & paramValuePairs) const size_t index = paramValuePairs.size(); paramValuePairs.resize(index + mParamMap.size()); - for (ConfigMap_t::const_iterator pIter = mParamMap.begin(); pIter != mParamMap.end(); pIter++, index++) + for (ConfigMap_t::const_iterator pIter = mParamMap.begin(); pIter != mParamMap.end(); ++pIter, ++index) { paramValuePairs[index].name = pIter->first; paramValuePairs[index].value = pIter->second.first; diff --git a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/cmdLine.cpp b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/cmdLine.cpp index 6d0aa26a..8c04219e 100644 --- a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/cmdLine.cpp +++ b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/cmdLine.cpp @@ -79,7 +79,7 @@ int CmdLine::SplitLine(int argc, char **argv) } else { - arg = ""; + arg.clear(); } } @@ -87,7 +87,7 @@ int CmdLine::SplitLine(int argc, char **argv) CmdParam cmd; // only add non-empty args - if (arg != "") + if (!arg.empty()) { cmd.m_strings.push_back(arg); } diff --git a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/serializeTemplates.h b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/serializeTemplates.h index c2f745ed..3c867c3d 100644 --- a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/serializeTemplates.h +++ b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/serializeTemplates.h @@ -24,7 +24,7 @@ namespace soe return 0; } size_t index = 0; - for (typename std::map::const_iterator iter = data.begin(); iter != data.end(); iter++, index++) + for (typename std::map::const_iterator iter = data.begin(); iter != data.end(); ++iter, ++index) { elementBytes = Write(stream+bytes, size-bytes, iter->second, version); if (!elementBytes) { @@ -621,7 +621,7 @@ namespace soe virtual void ClearMembers() { typename MemberScribeVector_t::const_iterator memberIter; - for (memberIter = mMemberScribes.begin(); memberIter != mMemberScribes.end(); memberIter++) + for (memberIter = mMemberScribes.begin(); memberIter != mMemberScribes.end(); ++memberIter) { MemberScribe_t * pMemberScribe = *memberIter; delete pMemberScribe; @@ -655,7 +655,7 @@ namespace soe unsigned bytesTotal = 0; typename MemberScribeVector_t::const_iterator memberIter; - for (memberIter = mMemberScribes.begin(); memberIter != mMemberScribes.end(); memberIter++) + for (memberIter = mMemberScribes.begin(); memberIter != mMemberScribes.end(); ++memberIter) { MemberScribe_t * pMemberScribe = *memberIter; @@ -688,7 +688,7 @@ namespace soe unsigned bytesTotal = 0; typename MemberScribeVector_t::const_iterator memberIter; - for (memberIter = mMemberScribes.begin(); memberIter != mMemberScribes.end(); memberIter++) + for (memberIter = mMemberScribes.begin(); memberIter != mMemberScribes.end(); ++memberIter) { const MemberScribe_t * pMemberScribe = *memberIter; diff --git a/external/ours/library/archive/src/shared/AutoDeltaSet.h b/external/ours/library/archive/src/shared/AutoDeltaSet.h index a548dce4..21cc93ca 100644 --- a/external/ours/library/archive/src/shared/AutoDeltaSet.h +++ b/external/ours/library/archive/src/shared/AutoDeltaSet.h @@ -187,7 +187,7 @@ inline typename AutoDeltaSet::const_iterator AutoDeltaSet // @note apathy - hack to convert from const_iterator to iterator as requried by STLPort typename SetType::iterator tmp(m_set.begin()); std::advance(tmp, std::distance(tmp, i)); - i++; + ++i; m_set.erase(tmp); touch(); diff --git a/game/server/application/SwgDatabaseServer/src/shared/buffers/MarketAuctionsBuffer.cpp b/game/server/application/SwgDatabaseServer/src/shared/buffers/MarketAuctionsBuffer.cpp index 24a0ac51..8663d1ef 100644 --- a/game/server/application/SwgDatabaseServer/src/shared/buffers/MarketAuctionsBuffer.cpp +++ b/game/server/application/SwgDatabaseServer/src/shared/buffers/MarketAuctionsBuffer.cpp @@ -81,7 +81,7 @@ void MarketAuctionsBufferCreate::setMarketAuctions(const NetworkId &itemId, cons // ---------------------------------------------------------------------- -void MarketAuctionsBufferCreate::setMarketAuctions(const NetworkId &itemId, const NetworkId &ownerId, const NetworkId &creatorId, const NetworkId &locationId, const int minBid, const int buyNowPrice, const int auctionTimer, std::vector > const & attributes, const Unicode::String userDescription, const int category, const int itemTemplateId, const Unicode::String itemName, const int itemTimer, const int active, const int itemSize) +void MarketAuctionsBufferCreate::setMarketAuctions(const NetworkId &itemId, const NetworkId &ownerId, const NetworkId &creatorId, const NetworkId &locationId, const int minBid, const int buyNowPrice, const int auctionTimer, std::vector > const & attributes, const Unicode::String &userDescription, const int category, const int itemTemplateId, const Unicode::String &itemName, const int itemTimer, const int active, const int itemSize) { DBSchema::MarketAuctionsRow *row=findRowByIndex(itemId); if (!row) diff --git a/game/server/application/SwgDatabaseServer/src/shared/buffers/MarketAuctionsBuffer.h b/game/server/application/SwgDatabaseServer/src/shared/buffers/MarketAuctionsBuffer.h index 603a9d70..b9158f94 100644 --- a/game/server/application/SwgDatabaseServer/src/shared/buffers/MarketAuctionsBuffer.h +++ b/game/server/application/SwgDatabaseServer/src/shared/buffers/MarketAuctionsBuffer.h @@ -39,7 +39,7 @@ public: DBSchema::MarketAuctionsRow * findRowByIndex (const NetworkId &itemId); void setMarketAuctions (const NetworkId &itemId, const NetworkId &ownerId, const int active); - void setMarketAuctions (const NetworkId &itemId, const NetworkId &ownerId, const NetworkId &creatorId, const NetworkId &locationId, const int minBid, const int buyNowPrice, const int auctionTimer, std::vector > const & attributes, const Unicode::String userDescription, const int category, const int itemTemplateId, const Unicode::String itemName, const int itemTimer, const int active, const int itemSize); + void setMarketAuctions (const NetworkId &itemId, const NetworkId &ownerId, const NetworkId &creatorId, const NetworkId &locationId, const int minBid, const int buyNowPrice, const int auctionTimer, std::vector > const & attributes, const Unicode::String &userDescription, const int category, const int itemTemplateId, const Unicode::String &itemName, const int itemTimer, const int active, const int itemSize); void removeMarketAuctions (const NetworkId &itemId); virtual void removeObject (const NetworkId &object); diff --git a/game/server/application/SwgDatabaseServer/src/shared/core/SwgLoader.cpp b/game/server/application/SwgDatabaseServer/src/shared/core/SwgLoader.cpp index 206cd1ee..930aaf68 100644 --- a/game/server/application/SwgDatabaseServer/src/shared/core/SwgLoader.cpp +++ b/game/server/application/SwgDatabaseServer/src/shared/core/SwgLoader.cpp @@ -114,7 +114,7 @@ void SwgLoader::verifyCharacterFinished (TaskVerifyCharacter *task) // ---------------------------------------------------------------------- -void SwgLoader::locateStructure(const NetworkId &structureId, const std::string whoRequested) +void SwgLoader::locateStructure(const NetworkId &structureId, const std::string &whoRequested) { TaskLocateStructure *task = new TaskLocateStructure(structureId, whoRequested); taskQ->asyncRequest(task); diff --git a/game/server/application/SwgDatabaseServer/src/shared/core/SwgLoader.h b/game/server/application/SwgDatabaseServer/src/shared/core/SwgLoader.h index daecba41..501045c3 100644 --- a/game/server/application/SwgDatabaseServer/src/shared/core/SwgLoader.h +++ b/game/server/application/SwgDatabaseServer/src/shared/core/SwgLoader.h @@ -32,7 +32,7 @@ class SwgLoader : public Loader virtual void verifyCharacter(StationId suid, const NetworkId &id, const TransferCharacterData *); virtual void update(real updateTime); void verifyCharacterFinished (TaskVerifyCharacter *task); - virtual void locateStructure(const NetworkId &structureId, const std::string whoRequested); + virtual void locateStructure(const NetworkId &structureId, const std::string &whoRequested); private: virtual LoaderSnapshotGroup *makeLoaderSnapshotGroup(uint32 processId); diff --git a/game/server/application/SwgGameServer/src/shared/combat/ConfigCombatEngine.cpp b/game/server/application/SwgGameServer/src/shared/combat/ConfigCombatEngine.cpp index 4fd1db3e..68f8eb34 100644 --- a/game/server/application/SwgGameServer/src/shared/combat/ConfigCombatEngine.cpp +++ b/game/server/application/SwgGameServer/src/shared/combat/ConfigCombatEngine.cpp @@ -163,17 +163,17 @@ ConfigCombatEngine::SkeletonAttackMod skeletonAttackMod; { m_data.numberSkeletons = file.read_uint8() + 1; // set up all-body skeleton - bodyAttackMod.name = ""; - bodyAttackMod.modelBoneName = ""; + bodyAttackMod.name.clear(); + bodyAttackMod.modelBoneName.clear(); bodyAttackMod.toHitChance = 100; bodyAttackMod.toWoundBonus = 0; bodyAttackMod.combatSkeletonBone = 0; bodyAttackMod.damageBonus[Attributes::Health] = 0; bodyAttackMod.damageBonus[Attributes::Action] = 0; bodyAttackMod.damageBonus[Attributes::Mind] = 0; - skeletonAttackMod.name = ""; + skeletonAttackMod.name.clear(); skeletonAttackMod.numHitLocations = 1; - skeletonAttackMod.script = ""; + skeletonAttackMod.script.clear(); skeletonAttackMod.attackMods.clear(); skeletonAttackMod.attackMods.push_back(bodyAttackMod); m_data.skeletonAttackMods.push_back(skeletonAttackMod);