diff --git a/libretroshare/src/dbase/cachestrapper.cc b/libretroshare/src/dbase/cachestrapper.cc index 2dda4e6ba..fc59fa707 100644 --- a/libretroshare/src/dbase/cachestrapper.cc +++ b/libretroshare/src/dbase/cachestrapper.cc @@ -242,7 +242,7 @@ bool CacheSource::cachesAvailable(const RsPeerId& pid, std::mapsecond).cid] = it->second; } @@ -260,7 +260,7 @@ bool CacheSource::findCache(const RsFileHash &hash, RsCacheData &data) const bool found = false; CacheSet::const_iterator it; - for(it = caches.begin(); it != caches.end(); it++) + for(it = caches.begin(); it != caches.end(); ++it) { if (hash == (it->second).hash) { @@ -296,7 +296,7 @@ void CacheSource::listCaches(std::ostream &out) out << "CacheSource::listCaches() [" << getCacheType(); out << "] Total: " << caches.size() << std::endl; int i; - for(i = 0, it = caches.begin(); it != caches.end(); it++, i++) + for(i = 0, it = caches.begin(); it != caches.end(); ++it, ++i) { out << "\tC[" << i << "] : " << it->second << std::endl; } @@ -341,12 +341,12 @@ void CacheStore::listCaches(std::ostream &out) out << "CacheStore::listCaches() [" << getCacheType(); out << "] Total People: " << caches.size(); out << std::endl; - for(pit = caches.begin(); pit != caches.end(); pit++) + for(pit = caches.begin(); pit != caches.end(); ++pit) { CacheSet::iterator it; out << "\tTotal for [" << pit->first << "] : " << (pit->second).size(); out << std::endl; - for(it = (pit->second).begin(); it != (pit->second).end(); it++) + for(it = (pit->second).begin(); it != (pit->second).end(); ++it) { out << "\t\t" << it->second; out << std::endl; @@ -416,12 +416,12 @@ bool CacheStore::getAllStoredCaches(std::list &data) lockData(); /* LOCK MUTEX */ std::map::iterator pit; - for(pit = caches.begin(); pit != caches.end(); pit++) + for(pit = caches.begin(); pit != caches.end(); ++pit) { CacheSet::iterator cit; /* look for subid */ for(cit = (pit->second).begin(); - cit != (pit->second).end(); cit++) + cit != (pit->second).end(); ++cit) { data.push_back(cit->second); } @@ -638,7 +638,7 @@ void CacheStrapper::addCachePair(CachePair set) void CacheStrapper::statusChange(const std::list &plist) { std::list::const_iterator it; - for(it = plist.begin(); it != plist.end(); it++) + for(it = plist.begin(); it != plist.end(); ++it) { if(it->actions & RS_SERVICE_PEER_CONNECTED) { @@ -650,7 +650,7 @@ void CacheStrapper::statusChange(const std::list &plist) handleCacheQuery(it->id, hashs); RsStackMutex stack(csMtx); /******* LOCK STACK MUTEX *********/ - for(cit = hashs.begin(); cit != hashs.end(); cit++) + for(cit = hashs.begin(); cit != hashs.end(); ++cit) { mCacheUpdates.push_back(std::make_pair(it->id, cit->second)); } @@ -754,7 +754,7 @@ void CacheStrapper::handleCacheQuery(const RsPeerId& id, std::map::iterator it; - for(it = caches.begin(); it != caches.end(); it++) + for(it = caches.begin(); it != caches.end(); ++it) { (it->second).source -> cachesAvailable(id, hashs); } @@ -768,7 +768,7 @@ void CacheStrapper::listCaches(std::ostream &out) out << "CacheStrapper::listCaches() [" << mServiceCtrl->getOwnId(); out << "] " << " Total Caches: " << caches.size(); out << std::endl; - for(it = caches.begin(); it != caches.end(); it++) + for(it = caches.begin(); it != caches.end(); ++it) { out << "CacheType: " << it->first; out << std::endl; @@ -787,7 +787,7 @@ void CacheStrapper::listPeerStatus(std::ostream & /* out */) out << "CacheStrapper::listPeerStatus() [" << ownId; out << "] Total Peers: " << status.size() << " Total Caches: " << caches.size(); out << std::endl; - for(it = status.begin(); it != status.end(); it++) + for(it = status.begin(); it != status.end(); ++it) { out << "Peer: " << it->first; out << " Query: " << (it->second).query; @@ -803,7 +803,7 @@ bool CacheStrapper::findCache(const RsFileHash& hash, RsCacheData &data) cons { /* can overwrite for more control! */ std::map::const_iterator it; - for(it = caches.begin(); it != caches.end(); it++) + for(it = caches.begin(); it != caches.end(); ++it) { if ((it->second).source->findCache(hash, data)) { @@ -861,21 +861,21 @@ bool CacheStrapper::saveList(bool &cleanup, std::list& saveData) const RsPeerId& ownId = mServiceCtrl->getOwnId(); std::map::iterator it; - for(it = caches.begin(); it != caches.end(); it++) + for(it = caches.begin(); it != caches.end(); ++it) { std::map::iterator tit; std::map ownTmp; (it->second).source -> cachesAvailable(ownId, ownTmp); (it->second).store -> getAllStoredCaches(remoteCaches); - for(tit = ownTmp.begin(); tit != ownTmp.end(); tit++) + for(tit = ownTmp.begin(); tit != ownTmp.end(); ++tit) { if(CacheExist(tit->second)) ownCaches.push_back(tit->second); } } - for(cit = ownCaches.begin(); cit != ownCaches.end(); cit++) + for(cit = ownCaches.begin(); cit != ownCaches.end(); ++cit) { RsCacheConfig *rscc = new RsCacheConfig(); @@ -896,7 +896,7 @@ bool CacheStrapper::saveList(bool &cleanup, std::list& saveData) saveData.push_back(rscc); } - for(cit = remoteCaches.begin(); cit != remoteCaches.end(); cit++) + for(cit = remoteCaches.begin(); cit != remoteCaches.end(); ++cit) { if (cit->pid == ownId) { @@ -947,7 +947,7 @@ bool CacheStrapper::loadList(std::list& load) std::map > saveFiles; std::map >::iterator sit; - for(it = load.begin(); it != load.end(); it++) + for(it = load.begin(); it != load.end(); ++it) { /* switch on type */ if (NULL != (rscc = dynamic_cast(*it))) @@ -1060,7 +1060,7 @@ bool CacheStrapper::loadList(std::list& load) std::set::iterator fit; #endif std::map::iterator cit; - for(cit = caches.begin(); cit != caches.end(); cit++) + for(cit = caches.begin(); cit != caches.end(); ++cit) { std::string lcdir = (cit->second).source->getCacheDir(); std::string rcdir = (cit->second).store->getCacheDir(); @@ -1081,10 +1081,10 @@ bool CacheStrapper::loadList(std::list& load) #endif #ifdef CS_DEBUG - for(sit = saveFiles.begin(); sit != saveFiles.end(); sit++) + for(sit = saveFiles.begin(); sit != saveFiles.end(); ++sit) { std::cerr << "CacheStrapper::loadList() Files To Save in dir: <" << sit->first << ">" << std::endl; - for(fit = (sit->second).begin(); fit != (sit->second).end(); fit++) + for(fit = (sit->second).begin(); fit != (sit->second).end(); ++fit) { std::cerr << "\tFile: " << *fit << std::endl; } @@ -1092,7 +1092,7 @@ bool CacheStrapper::loadList(std::list& load) #endif std::set emptySet; - for(dit = cacheDirs.begin(); dit != cacheDirs.end(); dit++) + for(dit = cacheDirs.begin(); dit != cacheDirs.end(); ++dit) { #ifdef CS_DEBUG std::cerr << "CacheStrapper::loadList() Cleaning cache dir: <" << *dit << ">" << std::endl; @@ -1102,7 +1102,7 @@ bool CacheStrapper::loadList(std::list& load) if (sit != saveFiles.end()) { #ifdef CS_DEBUG - for(fit = (sit->second).begin(); fit != (sit->second).end(); fit++) + for(fit = (sit->second).begin(); fit != (sit->second).end(); ++fit) { std::cerr << "CacheStrapper::loadList() Keeping File: " << *fit << std::endl; } @@ -1141,7 +1141,7 @@ bool CacheTransfer::RequestCache(RsCacheData &data, CacheStore *cbStore) std::map::iterator dit; std::map::iterator sit; - for(dit = cbData.begin(); dit != cbData.end(); dit++) + for(dit = cbData.begin(); dit != cbData.end(); ++dit) { if (((dit->second).pid == data.pid) && ((dit->second).cid.type == data.cid.type) && diff --git a/libretroshare/src/dbase/fimonitor.cc b/libretroshare/src/dbase/fimonitor.cc index 96da1dda3..9a5ef390d 100644 --- a/libretroshare/src/dbase/fimonitor.cc +++ b/libretroshare/src/dbase/fimonitor.cc @@ -627,7 +627,7 @@ void FileIndexMonitor::run() while(isRunning()) { int i=0 ; - for(;;i++) + for(;;++i) { if(!isRunning()) return; @@ -781,7 +781,7 @@ void FileIndexMonitor::updateCycle() std::map::iterator fit; /* flag existing subdirs as old */ - for(dit = olddir->subdirs.begin(); dit != olddir->subdirs.end(); dit++) + for(dit = olddir->subdirs.begin(); dit != olddir->subdirs.end(); ++dit) { fe.name = (dit->second)->name; /* set the age as out-of-date so that it gets checked */ @@ -1409,7 +1409,7 @@ void FileIndexMonitor::setSharedDirectories(const std::list& d std::cerr << "FileIndexMonitor::setSharedDirectories() :\n"; #endif - for(it = dirs.begin(); it != dirs.end(); it++) + for(it = dirs.begin(); it != dirs.end(); ++it) { #ifdef FIM_DEBUG @@ -1462,7 +1462,7 @@ void FileIndexMonitor::getSharedDirectories(std::list &dirs) /* get actual list (not pending stuff) */ std::map::const_iterator it; - for(it = directoryMap.begin(); it != directoryMap.end(); it++) + for(it = directoryMap.begin(); it != directoryMap.end(); ++it) dirs.push_back(it->second) ; } } @@ -1522,7 +1522,7 @@ bool FileIndexMonitor::internal_setSharedDirectories() /* iterate through the directories */ std::list::iterator it; std::map::const_iterator cit; - for(it = pendingDirList.begin(); it != pendingDirList.end(); it++) + for(it = pendingDirList.begin(); it != pendingDirList.end(); ++it) { /* get the head directory */ std::string root_dir = (*it).filename; @@ -1533,7 +1533,7 @@ bool FileIndexMonitor::internal_setSharedDirectories() /* if unique -> add, else add modifier */ bool unique = false; - for(i = 0; !unique; i++) + for(i = 0; !unique; ++i) { std::string tst_dir = top_dir; if (i > 0) @@ -1560,7 +1560,7 @@ bool FileIndexMonitor::internal_setSharedDirectories() * fileIndex */ std::list topdirs; - for(cit = directoryMap.begin(); cit != directoryMap.end(); cit++) + for(cit = directoryMap.begin(); cit != directoryMap.end(); ++cit) { topdirs.push_back(cit->first); } diff --git a/libretroshare/src/dbase/findex.cc b/libretroshare/src/dbase/findex.cc index f4948d0e2..c89f011eb 100644 --- a/libretroshare/src/dbase/findex.cc +++ b/libretroshare/src/dbase/findex.cc @@ -77,14 +77,14 @@ DirEntry::~DirEntry() std::map::iterator dit; std::map::iterator fit; - for(dit = subdirs.begin(); dit != subdirs.end(); dit++) + for(dit = subdirs.begin(); dit != subdirs.end(); ++dit) { FileIndex::unregisterEntry((void*)dit->second) ; delete (dit->second); } subdirs.clear(); - for(fit = files.begin(); fit != files.end(); fit++) + for(fit = files.begin(); fit != files.end(); ++fit) { FileIndex::unregisterEntry((void*)fit->second) ; delete (fit->second); @@ -98,7 +98,7 @@ int DirEntry::checkParentPointers() #ifdef FI_DEBUG updateChildRows(); std::map::iterator dit; - for(dit = subdirs.begin(); dit != subdirs.end(); dit++) + for(dit = subdirs.begin(); dit != subdirs.end(); ++dit) { /* debug check */ (dit->second)->checkParentPointers(); @@ -115,7 +115,7 @@ int DirEntry::updateChildRows() std::map::iterator dit; std::map::iterator fit; int i = 0; - for(dit = subdirs.begin(); dit != subdirs.end(); dit++) + for(dit = subdirs.begin(); dit != subdirs.end(); ++dit) { #ifdef FI_DEBUG /* debug check */ @@ -130,7 +130,7 @@ int DirEntry::updateChildRows() (dit->second)->row = i++; } - for(fit = files.begin(); fit != files.end(); fit++) + for(fit = files.begin(); fit != files.end(); ++fit) { #ifdef FI_DEBUG /* debug check */ @@ -254,7 +254,7 @@ int DirEntry::removeOldEntries(time_t old, bool recursive) /* get all dirs with old time */ std::list removeList; std::map::iterator it; - for(it = subdirs.begin(); it != subdirs.end(); it++) + for(it = subdirs.begin(); it != subdirs.end(); ++it) { if ((it->second)->updtime < old) { @@ -266,7 +266,7 @@ int DirEntry::removeOldEntries(time_t old, bool recursive) /* now remove the old entries */ std::list::iterator rit; - for(rit = removeList.begin(); rit != removeList.end(); rit++) + for(rit = removeList.begin(); rit != removeList.end(); ++rit) { removeDir((*rit)->name); } @@ -274,7 +274,7 @@ int DirEntry::removeOldEntries(time_t old, bool recursive) if (recursive) { /* now handle children */ - for(it = subdirs.begin(); it != subdirs.end(); it++) + for(it = subdirs.begin(); it != subdirs.end(); ++it) { count += (it->second)->removeOldEntries(old, recursive); } @@ -283,7 +283,7 @@ int DirEntry::removeOldEntries(time_t old, bool recursive) /* now handle files similarly */ std::list removeFileList; std::map::iterator fit; - for(fit = files.begin(); fit != files.end(); fit++) + for(fit = files.begin(); fit != files.end(); ++fit) { if ((fit->second)->updtime < old) { @@ -295,7 +295,7 @@ int DirEntry::removeOldEntries(time_t old, bool recursive) /* now remove the old entries */ std::list::iterator rfit; - for(rfit = removeFileList.begin(); rfit != removeFileList.end(); rfit++) + for(rfit = removeFileList.begin(); rfit != removeFileList.end(); ++rfit) { removeFile((*rfit)->name); } @@ -311,7 +311,7 @@ DirEntry *DirEntry::findOldDirectory(time_t old) /* get all dirs with old time */ std::map::iterator it; - for(it = subdirs.begin(); it != subdirs.end(); it++) + for(it = subdirs.begin(); it != subdirs.end(); ++it) { if ((it->second)->updtime < old) { @@ -323,7 +323,7 @@ DirEntry *DirEntry::findOldDirectory(time_t old) * else check chlidren. */ - for(it = subdirs.begin(); it != subdirs.end(); it++) + for(it = subdirs.begin(); it != subdirs.end(); ++it) { DirEntry *olddir = (it->second)->findOldDirectory(old); if (olddir) @@ -512,12 +512,12 @@ int DirEntry::print(std::string &out) rs_sprintf_append(out, "dir %03d [%ld] : %s\n", row, updtime, path.c_str()); std::map::iterator it; - for(it = subdirs.begin(); it != subdirs.end(); it++) + for(it = subdirs.begin(); it != subdirs.end(); ++it) { (it->second)->print(out); } std::map::iterator fit; - for(fit = files.begin(); fit != files.end(); fit++) + for(fit = files.begin(); fit != files.end(); ++fit) { (fit->second)->print(out); } @@ -541,7 +541,7 @@ int FileIndex::setRootDirectories(const std::list &inlist, time_t u { /* set update time to zero */ std::map::iterator it; - for(it = root->subdirs.begin(); it != root->subdirs.end(); it++) + for(it = root->subdirs.begin(); it != root->subdirs.end(); ++it) { (it->second)->updtime = 0; } @@ -549,7 +549,7 @@ int FileIndex::setRootDirectories(const std::list &inlist, time_t u std::list::const_iterator ait; FileEntry fe; time_t utime = 1; - for(ait = inlist.begin(); ait != inlist.end(); ait++) + for(ait = inlist.begin(); ait != inlist.end(); ++ait) { fe.name = (*ait); @@ -561,7 +561,7 @@ int FileIndex::setRootDirectories(const std::list &inlist, time_t u int cleanedCount = root->removeOldEntries(utime, false); /* now flag remaining directories with correct update time */ - for(it = root->subdirs.begin(); it != root->subdirs.end(); it++) + for(it = root->subdirs.begin(); it != root->subdirs.end(); ++it) { (it->second)->updtime = updtime; } @@ -611,7 +611,7 @@ int FileIndex::getRootDirectories(std::list &outlist) { /* set update time to zero */ std::map::iterator it; - for(it = root->subdirs.begin(); it != root->subdirs.end(); it++) + for(it = root->subdirs.begin(); it != root->subdirs.end(); ++it) { outlist.push_back(it->first); } @@ -730,7 +730,7 @@ int FileIndex::cleanOldEntries(time_t old) /* removes entries older than old */ int count = 0; std::map::iterator it; - for(it = root->subdirs.begin(); it != root->subdirs.end(); it++) + for(it = root->subdirs.begin(); it != root->subdirs.end(); ++it) { count += (it->second)->removeOldEntries(old, true); } @@ -796,7 +796,7 @@ int FileIndex::loadIndex(const std::string& filename, const RsFileHash& expected // delete sha_ctx; // // std::string tmpout; -// for(int i = 0; i < SHA_DIGEST_LENGTH; i++) +// for(int i = 0; i < SHA_DIGEST_LENGTH; ++i) // { // rs_sprintf_append(tmpout, "%02x", (unsigned int) (sha_buf[i])); // } @@ -885,7 +885,7 @@ int FileIndex::loadIndex(const std::string& filename, const RsFileHash& expected /* must reset parent pointers now */ std::map::iterator it; for(it = root->subdirs.begin(); - it != root->subdirs.end(); it++) + it != root->subdirs.end(); ++it) { (it->second)->parent = root; } @@ -931,7 +931,7 @@ int FileIndex::loadIndex(const std::string& filename, const RsFileHash& expected std::cerr << "loadIndex error parsing saved file: " << filename; std::cerr << " File token count wrong: " << tokens.size(); std::cerr << std::endl; - for(unsigned int i = 0; i < tokens.size(); i++) + for(unsigned int i = 0; i < tokens.size(); ++i) { std::cerr << "\tToken[" << i << "]:" << tokens[i]; std::cerr << std::endl; @@ -1015,7 +1015,7 @@ int FileIndex::saveIndex(const std::string& filename, RsFileHash &fileHash, uint root->writeDirInfo(s) ; std::map::iterator it; - for(it = root->subdirs.begin(); it != root->subdirs.end(); it++) + for(it = root->subdirs.begin(); it != root->subdirs.end(); ++it) { #ifdef FI_DEBUG std::cout << "writting root directory: name=" << it->second->name << ", path=" << it->second->path << std::endl ; @@ -1067,7 +1067,7 @@ int FileIndex::saveIndex(const std::string& filename, RsFileHash &fileHash, uint // SHA1_Final(&sha_buf[0], sha_ctx); // delete sha_ctx; // -// for(int i = 0; i < SHA_DIGEST_LENGTH; i++) +// for(int i = 0; i < SHA_DIGEST_LENGTH; ++i) // { // rs_sprintf_append(fileHash, "%02x", (unsigned int) (sha_buf[i])); // } @@ -1115,7 +1115,7 @@ std::string FixName(const std::string& _in) { /* replace any , with _ */ std::string in(_in) ; - for(unsigned int i = 0; i < in.length(); i++) + for(unsigned int i = 0; i < in.length(); ++i) { if (in[i] == FILE_CACHE_SEPARATOR_CHAR) { @@ -1141,7 +1141,7 @@ void DirEntry::writeFileInfo(std::string& s) { /* print file info */ std::map::iterator fit; - for(fit = files.begin(); fit != files.end(); fit++) + for(fit = files.begin(); fit != files.end(); ++fit) { rs_sprintf_append(s, "f%s%c%s%c%lld%c%ld%c%d%c%ld%c\n", FixName((fit->second)->name).c_str(), FILE_CACHE_SEPARATOR_CHAR, @@ -1159,7 +1159,7 @@ int DirEntry::saveEntry(std::string &s) writeDirInfo(s) ; std::map::iterator it; - for(it = subdirs.begin(); it != subdirs.end(); it++) + for(it = subdirs.begin(); it != subdirs.end(); ++it) { (it->second)->saveEntry(s); } @@ -1195,14 +1195,14 @@ int FileIndex::searchHash(const RsFileHash& hash, std::list &result dirlist.pop_back(); /* add subdirs to stack */ std::map::iterator it; - for(it = ndir->subdirs.begin(); it != ndir->subdirs.end(); it++) + for(it = ndir->subdirs.begin(); it != ndir->subdirs.end(); ++it) { dirlist.push_back(it->second); } std::map::iterator fit; /* search in current dir */ - for(fit = ndir->files.begin(); fit != ndir->files.end(); fit++) + for(fit = ndir->files.begin(); fit != ndir->files.end(); ++fit) { if (hash == (fit->second)->hash) { @@ -1236,12 +1236,12 @@ int FileIndex::searchTerms(const std::list& terms, std::listsubdirs.begin(); it != ndir->subdirs.end(); it++) + for(it = ndir->subdirs.begin(); it != ndir->subdirs.end(); ++it) { dirlist.push_back(it->second); } - for (iter = terms.begin(); iter != terms.end(); iter ++) { + for (iter = terms.begin(); iter != terms.end(); ++iter) { std::string::const_iterator it2; const std::string &str1 = ndir->name; const std::string &str2 = *iter; @@ -1249,7 +1249,7 @@ int FileIndex::searchTerms(const std::list& terms, std::list::iterator rit(results.begin()); rit != results.end() && addDir; rit ++) { + for (std::list::iterator rit(results.begin()); rit != results.end() && addDir; ++rit) { DirEntry *de = dynamic_cast(*rit); if (de && (de == root)) continue; @@ -1263,10 +1263,10 @@ int FileIndex::searchTerms(const std::list& terms, std::listfiles.begin(); fit != ndir->files.end(); fit++) + for(fit = ndir->files.begin(); fit != ndir->files.end(); ++fit) { /* cycle through terms */ - for(iter = terms.begin(); iter != terms.end(); iter++) + for(iter = terms.begin(); iter != terms.end(); ++iter) { /* always ignore case */ std::string::const_iterator it2 ; @@ -1309,12 +1309,12 @@ int FileIndex::searchBoolExp(Expression * exp, std::list &results) { ndir = dirlist.back(); dirlist.pop_back(); - for(it = ndir->subdirs.begin(); it != ndir->subdirs.end(); it++) + for(it = ndir->subdirs.begin(); it != ndir->subdirs.end(); ++it) { dirlist.push_back(it->second); } - for(fit = ndir->files.begin(); fit != ndir->files.end(); fit++) + for(fit = ndir->files.begin(); fit != ndir->files.end(); ++fit) { /*Evaluate the boolean expression and add it to the results if its true*/ bool ret = exp->eval(fit->second); diff --git a/libretroshare/src/dbase/fistore.cc b/libretroshare/src/dbase/fistore.cc index ef1e784b4..e413f4c09 100644 --- a/libretroshare/src/dbase/fistore.cc +++ b/libretroshare/src/dbase/fistore.cc @@ -148,7 +148,7 @@ int FileIndexStore::loadCache(const RsCacheData &data) /* need to correct indices(row) for the roots of the FileIndex */ int i = 0; - for(it = indices.begin(); it != indices.end(); it++) + for(it = indices.begin(); it != indices.end(); ++it) { (it->second)->root->row = i++; it->second->FileIndex::updateMaxModTime() ; @@ -232,7 +232,7 @@ int FileIndexStore::RequestDirDetails(void *ref, DirDetails &details, FileSearch #ifdef FIS_DEBUG std::cerr << "FileIndexStore::RequestDirDetails() CHKS" << std::endl; - for(pit = indices.begin(); pit != indices.end(); pit++) + for(pit = indices.begin(); pit != indices.end(); ++pit) { (pit->second)->root->checkParentPointers(); } @@ -245,7 +245,7 @@ int FileIndexStore::RequestDirDetails(void *ref, DirDetails &details, FileSearch #endif /* get remote root entries */ - for(pit = indices.begin(); pit != indices.end(); pit++) + for(pit = indices.begin(); pit != indices.end(); ++pit) { /* */ @@ -301,7 +301,7 @@ int FileIndexStore::SearchHash(const RsFileHash& hash, std::list &re #ifdef FIS_DEBUG std::cerr << "FileIndexStore::SearchHash()" << std::endl; #endif - for(pit = indices.begin(); pit != indices.end(); pit++) + for(pit = indices.begin(); pit != indices.end(); ++pit) { #ifdef FIS_DEBUG std::cerr << "FileIndexStore::SearchHash() Searching: Peer "; @@ -311,7 +311,7 @@ int FileIndexStore::SearchHash(const RsFileHash& hash, std::list &re (pit->second)->searchHash(hash, firesults); /* translate results */ - for(rit = firesults.begin(); rit != firesults.end(); rit++) + for(rit = firesults.begin(); rit != firesults.end(); ++rit) { FileDetail fd; fd.id = pit->first; @@ -351,13 +351,13 @@ int FileIndexStore::SearchKeywords(std::list keywords, std::listsecond)->searchTerms(keywords, firesults); /* translate results */ - for(rit = firesults.begin(); rit != firesults.end(); rit++) + for(rit = firesults.begin(); rit != firesults.end(); ++rit) { DirDetails dd; @@ -375,7 +375,7 @@ int FileIndexStore::SearchKeywords(std::list keywords, std::listsearchTerms(keywords, firesults); /* translate results */ - for(rit = firesults.begin(); rit != firesults.end(); rit++) + for(rit = firesults.begin(); rit != firesults.end(); ++rit) { DirDetails dd; @@ -403,14 +403,14 @@ int FileIndexStore::searchBoolExp(Expression * exp, std::list &resul #ifdef FIS_DEBUG std::cerr << "FileIndexStore::searchBoolExp()" << std::endl; #endif - for(pit = indices.begin(); pit != indices.end(); pit++) + for(pit = indices.begin(); pit != indices.end(); ++pit) { firesults.clear(); (pit->second)->searchBoolExp(exp, firesults); /* translate results */ - for(rit = firesults.begin(); rit != firesults.end(); rit++) + for(rit = firesults.begin(); rit != firesults.end(); ++rit) { DirDetails dd; FileIndex::extractData(*rit, dd); @@ -427,7 +427,7 @@ int FileIndexStore::searchBoolExp(Expression * exp, std::list &resul localindex->searchBoolExp(exp, firesults); /* translate results */ - for(rit = firesults.begin(); rit != firesults.end(); rit++) + for(rit = firesults.begin(); rit != firesults.end(); ++rit) { DirDetails dd; FileIndex::extractData(*rit, dd); diff --git a/libretroshare/src/dbase/rsexpr.cc b/libretroshare/src/dbase/rsexpr.cc index 6a3382030..c9e1ff798 100644 --- a/libretroshare/src/dbase/rsexpr.cc +++ b/libretroshare/src/dbase/rsexpr.cc @@ -135,7 +135,7 @@ bool StringExpression :: evalStr ( const std::string &str ){ std::list::iterator iter; switch (Op) { case ContainsAllStrings: - for ( iter = terms.begin(); iter != terms.end(); iter++ ) { + for ( iter = terms.begin(); iter != terms.end(); ++iter ) { if ( StrContains (str, *iter, IgnoreCase) == false ){ return false; } @@ -143,14 +143,14 @@ bool StringExpression :: evalStr ( const std::string &str ){ return true; break; case ContainsAnyStrings: - for ( iter = terms.begin(); iter != terms.end(); iter++ ) { + for ( iter = terms.begin(); iter != terms.end(); ++iter ) { if ( StrContains (str,*iter, IgnoreCase) == true ) { return true; } } break; case EqualsString: - for ( iter = terms.begin(); iter != terms.end(); iter++ ) { + for ( iter = terms.begin(); iter != terms.end(); ++iter ) { if ( StrEquals (str,*iter, IgnoreCase) == true ) { return true; } diff --git a/libretroshare/src/dht/p3bitdht_interface.cc b/libretroshare/src/dht/p3bitdht_interface.cc index d73ffebe4..7eaff764e 100644 --- a/libretroshare/src/dht/p3bitdht_interface.cc +++ b/libretroshare/src/dht/p3bitdht_interface.cc @@ -54,7 +54,7 @@ int p3BitDht::getDhtPeers(int lvl, std::list &peers) std::list::iterator it; mUdpBitDht->getDhtBucket(lvl, int_peers); - for(it = int_peers.entries.begin(); it != int_peers.entries.end(); it++) + for(it = int_peers.entries.begin(); it != int_peers.entries.end(); ++it) { RsDhtPeer peer; @@ -70,7 +70,7 @@ int p3BitDht::getNetPeerList(std::list &peerIds) { RsStackMutex stack(dhtMtx); /*********** LOCKED **********/ std::map::iterator it; - for(it = mPeers.begin(); it != mPeers.end(); it++) + for(it = mPeers.begin(); it != mPeers.end(); ++it) { peerIds.push_back(it->second.mRsId); } @@ -106,7 +106,7 @@ int p3BitDht::getRelayEnds(std::list &relayEnds) std::list::iterator it; mRelay->getRelayEnds(int_relayEnds); - for(it = int_relayEnds.begin(); it != int_relayEnds.end(); it++) + for(it = int_relayEnds.begin(); it != int_relayEnds.end(); ++it) { RsDhtRelayEnd end; convertUdpRelayEndtoRsDhtRelayEnd(end, *it); @@ -129,7 +129,7 @@ int p3BitDht::getRelayProxies(std::list &relayProxies) std::list::iterator it; mRelay->getRelayProxies(int_relayProxies); - for(it = int_relayProxies.begin(); it != int_relayProxies.end(); it++) + for(it = int_relayProxies.begin(); it != int_relayProxies.end(); ++it) { RsDhtRelayProxy proxy; convertUdpRelayProxytoRsDhtRelayProxy(proxy, *it); diff --git a/libretroshare/src/dht/p3bitdht_peernet.cc b/libretroshare/src/dht/p3bitdht_peernet.cc index 71e14061f..d8b097697 100644 --- a/libretroshare/src/dht/p3bitdht_peernet.cc +++ b/libretroshare/src/dht/p3bitdht_peernet.cc @@ -2145,7 +2145,7 @@ void p3BitDht::monitorConnections() std::map::iterator it; - for(it = mPeers.begin(); it != mPeers.end(); it++) + for(it = mPeers.begin(); it != mPeers.end(); ++it) { /* ignore ones which aren't friends */ if (it->second.mPeerType != RSDHT_PEERTYPE_FRIEND) diff --git a/libretroshare/src/dht/p3bitdht_relay.cc b/libretroshare/src/dht/p3bitdht_relay.cc index 86243075b..47d4665ed 100644 --- a/libretroshare/src/dht/p3bitdht_relay.cc +++ b/libretroshare/src/dht/p3bitdht_relay.cc @@ -100,7 +100,7 @@ int p3BitDht::pushRelayServers() } std::list::iterator it; - for(it = servers.begin(); it != servers.end(); it++) + for(it = servers.begin(); it != servers.end(); ++it) { /* push it to dht */ uint32_t bdflags = BITDHT_PEER_STATUS_DHT_RELAY_SERVER; @@ -227,7 +227,7 @@ bool p3BitDht::saveList(bool &cleanup, std::list &saveList) /* Push Relay Class Stuff */ int i; - for(i = 0; i < RSDHT_RELAY_NUM_CLASS; i++) + for(i = 0; i < RSDHT_RELAY_NUM_CLASS; ++i) { rs_sprintf(kv.key, "RELAY_CLASS%d_COUNT", i); rs_sprintf(kv.value, "%d", mRelay->getRelayClassMax(i)); @@ -247,7 +247,7 @@ bool p3BitDht::saveList(bool &cleanup, std::list &saveList) /* add Servers */ std::list::iterator it; - for(i = 0, it = mRelayServerList.begin(); it != mRelayServerList.end(); it++, i++) + for(i = 0, it = mRelayServerList.begin(); it != mRelayServerList.end(); ++it, ++i) { rs_sprintf(kv.key, "RELAY_SERVER%d", i); kv.value = *it; @@ -306,7 +306,7 @@ bool p3BitDht::loadList(std::list& load) int mode = 0; std::list::iterator it; - for(it = config->tlvkvs.pairs.begin(); it != config->tlvkvs.pairs.end(); it++) + for(it = config->tlvkvs.pairs.begin(); it != config->tlvkvs.pairs.end(); ++it) { std::string key = it->key; std::string value = it->value; @@ -383,7 +383,7 @@ bool p3BitDht::loadList(std::list& load) } int i; - for(i = 0; i < RSDHT_RELAY_NUM_CLASS; i++) + for(i = 0; i < RSDHT_RELAY_NUM_CLASS; ++i) { mRelay->setRelayClassMax(i, peers[i], bandwidth[i]); } diff --git a/libretroshare/src/ft/ftcontroller.cc b/libretroshare/src/ft/ftcontroller.cc index 34a560623..c50706d94 100644 --- a/libretroshare/src/ft/ftcontroller.cc +++ b/libretroshare/src/ft/ftcontroller.cc @@ -284,14 +284,14 @@ void ftController::searchForDirectSources() { RsStackMutex stack(ctrlMutex); /******* LOCKED ********/ - for(std::map::iterator it(mDownloads.begin()); it != mDownloads.end(); it++) + for(std::map::iterator it(mDownloads.begin()); it != mDownloads.end(); ++it) if(it->second->mState != ftFileControl::QUEUED && it->second->mState != ftFileControl::PAUSED) if(! (it->second->mFlags & RS_FILE_REQ_CACHE)) { FileInfo info ; // info needs to be re-allocated each time, to start with a clear list of peers (it's not cleared down there) if(mSearch->search(it->first, RS_FILE_HINTS_REMOTE | RS_FILE_HINTS_SPEC_ONLY, info)) - for(std::list::const_iterator pit = info.peers.begin(); pit != info.peers.end(); pit++) + for(std::list::const_iterator pit = info.peers.begin(); pit != info.peers.end(); ++pit) if(rsPeers->servicePermissionFlags(pit->peerId) & RS_SERVICE_PERM_DIRECT_DL) if(it->second->mTransfer->addFileSource(pit->peerId)) /* if the sources don't exist already - add in */ setPeerState(it->second->mTransfer, pit->peerId, FT_CNTRL_STANDARD_RATE, mServiceCtrl->isPeerConnected(mFtServiceId, pit->peerId)); @@ -309,7 +309,7 @@ void ftController::tickTransfers() #endif // Collect all non queued files. // - for(std::map::iterator it(mDownloads.begin()); it != mDownloads.end(); it++) + for(std::map::iterator it(mDownloads.begin()); it != mDownloads.end(); ++it) if(it->second->mState != ftFileControl::QUEUED && it->second->mState != ftFileControl::PAUSED) it->second->mTransfer->tick() ; } @@ -1152,7 +1152,7 @@ bool ftController::FileRequest(const std::string& fname, const RsFileHash& hash std::cerr << hash << "," << size << "," << dest << ","; std::cerr << flags << ",<"; - for(it = srcIds.begin(); it != srcIds.end(); it++) + for(it = srcIds.begin(); it != srcIds.end(); ++it) { std::cerr << *it << ","; } @@ -1189,7 +1189,7 @@ bool ftController::FileRequest(const std::string& fname, const RsFileHash& hash * (needed for channels). */ - for(it = srcIds.begin(); it != srcIds.end(); it++) + for(it = srcIds.begin(); it != srcIds.end(); ++it) if(rsPeers->servicePermissionFlags(*it) & RS_SERVICE_PERM_DIRECT_DL) { uint32_t i, j; @@ -1237,7 +1237,7 @@ bool ftController::FileRequest(const std::string& fname, const RsFileHash& hash #endif /* if the sources don't exist already - add in */ - for(pit = info.peers.begin(); pit != info.peers.end(); pit++) + for(pit = info.peers.begin(); pit != info.peers.end(); ++pit) { #ifdef CONTROL_DEBUG std::cerr << "\tSource: " << pit->peerId; @@ -1296,7 +1296,7 @@ bool ftController::FileRequest(const std::string& fname, const RsFileHash& hash tm->setFileSources(srcIds); /* get current state for transfer module */ - for(it = srcIds.begin(); it != srcIds.end(); it++) + for(it = srcIds.begin(); it != srcIds.end(); ++it) { #ifdef CONTROL_DEBUG std::cerr << "ftController::FileRequest() adding peer: " << *it; @@ -1529,11 +1529,11 @@ bool ftController::FileDownloads(std::list &hashs) RsStackMutex stack(ctrlMutex); /******* LOCKED ********/ std::map::iterator it; - for(it = mDownloads.begin(); it != mDownloads.end(); it++) + for(it = mDownloads.begin(); it != mDownloads.end(); ++it) { hashs.push_back(it->second->mHash); } - for(it = mCompleted.begin(); it != mCompleted.end(); it++) + for(it = mCompleted.begin(); it != mCompleted.end(); ++it) { hashs.push_back(it->second->mHash); } @@ -1588,7 +1588,7 @@ bool ftController::setPartialsDirectory(std::string path) std::list::iterator it; std::list dirs; rsFiles->getSharedDirectories(dirs); - for (it = dirs.begin(); it != dirs.end(); it++) { + for (it = dirs.begin(); it != dirs.end(); ++it) { if (!path.find((*it).filename)) { return false; } @@ -1609,7 +1609,7 @@ bool ftController::setPartialsDirectory(std::string path) #if 0 /*** FIX ME !!!**************/ /* move all existing files! */ std::map::iterator it; - for(it = mDownloads.begin(); it != mDownloads.end(); it++) + for(it = mDownloads.begin(); it != mDownloads.end(); ++it) { (it->second).mCreator->changePartialDirectory(mPartialPath); } @@ -1724,7 +1724,7 @@ bool ftController::FileDetails(const RsFileHash &hash, FileInfo &info) bool isDownloading = false; bool isSuspended = false; - for(pit = peerIds.begin(); pit != peerIds.end(); pit++) + for(pit = peerIds.begin(); pit != peerIds.end(); ++pit) { if (it->second->mTransfer->getPeerState(*pit, state, tfRate)) { @@ -1826,7 +1826,7 @@ void ftController::statusChange(const std::list &plist) std::cerr << std::endl; #endif - for(it = mDownloads.begin(); it != mDownloads.end(); it++) + for(it = mDownloads.begin(); it != mDownloads.end(); ++it) if(it->second->mState == ftFileControl::DOWNLOADING) { #ifdef CONTROL_DEBUG @@ -1834,7 +1834,7 @@ void ftController::statusChange(const std::list &plist) std::cerr << it->first; std::cerr << std::endl; #endif - for(pit = plist.begin(); pit != plist.end(); pit++) + for(pit = plist.begin(); pit != plist.end(); ++pit) { #ifdef CONTROL_DEBUG std::cerr << "Peer: " << pit->id; @@ -1876,7 +1876,7 @@ void ftController::statusChange(const std::list &plist) std::cerr << "vlist.size() = " << vlist.size() << std::endl; #endif - for(vit = vlist.begin(); vit != vlist.end(); vit++) + for(vit = vlist.begin(); vit != vlist.end(); ++vit) { #ifdef CONTROL_DEBUG std::cerr << "Peer: " << vit->id; @@ -2021,7 +2021,7 @@ bool ftController::saveList(bool &cleanup, std::list& saveData) RsConfigKeyValueSet *rskv = new RsConfigKeyValueSet(); /* Convert to TLV */ - for(mit = configMap.begin(); mit != configMap.end(); mit++) + for(mit = configMap.begin(); mit != configMap.end(); ++mit) { RsTlvKeyValue kv; kv.key = mit->first; @@ -2044,7 +2044,7 @@ bool ftController::saveList(bool &cleanup, std::list& saveData) std::list hashs; FileDownloads(hashs); - for(it = hashs.begin(); it != hashs.end(); it++) + for(it = hashs.begin(); it != hashs.end(); ++it) { /* stack mutex released each loop */ RsStackMutex stack(ctrlMutex); /******* LOCKED ********/ @@ -2166,7 +2166,7 @@ bool ftController::loadList(std::list& load) std::cerr << std::endl; #endif - for(it = load.begin(); it != load.end(); it++) + for(it = load.begin(); it != load.end(); ++it) { /* switch on type */ if (NULL != (rskv = dynamic_cast(*it))) @@ -2174,7 +2174,7 @@ bool ftController::loadList(std::list& load) /* make into map */ std::map configMap; for(kit = rskv->tlvkvs.pairs.begin(); - kit != rskv->tlvkvs.pairs.end(); kit++) + kit != rskv->tlvkvs.pairs.end(); ++kit) { configMap[kit->key] = kit->value; } diff --git a/libretroshare/src/ft/ftdatamultiplex.cc b/libretroshare/src/ft/ftdatamultiplex.cc index 32e04af28..46f2fba44 100644 --- a/libretroshare/src/ft/ftdatamultiplex.cc +++ b/libretroshare/src/ft/ftdatamultiplex.cc @@ -124,7 +124,7 @@ bool ftDataMultiplex::FileUploads(std::list &hashs) { RsStackMutex stack(dataMtx); /******* LOCK MUTEX ******/ std::map::iterator sit; - for(sit = mServers.begin(); sit != mServers.end(); sit++) + for(sit = mServers.begin(); sit != mServers.end(); ++sit) { hashs.push_back(sit->first); } @@ -135,7 +135,7 @@ bool ftDataMultiplex::FileDownloads(std::list &hashs) { RsStackMutex stack(dataMtx); /******* LOCK MUTEX ******/ std::map::iterator cit; - for(cit = mClients.begin(); cit != mClients.end(); cit++) + for(cit = mClients.begin(); cit != mClients.end(); ++cit) { hashs.push_back(cit->first); } diff --git a/libretroshare/src/ft/ftdbase.cc b/libretroshare/src/ft/ftdbase.cc index b8b3e5055..25cbe65f2 100644 --- a/libretroshare/src/ft/ftdbase.cc +++ b/libretroshare/src/ft/ftdbase.cc @@ -61,7 +61,7 @@ bool ftFiStore::search(const RsFileHash &hash, FileSearchFlags hintflags, FileIn if (SearchHash(hash, results)) { bool first = true; - for(it = results.begin(); it != results.end(); it++) + for(it = results.begin(); it != results.end(); ++it) { #ifdef DB_DEBUG std::cerr << "ftFiStore::search() found: "; @@ -235,7 +235,7 @@ bool ftFiMonitor::saveList(bool &cleanup, std::list& sList) getSharedDirectories(dirList); - for(it = dirList.begin(); it != dirList.end(); it++) + for(it = dirList.begin(); it != dirList.end(); ++it) { RsFileConfigItem *fi = new RsFileConfigItem(); fi->file.path = (*it).filename ; @@ -267,7 +267,7 @@ bool ftFiMonitor::saveList(bool &cleanup, std::list& sList) RsConfigKeyValueSet *rskv = new RsConfigKeyValueSet(); /* Convert to TLV */ - for(std::map::const_iterator mit = configMap.begin(); mit != configMap.end(); mit++) + for(std::map::const_iterator mit = configMap.begin(); mit != configMap.end(); ++mit) { RsTlvKeyValue kv; kv.key = mit->first; @@ -298,7 +298,7 @@ bool ftFiMonitor::loadList(std::list& load) std::list dirList; std::list::iterator it; - for(it = load.begin(); it != load.end(); it++) + for(it = load.begin(); it != load.end(); ++it) { RsConfigKeyValueSet *rskv ; /* switch on type */ @@ -308,7 +308,7 @@ bool ftFiMonitor::loadList(std::list& load) std::map configMap; std::map::const_iterator mit ; - for(std::list::const_iterator kit = rskv->tlvkvs.pairs.begin(); kit != rskv->tlvkvs.pairs.end(); kit++) + for(std::list::const_iterator kit = rskv->tlvkvs.pairs.begin(); kit != rskv->tlvkvs.pairs.end(); ++kit) { configMap[kit->key] = kit->value; } diff --git a/libretroshare/src/ft/ftextralist.cc b/libretroshare/src/ft/ftextralist.cc index 3c540770c..9b81db1f9 100644 --- a/libretroshare/src/ft/ftextralist.cc +++ b/libretroshare/src/ft/ftextralist.cc @@ -250,7 +250,7 @@ bool ftExtraList::cleanupOldFiles() std::list::iterator rit; std::map::iterator it; - for(it = mFiles.begin(); it != mFiles.end(); it++) + for(it = mFiles.begin(); it != mFiles.end(); ++it) { /* check timestamps */ if ((time_t)it->second.info.age < now) @@ -262,7 +262,7 @@ bool ftExtraList::cleanupOldFiles() if (toRemove.size() > 0) { /* remove items */ - for(rit = toRemove.begin(); rit != toRemove.end(); rit++) + for(rit = toRemove.begin(); rit != toRemove.end(); ++rit) { if (mFiles.end() != (it = mFiles.find(*rit))) { @@ -398,7 +398,7 @@ bool ftExtraList::saveList(bool &cleanup, std::list& sList) std::map::const_iterator it; - for(it = mFiles.begin(); it != mFiles.end(); it++) + for(it = mFiles.begin(); it != mFiles.end(); ++it) { RsFileConfigItem *fi = new RsFileConfigItem(); fi->file.path = (it->second).info.path; @@ -430,7 +430,7 @@ bool ftExtraList::loadList(std::list& load) std::list::iterator it; - for(it = load.begin(); it != load.end(); it++) + for(it = load.begin(); it != load.end(); ++it) { RsFileConfigItem *fi = dynamic_cast(*it); diff --git a/libretroshare/src/ft/ftfilecreator.cc b/libretroshare/src/ft/ftfilecreator.cc index 6c5fad0f8..80a0e90e6 100644 --- a/libretroshare/src/ft/ftfilecreator.cc +++ b/libretroshare/src/ft/ftfilecreator.cc @@ -555,7 +555,7 @@ bool ftFileCreator::locked_printChunkMap() std::map::iterator it; - for(it = mChunks.begin(); it != mChunks.end(); it++) + for(it = mChunks.begin(); it != mChunks.end(); ++it) std::cerr << " " << it->second << std::endl ; std::cerr << "Active chunks per peer:" << std::endl ; diff --git a/libretroshare/src/ft/ftserver.cc b/libretroshare/src/ft/ftserver.cc index b8e7222be..1410ddb6d 100644 --- a/libretroshare/src/ft/ftserver.cc +++ b/libretroshare/src/ft/ftserver.cc @@ -737,7 +737,7 @@ bool ftServer::removeSharedDirectory(std::string dir) mFiMon->getSharedDirectories(dirList); #ifdef SERVER_DEBUG - for(it = dirList.begin(); it != dirList.end(); it++) + for(it = dirList.begin(); it != dirList.end(); ++it) { std::cerr << "ftServer::removeSharedDirectory()"; std::cerr << " existing: " << (*it).filename; @@ -1246,7 +1246,7 @@ bool ftServer::handleCacheData() std::cerr << "handleCacheData() " << std::endl; #endif mCacheStrapper->getCacheUpdates(cacheUpdates); - for(it = cacheUpdates.begin(); it != cacheUpdates.end(); it++) + for(it = cacheUpdates.begin(); it != cacheUpdates.end(); ++it) { /* construct reply */ RsFileTransferCacheItem *ci = new RsFileTransferCacheItem(); diff --git a/libretroshare/src/ft/fttransfermodule.cc b/libretroshare/src/ft/fttransfermodule.cc index 61dafd819..cac86a7b5 100644 --- a/libretroshare/src/ft/fttransfermodule.cc +++ b/libretroshare/src/ft/fttransfermodule.cc @@ -115,7 +115,7 @@ bool ftTransferModule::setFileSources(const std::list& peerIds) #endif std::list::const_iterator it; - for(it = peerIds.begin(); it != peerIds.end(); it++) + for(it = peerIds.begin(); it != peerIds.end(); ++it) { #ifdef FT_DEBUG @@ -137,7 +137,7 @@ bool ftTransferModule::getFileSources(std::list &peerIds) { RsStackMutex stack(tfMtx); /******* STACK LOCKED ******/ std::map::iterator it; - for(it = mFileSources.begin(); it != mFileSources.end(); it++) + for(it = mFileSources.begin(); it != mFileSources.end(); ++it) { peerIds.push_back(it->first); } @@ -428,7 +428,7 @@ bool ftTransferModule::queryInactive() return false ; std::map::iterator mit; - for(mit = mFileSources.begin(); mit != mFileSources.end(); mit++) + for(mit = mFileSources.begin(); mit != mFileSources.end(); ++mit) { locked_tickPeerTransfer(mit->second); } @@ -497,7 +497,7 @@ int ftTransferModule::tick() std::cerr << "Peers: "; std::map::iterator it; - for(it = mFileSources.begin(); it != mFileSources.end(); it++) + for(it = mFileSources.begin(); it != mFileSources.end(); ++it) { std::cerr << " " << it->first; } @@ -649,7 +649,7 @@ void ftTransferModule::adjustSpeed() actualRate = 0; - for(mit = mFileSources.begin(); mit != mFileSources.end(); mit++) + for(mit = mFileSources.begin(); mit != mFileSources.end(); ++mit) { #ifdef FT_DEBUG std::cerr << "ftTransferModule::adjustSpeed()"; diff --git a/libretroshare/src/gxs/gxstokenqueue.cc b/libretroshare/src/gxs/gxstokenqueue.cc index 178caae20..e0cbdf46d 100644 --- a/libretroshare/src/gxs/gxstokenqueue.cc +++ b/libretroshare/src/gxs/gxstokenqueue.cc @@ -69,7 +69,7 @@ void GxsTokenQueue::checkRequests() std::cerr << "GxsTokenQueue::checkRequests() token: " << token << " Complete"; std::cerr << std::endl; #endif - it++; + ++it; } else if (status == RsTokenService::GXS_REQUEST_V2_STATUS_FAILED) { @@ -85,14 +85,14 @@ void GxsTokenQueue::checkRequests() std::cerr << "GxsTokenQueue::checkRequests() token: " << token << " is unfinished, status: " << status; std::cerr << std::endl; #endif - it++; + ++it; } } } if (stuffToLoad) { - for(it = toload.begin(); it != toload.end(); it++) + for(it = toload.begin(); it != toload.end(); ++it) { handleResponse(it->mToken, it->mReqType); } diff --git a/libretroshare/src/gxs/rsdataservice.cc b/libretroshare/src/gxs/rsdataservice.cc index af73b71f1..d706fc3eb 100644 --- a/libretroshare/src/gxs/rsdataservice.cc +++ b/libretroshare/src/gxs/rsdataservice.cc @@ -565,7 +565,7 @@ int RsDataService::storeMessage(std::map &msg) // start a transaction mDb->execSQL("BEGIN;"); - for(; mit != msg.end(); mit++){ + for(; mit != msg.end(); ++mit){ RsNxsMsg* msgPtr = mit->first; RsGxsMsgMetaData* msgMetaPtr = mit->second; @@ -649,7 +649,7 @@ int RsDataService::storeMessage(std::map &msg) // finish transaction bool ret = mDb->execSQL("COMMIT;"); - for(mit = msg.begin(); mit != msg.end(); mit++) + for(mit = msg.begin(); mit != msg.end(); ++mit) { //TODO: API encourages aliasing, remove this abomination if(mit->second != mit->first->metaData) @@ -680,7 +680,7 @@ int RsDataService::storeGroup(std::map &grp) // begin transaction mDb->execSQL("BEGIN;"); - for(; sit != grp.end(); sit++) + for(; sit != grp.end(); ++sit) { RsNxsGrp* grpPtr = sit->first; @@ -764,7 +764,7 @@ int RsDataService::storeGroup(std::map &grp) // finish transaction bool ret = mDb->execSQL("COMMIT;"); - for(sit = grp.begin(); sit != grp.end(); sit++) + for(sit = grp.begin(); sit != grp.end(); ++sit) { //TODO: API encourages aliasing, remove this abomination if(sit->second != sit->first->metaData) @@ -786,7 +786,7 @@ int RsDataService::updateGroup(std::map &grp) // begin transaction mDb->execSQL("BEGIN;"); - for(; sit != grp.end(); sit++) + for(; sit != grp.end(); ++sit) { RsNxsGrp* grpPtr = sit->first; @@ -853,7 +853,7 @@ int RsDataService::updateGroup(std::map &grp) // finish transaction bool ret = mDb->execSQL("COMMIT;"); - for(sit = grp.begin(); sit != grp.end(); sit++) + for(sit = grp.begin(); sit != grp.end(); ++sit) { //TODO: API encourages aliasing, remove this abomination if(sit->second != sit->first->metaData) @@ -911,7 +911,7 @@ int RsDataService::retrieveNxsGrps(std::map &grp, bool locked_retrieveGroups(c, grps); std::vector::iterator vit = grps.begin(); - for(; vit != grps.end(); vit++) + for(; vit != grps.end(); ++vit) { grp[(*vit)->grpId] = *vit; } @@ -926,7 +926,7 @@ int RsDataService::retrieveNxsGrps(std::map &grp, bool std::list toRemove; - for(; mit != grp.end(); mit++) + for(; mit != grp.end(); ++mit) { const RsGxsGroupId& grpId = mit->first; RetroCursor* c = mDb->sqlQuery(GRP_TABLE_NAME, grpColumns, "grpId='" + grpId.toStdString() + "'", ""); @@ -959,13 +959,13 @@ int RsDataService::retrieveNxsGrps(std::map &grp, bool { std::map metaMap; std::map::iterator mit = grp.begin(); - for(; mit != grp.end(); mit++) + for(; mit != grp.end(); ++mit) metaMap.insert(std::make_pair(mit->first, (RsGxsGrpMetaData*)(NULL))); retrieveGxsGrpMetaData(metaMap); mit = grp.begin(); - for(; mit != grp.end(); mit++) + for(; mit != grp.end(); ++mit) { RsNxsGrp* grpPtr = grp[mit->first]; grpPtr->metaData = metaMap[mit->first]; @@ -1007,7 +1007,7 @@ int RsDataService::retrieveNxsMsgs(const GxsMsgReq &reqIds, GxsMsgResult &msg, b GxsMsgReq metaReqIds;// collects metaReqIds if needed - for(; mit != reqIds.end(); mit++) + for(; mit != reqIds.end(); ++mit) { const RsGxsGroupId& grpId = mit->first; @@ -1031,7 +1031,7 @@ int RsDataService::retrieveNxsMsgs(const GxsMsgReq &reqIds, GxsMsgResult &msg, b // request each grp std::vector::const_iterator sit = msgIdV.begin(); - for(; sit!=msgIdV.end();sit++){ + for(; sit!=msgIdV.end();++sit){ const RsGxsMessageId& msgId = *sit; RsStackMutex stack(mDbMutex); @@ -1055,7 +1055,7 @@ int RsDataService::retrieveNxsMsgs(const GxsMsgReq &reqIds, GxsMsgResult &msg, b std::vector::iterator lit = msgSet.begin(), lit_end = msgSet.end(); - for(; lit != lit_end; lit++) + for(; lit != lit_end; ++lit) msgIds.push_back( (*lit)->msgId ); metaReqIds[grpId] = msgIds; @@ -1075,7 +1075,7 @@ int RsDataService::retrieveNxsMsgs(const GxsMsgReq &reqIds, GxsMsgResult &msg, b GxsMsgResult::iterator mit2 = msg.begin(), mit2_end = msg.end(); - for(; mit2 != mit2_end; mit2++) + for(; mit2 != mit2_end; ++mit2) { const RsGxsGroupId& grpId = mit2->first; std::vector& msgV = msg[grpId]; @@ -1084,7 +1084,7 @@ int RsDataService::retrieveNxsMsgs(const GxsMsgReq &reqIds, GxsMsgResult &msg, b // as retrieval only attempts to retrieve what was found this elimiates chance // of a memory fault as all are assigned - for(; lit != lit_end; lit++) + for(; lit != lit_end; ++lit) { std::vector& msgMetaV = metaResult[grpId]; std::vector::iterator meta_lit = msgMetaV.begin(); @@ -1097,7 +1097,7 @@ int RsDataService::retrieveNxsMsgs(const GxsMsgReq &reqIds, GxsMsgResult &msg, b msgPtr->metaData = meta; meta_lit = msgMetaV.erase(meta_lit); }else{ - meta_lit++; + ++meta_lit; } } } @@ -1141,7 +1141,7 @@ int RsDataService::retrieveGxsMsgMetaData(const GxsMsgReq& reqIds, GxsMsgMetaRes GxsMsgReq::const_iterator mit = reqIds.begin(); - for(; mit != reqIds.end(); mit++) + for(; mit != reqIds.end(); ++mit) { const RsGxsGroupId& grpId = mit->first; @@ -1160,7 +1160,7 @@ int RsDataService::retrieveGxsMsgMetaData(const GxsMsgReq& reqIds, GxsMsgMetaRes // request each grp std::vector::const_iterator sit = msgIdV.begin(); - for(; sit!=msgIdV.end();sit++){ + for(; sit!=msgIdV.end(); ++sit){ const RsGxsMessageId& msgId = *sit; RetroCursor* c = mDb->sqlQuery(MSG_TABLE_NAME, msgMetaColumns, KEY_GRP_ID+ "='" + grpId.toStdString() + "' AND " + KEY_MSG_ID + "='" + msgId.toStdString() + "'", ""); @@ -1231,7 +1231,7 @@ int RsDataService::retrieveGxsGrpMetaData(std::map::iterator mit = grp.begin(); - for(; mit != grp.end(); mit++) + for(; mit != grp.end(); ++mit) { const RsGxsGroupId& grpId = mit->first; RetroCursor* c = mDb->sqlQuery(GRP_TABLE_NAME, grpMetaColumns, "grpId='" + grpId.toStdString() + "'", ""); @@ -1278,7 +1278,7 @@ int RsDataService::resetDataStore() RsStackMutex stack(mDbMutex); // remove all grp msgs files from service dir - for(; mit != grps.end(); mit++){ + for(; mit != grps.end(); ++mit){ std::string file = mServiceDir + "/" + mit->first.toStdString(); std::string msgFile = file + "-msgs"; remove(file.c_str()); // remove group file @@ -1337,7 +1337,7 @@ int RsDataService::removeMsgs(const GxsMsgReq& msgIds) GxsMsgReq::const_iterator mit = msgIds.begin(); - for(; mit != msgIds.end(); mit++) + for(; mit != msgIds.end(); ++mit) { MsgUpdates updates; const std::vector& msgIdV = mit->second; @@ -1358,7 +1358,7 @@ int RsDataService::removeMsgs(const GxsMsgReq& msgIds) std::vector::iterator vit = msgOffsets.begin(); uint32_t maxSize = 0;// größe aller msgs, newbuf könnte aber kleiner sein, weil msgs weggehen - for(; vit != msgOffsets.end(); vit++) + for(; vit != msgOffsets.end(); ++vit) maxSize += vit->msgLen; // may be preferable to determine file len reality @@ -1372,7 +1372,7 @@ int RsDataService::removeMsgs(const GxsMsgReq& msgIds) in.close(); uint32_t newOffset = 0;// am anfang der liste ist offset=0, jetzt gehen wir die msgs liste durch - for(std::vector::size_type i = 0; i < msgOffsets.size(); i++) + for(std::vector::size_type i = 0; i < msgOffsets.size(); ++i) { const MsgOffset& m = msgOffsets[i]; @@ -1431,7 +1431,7 @@ int RsDataService::removeGroups(const std::vector &grpIds) // from db std::vector::const_iterator vit = grpIds.begin(); - for(; vit != grpIds.end(); vit++) + for(; vit != grpIds.end(); ++vit) { const std::string grpFileName = mServiceDir + "/" + (*vit).toStdString(); remove(grpFileName.c_str()); @@ -1505,14 +1505,14 @@ bool RsDataService::locked_updateMessageEntries(const MsgUpdates& updates) MsgUpdates::const_iterator mit = updates.begin(); - for(; mit != updates.end(); mit++) + for(; mit != updates.end(); ++mit) { const RsGxsGroupId& grpId = mit->first; const std::vector& updateV = mit->second; std::vector::const_iterator vit = updateV.begin(); - for(; vit != updateV.end(); vit++) + for(; vit != updateV.end(); ++vit) { const MsgUpdate& update = *vit; mDb->sqlUpdate(MSG_TABLE_NAME, KEY_GRP_ID+ "='" + grpId.toStdString() @@ -1532,13 +1532,13 @@ bool RsDataService::locked_removeMessageEntries(const GxsMsgReq& msgIds) GxsMsgReq::const_iterator mit = msgIds.begin(); - for(; mit != msgIds.end(); mit++) + for(; mit != msgIds.end(); ++mit) { const RsGxsGroupId& grpId = mit->first; const std::vector& msgsV = mit->second; std::vector::const_iterator vit = msgsV.begin(); - for(; vit != msgsV.end(); vit++) + for(; vit != msgsV.end(); ++vit) { const RsGxsMessageId& msgId = *vit; mDb->sqlDelete(MSG_TABLE_NAME, KEY_GRP_ID+ "='" + grpId.toStdString() @@ -1558,7 +1558,7 @@ bool RsDataService::locked_removeGroupEntries(const std::vector& g std::vector::const_iterator vit = grpIds.begin(); - for(; vit != grpIds.end(); vit++) + for(; vit != grpIds.end(); ++vit) { const RsGxsGroupId& grpId = *vit; diff --git a/libretroshare/src/gxs/rsgenexchange.cc b/libretroshare/src/gxs/rsgenexchange.cc index ef151db47..c0dbc01e9 100644 --- a/libretroshare/src/gxs/rsgenexchange.cc +++ b/libretroshare/src/gxs/rsgenexchange.cc @@ -378,7 +378,7 @@ uint8_t RsGenExchange::createGroup(RsNxsGrp *grp, RsTlvSecurityKeySet& privateKe std::map::iterator mit = privateKeySet.keys.begin(); bool privKeyFound = false; // private admin key - for(; mit != privateKeySet.keys.end(); mit++) + for(; mit != privateKeySet.keys.end(); ++mit) { RsTlvSecurityKey& key = mit->second; @@ -591,7 +591,7 @@ int RsGenExchange::createMsgSignatures(RsTlvKeySignatureSet& signSet, RsTlvBinar std::map::iterator mit = keys.keys.begin(), mit_end = keys.keys.end(); bool pub_key_found = false; - for(; mit != mit_end; mit++) + for(; mit != mit_end; ++mit) { pub_key_found = mit->second.keyFlags == (RSTLV_KEY_DISTRIB_PRIVATE | RSTLV_KEY_TYPE_FULL); @@ -802,7 +802,7 @@ int RsGenExchange::validateMsg(RsNxsMsg *msg, const uint32_t& grpFlag, RsTlvSecu std::map::iterator mit = keys.begin(); RsGxsId keyId; - for(; mit != keys.end() ; mit++) + for(; mit != keys.end() ; ++mit) { RsTlvSecurityKey& key = mit->second; @@ -991,7 +991,7 @@ void RsGenExchange::receiveChanges(std::vector& changes) #endif std::vector::iterator vit = changes.begin(); - for(; vit != changes.end(); vit++) + for(; vit != changes.end(); ++vit) { RsGxsNotify* n = *vit; RsGxsGroupChange* gc; @@ -1045,7 +1045,7 @@ void RsGenExchange::groupsChanged(std::list& grpIds, std::list& gList = gc->mGrpIdList; std::list::iterator lit = gList.begin(); - for(; lit != gList.end(); lit++) + for(; lit != gList.end(); ++lit) if (gc->metaChange()) { grpIdsMeta.push_back(*lit); @@ -1142,7 +1142,7 @@ bool RsGenExchange::getGroupMeta(const uint32_t &token, std::list::iterator lit = metaL.begin(); RsGroupMetaData m; - for(; lit != metaL.end(); lit++) + for(; lit != metaL.end(); ++lit) { RsGxsGrpMetaData& gMeta = *(*lit); m = gMeta; @@ -1172,7 +1172,7 @@ bool RsGenExchange::getMsgMeta(const uint32_t &token, GxsMsgMetaResult::iterator mit = result.begin(); - for(; mit != result.end(); mit++) + for(; mit != result.end(); ++mit) { std::vector& metaV = mit->second; @@ -1181,7 +1181,7 @@ bool RsGenExchange::getMsgMeta(const uint32_t &token, std::vector::iterator vit = metaV.begin(); RsMsgMetaData meta; - for(; vit != metaV.end(); vit++) + for(; vit != metaV.end(); ++vit) { RsGxsMsgMetaData& m = *(*vit); meta = m; @@ -1201,7 +1201,7 @@ bool RsGenExchange::getMsgRelatedMeta(const uint32_t &token, GxsMsgRelatedMetaMa MsgRelatedMetaResult::iterator mit = result.begin(); - for(; mit != result.end(); mit++) + for(; mit != result.end(); ++mit) { std::vector& metaV = mit->second; @@ -1210,7 +1210,7 @@ bool RsGenExchange::getMsgRelatedMeta(const uint32_t &token, GxsMsgRelatedMetaMa std::vector::iterator vit = metaV.begin(); RsMsgMetaData meta; - for(; vit != metaV.end(); vit++) + for(; vit != metaV.end(); ++vit) { RsGxsMsgMetaData& m = *(*vit); meta = m; @@ -1236,7 +1236,7 @@ bool RsGenExchange::getGroupData(const uint32_t &token, std::vectorgrp; RsItem* item = NULL; @@ -1284,13 +1284,13 @@ bool RsGenExchange::getMsgData(const uint32_t &token, GxsMsgDataMap &msgItems) if(ok) { - for(; mit != msgResult.end(); mit++) + for(; mit != msgResult.end(); ++mit) { std::vector gxsMsgItems; const RsGxsGroupId& grpId = mit->first; std::vector& nxsMsgsV = mit->second; std::vector::iterator vit = nxsMsgsV.begin(); - for(; vit != nxsMsgsV.end(); vit++) + for(; vit != nxsMsgsV.end(); ++vit) { RsNxsMsg*& msg = *vit; RsItem* item = NULL; @@ -1336,14 +1336,14 @@ bool RsGenExchange::getMsgRelatedData(const uint32_t &token, GxsMsgRelatedDataMa if(ok) { NxsMsgRelatedDataResult::iterator mit = msgResult.begin(); - for(; mit != msgResult.end(); mit++) + for(; mit != msgResult.end(); ++mit) { std::vector gxsMsgItems; const RsGxsGrpMsgIdPair& msgId = mit->first; std::vector& nxsMsgsV = mit->second; std::vector::iterator vit = nxsMsgsV.begin(); - for(; vit != nxsMsgsV.end(); vit++) + for(; vit != nxsMsgsV.end(); ++vit) { RsNxsMsg*& msg = *vit; RsItem* item = NULL; @@ -1427,7 +1427,7 @@ void RsGenExchange::notifyNewGroups(std::vector &groups) std::vector::iterator vit = groups.begin(); // store these for tick() to pick them up - for(; vit != groups.end(); vit++) + for(; vit != groups.end(); ++vit) { RsNxsGrp* grp = *vit; NxsGrpPendValidVect::iterator received = std::find(mReceivedGrps.begin(), @@ -1461,7 +1461,7 @@ void RsGenExchange::notifyNewMessages(std::vector& messages) std::vector::iterator vit = messages.begin(); // store these for tick() to pick them up - for(; vit != messages.end(); vit++) + for(; vit != messages.end(); ++vit) { RsNxsMsg* msg = *vit; @@ -1613,7 +1613,7 @@ void RsGenExchange::processMsgMetaChanges() std::map::iterator mit = mMsgLocMetaMap.begin(), mit_end = mMsgLocMetaMap.end(); - for(; mit != mit_end; mit++) + for(; mit != mit_end; ++mit) { MsgLocMetaData& m = mit->second; @@ -1689,7 +1689,7 @@ void RsGenExchange::processGrpMetaChanges() std::map::iterator mit = mGrpLocMetaMap.begin(), mit_end = mGrpLocMetaMap.end(); - for(; mit != mit_end; mit++) + for(; mit != mit_end; ++mit) { GrpLocMetaData& g = mit->second; uint32_t token = mit->first; @@ -1782,7 +1782,7 @@ void RsGenExchange::publishMsgs() PendSignMap::iterator sign_it = mMsgPendingSign.begin(); - for(; sign_it != mMsgPendingSign.end(); sign_it++) + for(; sign_it != mMsgPendingSign.end(); ++sign_it) { GxsPendingItem& item = sign_it->second; mMsgsToPublish.insert(std::make_pair(sign_it->first, item.mItem)); @@ -1791,7 +1791,7 @@ void RsGenExchange::publishMsgs() std::map > msgChangeMap; std::map::iterator mit = mMsgsToPublish.begin(); - for(; mit != mMsgsToPublish.end(); mit++) + for(; mit != mMsgsToPublish.end(); ++mit) { #ifdef GEN_EXCH_DEBUG std::cerr << "RsGenExchange::publishMsgs() Publishing a Message"; @@ -1858,7 +1858,7 @@ void RsGenExchange::publishMsgs() } else { - pit->second.mAttempts++; + ++pit->second.mAttempts; } } @@ -1978,7 +1978,7 @@ void RsGenExchange::processGroupUpdatePublish() std::map grpMeta; std::vector::iterator vit = mGroupUpdatePublish.begin(); - for(; vit != mGroupUpdatePublish.end(); vit++) + for(; vit != mGroupUpdatePublish.end(); ++vit) { GroupUpdatePublish& gup = *vit; const RsGxsGroupId& groupId = gup.grpItem->meta.mGroupId; @@ -1992,7 +1992,7 @@ void RsGenExchange::processGroupUpdatePublish() // now vit = mGroupUpdatePublish.begin(); - for(; vit != mGroupUpdatePublish.end(); vit++) + for(; vit != mGroupUpdatePublish.end(); ++vit) { GroupUpdatePublish& gup = *vit; const RsGxsGroupId& groupId = gup.grpItem->meta.mGroupId; @@ -2057,7 +2057,7 @@ void RsGenExchange::processGroupDelete() std::map toNotify; std::vector::iterator vit = mGroupDeletePublish.begin(); - for(; vit != mGroupDeletePublish.end(); vit++) + for(; vit != mGroupDeletePublish.end(); ++vit) { GroupDeletePublish& gdp = *vit; uint32_t token = gdp.mToken; @@ -2072,7 +2072,7 @@ void RsGenExchange::processGroupDelete() std::list grpDeleted; std::map::iterator mit = toNotify.begin(); - for(; mit != toNotify.end(); mit++) + for(; mit != toNotify.end(); ++mit) { GrpNote& note = mit->second; uint8_t status = note.first ? RsTokenService::GXS_REQUEST_V2_STATUS_COMPLETE @@ -2102,7 +2102,7 @@ bool RsGenExchange::checkKeys(const RsTlvSecurityKeySet& keySet) const keyMap& allKeys = keySet.keys; keyMap::const_iterator cit = allKeys.begin(); bool adminFound = false, publishFound = false; - for(; cit != allKeys.end(); cit++) + for(; cit != allKeys.end(); ++cit) { const RsTlvSecurityKey& key = cit->second; if(key.keyFlags & RSTLV_KEY_TYPE_FULL) @@ -2172,7 +2172,7 @@ void RsGenExchange::publishGrps() std::map::iterator mit_keys = privatekeySet.keys.begin(); bool privKeyFound = false; - for(; mit_keys != privatekeySet.keys.end(); mit_keys++) + for(; mit_keys != privatekeySet.keys.end(); ++mit_keys) { RsTlvSecurityKey& key = mit_keys->second; @@ -2290,7 +2290,7 @@ void RsGenExchange::publishGrps() std::cerr << "RsGenExchange::publishGrps() failed grp, trying again " << std::endl; #endif ggps.mLastAttemptTS = time(NULL); - vit++; + ++vit; } else if(create == CREATE_SUCCESS) { @@ -2311,7 +2311,7 @@ void RsGenExchange::publishGrps() std::map::iterator mit = toNotify.begin(); std::list grpChanged; - for(; mit != toNotify.end(); mit++) + for(; mit != toNotify.end(); ++mit) { GrpNote& note = mit->second; uint8_t status = note.first ? RsTokenService::GXS_REQUEST_V2_STATUS_COMPLETE @@ -2439,7 +2439,7 @@ void RsGenExchange::processRecvdMessages() std::cerr << " movign to recvd." << std::endl; #endif mReceivedMsgs.push_back(gpsi.mItem); - pend_it++; + ++pend_it; } } @@ -2453,7 +2453,7 @@ void RsGenExchange::processRecvdMessages() std::map grpMetas; // coalesce group meta retrieval for performance - for(; vit != mReceivedMsgs.end(); vit++) + for(; vit != mReceivedMsgs.end(); ++vit) { RsNxsMsg* msg = *vit; grpMetas.insert(std::make_pair(msg->grpId, (RsGxsGrpMetaData*)NULL)); @@ -2464,7 +2464,7 @@ void RsGenExchange::processRecvdMessages() #ifdef GEN_EXCH_DEBUG std::cerr << " updating received messages:" << std::endl; #endif - for(vit = mReceivedMsgs.begin(); vit != mReceivedMsgs.end(); vit++) + for(vit = mReceivedMsgs.begin(); vit != mReceivedMsgs.end(); ++vit) { RsNxsMsg* msg = *vit; RsGxsMsgMetaData* meta = new RsGxsMsgMetaData(); @@ -2703,7 +2703,7 @@ void RsGenExchange::processRecvdGroups() if(erase) vit = mReceivedGrps.erase(vit); else - vit++; + ++vit; } if(!grpIds.empty()) @@ -2729,7 +2729,7 @@ void RsGenExchange::performUpdateValidation() std::map grpMetas; std::vector::iterator vit = mGroupUpdates.begin(); - for(; vit != mGroupUpdates.end(); vit++) + for(; vit != mGroupUpdates.end(); ++vit) grpMetas.insert(std::make_pair(vit->newGrp->grpId, (RsGxsGrpMetaData*)NULL)); if(!grpMetas.empty()) @@ -2738,7 +2738,7 @@ void RsGenExchange::performUpdateValidation() return; vit = mGroupUpdates.begin(); - for(; vit != mGroupUpdates.end(); vit++) + for(; vit != mGroupUpdates.end(); ++vit) { GroupUpdate& gu = *vit; std::map::iterator mit = @@ -2753,7 +2753,7 @@ void RsGenExchange::performUpdateValidation() vit = mGroupUpdates.begin(); std::map grps; - for(; vit != mGroupUpdates.end(); vit++) + for(; vit != mGroupUpdates.end(); ++vit) { GroupUpdate& gu = *vit; @@ -2827,7 +2827,7 @@ void RsGenExchange::removeDeleteExistingMessages( RsGeneralDataService::MsgStore RsGxsGroupId::std_set mGrpIdsUnique; - for(RsGeneralDataService::MsgStoreMap::const_iterator cit = msgs.begin(); cit != msgs.end(); cit++) + for(RsGeneralDataService::MsgStoreMap::const_iterator cit = msgs.begin(); cit != msgs.end(); ++cit) mGrpIdsUnique.insert(cit->second->mGroupId); //RsGxsGroupId::std_list grpIds(mGrpIdsUnique.begin(), mGrpIdsUnique.end()); @@ -2836,7 +2836,7 @@ void RsGenExchange::removeDeleteExistingMessages( RsGeneralDataService::MsgStore MsgIdReq msgIdReq; // now get a list of all msgs ids for each group - for(RsGxsGroupId::std_set::const_iterator it(mGrpIdsUnique.begin()); it != mGrpIdsUnique.end(); it++) + for(RsGxsGroupId::std_set::const_iterator it(mGrpIdsUnique.begin()); it != mGrpIdsUnique.end(); ++it) { mDataStore->retrieveMsgIds(*it, msgIdReq[*it]); @@ -2853,7 +2853,7 @@ void RsGenExchange::removeDeleteExistingMessages( RsGeneralDataService::MsgStore RsGeneralDataService::MsgStoreMap filtered; // now for each msg to be stored that exist in the retrieved msg/grp "index" delete and erase from map - for(RsGeneralDataService::MsgStoreMap::iterator cit2 = msgs.begin(); cit2 != msgs.end(); cit2++) + for(RsGeneralDataService::MsgStoreMap::iterator cit2 = msgs.begin(); cit2 != msgs.end(); ++cit2) { const RsGxsMessageId::std_vector& msgIds = msgIdReq[cit2->second->mGroupId]; diff --git a/libretroshare/src/gxs/rsgenexchange.h b/libretroshare/src/gxs/rsgenexchange.h index 5a9447fb2..b5f92f5f2 100644 --- a/libretroshare/src/gxs/rsgenexchange.h +++ b/libretroshare/src/gxs/rsgenexchange.h @@ -323,7 +323,7 @@ protected: bool ok = getGroupData(token, items); std::vector::iterator vit = items.begin(); - for(; vit != items.end(); vit++) + for(; vit != items.end(); ++vit) { RsGxsGrpItem* gi = *vit; @@ -363,12 +363,12 @@ public: GxsMsgDataMap::iterator mit = msgData.begin(); - for(; mit != msgData.end(); mit++) + for(; mit != msgData.end(); ++mit) { const RsGxsGroupId& grpId = mit->first; std::vector& mv = mit->second; std::vector::iterator vit = mv.begin(); - for(; vit != mv.end(); vit++) + for(; vit != mv.end(); ++vit) { RsGxsMsgItem* mi = *vit; MsgType* mt = dynamic_cast(mi); @@ -415,14 +415,14 @@ protected: if(ok) { - for(; mit != msgResult.end(); mit++) + for(; mit != msgResult.end(); ++mit) { std::vector gxsMsgItems; const RsGxsGrpMsgIdPair& msgId = mit->first; std::vector& nxsMsgsV = mit->second; std::vector::iterator vit = nxsMsgsV.begin(); - for(; vit != nxsMsgsV.end(); vit++) + for(; vit != nxsMsgsV.end(); ++vit) { RsNxsMsg*& msg = *vit; RsItem* item = NULL; diff --git a/libretroshare/src/gxs/rsgxsdataaccess.cc b/libretroshare/src/gxs/rsgxsdataaccess.cc index 5ebc11a2f..6ef9ad047 100644 --- a/libretroshare/src/gxs/rsgxsdataaccess.cc +++ b/libretroshare/src/gxs/rsgxsdataaccess.cc @@ -184,7 +184,7 @@ bool RsGxsDataAccess::requestMsgInfo(uint32_t &token, uint32_t ansType, GxsMsgReq::const_iterator mit = msgIds.begin(); std::vector toRemove; - for(; mit != msgIds.end(); mit++) + for(; mit != msgIds.end(); ++mit) { if(mit->second.empty()) toRemove.push_back(mit->first); @@ -194,7 +194,7 @@ bool RsGxsDataAccess::requestMsgInfo(uint32_t &token, uint32_t ansType, GxsMsgReq filteredMsgIds = msgIds; - for(; vit != toRemove.end(); vit++) + for(; vit != toRemove.end(); ++vit) filteredMsgIds.erase(*vit); if(reqType & GXS_REQUEST_TYPE_MSG_META) @@ -247,7 +247,7 @@ bool RsGxsDataAccess::requestMsgInfo(uint32_t &token, uint32_t ansType, { MsgMetaReq* mmr = new MsgMetaReq(); - for(; lit != grpIds.end(); lit++) + for(; lit != grpIds.end(); ++lit) mmr->mMsgIds[*lit] = std::vector(); req = mmr; @@ -255,7 +255,7 @@ bool RsGxsDataAccess::requestMsgInfo(uint32_t &token, uint32_t ansType, { MsgDataReq* mdr = new MsgDataReq(); - for(; lit != grpIds.end(); lit++) + for(; lit != grpIds.end(); ++lit) mdr->mMsgIds[*lit] = std::vector(); req = mdr; @@ -263,7 +263,7 @@ bool RsGxsDataAccess::requestMsgInfo(uint32_t &token, uint32_t ansType, { MsgIdReq* mir = new MsgIdReq(); - for(; lit != grpIds.end(); lit++) + for(; lit != grpIds.end(); ++lit) mir->mMsgIds[*lit] = std::vector(); req = mir; @@ -733,7 +733,7 @@ void RsGxsDataAccess::processRequests() GroupStatisticRequest* gsr; ServiceStatisticRequest* ssr; - for(it = mRequests.begin(); it != mRequests.end(); it++) + for(it = mRequests.begin(); it != mRequests.end(); ++it) { GxsRequest* req = it->second; @@ -818,7 +818,7 @@ void RsGxsDataAccess::processRequests() } // END OF MUTEX. - for(cit = toClear.begin(); cit != toClear.end(); cit++) + for(cit = toClear.begin(); cit != toClear.end(); ++cit) { clearRequest(*cit); } @@ -902,7 +902,7 @@ bool RsGxsDataAccess::getGroupData(GroupDataReq* req) std::list::iterator lit = grpIdsOut.begin(), lit_end = grpIdsOut.end(); - for(; lit != lit_end; lit++) + for(; lit != lit_end; ++lit) { grpData[*lit] = NULL; } @@ -910,7 +910,7 @@ bool RsGxsDataAccess::getGroupData(GroupDataReq* req) bool ok = mDataStore->retrieveNxsGrps(grpData, true, true); std::map::iterator mit = grpData.begin(); - for(; mit != grpData.end(); mit++) + for(; mit != grpData.end(); ++mit) req->mGroupData.push_back(mit->second); return ok; @@ -930,14 +930,14 @@ bool RsGxsDataAccess::getGroupSummary(GroupMetaReq* req) std::list::const_iterator lit = grpIdsOut.begin(); - for(; lit != grpIdsOut.end(); lit++) + for(; lit != grpIdsOut.end(); ++lit) grpMeta[*lit] = NULL; mDataStore->retrieveGxsGrpMetaData(grpMeta); std::map::iterator mit = grpMeta.begin(); - for(; mit != grpMeta.end(); mit++) + for(; mit != grpMeta.end(); ++mit) req->mGroupMetaData.push_back(mit->second); return true; @@ -956,21 +956,21 @@ bool RsGxsDataAccess::getGroupList(const std::list& grpIdsIn, cons std::list::const_iterator lit = grpIdsIn.begin(); - for(; lit != grpIdsIn.end(); lit++) + for(; lit != grpIdsIn.end(); ++lit) grpMeta[*lit] = NULL; mDataStore->retrieveGxsGrpMetaData(grpMeta); std::map::iterator mit = grpMeta.begin(); - for(; mit != grpMeta.end(); mit++) + for(; mit != grpMeta.end(); ++mit) { grpIdsOut.push_back(mit->first); } filterGrpList(grpIdsOut, opts, grpMeta); - for(mit = grpMeta.begin(); mit != grpMeta.end(); mit++) + for(mit = grpMeta.begin(); mit != grpMeta.end(); ++mit) { delete mit->second; // so wasteful!! } @@ -1053,7 +1053,7 @@ bool RsGxsDataAccess::getMsgList(const GxsMsgReq& msgIds, const RsTokReqOptions& GxsMsgMetaResult::iterator meta_it; MsgMetaFilter metaFilter; - for(meta_it = result.begin(); meta_it != result.end(); meta_it++) + for(meta_it = result.begin(); meta_it != result.end(); ++meta_it) { const RsGxsGroupId& grpId = meta_it->first; @@ -1068,7 +1068,7 @@ bool RsGxsDataAccess::getMsgList(const GxsMsgReq& msgIds, const RsTokReqOptions& std::map > origMsgTs; std::map >::iterator oit; - for(; vit != metaV.end(); vit++) + for(; vit != metaV.end(); ++vit) { RsGxsMsgMetaData* msgMeta = *vit; @@ -1118,7 +1118,7 @@ bool RsGxsDataAccess::getMsgList(const GxsMsgReq& msgIds, const RsTokReqOptions& } // Add the discovered Latest Msgs. - for(oit = origMsgTs.begin(); oit != origMsgTs.end(); oit++) + for(oit = origMsgTs.begin(); oit != origMsgTs.end(); ++oit) { msgIdsOut[grpId].push_back(oit->second.first); } @@ -1128,7 +1128,7 @@ bool RsGxsDataAccess::getMsgList(const GxsMsgReq& msgIds, const RsTokReqOptions& { std::vector::const_iterator vit = metaV.begin(); - for(; vit != metaV.end(); vit++) + for(; vit != metaV.end(); ++vit) { RsGxsMsgMetaData* msgMeta = *vit; bool add = false; @@ -1292,7 +1292,7 @@ bool RsGxsDataAccess::getMsgRelatedInfo(MsgRelatedInfoReq *req) std::vector::iterator vit_msgIds = req->mMsgIds.begin(); - for(; vit_msgIds != req->mMsgIds.end(); vit_msgIds++) + for(; vit_msgIds != req->mMsgIds.end(); ++vit_msgIds) { MsgMetaFilter filterMap; @@ -1314,7 +1314,7 @@ bool RsGxsDataAccess::getMsgRelatedInfo(MsgRelatedInfoReq *req) std::vector outMsgIds; RsGxsMsgMetaData* origMeta = NULL; - for(vit_meta = metaV.begin(); vit_meta != metaV.end(); vit_meta++) + for(vit_meta = metaV.begin(); vit_meta != metaV.end(); ++vit_meta) { RsGxsMsgMetaData* meta = *vit_meta; @@ -1345,7 +1345,7 @@ bool RsGxsDataAccess::getMsgRelatedInfo(MsgRelatedInfoReq *req) // RUN THROUGH ALL MSGS... in map origId -> TS. std::map > origMsgTs; std::map >::iterator oit; - for(vit_meta = metaV.begin(); vit_meta != metaV.end(); vit_meta++) + for(vit_meta = metaV.begin(); vit_meta != metaV.end(); ++vit_meta) { RsGxsMsgMetaData* meta = *vit_meta; @@ -1404,7 +1404,7 @@ bool RsGxsDataAccess::getMsgRelatedInfo(MsgRelatedInfoReq *req) } // Add the discovered Latest Msgs. - for(oit = origMsgTs.begin(); oit != origMsgTs.end(); oit++) + for(oit = origMsgTs.begin(); oit != origMsgTs.end(); ++oit) { outMsgIds.push_back(oit->second.first); } @@ -1417,7 +1417,7 @@ bool RsGxsDataAccess::getMsgRelatedInfo(MsgRelatedInfoReq *req) RsGxsMessageId latestMsgId; RsGxsMsgMetaData* latestMeta; - for(vit_meta = metaV.begin(); vit_meta != metaV.end(); vit_meta++) + for(vit_meta = metaV.begin(); vit_meta != metaV.end(); ++vit_meta) { RsGxsMsgMetaData* meta = *vit_meta; @@ -1437,7 +1437,7 @@ bool RsGxsDataAccess::getMsgRelatedInfo(MsgRelatedInfoReq *req) } else if (onlyAllVersions) { - for(vit_meta = metaV.begin(); vit_meta != metaV.end(); vit_meta++) + for(vit_meta = metaV.begin(); vit_meta != metaV.end(); ++vit_meta) { RsGxsMsgMetaData* meta = *vit_meta; @@ -1499,7 +1499,7 @@ bool RsGxsDataAccess::getGroupStatistic(GroupStatisticRequest *req) req->mGroupStatistic.mNumChildMsgsNew = 0; req->mGroupStatistic.mNumChildMsgsUnread = 0; - for(int i = 0; i < msgMetaV.size(); i++) + for(int i = 0; i < msgMetaV.size(); ++i) { RsGxsMsgMetaData* m = msgMetaV[i]; req->mGroupStatistic.mTotalSizeOfMsgs += m->mMsgSize + m->serial_size(); @@ -1547,7 +1547,7 @@ bool RsGxsDataAccess::getServiceStatistic(ServiceStatisticRequest *req) req->mServiceStatistic.mNumChildMsgsNew = 0; req->mServiceStatistic.mNumChildMsgsUnread = 0; - for(; mit != grpMeta.end(); mit++) + for(; mit != grpMeta.end(); ++mit) { RsGxsGrpMetaData* m = mit->second; req->mServiceStatistic.mSizeOfGrps += m->mGrpSize + m->serial_size(); @@ -1586,14 +1586,14 @@ bool RsGxsDataAccess::getMsgList(MsgIdReq* req) GxsMsgMetaResult::iterator mit = result.begin(), mit_end = result.end(); - for(; mit != mit_end; mit++) + for(; mit != mit_end; ++mit) { const RsGxsGroupId grpId = mit->first; std::vector& metaV = mit->second; std::vector::iterator vit = metaV.begin(), vit_end = metaV.end(); - for(; vit != vit_end; vit++) + for(; vit != vit_end; ++vit) { RsGxsMsgMetaData* meta = *vit; req->mMsgIdResult[grpId].push_back(meta->mMsgId); @@ -1614,12 +1614,12 @@ void RsGxsDataAccess::cleanseMsgMetaMap(GxsMsgMetaResult& result) { GxsMsgMetaResult::iterator mit = result.begin(); - for(; mit !=result.end(); mit++) + for(; mit !=result.end(); ++mit) { std::vector& msgMetaV = mit->second; std::vector::iterator vit = msgMetaV.begin(); - for(; vit != msgMetaV.end(); vit++) + for(; vit != msgMetaV.end(); ++vit) { delete *vit; } @@ -1634,7 +1634,7 @@ void RsGxsDataAccess::filterMsgList(GxsMsgIdResult& msgIds, const RsTokReqOption { GxsMsgIdResult::iterator mit = msgIds.begin(); - for(;mit != msgIds.end(); mit++) + for(;mit != msgIds.end(); ++mit) { MsgMetaFilter::const_iterator cit = msgMetas.find(mit->first); @@ -1658,7 +1658,7 @@ void RsGxsDataAccess::filterMsgList(GxsMsgIdResult& msgIds, const RsTokReqOption if(keep) { - vit++; + ++vit; }else { vit = msgs.erase(vit); @@ -1684,7 +1684,7 @@ void RsGxsDataAccess::filterGrpList(std::list &grpIds, const RsTok if(keep) { - lit++; + ++lit; }else { lit = grpIds.erase(lit); @@ -1749,7 +1749,7 @@ void RsGxsDataAccess::tokenList(std::list& tokens) std::map::iterator mit = mRequests.begin(); - for(; mit != mRequests.end(); mit++) + for(; mit != mRequests.end(); ++mit) { tokens.push_back(mit->first); } diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index fa053307f..38c35c5a5 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -109,7 +109,7 @@ void RsGxsNetService::syncWithPeers() if(mGrpAutoSync) { // for now just grps - for(; sit != peers.end(); sit++) + for(; sit != peers.end(); ++sit) { const RsPeerId peerId = *sit; @@ -141,7 +141,7 @@ void RsGxsNetService::syncWithPeers() GrpMetaMap toRequest; - for(; mit != grpMeta.end(); mit++) + for(; mit != grpMeta.end(); ++mit) { RsGxsGrpMetaData* meta = mit->second; @@ -157,7 +157,7 @@ void RsGxsNetService::syncWithPeers() sit = peers.begin(); // synchronise group msg for groups which we're subscribed to - for(; sit != peers.end(); sit++) + for(; sit != peers.end(); ++sit) { const RsPeerId& peerId = *sit; @@ -174,7 +174,7 @@ void RsGxsNetService::syncWithPeers() } GrpMetaMap::const_iterator mmit = toRequest.begin(); - for(; mmit != toRequest.end(); mmit++) + for(; mmit != toRequest.end(); ++mmit) { const RsGxsGrpMetaData* meta = mmit->second; const RsGxsGroupId& grpId = mmit->first; @@ -204,7 +204,7 @@ void RsGxsNetService::syncWithPeers() } GrpMetaMap::iterator mmit = toRequest.begin(); - for(; mmit != toRequest.end(); mmit++) + for(; mmit != toRequest.end(); ++mmit) { delete mmit->second; } @@ -222,7 +222,7 @@ bool RsGxsNetService::fragmentMsg(RsNxsMsg& msg, MsgFragments& msgFragments) con int currPos = 0; - for(uint8_t i=0; i < nFragments; i++) + for(uint8_t i=0; i < nFragments; ++i) { RsNxsMsg* msgFrag = new RsNxsMsg(mServType); msgFrag->grpId = msg.grpId; @@ -255,7 +255,7 @@ bool RsGxsNetService::fragmentGrp(RsNxsGrp& grp, GrpFragments& grpFragments) con int currPos = 0; - for(uint8_t i=0; i < nFragments; i++) + for(uint8_t i=0; i < nFragments; ++i) { RsNxsGrp* grpFrag = new RsNxsGrp(mServType); grpFrag->grpId = grp.grpId; @@ -294,13 +294,13 @@ RsNxsMsg* RsGxsNetService::deFragmentMsg(MsgFragments& msgFragments) const MsgFragments::iterator mit = msgFragments.begin(); uint32_t datSize = 0; - for(; mit != msgFragments.end(); mit++) + for(; mit != msgFragments.end(); ++mit) datSize += (*mit)->msg.bin_len; char* data = new char[datSize]; uint32_t currPos = 0; - for(mit = msgFragments.begin(); mit != msgFragments.end(); mit++) + for(mit = msgFragments.begin(); mit != msgFragments.end(); ++mit) { RsNxsMsg* msg = *mit; memcpy(data + (currPos), msg->msg.bin_data, msg->msg.bin_len); @@ -327,13 +327,13 @@ RsNxsGrp* RsGxsNetService::deFragmentGrp(GrpFragments& grpFragments) const GrpFragments::iterator mit = grpFragments.begin(); uint32_t datSize = 0; - for(; mit != grpFragments.end(); mit++) + for(; mit != grpFragments.end(); ++mit) datSize += (*mit)->grp.bin_len; char* data = new char[datSize]; uint32_t currPos = 0; - for(mit = grpFragments.begin(); mit != grpFragments.end(); mit++) + for(mit = grpFragments.begin(); mit != grpFragments.end(); ++mit) { RsNxsGrp* grp = *mit; memcpy(data + (currPos), grp->grp.bin_data, grp->grp.bin_len); @@ -365,7 +365,7 @@ void RsGxsNetService::locked_createTransactionFromPending( MsgAuthorV::const_iterator cit = msgPend->mMsgAuthV.begin(); std::list reqList; uint32_t transN = locked_getTransactionId(); - for(; cit != msgPend->mMsgAuthV.end(); cit++) + for(; cit != msgPend->mMsgAuthV.end(); ++cit) { const MsgAuthEntry& entry = *cit; @@ -392,7 +392,7 @@ void RsGxsNetService::locked_createTransactionFromPending( GrpAuthorV::const_iterator cit = grpPend->mGrpAuthV.begin(); std::list reqList; uint32_t transN = locked_getTransactionId(); - for(; cit != grpPend->mGrpAuthV.end(); cit++) + for(; cit != grpPend->mGrpAuthV.end(); ++cit) { const GrpAuthEntry& entry = *cit; @@ -429,7 +429,7 @@ void RsGxsNetService::locked_createTransactionFromPending(GrpCircleIdRequestVett std::vector::iterator cit = grpPend->mGrpCircleV.begin(); uint32_t transN = locked_getTransactionId(); std::list itemL; - for(; cit != grpPend->mGrpCircleV.end(); cit++) + for(; cit != grpPend->mGrpCircleV.end(); ++cit) { const GrpIdCircleVet& entry = *cit; if(entry.mCleared) @@ -469,7 +469,7 @@ void RsGxsNetService::locked_createTransactionFromPending(MsgCircleIdsRequestVet uint32_t transN = locked_getTransactionId(); - for(; vit != msgPend->mMsgs.end(); vit++) + for(; vit != msgPend->mMsgs.end(); ++vit) { MsgIdCircleVet& mic = *vit; RsNxsSyncMsgItem* mItem = new @@ -524,12 +524,12 @@ void RsGxsNetService::collateGrpFragments(GrpFragments fragments, GrpFragments::iterator vit = fragments.begin(); std::set grpIds; - for(; vit != fragments.end(); vit++) + for(; vit != fragments.end(); ++vit) grpIds.insert( (*vit)->grpId ); std::set::iterator sit = grpIds.begin(); - for(; sit != grpIds.end(); sit++) + for(; sit != grpIds.end(); ++sit) { const RsGxsGroupId& grpId = *sit; GrpFragments::iterator bound = std::partition( @@ -552,7 +552,7 @@ void RsGxsNetService::collateGrpFragments(GrpFragments fragments, { GrpFragments::iterator vit2 = f.begin(); - for(; vit2 != f.end(); vit2++) + for(; vit2 != f.end(); ++vit2) delete *vit2; partFragments.erase(grpId); @@ -575,13 +575,13 @@ void RsGxsNetService::collateMsgFragments(MsgFragments fragments, std::map msgIds; - for(; vit != fragments.end(); vit++) + for(; vit != fragments.end(); ++vit) msgIds.insert( (*vit)->msgId ); std::set::iterator sit = msgIds.begin(); - for(; sit != msgIds.end(); sit++) + for(; sit != msgIds.end(); ++sit) { const RsGxsMessageId& msgId = *sit; MsgFragments::iterator bound = std::partition( @@ -589,7 +589,7 @@ void RsGxsNetService::collateMsgFragments(MsgFragments fragments, std::mapfirst; RsGxsGrpMetaData* grpMeta = mit->second; @@ -1024,7 +1024,7 @@ void RsGxsNetService::processTransactions(){ TransactionsPeerMap::iterator mit = mTransactions.begin(); - for(; mit != mTransactions.end(); mit++){ + for(; mit != mTransactions.end(); ++mit){ TransactionIdMap& transMap = mit->second; TransactionIdMap::iterator mmit = transMap.begin(), @@ -1039,7 +1039,7 @@ void RsGxsNetService::processTransactions(){ */ if(mit->first == mOwnId){ - for(; mmit != mmit_end; mmit++){ + for(; mmit != mmit_end; ++mmit){ NxsTransaction* tr = mmit->second; uint16_t flag = tr->mFlag; @@ -1071,7 +1071,7 @@ void RsGxsNetService::processTransactions(){ lit = tr->mItems.begin(); lit_end = tr->mItems.end(); - for(; lit != lit_end; lit++){ + for(; lit != lit_end; ++lit){ sendItem(*lit); } @@ -1119,7 +1119,7 @@ void RsGxsNetService::processTransactions(){ * involved in transaction */ - for(; mmit != mmit_end; mmit++){ + for(; mmit != mmit_end; ++mmit){ NxsTransaction* tr = mmit->second; uint16_t flag = tr->mFlag; @@ -1197,7 +1197,7 @@ void RsGxsNetService::processTransactions(){ std::list::iterator lit = toRemove.begin(); - for(; lit != toRemove.end(); lit++) + for(; lit != toRemove.end(); ++lit) { transMap.erase(*lit); } @@ -1356,7 +1356,7 @@ void RsGxsNetService::locked_processCompletedIncomingTrans(NxsTransaction* tr) msgs.clear(); std::map::iterator mit = collatedMsgs.begin(); - for(; mit != collatedMsgs.end(); mit++) + for(; mit != collatedMsgs.end(); ++mit) { MsgFragments& f = mit->second; RsNxsMsg* msg = deFragmentMsg(f); @@ -1509,7 +1509,7 @@ void RsGxsNetService::locked_genReqMsgTransaction(NxsTransaction* tr) std::list::iterator lit = tr->mItems.begin(); // first get item list sent from transaction - for(; lit != tr->mItems.end(); lit++) + for(; lit != tr->mItems.end(); ++lit) { RsNxsSyncMsgItem* item = dynamic_cast(*lit); if(item) @@ -1569,7 +1569,7 @@ void RsGxsNetService::locked_genReqMsgTransaction(NxsTransaction* tr) std::set msgIdSet; // put ids in set for each searching - for(; vit != msgMetaV.end(); vit++) + for(; vit != msgMetaV.end(); ++vit) { msgIdSet.insert((*vit)->mMsgId); delete(*vit); @@ -1590,7 +1590,7 @@ void RsGxsNetService::locked_genReqMsgTransaction(NxsTransaction* tr) std::list peers; peers.push_back(tr->mTransaction->PeerId()); - for(; llit != msgItemL.end(); llit++) + for(; llit != msgItemL.end(); ++llit) { RsNxsSyncMsgItem*& syncItem = *llit; const RsGxsMessageId& msgId = syncItem->msgId; @@ -1700,7 +1700,7 @@ void RsGxsNetService::locked_genReqGrpTransaction(NxsTransaction* tr) std::list::iterator lit = tr->mItems.begin(); - for(; lit != tr->mItems.end(); lit++) + for(; lit != tr->mItems.end(); ++lit) { RsNxsSyncGrpItem* item = dynamic_cast(*lit); if(item) @@ -1729,7 +1729,7 @@ void RsGxsNetService::locked_genReqGrpTransaction(NxsTransaction* tr) std::list peers; peers.push_back(tr->mTransaction->PeerId()); - for(; llit != grpItemL.end(); llit++) + for(; llit != grpItemL.end(); ++llit) { RsNxsSyncGrpItem*& grpSyncItem = *llit; const RsGxsGroupId& grpId = grpSyncItem->grpId; @@ -1795,7 +1795,7 @@ void RsGxsNetService::locked_genReqGrpTransaction(NxsTransaction* tr) // clean up meta data std::map::iterator mit = grpMetaMap.begin(); - for(; mit != grpMetaMap.end(); mit++) + for(; mit != grpMetaMap.end(); ++mit) delete mit->second; } @@ -1814,7 +1814,7 @@ void RsGxsNetService::locked_genSendGrpsTransaction(NxsTransaction* tr) std::map grps; - for(;lit != tr->mItems.end(); lit++) + for(;lit != tr->mItems.end(); ++lit) { RsNxsSyncGrpItem* item = dynamic_cast(*lit); if (item) @@ -1845,7 +1845,7 @@ void RsGxsNetService::locked_genSendGrpsTransaction(NxsTransaction* tr) // store grp items to send in transaction std::map::iterator mit = grps.begin(); RsPeerId peerId = tr->mTransaction->PeerId(); - for(;mit != grps.end(); mit++) + for(;mit != grps.end(); ++mit) { mit->second->PeerId(peerId); // set so it gets sent to right peer mit->second->transactionNumber = transN; @@ -1916,7 +1916,7 @@ void RsGxsNetService::runVetting() } else { - vit++; + ++vit; } } @@ -1957,7 +1957,7 @@ void RsGxsNetService::runVetting() } else { - vit2++; + ++vit2; } } } @@ -1985,7 +1985,7 @@ void RsGxsNetService::locked_genSendMsgsTransaction(NxsTransaction* tr) // hacky assumes a transaction only consist of a single grpId RsGxsGroupId grpId; - for(;lit != tr->mItems.end(); lit++) + for(;lit != tr->mItems.end(); ++lit) { RsNxsSyncMsgItem* item = dynamic_cast(*lit); if (item) @@ -2016,12 +2016,12 @@ void RsGxsNetService::locked_genSendMsgsTransaction(NxsTransaction* tr) RsPeerId peerId = tr->mTransaction->PeerId(); uint32_t msgSize = 0; - for(;mit != msgs.end(); mit++) + for(;mit != msgs.end(); ++mit) { std::vector& msgV = mit->second; std::vector::iterator vit = msgV.begin(); - for(; vit != msgV.end(); vit++) + for(; vit != msgV.end(); ++vit) { RsNxsMsg* msg = *vit; msg->PeerId(peerId); @@ -2036,7 +2036,7 @@ void RsGxsNetService::locked_genSendMsgsTransaction(NxsTransaction* tr) MsgFragments::iterator mit = fragments.begin(); - for(; mit != fragments.end(); mit++) + for(; mit != fragments.end(); ++mit) { newTr->mItems.push_back(*mit); msgSize++; @@ -2106,7 +2106,7 @@ void RsGxsNetService::cleanTransactionItems(NxsTransaction* tr) const { std::list::iterator lit = tr->mItems.begin(); - for(; lit != tr->mItems.end(); lit++) + for(; lit != tr->mItems.end(); ++lit) { delete *lit; } @@ -2196,7 +2196,7 @@ void RsGxsNetService::handleRecvSyncGroup(RsNxsSyncGrp* item) std::cerr << "RsGxsNetService::handleRecvSyncGroup() \nService: " << mServType << "\nGroup list beings being sent: " << std::endl; #endif - for(; mit != grp.end(); mit++) + for(; mit != grp.end(); ++mit) { RsGxsGrpMetaData* grpMeta = mit->second; @@ -2546,7 +2546,7 @@ void RsGxsNetService::handleRecvSyncMessage(RsNxsSyncMsg* item) { std::vector::iterator vit = msgMetas.begin(); - for(; vit != msgMetas.end(); vit++) + for(; vit != msgMetas.end(); ++vit) { RsGxsMsgMetaData* m = *vit; @@ -2567,7 +2567,7 @@ void RsGxsNetService::handleRecvSyncMessage(RsNxsSyncMsg* item) std::vector::iterator vit = msgMetas.begin(); // release meta resource - for(vit = msgMetas.begin(); vit != msgMetas.end(); vit++) + for(vit = msgMetas.begin(); vit != msgMetas.end(); ++vit) delete *vit; delete(grpMeta); @@ -2630,7 +2630,7 @@ bool RsGxsNetService::canSendMsgIds(const std::vector& msgMet std::vector toVet; std::vector::const_iterator vit = msgMetas.begin(); - for(; vit != msgMetas.end(); vit++) + for(; vit != msgMetas.end(); ++vit) { const RsGxsMsgMetaData* const& meta = *vit; @@ -2661,7 +2661,7 @@ bool RsGxsNetService::canSendMsgIds(const std::vector& msgMet std::vector toVet; std::vector::const_iterator vit = msgMetas.begin(); - for(; vit != msgMetas.end(); vit++) + for(; vit != msgMetas.end(); ++vit) { const RsGxsMsgMetaData* const& meta = *vit; @@ -2715,7 +2715,7 @@ void RsGxsNetService::processExplicitGroupRequests() std::map >::const_iterator cit = mExplicitRequest.begin(); - for(; cit != mExplicitRequest.end(); cit++) + for(; cit != mExplicitRequest.end(); ++cit) { const RsPeerId& peerId = cit->first; const std::list& groupIdList = cit->second; @@ -2723,7 +2723,7 @@ void RsGxsNetService::processExplicitGroupRequests() std::list grpSyncItems; std::list::const_iterator git = groupIdList.begin(); uint32_t transN = locked_getTransactionId(); - for(; git != groupIdList.end(); git++) + for(; git != groupIdList.end(); ++git) { RsNxsSyncGrpItem* item = new RsNxsSyncGrpItem(mServType); item->grpId = *git; @@ -2869,7 +2869,7 @@ void RsGxsNetService::sharePublishKeysPending() } // delete pending peer list which are done with - for(std::list::const_iterator lit = toDelete.begin(); lit != toDelete.end(); lit++) + for(std::list::const_iterator lit = toDelete.begin(); lit != toDelete.end(); ++lit) mPendingPublishKeyRecipients.erase(*lit); } diff --git a/libretroshare/src/gxs/rsgxsnetutils.cc b/libretroshare/src/gxs/rsgxsnetutils.cc index 74fd0c3cc..7beba67ad 100644 --- a/libretroshare/src/gxs/rsgxsnetutils.cc +++ b/libretroshare/src/gxs/rsgxsnetutils.cc @@ -90,7 +90,7 @@ bool MsgRespPending::accepted() { MsgAuthorV::iterator cit = mMsgAuthV.begin(); MsgAuthorV::size_type count = 0; - for(; cit != mMsgAuthV.end(); cit++) + for(; cit != mMsgAuthV.end(); ++cit) { MsgAuthEntry& entry = *cit; @@ -124,7 +124,7 @@ bool GrpRespPending::accepted() { GrpAuthorV::iterator cit = mGrpAuthV.begin(); GrpAuthorV::size_type count = 0; - for(; cit != mGrpAuthV.end(); cit++) + for(; cit != mGrpAuthV.end(); ++cit) { GrpAuthEntry& entry = *cit; @@ -171,7 +171,7 @@ NxsTransaction::~NxsTransaction(){ std::list::iterator lit = mItems.begin(); - for(; lit != mItems.end(); lit++) + for(; lit != mItems.end(); ++lit) { delete *lit; *lit = NULL; @@ -244,7 +244,7 @@ GrpCircleIdRequestVetting::GrpCircleIdRequestVetting( bool GrpCircleIdRequestVetting::cleared() { std::vector::size_type i, count; - for(i = 0; i < mGrpCircleV.size(); i++) + for(i = 0; i < mGrpCircleV.size(); ++i) { GrpIdCircleVet& gic = mGrpCircleV[i]; diff --git a/libretroshare/src/gxs/rsgxsutil.cc b/libretroshare/src/gxs/rsgxsutil.cc index c066893b8..d5bb8c291 100644 --- a/libretroshare/src/gxs/rsgxsutil.cc +++ b/libretroshare/src/gxs/rsgxsutil.cc @@ -39,7 +39,7 @@ RsGxsMessageCleanUp::RsGxsMessageCleanUp(RsGeneralDataService* const dataService std::map::iterator cit = grpMeta.begin(); - for(;cit != grpMeta.end(); cit++) + for(;cit != grpMeta.end(); ++cit) { mGrpMeta.push_back(cit->second); } @@ -67,7 +67,7 @@ bool RsGxsMessageCleanUp::clean() req.clear(); - for(; mit != result.end(); mit++) + for(; mit != result.end(); ++mit) { std::vector& metaV = mit->second; std::vector::iterator vit = metaV.begin(); @@ -129,7 +129,7 @@ bool RsGxsIntegrityCheck::check() // compute hash and compare to stored value, if it fails then simply add it // to list std::map::iterator git = grp.begin(); - for(; git != grp.end(); git++) + for(; git != grp.end(); ++git) { RsNxsGrp* grp = git->second; RsFileHash currHash; @@ -198,12 +198,12 @@ bool RsGxsIntegrityCheck::check() GxsMsgResult::iterator mit = msgs.begin(); - for(; mit != msgs.end(); mit++) + for(; mit != msgs.end(); ++mit) { std::vector& msgV = mit->second; std::vector::iterator vit = msgV.begin(); - for(; vit != msgV.end(); vit++) + for(; vit != msgV.end(); ++vit) { RsNxsMsg* msg = *vit; RsFileHash currHash; diff --git a/libretroshare/src/gxs/rsgxsutil.h b/libretroshare/src/gxs/rsgxsutil.h index 23edb10e2..e2a7d2a88 100644 --- a/libretroshare/src/gxs/rsgxsutil.h +++ b/libretroshare/src/gxs/rsgxsutil.h @@ -39,7 +39,7 @@ void freeAndClearContainerResource(Container container) { typename Container::iterator meta_it = container.begin(); - for(; meta_it != container.end(); meta_it++) + for(; meta_it != container.end(); ++meta_it) { delete meta_it->second; diff --git a/libretroshare/src/pgp/pgphandler.cc b/libretroshare/src/pgp/pgphandler.cc index ea0208cc6..396d19aa1 100644 --- a/libretroshare/src/pgp/pgphandler.cc +++ b/libretroshare/src/pgp/pgphandler.cc @@ -282,7 +282,7 @@ bool PGPHandler::printKeys() const std::cerr << "Printing details of all " << std::dec << _public_keyring_map.size() << " keys: " << std::endl; #endif - for(std::map::const_iterator it(_public_keyring_map.begin()); it != _public_keyring_map.end(); it++) + for(std::map::const_iterator it(_public_keyring_map.begin()); it != _public_keyring_map.end(); ++it) { std::cerr << "PGP Key: " << it->first.toStdString() << std::endl; @@ -297,7 +297,7 @@ bool PGPHandler::printKeys() const std::cerr << "\tSigners : " << it->second.signers.size() << std::endl; std::set::const_iterator sit; - for(sit = it->second.signers.begin(); sit != it->second.signers.end(); sit++) + for(sit = it->second.signers.begin(); sit != it->second.signers.end(); ++sit) { std::cerr << "\t\tSigner ID:" << (*sit).toStdString() << ", Name: " ; const PGPCertificateInfo *info = PGPHandler::getCertificateInfo(*sit) ; diff --git a/libretroshare/src/plugins/pluginmanager.cc b/libretroshare/src/plugins/pluginmanager.cc index 0889677ac..f4c3e53c9 100644 --- a/libretroshare/src/plugins/pluginmanager.cc +++ b/libretroshare/src/plugins/pluginmanager.cc @@ -444,7 +444,7 @@ bool RsPluginManager::loadList(std::list& list) RsFileHash reference_executable_hash ; std::list::iterator it; - for(it = list.begin(); it != list.end(); it++) + for(it = list.begin(); it != list.end(); ++it) { RsConfigKeyValueSet *witem = dynamic_cast(*it) ; diff --git a/libretroshare/src/pqi/authgpg.cc b/libretroshare/src/pqi/authgpg.cc index bd44847bb..01ba414c9 100644 --- a/libretroshare/src/pqi/authgpg.cc +++ b/libretroshare/src/pqi/authgpg.cc @@ -213,7 +213,7 @@ void AuthGPG::processServices() RsStackMutex stack(gpgMtxService); /******* LOCKED ******/ std::list::iterator serviceIt; - for (serviceIt = services.begin(); serviceIt != services.end(); serviceIt++) { + for (serviceIt = services.begin(); serviceIt != services.end(); ++serviceIt) { operation = (*serviceIt)->getGPGOperation(); if (operation) { service = *serviceIt; @@ -695,7 +695,7 @@ bool AuthGPG::loadList(std::list& load) RsStackMutex stack(gpgMtxData); /******* LOCKED ******/ /* load the list of accepted gpg keys */ std::list::iterator it; - for(it = load.begin(); it != load.end(); it++) + for(it = load.begin(); it != load.end(); ++it) { RsConfigKeyValueSet *vitem = dynamic_cast(*it); if(vitem) @@ -707,7 +707,7 @@ bool AuthGPG::loadList(std::list& load) #endif std::list::iterator kit; - for(kit = vitem->tlvkvs.pairs.begin(); kit != vitem->tlvkvs.pairs.end(); kit++) + for(kit = vitem->tlvkvs.pairs.begin(); kit != vitem->tlvkvs.pairs.end(); ++kit) if (kit->key != mOwnGpgId.toStdString()) PGPHandler::setAcceptConnexion(RsPgpId(kit->key), (kit->value == "TRUE")); } diff --git a/libretroshare/src/pqi/authssl.cc b/libretroshare/src/pqi/authssl.cc index 305ceb0ba..025ceffab 100644 --- a/libretroshare/src/pqi/authssl.cc +++ b/libretroshare/src/pqi/authssl.cc @@ -1633,7 +1633,7 @@ bool AuthSSLimpl::saveList(bool& cleanup, std::list& lst) // Now save config for network digging strategies RsConfigKeyValueSet *vitem = new RsConfigKeyValueSet ; std::map::iterator mapIt; - for (mapIt = mCerts.begin(); mapIt != mCerts.end(); mapIt++) { + for (mapIt = mCerts.begin(); mapIt != mCerts.end(); ++mapIt) { if (mapIt->first == mOwnId) { continue; } @@ -1658,7 +1658,7 @@ bool AuthSSLimpl::loadList(std::list& load) /* load the list of accepted gpg keys */ std::list::iterator it; - for(it = load.begin(); it != load.end(); it++) { + for(it = load.begin(); it != load.end(); ++it) { RsConfigKeyValueSet *vitem = dynamic_cast(*it); if(vitem) { @@ -1669,7 +1669,7 @@ bool AuthSSLimpl::loadList(std::list& load) #endif std::list::iterator kit; - for(kit = vitem->tlvkvs.pairs.begin(); kit != vitem->tlvkvs.pairs.end(); kit++) { + for(kit = vitem->tlvkvs.pairs.begin(); kit != vitem->tlvkvs.pairs.end(); ++kit) { if (RsPeerId(kit->key) == mOwnId) { continue; } diff --git a/libretroshare/src/pqi/p3cfgmgr.cc b/libretroshare/src/pqi/p3cfgmgr.cc index 7eaf752ce..72064d33a 100644 --- a/libretroshare/src/pqi/p3cfgmgr.cc +++ b/libretroshare/src/pqi/p3cfgmgr.cc @@ -58,7 +58,7 @@ void p3ConfigMgr::tick() /* iterate through and check if any have changed */ std::list::iterator it; - for(it = mConfigs.begin(); it != mConfigs.end(); it++) + for(it = mConfigs.begin(); it != mConfigs.end(); ++it) { if ((*it)->HasConfigChanged(0)) { @@ -105,7 +105,7 @@ void p3ConfigMgr::saveConfig() RsStackMutex stack(cfgMtx); /***** LOCK STACK MUTEX ****/ std::list::iterator it; - for(it = mConfigs.begin(); it != mConfigs.end(); it++) + for(it = mConfigs.begin(); it != mConfigs.end(); ++it) { if ((*it)->HasConfigChanged(1)) { @@ -133,7 +133,7 @@ void p3ConfigMgr::loadConfig() { std::list::iterator cit; RsFileHash dummyHash ; - for (cit = mConfigs.begin(); cit != mConfigs.end(); cit++) + for (cit = mConfigs.begin(); cit != mConfigs.end(); ++cit) { #ifdef CONFIG_DEBUG std::cerr << "p3ConfigMgr::loadConfig() Element: "; @@ -230,7 +230,7 @@ bool p3Config::loadConfig() #endif /* bad load */ - for(it = load.begin(); it != load.end(); it++) + for(it = load.begin(); it != load.end(); ++it) { delete (*it); } @@ -250,7 +250,7 @@ bool p3Config::loadConfig() #endif /* bad load */ - for(it = load.begin(); it != load.end(); it++) + for(it = load.begin(); it != load.end(); ++it) { delete (*it); } @@ -484,7 +484,7 @@ bool p3GeneralConfig::saveList(bool &cleanup, std::list& savelist) RsConfigKeyValueSet *item = new RsConfigKeyValueSet(); std::map::iterator it; - for(it = settings.begin(); it != settings.end(); it++) + for(it = settings.begin(); it != settings.end(); ++it) { RsTlvKeyValue kv; kv.key = it->first; @@ -528,7 +528,7 @@ bool p3GeneralConfig::loadList(std::list& load) if (item) { for(kit = item->tlvkvs.pairs.begin(); - kit != item->tlvkvs.pairs.end(); kit++) + kit != item->tlvkvs.pairs.end(); ++kit) { settings[kit->key] = kit->value; } diff --git a/libretroshare/src/pqi/p3historymgr.cc b/libretroshare/src/pqi/p3historymgr.cc index c5333c9f8..0b260433e 100644 --- a/libretroshare/src/pqi/p3historymgr.cc +++ b/libretroshare/src/pqi/p3historymgr.cc @@ -218,8 +218,8 @@ bool p3HistoryMgr::saveList(bool& cleanup, std::list& saveData) std::map >::iterator mit; std::map::iterator lit; - for (mit = mMessages.begin(); mit != mMessages.end(); mit++) { - for (lit = mit->second.begin(); lit != mit->second.end(); lit++) { + for (mit = mMessages.begin(); mit != mMessages.end(); ++mit) { + for (lit = mit->second.begin(); lit != mit->second.end(); ++lit) { if (lit->second->saveToDisc) { saveData.push_back(lit->second); } @@ -284,7 +284,7 @@ bool p3HistoryMgr::loadList(std::list& load) RsHistoryMsgItem *msgItem; std::list::iterator it; - for (it = load.begin(); it != load.end(); it++) { + for (it = load.begin(); it != load.end(); ++it) { if (NULL != (msgItem = dynamic_cast(*it))) { std::map >::iterator mit = mMessages.find(msgItem->chatPeerId); @@ -307,7 +307,7 @@ bool p3HistoryMgr::loadList(std::list& load) RsConfigKeyValueSet *rskv ; if (NULL != (rskv = dynamic_cast(*it))) { - for (std::list::const_iterator kit = rskv->tlvkvs.pairs.begin(); kit != rskv->tlvkvs.pairs.end(); kit++) { + for (std::list::const_iterator kit = rskv->tlvkvs.pairs.begin(); kit != rskv->tlvkvs.pairs.end(); ++kit) { if (kit->key == "PUBLIC_ENABLE") { mPublicEnable = (kit->value == "TRUE") ? true : false; continue; @@ -398,7 +398,7 @@ bool p3HistoryMgr::getMessages(const RsPeerId &chatPeerId, std::list { std::map::reverse_iterator lit; - for (lit = mit->second.rbegin(); lit != mit->second.rend(); lit++) + for (lit = mit->second.rbegin(); lit != mit->second.rend(); ++lit) { HistoryMsg msg; convertMsg(lit->second, msg); @@ -419,7 +419,7 @@ bool p3HistoryMgr::getMessage(uint32_t msgId, HistoryMsg &msg) RsStackMutex stack(mHistoryMtx); /********** STACK LOCKED MTX ******/ std::map >::iterator mit; - for (mit = mMessages.begin(); mit != mMessages.end(); mit++) { + for (mit = mMessages.begin(); mit != mMessages.end(); ++mit) { std::map::iterator lit = mit->second.find(msgId); if (lit != mit->second.end()) { convertMsg(lit->second, msg); @@ -443,7 +443,7 @@ void p3HistoryMgr::clear(const RsPeerId &chatPeerId) } std::map::iterator lit; - for (lit = mit->second.begin(); lit != mit->second.end(); lit++) { + for (lit = mit->second.begin(); lit != mit->second.end(); ++lit) { delete(lit->second); } mit->second.clear(); diff --git a/libretroshare/src/pqi/p3linkmgr.cc b/libretroshare/src/pqi/p3linkmgr.cc index 74dfa1ca9..ed8c59f23 100644 --- a/libretroshare/src/pqi/p3linkmgr.cc +++ b/libretroshare/src/pqi/p3linkmgr.cc @@ -221,7 +221,7 @@ void p3LinkMgrIMPL::getOnlineList(std::list &ssl_peers) RsStackMutex stack(mLinkMtx); /****** STACK LOCK MUTEX *******/ std::map::iterator it; - for(it = mFriendList.begin(); it != mFriendList.end(); it++) + for(it = mFriendList.begin(); it != mFriendList.end(); ++it) { if (it->second.state & RS_PEER_S_CONNECTED) { @@ -236,7 +236,7 @@ void p3LinkMgrIMPL::getFriendList(std::list &ssl_peers) RsStackMutex stack(mLinkMtx); /****** STACK LOCK MUTEX *******/ std::map::iterator it; - for(it = mFriendList.begin(); it != mFriendList.end(); it++) + for(it = mFriendList.begin(); it != mFriendList.end(); ++it) { ssl_peers.push_back(it->first); } @@ -332,7 +332,7 @@ void p3LinkMgrIMPL::statusTick() RsStackMutex stack(mLinkMtx); /****** LOCK MUTEX ******/ std::map::iterator it; - for(it = mFriendList.begin(); it != mFriendList.end(); it++) + for(it = mFriendList.begin(); it != mFriendList.end(); ++it) { if (it->second.state & RS_PEER_S_CONNECTED) { @@ -359,7 +359,7 @@ void p3LinkMgrIMPL::statusTick() #ifndef P3CONNMGR_NO_AUTO_CONNECTION - for(it2 = retryIds.begin(); it2 != retryIds.end(); it2++) + for(it2 = retryIds.begin(); it2 != retryIds.end(); ++it2) { #ifdef LINKMGR_DEBUG_TICK std::cerr << "p3LinkMgrIMPL::statusTick() RETRY TIMEOUT for: "; @@ -426,7 +426,7 @@ void p3LinkMgrIMPL::tickMonitors() std::cerr << "p3LinkMgrIMPL::tickMonitors() StatusChanged! List:" << std::endl; #endif /* assemble list */ - for(it = mFriendList.begin(); it != mFriendList.end(); it++) + for(it = mFriendList.begin(); it != mFriendList.end(); ++it) { if (it->second.actions) { @@ -479,7 +479,7 @@ void p3LinkMgrIMPL::tickMonitors() } /* do the Others as well! */ - for(it = mOthersList.begin(); it != mOthersList.end(); it++) + for(it = mOthersList.begin(); it != mOthersList.end(); ++it) { if (it->second.actions) { @@ -541,7 +541,7 @@ void p3LinkMgrIMPL::tickMonitors() /* send to all monitors */ std::list::iterator mit; - for(mit = clients.begin(); mit != clients.end(); mit++) + for(mit = clients.begin(); mit != clients.end(); ++mit) { (*mit)->statusChange(actionList); } @@ -553,7 +553,7 @@ void p3LinkMgrIMPL::tickMonitors() /* notify all monitors */ std::list::iterator mit; - for(mit = clients.begin(); mit != clients.end(); mit++) { + for(mit = clients.begin(); mit != clients.end(); ++mit) { (*mit)->statusChanged(); } @@ -1723,7 +1723,7 @@ bool p3LinkMgrIMPL::locked_CheckPotentialAddr(const struct sockaddr_storage &ad /* checks - is it the dreaded 1.0.0.0 */ std::list::const_iterator it; - for(it = mBannedIpList.begin(); it != mBannedIpList.end(); it++) + for(it = mBannedIpList.begin(); it != mBannedIpList.end(); ++it) { if (sockaddr_storage_sameip(*it, addr)) { @@ -1886,7 +1886,7 @@ void p3LinkMgrIMPL::locked_ConnectAttempt_HistoricalAddresses(peerConnectState std::cerr << std::endl; #endif for(ait = ipAddrs.mLocal.mAddrs.begin(); - ait != ipAddrs.mLocal.mAddrs.end(); ait++) + ait != ipAddrs.mLocal.mAddrs.end(); ++ait) { if (locked_CheckPotentialAddr(ait->mAddr, now - ait->mSeenTime)) { @@ -1913,7 +1913,7 @@ void p3LinkMgrIMPL::locked_ConnectAttempt_HistoricalAddresses(peerConnectState } for(ait = ipAddrs.mExt.mAddrs.begin(); - ait != ipAddrs.mExt.mAddrs.end(); ait++) + ait != ipAddrs.mExt.mAddrs.end(); ++ait) { if (locked_CheckPotentialAddr(ait->mAddr, now - ait->mSeenTime)) { @@ -2036,7 +2036,7 @@ bool p3LinkMgrIMPL::addAddressIfUnique(std::list &addrList, #endif std::list::iterator it; - for(it = addrList.begin(); it != addrList.end(); it++) + for(it = addrList.begin(); it != addrList.end(); ++it) { if (sockaddr_storage_same(pca.addr, it->addr) && (pca.type == it->type)) @@ -2213,7 +2213,7 @@ void p3LinkMgrIMPL::printPeerLists(std::ostream &out) std::map::iterator it; - for(it = mFriendList.begin(); it != mFriendList.end(); it++) + for(it = mFriendList.begin(); it != mFriendList.end(); ++it) { out << "\t SSL ID: " << it->second.id.toStdString(); out << "\t State: " << it->second.state; @@ -2222,7 +2222,7 @@ void p3LinkMgrIMPL::printPeerLists(std::ostream &out) out << "p3LinkMgrIMPL::printPeerLists() Others List"; out << std::endl; - for(it = mOthersList.begin(); it != mOthersList.end(); it++) + for(it = mOthersList.begin(); it != mOthersList.end(); ++it) { out << "\t SSL ID: " << it->second.id.toStdString(); out << "\t State: " << it->second.state; diff --git a/libretroshare/src/pqi/p3netmgr.cc b/libretroshare/src/pqi/p3netmgr.cc index e5c3f1151..b47c7c6fd 100644 --- a/libretroshare/src/pqi/p3netmgr.cc +++ b/libretroshare/src/pqi/p3netmgr.cc @@ -280,7 +280,7 @@ void p3NetMgrIMPL::netReset() std::cerr << "p3NetMgrIMPL::netReset() resetting listeners" << std::endl; #endif std::list::const_iterator it; - for(it = mNetListeners.begin(); it != mNetListeners.end(); it++) + for(it = mNetListeners.begin(); it != mNetListeners.end(); ++it) { (*it)->resetListener(iaddr); #ifdef NETMGR_DEBUG_RESET @@ -1194,7 +1194,7 @@ void p3NetMgrIMPL::addNetAssistFirewall(uint32_t id, pqiNetAssistFirewall *fwAge bool p3NetMgrIMPL::enableNetAssistFirewall(bool on) { std::map::iterator it; - for(it = mFwAgents.begin(); it != mFwAgents.end(); it++) + for(it = mFwAgents.begin(); it != mFwAgents.end(); ++it) { (it->second)->enable(on); } @@ -1205,7 +1205,7 @@ bool p3NetMgrIMPL::enableNetAssistFirewall(bool on) bool p3NetMgrIMPL::netAssistFirewallEnabled() { std::map::iterator it; - for(it = mFwAgents.begin(); it != mFwAgents.end(); it++) + for(it = mFwAgents.begin(); it != mFwAgents.end(); ++it) { if ((it->second)->getEnabled()) { @@ -1218,7 +1218,7 @@ bool p3NetMgrIMPL::netAssistFirewallEnabled() bool p3NetMgrIMPL::netAssistFirewallActive() { std::map::iterator it; - for(it = mFwAgents.begin(); it != mFwAgents.end(); it++) + for(it = mFwAgents.begin(); it != mFwAgents.end(); ++it) { if ((it->second)->getActive()) { @@ -1231,7 +1231,7 @@ bool p3NetMgrIMPL::netAssistFirewallActive() bool p3NetMgrIMPL::netAssistFirewallShutdown() { std::map::iterator it; - for(it = mFwAgents.begin(); it != mFwAgents.end(); it++) + for(it = mFwAgents.begin(); it != mFwAgents.end(); ++it) { (it->second)->shutdown(); } @@ -1241,7 +1241,7 @@ bool p3NetMgrIMPL::netAssistFirewallShutdown() bool p3NetMgrIMPL::netAssistFirewallPorts(uint16_t iport, uint16_t eport) { std::map::iterator it; - for(it = mFwAgents.begin(); it != mFwAgents.end(); it++) + for(it = mFwAgents.begin(); it != mFwAgents.end(); ++it) { (it->second)->setInternalPort(iport); (it->second)->setExternalPort(eport); @@ -1253,7 +1253,7 @@ bool p3NetMgrIMPL::netAssistFirewallPorts(uint16_t iport, uint16_t eport) bool p3NetMgrIMPL::netAssistExtAddress(struct sockaddr_storage &extAddr) { std::map::iterator it; - for(it = mFwAgents.begin(); it != mFwAgents.end(); it++) + for(it = mFwAgents.begin(); it != mFwAgents.end(); ++it) { if ((it->second)->getActive()) { @@ -1281,7 +1281,7 @@ bool p3NetMgrIMPL::enableNetAssistConnect(bool on) #endif std::map::iterator it; - for(it = mDhts.begin(); it != mDhts.end(); it++) + for(it = mDhts.begin(); it != mDhts.end(); ++it) { (it->second)->enable(on); } @@ -1291,7 +1291,7 @@ bool p3NetMgrIMPL::enableNetAssistConnect(bool on) bool p3NetMgrIMPL::netAssistConnectEnabled() { std::map::iterator it; - for(it = mDhts.begin(); it != mDhts.end(); it++) + for(it = mDhts.begin(); it != mDhts.end(); ++it) { if ((it->second)->getEnabled()) { @@ -1315,7 +1315,7 @@ bool p3NetMgrIMPL::netAssistConnectEnabled() bool p3NetMgrIMPL::netAssistConnectActive() { std::map::iterator it; - for(it = mDhts.begin(); it != mDhts.end(); it++) + for(it = mDhts.begin(); it != mDhts.end(); ++it) { if ((it->second)->getActive()) @@ -1340,7 +1340,7 @@ bool p3NetMgrIMPL::netAssistConnectActive() bool p3NetMgrIMPL::netAssistConnectStats(uint32_t &netsize, uint32_t &localnetsize) { std::map::iterator it; - for(it = mDhts.begin(); it != mDhts.end(); it++) + for(it = mDhts.begin(); it != mDhts.end(); ++it) { if (((it->second)->getActive()) && ((it->second)->getNetworkStats(netsize, localnetsize))) @@ -1371,7 +1371,7 @@ bool p3NetMgrIMPL::netAssistConnectShutdown() #endif std::map::iterator it; - for(it = mDhts.begin(); it != mDhts.end(); it++) + for(it = mDhts.begin(); it != mDhts.end(); ++it) { (it->second)->shutdown(); } @@ -1387,7 +1387,7 @@ bool p3NetMgrIMPL::netAssistFriend(const RsPeerId &id, bool on) std::cerr << std::endl; #endif - for(it = mDhts.begin(); it != mDhts.end(); it++) + for(it = mDhts.begin(); it != mDhts.end(); ++it) { if (on) (it->second)->findPeer(id); @@ -1407,7 +1407,7 @@ bool p3NetMgrIMPL::netAssistKnownPeer(const RsPeerId &id, const struct sockaddr_ std::cerr << std::endl; #endif - for(it = mDhts.begin(); it != mDhts.end(); it++) + for(it = mDhts.begin(); it != mDhts.end(); ++it) { (it->second)->addKnownPeer(id, addr, flags); } @@ -1423,7 +1423,7 @@ bool p3NetMgrIMPL::netAssistBadPeer(const struct sockaddr_storage &addr, uint32_ std::cerr << std::endl; #endif - for(it = mDhts.begin(); it != mDhts.end(); it++) + for(it = mDhts.begin(); it != mDhts.end(); ++it) { (it->second)->addBadPeer(addr, reason, flags, age); } @@ -1440,7 +1440,7 @@ bool p3NetMgrIMPL::netAssistAttach(bool on) std::cerr << std::endl; #endif - for(it = mDhts.begin(); it != mDhts.end(); it++) + for(it = mDhts.begin(); it != mDhts.end(); ++it) { (it->second)->setAttachMode(on); } @@ -1458,7 +1458,7 @@ bool p3NetMgrIMPL::netAssistStatusUpdate(const RsPeerId &id, int state) std::cerr << std::endl; #endif - for(it = mDhts.begin(); it != mDhts.end(); it++) + for(it = mDhts.begin(); it != mDhts.end(); ++it) { (it->second)->ConnectionFeedback(id, state); } @@ -1472,7 +1472,7 @@ bool p3NetMgrIMPL::netAssistSetAddress( const struct sockaddr_storage & /*laddr* { #if 0 std::map::iterator it; - for(it = mDhts.begin(); it != mDhts.end(); it++) + for(it = mDhts.begin(); it != mDhts.end(); ++it) { (it->second)->setExternalInterface(laddr, eaddr, mode); } @@ -1483,13 +1483,13 @@ bool p3NetMgrIMPL::netAssistSetAddress( const struct sockaddr_storage & /*laddr* void p3NetMgrIMPL::netAssistTick() { std::map::iterator it; - for(it = mDhts.begin(); it != mDhts.end(); it++) + for(it = mDhts.begin(); it != mDhts.end(); ++it) { (it->second)->tick(); } std::map::iterator fit; - for(fit = mFwAgents.begin(); fit != mFwAgents.end(); fit++) + for(fit = mFwAgents.begin(); fit != mFwAgents.end(); ++fit) { (fit->second)->tick(); } diff --git a/libretroshare/src/pqi/p3notify.cc b/libretroshare/src/pqi/p3notify.cc index f6d337756..0ddc9a0a8 100644 --- a/libretroshare/src/pqi/p3notify.cc +++ b/libretroshare/src/pqi/p3notify.cc @@ -218,7 +218,7 @@ bool p3Notify::ClearFeedItems(uint32_t type) } else { - it++; + ++it; } } return true; diff --git a/libretroshare/src/pqi/p3peermgr.cc b/libretroshare/src/pqi/p3peermgr.cc index 15eef33bb..bd59882d6 100644 --- a/libretroshare/src/pqi/p3peermgr.cc +++ b/libretroshare/src/pqi/p3peermgr.cc @@ -601,7 +601,7 @@ bool p3PeerMgrIMPL::haveOnceConnected() /* check for existing */ std::map::iterator it; - for(it = mFriendList.begin(); it != mFriendList.end(); it++) + for(it = mFriendList.begin(); it != mFriendList.end(); ++it) { if (it->second.lastcontact > 0) { @@ -771,7 +771,7 @@ bool p3PeerMgrIMPL::removeFriend(const RsPgpId &id) bool success = false; std::map::iterator it; //remove ssl and gpg_ids - for(it = mFriendList.begin(); it != mFriendList.end(); it++) + for(it = mFriendList.begin(); it != mFriendList.end(); ++it) { if (find(sslid_toRemove.begin(),sslid_toRemove.end(),it->second.id) != sslid_toRemove.end()) { @@ -789,7 +789,7 @@ bool p3PeerMgrIMPL::removeFriend(const RsPgpId &id) } } - for(std::list::iterator rit = sslid_toRemove.begin(); rit != sslid_toRemove.end(); rit++) + for(std::list::iterator rit = sslid_toRemove.begin(); rit != sslid_toRemove.end(); ++rit) if (mFriendList.end() != (it = mFriendList.find(*rit))) mFriendList.erase(it); @@ -804,7 +804,7 @@ bool p3PeerMgrIMPL::removeFriend(const RsPgpId &id) } std::list::iterator rit; - for(rit = sslid_toRemove.begin(); rit != sslid_toRemove.end(); rit++) + for(rit = sslid_toRemove.begin(); rit != sslid_toRemove.end(); ++rit) { mLinkMgr->removeFriend(*rit); } @@ -844,7 +844,7 @@ bool p3PeerMgrIMPL::removeFriend(const RsPeerId &id, bool removePgpId) bool success = false; std::map::iterator it; //remove ssl and gpg_ids - for(it = mFriendList.begin(); it != mFriendList.end(); it++) + for(it = mFriendList.begin(); it != mFriendList.end(); ++it) { if (it->second.id == id) { @@ -864,13 +864,13 @@ bool p3PeerMgrIMPL::removeFriend(const RsPeerId &id, bool removePgpId) } } - for(std::list::iterator rit = sslid_toRemove.begin(); rit != sslid_toRemove.end(); rit++) + for(std::list::iterator rit = sslid_toRemove.begin(); rit != sslid_toRemove.end(); ++rit) if (mFriendList.end() != (it = mFriendList.find(*rit))) mFriendList.erase(it); std::map::iterator it2 ; - for(std::list::iterator rit = pgpid_toRemove.begin(); rit != pgpid_toRemove.end(); rit++) + for(std::list::iterator rit = pgpid_toRemove.begin(); rit != pgpid_toRemove.end(); ++rit) if (mFriendsPermissionFlags.end() != (it2 = mFriendsPermissionFlags.find(*rit))) mFriendsPermissionFlags.erase(it2); @@ -880,7 +880,7 @@ bool p3PeerMgrIMPL::removeFriend(const RsPeerId &id, bool removePgpId) } std::list::iterator rit; - for(rit = sslid_toRemove.begin(); rit != sslid_toRemove.end(); rit++) + for(rit = sslid_toRemove.begin(); rit != sslid_toRemove.end(); ++rit) { mLinkMgr->removeFriend(*rit); } @@ -910,7 +910,7 @@ void p3PeerMgrIMPL::printPeerLists(std::ostream &out) std::map::iterator it; - for(it = mFriendList.begin(); it != mFriendList.end(); it++) + for(it = mFriendList.begin(); it != mFriendList.end(); ++it) { out << "\t SSL ID: " << it->second.id; out << "\t GPG ID: " << it->second.gpg_id; @@ -919,7 +919,7 @@ void p3PeerMgrIMPL::printPeerLists(std::ostream &out) out << "p3PeerMgrIMPL::printPeerLists() Others List"; out << std::endl; - for(it = mOthersList.begin(); it != mOthersList.end(); it++) + for(it = mOthersList.begin(); it != mOthersList.end(); ++it) { out << "\t SSL ID: " << it->second.id; out << "\t GPG ID: " << it->second.gpg_id; @@ -1529,7 +1529,7 @@ bool p3PeerMgrIMPL::saveList(bool &cleanup, std::list& saveData) /* iterate through all friends and save */ std::map::iterator it; - for(it = mFriendList.begin(); it != mFriendList.end(); it++) + for(it = mFriendList.begin(); it != mFriendList.end(); ++it) { item = new RsPeerNetItem(); item->clear(); @@ -1603,7 +1603,7 @@ bool p3PeerMgrIMPL::saveList(bool &cleanup, std::list& saveData) /* save groups */ std::list::iterator groupIt; - for (groupIt = groupList.begin(); groupIt != groupList.end(); groupIt++) { + for (groupIt = groupList.begin(); groupIt != groupList.end(); ++groupIt) { saveData.push_back(*groupIt); // no delete } @@ -1614,7 +1614,7 @@ void p3PeerMgrIMPL::saveDone() { /* clean up the save List */ std::list::iterator it; - for(it = saveCleanupList.begin(); it != saveCleanupList.end(); it++) + for(it = saveCleanupList.begin(); it != saveCleanupList.end(); ++it) { delete (*it); } @@ -1646,7 +1646,7 @@ bool p3PeerMgrIMPL::loadList(std::list& load) /* load the list of peers */ std::list::iterator it; - for(it = load.begin(); it != load.end(); it++) + for(it = load.begin(); it != load.end(); ++it) { RsPeerNetItem *pitem = dynamic_cast(*it); if (pitem) @@ -1717,7 +1717,7 @@ bool p3PeerMgrIMPL::loadList(std::list& load) std::cerr << std::endl; #endif std::list::iterator kit; - for(kit = vitem->tlvkvs.pairs.begin(); kit != vitem->tlvkvs.pairs.end(); kit++) + for(kit = vitem->tlvkvs.pairs.begin(); kit != vitem->tlvkvs.pairs.end(); ++kit) { if (kit->key == kConfigKeyExtIpFinder) { @@ -1799,10 +1799,10 @@ bool p3PeerMgrIMPL::loadList(std::list& load) bool foundStandardGroup[standardGroupCount] = { false, false, false, false, false }; std::list::iterator groupIt; - for (groupIt = groupList.begin(); groupIt != groupList.end(); groupIt++) { + for (groupIt = groupList.begin(); groupIt != groupList.end(); ++groupIt) { if ((*groupIt)->flag & RS_GROUP_FLAG_STANDARD) { int i; - for (i = 0; i < standardGroupCount; i++) { + for (i = 0; i < standardGroupCount; ++i) { if ((*groupIt)->id == standardGroup[i]) { foundStandardGroup[i] = true; break; @@ -1822,7 +1822,7 @@ bool p3PeerMgrIMPL::loadList(std::list& load) } /* Initialize standard groups */ - for (int i = 0; i < standardGroupCount; i++) { + for (int i = 0; i < standardGroupCount; ++i) { if (foundStandardGroup[i] == false) { RsPeerGroupItem *gitem = new RsPeerGroupItem; gitem->id = standardGroup[i]; @@ -1932,7 +1932,7 @@ bool p3PeerMgrIMPL::editGroup(const std::string &groupId, RsGroupInfo &groupInfo RsStackMutex stack(mPeerMtx); /****** STACK LOCK MUTEX *******/ std::list::iterator groupIt; - for (groupIt = groupList.begin(); groupIt != groupList.end(); groupIt++) { + for (groupIt = groupList.begin(); groupIt != groupList.end(); ++groupIt) { if ((*groupIt)->id == groupId) { break; } @@ -1969,7 +1969,7 @@ bool p3PeerMgrIMPL::removeGroup(const std::string &groupId) RsStackMutex stack(mPeerMtx); /****** STACK LOCK MUTEX *******/ std::list::iterator groupIt; - for (groupIt = groupList.begin(); groupIt != groupList.end(); groupIt++) { + for (groupIt = groupList.begin(); groupIt != groupList.end(); ++groupIt) { if ((*groupIt)->id == groupId) { break; } @@ -2004,7 +2004,7 @@ bool p3PeerMgrIMPL::getGroupInfo(const std::string &groupId, RsGroupInfo &groupI RsStackMutex stack(mPeerMtx); /****** STACK LOCK MUTEX *******/ std::list::iterator groupIt; - for (groupIt = groupList.begin(); groupIt != groupList.end(); groupIt++) { + for (groupIt = groupList.begin(); groupIt != groupList.end(); ++groupIt) { if ((*groupIt)->id == groupId) { (*groupIt)->get(groupInfo); @@ -2020,7 +2020,7 @@ bool p3PeerMgrIMPL::getGroupInfoList(std::list &groupInfoList) RsStackMutex stack(mPeerMtx); /****** STACK LOCK MUTEX *******/ std::list::iterator groupIt; - for (groupIt = groupList.begin(); groupIt != groupList.end(); groupIt++) { + for (groupIt = groupList.begin(); groupIt != groupList.end(); ++groupIt) { RsGroupInfo groupInfo; (*groupIt)->get(groupInfo); groupInfoList.push_back(groupInfo); @@ -2046,12 +2046,12 @@ bool p3PeerMgrIMPL::assignPeersToGroup(const std::string &groupId, const std::li RsStackMutex stack(mPeerMtx); /****** STACK LOCK MUTEX *******/ std::list::iterator groupIt; - for (groupIt = groupList.begin(); groupIt != groupList.end(); groupIt++) { + for (groupIt = groupList.begin(); groupIt != groupList.end(); ++groupIt) { if (groupId.empty() || (*groupIt)->id == groupId) { RsPeerGroupItem *groupItem = *groupIt; std::list::const_iterator peerIt; - for (peerIt = peerIds.begin(); peerIt != peerIds.end(); peerIt++) { + for (peerIt = peerIds.begin(); peerIt != peerIds.end(); ++peerIt) { std::list::iterator peerIt1 = std::find(groupItem->pgpList.ids.begin(), groupItem->pgpList.ids.end(), *peerIt); if (assign) { if (peerIt1 == groupItem->pgpList.ids.end()) { @@ -2148,7 +2148,7 @@ bool p3PeerMgrIMPL::removeAllFriendLocations(const RsPgpId &gpgid) } std::list::iterator it; - for(it = sslIds.begin(); it != sslIds.end(); it++) + for(it = sslIds.begin(); it != sslIds.end(); ++it) { removeFriend(*it, true); } @@ -2167,7 +2167,7 @@ bool p3PeerMgrIMPL::getAssociatedPeers(const RsPgpId &gpg_id, std::list::iterator it; - for(it = mFriendList.begin(); it != mFriendList.end(); it++) + for(it = mFriendList.begin(); it != mFriendList.end(); ++it) { if (it->second.gpg_id == gpg_id) { @@ -2212,7 +2212,7 @@ bool p3PeerMgrIMPL::removeUnusedLocations() time_t now = time(NULL); std::map::iterator it; - for(it = mFriendList.begin(); it != mFriendList.end(); it++) + for(it = mFriendList.begin(); it != mFriendList.end(); ++it) { if (now - it->second.lastcontact > VERY_OLD_PEER) { @@ -2238,7 +2238,7 @@ bool p3PeerMgrIMPL::removeUnusedLocations() } std::list::iterator it; - for(it = toRemove.begin(); it != toRemove.end(); it++) + for(it = toRemove.begin(); it != toRemove.end(); ++it) { removeFriend(*it,false); } diff --git a/libretroshare/src/pqi/p3servicecontrol.cc b/libretroshare/src/pqi/p3servicecontrol.cc index ab285869b..b7c6aef98 100644 --- a/libretroshare/src/pqi/p3servicecontrol.cc +++ b/libretroshare/src/pqi/p3servicecontrol.cc @@ -152,7 +152,7 @@ void p3ServiceControl::getServiceChanges(std::set &updateSet) #endif std::set::iterator it; - for (it = mUpdatedSet.begin(); it != mUpdatedSet.end(); it++) + for (it = mUpdatedSet.begin(); it != mUpdatedSet.end(); ++it) { updateSet.insert(*it); } @@ -189,7 +189,7 @@ bool p3ServiceControl::getServicesAllowed(const RsPeerId &peerId, RsPeerServiceI // For each registered Service.. check if peer has permissions. std::map::iterator it; - for(it = mOwnServices.begin(); it != mOwnServices.end(); it++) + for(it = mOwnServices.begin(); it != mOwnServices.end(); ++it) { if (peerHasPermissionForService_locked(peerId, it->first)) { @@ -317,7 +317,7 @@ bool p3ServiceControl::updateServicePermissions(uint32_t serviceId, const RsServ std::list::const_iterator pit; if (it != mServicePermissionMap.end()) { - for(pit = onlinePeers.begin(); pit != onlinePeers.end(); pit++) + for(pit = onlinePeers.begin(); pit != onlinePeers.end(); ++pit) { if (it->second.peerHasPermission(*pit) != permissions.peerHasPermission(*pit)) @@ -526,18 +526,18 @@ bool p3ServiceControl::updateAllFilters_locked() std::set::const_iterator pit; std::map::const_iterator it; - for(it = mServicesProvided.begin(); it != mServicesProvided.end(); it++) + for(it = mServicesProvided.begin(); it != mServicesProvided.end(); ++it) { peerSet.insert(it->first); } std::map::const_iterator fit; - for(fit = mPeerFilterMap.begin(); fit != mPeerFilterMap.end(); fit++) + for(fit = mPeerFilterMap.begin(); fit != mPeerFilterMap.end(); ++fit) { peerSet.insert(fit->first); } - for(pit = peerSet.begin(); pit != peerSet.end(); pit++) + for(pit = peerSet.begin(); pit != peerSet.end(); ++pit) { updateFilterByPeer_locked(*pit); } @@ -618,8 +618,8 @@ bool p3ServiceControl::updateFilterByPeer_locked(const RsPeerId &peerId) peerFilter.mAllowedServices.insert(oit->first); } } - oit++; - tit++; + ++oit; + ++tit; } else { @@ -629,7 +629,7 @@ bool p3ServiceControl::updateFilterByPeer_locked(const RsPeerId &peerId) std::cerr << "\tSkipping Only Own Service ID: " << oit->first; std::cerr << std::endl; #endif - oit++; + ++oit; } else { @@ -637,7 +637,7 @@ bool p3ServiceControl::updateFilterByPeer_locked(const RsPeerId &peerId) std::cerr << "\tSkipping Only Peer Service ID: " << tit->first; std::cerr << std::endl; #endif - tit++; + ++tit; } } } @@ -735,7 +735,7 @@ void p3ServiceControl::recordFilterChanges_locked(const RsPeerId &peerId, } // Handle the unfinished Set. - for(; it1 != eit1; it1++) + for(; it1 != eit1; ++it1) { #ifdef SERVICECONTROL_DEBUG std::cerr << "Removed Service: " << *it1; @@ -746,7 +746,7 @@ void p3ServiceControl::recordFilterChanges_locked(const RsPeerId &peerId, filterChangeRemoved_locked(peerId, *it1); } - for(; it2 != eit2; it2++) + for(; it2 != eit2; ++it2) { #ifdef SERVICECONTROL_DEBUG std::cerr << "Added Service: " << *it2; @@ -761,7 +761,7 @@ void p3ServiceControl::recordFilterChanges_locked(const RsPeerId &peerId, #if 0 // now we to store for later notifications. std::map::const_iterator cit; - for(cit = changes.begin(); cit != changes.end(); cit++) + for(cit = changes.begin(); cit != changes.end(); ++cit) { ServiceNotifications ¬es = mNotifications[cit->first]; if (cit->second) @@ -988,7 +988,7 @@ void p3ServiceControl::statusChange(const std::list &plist) #endif std::list::const_iterator pit; - for(pit = plist.begin(); pit != plist.end(); pit++) + for(pit = plist.begin(); pit != plist.end(); ++pit) { #ifdef SERVICECONTROL_DEBUG std::cerr << "p3ServiceControl::statusChange() for peer: "; @@ -1111,7 +1111,7 @@ void p3ServiceControl::notifyAboutFriends() RsStackMutex stack(mMonitorMtx); /***** LOCK STACK MUTEX ****/ std::multimap::const_iterator sit; - for(sit = mMonitors.begin(); sit != mMonitors.end(); sit++) + for(sit = mMonitors.begin(); sit != mMonitors.end(); ++sit) { sit->second->statusChange(friendNotifications); } @@ -1143,7 +1143,7 @@ void p3ServiceControl::notifyServices() std::map::const_iterator it; std::multimap::const_iterator sit, eit; - for(it = notifications.begin(); it != notifications.end(); it++) + for(it = notifications.begin(); it != notifications.end(); ++it) { #ifdef SERVICECONTROL_DEBUG std::cerr << "p3ServiceControl::notifyServices(): Notifications for Service: " << it->first; @@ -1166,7 +1166,7 @@ void p3ServiceControl::notifyServices() std::list peers; std::set::const_iterator pit; for(pit = it->second.mAdded.begin(); - pit != it->second.mAdded.end(); pit++) + pit != it->second.mAdded.end(); ++pit) { pqiServicePeer peer; peer.id = *pit; @@ -1181,7 +1181,7 @@ void p3ServiceControl::notifyServices() } for(pit = it->second.mRemoved.begin(); - pit != it->second.mRemoved.end(); pit++) + pit != it->second.mRemoved.end(); ++pit) { pqiServicePeer peer; peer.id = *pit; @@ -1195,7 +1195,7 @@ void p3ServiceControl::notifyServices() #endif } - for(; sit != eit; sit++) + for(; sit != eit; ++sit) { #ifdef SERVICECONTROL_DEBUG std::cerr << "p3ServiceControl::notifyServices(): Sending to Monitoring Service"; @@ -1273,7 +1273,7 @@ std::ostream &operator<<(std::ostream &out, const RsPeerServiceInfo &info) out << "RsPeerServiceInfo(" << info.mPeerId << ")"; out << std::endl; std::map::const_iterator it; - for(it = info.mServiceList.begin(); it != info.mServiceList.end(); it++) + for(it = info.mServiceList.begin(); it != info.mServiceList.end(); ++it) { out << "\t Service:" << it->first << " : "; out << it->second; @@ -1297,7 +1297,7 @@ std::ostream &operator<<(std::ostream &out, const ServicePeerFilter &filter) out << " AllowAll: " << filter.mAllowAll; out << " Matched Services: "; std::set::const_iterator it; - for(it = filter.mAllowedServices.begin(); it != filter.mAllowedServices.end(); it++) + for(it = filter.mAllowedServices.begin(); it != filter.mAllowedServices.end(); ++it) { out << *it << " "; } diff --git a/libretroshare/src/pqi/pqihandler.cc b/libretroshare/src/pqi/pqihandler.cc index 75cd3be3f..16ea9d387 100644 --- a/libretroshare/src/pqi/pqihandler.cc +++ b/libretroshare/src/pqi/pqihandler.cc @@ -70,7 +70,7 @@ int pqihandler::tick() // tick all interfaces... std::map::iterator it; - for(it = mods.begin(); it != mods.end(); it++) + for(it = mods.begin(); it != mods.end(); ++it) { if (0 < ((it -> second) -> pqi) -> tick()) { @@ -120,7 +120,7 @@ int pqihandler::status() std::string out = "pqihandler::status() Active Modules:\n"; // display all interfaces... - for(it = mods.begin(); it != mods.end(); it++) + for(it = mods.begin(); it != mods.end(); ++it) { rs_sprintf_append(out, "\tModule [%s] Pointer <%p>", it -> first.toStdString().c_str(), (void *) ((it -> second) -> pqi)); } @@ -131,7 +131,7 @@ int pqihandler::status() // status all interfaces... - for(it = mods.begin(); it != mods.end(); it++) + for(it = mods.begin(); it != mods.end(); ++it) { ((it -> second) -> pqi) -> status(); } @@ -183,7 +183,7 @@ bool pqihandler::RemoveSearchModule(SearchModule *mod) { RsStackMutex stack(coreMtx); /**************** LOCKED MUTEX ****************/ std::map::iterator it; - for(it = mods.begin(); it != mods.end(); it++) + for(it = mods.begin(); it != mods.end(); ++it) { if (mod == it -> second) { @@ -314,7 +314,7 @@ int pqihandler::locked_GetItems() int count = 0; // loop through modules.... - for(it = mods.begin(); it != mods.end(); it++) + for(it = mods.begin(); it != mods.end(); ++it) { SearchModule *mod = (it -> second); @@ -441,7 +441,7 @@ int pqihandler::ExtractRates(std::map &ratemap, RsBwRat RsStackMutex stack(coreMtx); /**************** LOCKED MUTEX ****************/ std::map::iterator it; - for(it = mods.begin(); it != mods.end(); it++) + for(it = mods.begin(); it != mods.end(); ++it) { SearchModule *mod = (it -> second); @@ -481,7 +481,7 @@ int pqihandler::UpdateRates() int effectiveDownloadsSm = 0; // loop through modules to get the used bandwith and the number of modules that are affectively transfering //std::cerr << " Looping through modules" << std::endl; - for(it = mods.begin(); it != mods.end(); it++) + for(it = mods.begin(); it != mods.end(); ++it) { SearchModule *mod = (it -> second); float crate_in = mod -> pqi -> getRate(true); @@ -528,7 +528,7 @@ int pqihandler::UpdateRates() rate_out_modifier = - 0.001 * avail_out; } if (rate_out_modifier != 0) { - for(it = mods.begin(); it != mods.end(); it++) + for(it = mods.begin(); it != mods.end(); ++it) { SearchModule *mod = (it -> second); mod -> pqi -> setMaxRate(false, mod -> pqi -> getMaxRate(false) + rate_out_modifier); @@ -543,7 +543,7 @@ int pqihandler::UpdateRates() rate_in_modifier = - 0.001 * avail_in; } if (rate_in_modifier != 0) { - for(it = mods.begin(); it != mods.end(); it++) + for(it = mods.begin(); it != mods.end(); ++it) { SearchModule *mod = (it -> second); mod -> pqi -> setMaxRate(true, mod -> pqi -> getMaxRate(true) + rate_in_modifier); @@ -551,7 +551,7 @@ int pqihandler::UpdateRates() } //cap the rates - for(it = mods.begin(); it != mods.end(); it++) + for(it = mods.begin(); it != mods.end(); ++it) { SearchModule *mod = (it -> second); if (mod -> pqi -> getMaxRate(false) < max_out_effective) { diff --git a/libretroshare/src/pqi/pqiipset.cc b/libretroshare/src/pqi/pqiipset.cc index 361cde5b0..8fa686844 100644 --- a/libretroshare/src/pqi/pqiipset.cc +++ b/libretroshare/src/pqi/pqiipset.cc @@ -94,7 +94,7 @@ bool pqiIpAddrList::updateIpAddressList(const pqiIpAddress &addr) return false; } - for(it = mAddrs.begin(); it != mAddrs.end(); it++) + for(it = mAddrs.begin(); it != mAddrs.end(); ++it) { if (it->sameAddress(addr)) { @@ -124,7 +124,7 @@ bool pqiIpAddrList::updateIpAddressList(const pqiIpAddress &addr) // ordered by decreaseing time. (newest at front) bool added = false; - for(it = mAddrs.begin(); it != mAddrs.end(); it++) + for(it = mAddrs.begin(); it != mAddrs.end(); ++it) { if (it->mSeenTime < addr.mSeenTime) { @@ -198,7 +198,7 @@ void pqiIpAddrList::printIpAddressList(std::string &out) const { std::list::const_iterator it; time_t now = time(NULL); - for(it = mAddrs.begin(); it != mAddrs.end(); it++) + for(it = mAddrs.begin(); it != mAddrs.end(); ++it) { out += sockaddr_storage_tostring(it->mAddr); rs_sprintf_append(out, "( %ld old)\n", now - it->mSeenTime); @@ -226,7 +226,7 @@ bool pqiIpAddrSet::updateAddrs(const pqiIpAddrSet &addrs) bool newAddrs = false; std::list::const_iterator it; - for(it = addrs.mLocal.mAddrs.begin(); it != addrs.mLocal.mAddrs.end(); it++) + for(it = addrs.mLocal.mAddrs.begin(); it != addrs.mLocal.mAddrs.end(); ++it) { if (mLocal.updateIpAddressList(*it)) { @@ -238,7 +238,7 @@ bool pqiIpAddrSet::updateAddrs(const pqiIpAddrSet &addrs) } } - for(it = addrs.mExt.mAddrs.begin(); it != addrs.mExt.mAddrs.end(); it++) + for(it = addrs.mExt.mAddrs.begin(); it != addrs.mExt.mAddrs.end(); ++it) { if (mExt.updateIpAddressList(*it)) { diff --git a/libretroshare/src/pqi/pqinetwork.cc b/libretroshare/src/pqi/pqinetwork.cc index 3a1cc217c..5cbebda1f 100644 --- a/libretroshare/src/pqi/pqinetwork.cc +++ b/libretroshare/src/pqi/pqinetwork.cc @@ -171,7 +171,7 @@ bool getLocalInterfaces_ipv4(struct in_addr &/*routeAddr*/, std::listif_index != 0; ifptr++) + for(; ifptr->if_index != 0; ++ifptr) { //copy in the interface name to look up address of strncpy(ifreq.ifr_name, ifptr->if_name, IF_NAMESIZE); @@ -598,7 +598,7 @@ bool getPreferredInterface_ipv4(in_addr &routeAddr, struct in_addr &prefAddr) / std::cerr << "getPreferredInterface() " << addrs.size() << " interfaces." << std::endl; #endif - for(it = addrs.begin(); it != addrs.end(); it++) + for(it = addrs.begin(); it != addrs.end(); ++it) { struct in_addr addr = *it; @@ -741,7 +741,7 @@ bool getLocalInterfaces(struct sockaddr_storage &existAddr, std::list::iterator it; - for(it = local_addrs.begin(); it != local_addrs.end(); it++) + for(it = local_addrs.begin(); it != local_addrs.end(); ++it) { /* store into prefAddr */ diff --git a/libretroshare/src/pqi/pqiperson.cc b/libretroshare/src/pqi/pqiperson.cc index 009152606..0971cb370 100644 --- a/libretroshare/src/pqi/pqiperson.cc +++ b/libretroshare/src/pqi/pqiperson.cc @@ -56,7 +56,7 @@ pqiperson::~pqiperson() // clean up the children. std::map::iterator it; - for(it = kids.begin(); it != kids.end(); it++) + for(it = kids.begin(); it != kids.end(); ++it) { pqiconnect *pc = (it->second); delete pc; @@ -180,7 +180,7 @@ int pqiperson::tick() // tick the children. std::map::iterator it; - for(it = kids.begin(); it != kids.end(); it++) + for(it = kids.begin(); it != kids.end(); ++it) { if (0 < (it->second) -> tick()) { @@ -271,7 +271,7 @@ int pqiperson::handleNotifyEvent_locked(NetInterface *ni, int newState, const s /* start again */ int i = 0; - for(it = kids.begin(); it != kids.end(); it++) + for(it = kids.begin(); it != kids.end(); ++it) { std::string out; rs_sprintf(out, "pqiperson::connectattempt() Kid# %d of %u\n", i, kids.size()); @@ -328,7 +328,7 @@ int pqiperson::handleNotifyEvent_locked(NetInterface *ni, int newState, const s activepqi->start(); // STARTUP THREAD. /* reset all other children? (clear up long UDP attempt) */ - for(it = kids.begin(); it != kids.end(); it++) + for(it = kids.begin(); it != kids.end(); ++it) { if (!(it->second)->thisNetInterface(ni)) { @@ -397,7 +397,7 @@ int pqiperson::reset_locked() pqioutput(PQL_WARNING, pqipersonzone, "pqiperson::reset() resetting all pqiconnect for Id: " + PeerId().toStdString()); std::map::iterator it; - for(it = kids.begin(); it != kids.end(); it++) + for(it = kids.begin(); it != kids.end(); ++it) { (it->second) -> stop(); // STOP THREAD. (it->second) -> reset(); @@ -417,7 +417,7 @@ int pqiperson::fullstopthreads() pqioutput(PQL_WARNING, pqipersonzone, "pqiperson::fullstopthreads() for Id: " + PeerId().toStdString()); std::map::iterator it; - for(it = kids.begin(); it != kids.end(); it++) + for(it = kids.begin(); it != kids.end(); ++it) { (it->second) -> fullstop(); // WAIT FOR THREAD TO STOP. } @@ -456,7 +456,7 @@ int pqiperson::listen() if (!active) { std::map::iterator it; - for(it = kids.begin(); it != kids.end(); it++) + for(it = kids.begin(); it != kids.end(); ++it) { // set them all listening. (it->second) -> listen(); @@ -473,7 +473,7 @@ int pqiperson::stoplistening() pqioutput(PQL_DEBUG_BASIC, pqipersonzone, "pqiperson::stoplistening() Id: " + PeerId().toStdString()); std::map::iterator it; - for(it = kids.begin(); it != kids.end(); it++) + for(it = kids.begin(); it != kids.end(); ++it) { // set them all listening. (it->second) -> stoplistening(); @@ -640,7 +640,7 @@ void pqiperson::setMaxRate(bool in, float val) PQInterface::setMaxRate(in, val); // clean up the children. std::map::iterator it; - for(it = kids.begin(); it != kids.end(); it++) + for(it = kids.begin(); it != kids.end(); ++it) { (it->second) -> setMaxRate(in, val); } @@ -675,7 +675,7 @@ void pqiperson::setRateCap_locked(float val_in, float val_out) PQInterface::setRateCap(val_in, val_out); // clean up the children. std::map::iterator it; - for(it = kids.begin(); it != kids.end(); it++) + for(it = kids.begin(); it != kids.end(); ++it) { (it->second) -> setRateCap(val_in, val_out); } diff --git a/libretroshare/src/pqi/pqipersongrp.cc b/libretroshare/src/pqi/pqipersongrp.cc index 576de2e35..ddd5839bf 100644 --- a/libretroshare/src/pqi/pqipersongrp.cc +++ b/libretroshare/src/pqi/pqipersongrp.cc @@ -272,7 +272,7 @@ void pqipersongrp::statusChange(const std::list &plist) /* iterate through, only worry about the friends */ std::list::const_iterator it; - for(it = plist.begin(); it != plist.end(); it++) + for(it = plist.begin(); it != plist.end(); ++it) { if (it->state & RS_PEER_S_FRIEND) { @@ -339,7 +339,7 @@ void pqipersongrp::statusChanged() /* count connection attempts */ std::list::iterator peer; - for (peer = peers.begin(); peer != peers.end(); peer++) { + for (peer = peers.begin(); peer != peers.end(); ++peer) { peerConnectState state; if (mLinkMgr->getFriendNetStatus(*peer, state) == false) { continue; @@ -383,7 +383,7 @@ void pqipersongrp::statusChanged() } /* UNLOCKED */ std::list::iterator cit; - for(cit = toConnect.begin(); cit != toConnect.end(); cit++) + for(cit = toConnect.begin(); cit != toConnect.end(); ++cit) { connectPeer(*cit, true); } diff --git a/libretroshare/src/pqi/pqiservice.cc b/libretroshare/src/pqi/pqiservice.cc index aa1af13f3..d473bf2ae 100644 --- a/libretroshare/src/pqi/pqiservice.cc +++ b/libretroshare/src/pqi/pqiservice.cc @@ -182,7 +182,7 @@ int p3ServiceServer::tick() std::map::iterator it; // from the beginning to where we started. - for(it = services.begin();it != services.end(); it++) + for(it = services.begin();it != services.end(); ++it) { #ifdef SERVICE_DEBUG diff --git a/libretroshare/src/pqi/pqissllistener.cc b/libretroshare/src/pqi/pqissllistener.cc index 6084230c6..d894f9817 100644 --- a/libretroshare/src/pqi/pqissllistener.cc +++ b/libretroshare/src/pqi/pqissllistener.cc @@ -563,7 +563,7 @@ int pqissllistenbase::continueaccepts() incoming_ssl.erase(itd); } else - it++; + ++it; } return 1; } @@ -614,7 +614,7 @@ int pqissllistenbase::finaliseAccepts() { pqioutput(PQL_DEBUG_BASIC, pqissllistenzone, "pqissllistenbase::finaliseAccepts() SSL Connection Status Unknown"); - it++; + ++it; } } return 1; @@ -695,7 +695,7 @@ int pqissllistener::addlistenaddr(const RsPeerId& id, pqissl *acc) std::map::iterator it; std::string out = "Adding to Cert Listening Addresses Id: " + id.toStdString() + "\nCurrent Certs:\n"; - for(it = listenaddr.begin(); it != listenaddr.end(); it++) + for(it = listenaddr.begin(); it != listenaddr.end(); ++it) { out += id.toStdString() + "\n"; if (it -> first == id) @@ -722,7 +722,7 @@ int pqissllistener::removeListenPort(const RsPeerId& id) // // check if in list. std::map::iterator it; - for(it = listenaddr.begin();it!=listenaddr.end();it++) + for(it = listenaddr.begin();it!=listenaddr.end(); ++it) { if (it->first == id) { @@ -750,7 +750,7 @@ int pqissllistener::status() std::string out = "pqissllistener::status(): Listening ("; out += sockaddr_storage_tostring(laddr); out += ") for Certs:"; - for(it = listenaddr.begin(); it != listenaddr.end(); it++) + for(it = listenaddr.begin(); it != listenaddr.end(); ++it) { out += "\n" + it -> first.toStdString() ; } @@ -816,7 +816,7 @@ int pqissllistener::completeConnection(int fd, IncomingSSLInfo& info) } else { - it++; + ++it; } } diff --git a/libretroshare/src/pqi/pqistore.cc b/libretroshare/src/pqi/pqistore.cc index a108d5e4a..217ebdfb4 100644 --- a/libretroshare/src/pqi/pqistore.cc +++ b/libretroshare/src/pqi/pqistore.cc @@ -389,12 +389,12 @@ bool pqiSSLstore::encryptedSendItems(const std::list& rsItemList) uint32_t offset = 0; char* data = NULL; - for(it = rsItemList.begin(); it != rsItemList.end(); it++) + for(it = rsItemList.begin(); it != rsItemList.end(); ++it) sizeItems += rsSerialiser->size(*it); data = new char[sizeItems]; - for(it = rsItemList.begin(); it != rsItemList.end(); it++) + for(it = rsItemList.begin(); it != rsItemList.end(); ++it) { sizeItem = rsSerialiser->size(*it); diff --git a/libretroshare/src/rsserver/p3peers.cc b/libretroshare/src/rsserver/p3peers.cc index 9b0f34761..78e224510 100644 --- a/libretroshare/src/rsserver/p3peers.cc +++ b/libretroshare/src/rsserver/p3peers.cc @@ -333,7 +333,7 @@ bool p3Peers::getPeerDetails(const RsPeerId& id, RsPeerDetails &d) std::list::iterator it; for(it = ps.ipAddrs.mLocal.mAddrs.begin(); - it != ps.ipAddrs.mLocal.mAddrs.end(); it++) + it != ps.ipAddrs.mLocal.mAddrs.end(); ++it) { std::string toto; toto += "L:"; @@ -342,7 +342,7 @@ bool p3Peers::getPeerDetails(const RsPeerId& id, RsPeerDetails &d) d.ipAddressList.push_back(toto); } for(it = ps.ipAddrs.mExt.mAddrs.begin(); - it != ps.ipAddrs.mExt.mAddrs.end(); it++) + it != ps.ipAddrs.mExt.mAddrs.end(); ++it) { std::string toto; toto += "E:"; @@ -1310,7 +1310,7 @@ std::ostream &operator<<(std::ostream &out, const RsPeerDetails &detail) std::list::const_iterator it; for(it = detail.gpgSigners.begin(); - it != detail.gpgSigners.end(); it++) + it != detail.gpgSigners.end(); ++it) { out << "\t" << *it; out << std::endl; diff --git a/libretroshare/src/rsserver/rsaccounts.cc b/libretroshare/src/rsserver/rsaccounts.cc index 250ad79bf..7f68a6278 100644 --- a/libretroshare/src/rsserver/rsaccounts.cc +++ b/libretroshare/src/rsserver/rsaccounts.cc @@ -116,7 +116,7 @@ bool RsAccountsDetail::selectAccountByString(const std::string &prefUserString) bool pgpNameFound = false; std::map::const_iterator it; - for(it = mAccounts.begin() ; it!= mAccounts.end() ; it++) + for(it = mAccounts.begin() ; it!= mAccounts.end() ; ++it) { std::cerr << "\tChecking account (pgpid = " << it->second.mPgpId; std::cerr << ", name=" << it->second.mPgpName << ", sslId="; @@ -417,7 +417,7 @@ bool RsAccountsDetail::getAccountIds(std::list &ids) std::map::iterator it; std::cerr << "getAccountIds:" << std::endl; - for(it = mAccounts.begin(); it != mAccounts.end(); it++) + for(it = mAccounts.begin(); it != mAccounts.end(); ++it) { std::cerr << "SSL Id: " << it->second.mSslId << " PGP Id " << it->second.mPgpId; std::cerr << " PGP Name: " << it->second.mPgpName; @@ -533,7 +533,7 @@ bool RsAccountsDetail::getAvailableAccounts(std::map & /* close directory */ dirIt.closedir(); - for(it = directories.begin(); it != directories.end(); it++) + for(it = directories.begin(); it != directories.end(); ++it) { // For V0.6 Accounts we expect format: // LOC06_xxxhexaxxx or diff --git a/libretroshare/src/rsserver/rsinit.cc b/libretroshare/src/rsserver/rsinit.cc index bd86d32bd..e77ffa552 100644 --- a/libretroshare/src/rsserver/rsinit.cc +++ b/libretroshare/src/rsserver/rsinit.cc @@ -1028,7 +1028,7 @@ int RsServer::StartupRetroShare() //load all the SSL certs as friends // std::list sslIds; // AuthSSL::getAuthSSL()->getAuthenticatedList(sslIds); - // for (std::list::iterator sslIdsIt = sslIds.begin(); sslIdsIt != sslIds.end(); sslIdsIt++) { + // for (std::list::iterator sslIdsIt = sslIds.begin(); sslIdsIt != sslIds.end(); ++sslIdsIt) { // mConnMgr->addFriend(*sslIdsIt); // } //p3DhtMgr *mDhtMgr = new OpenDHTMgr(ownId, mConnMgr, rsInitConfig->configDir); diff --git a/libretroshare/src/serialiser/rsconfigitems.cc b/libretroshare/src/serialiser/rsconfigitems.cc index c65fd8b2a..738bcc081 100644 --- a/libretroshare/src/serialiser/rsconfigitems.cc +++ b/libretroshare/src/serialiser/rsconfigitems.cc @@ -1179,7 +1179,7 @@ std::ostream &RsPeerGroupItem::print(std::ostream &out, uint16_t indent) out << "groupFlag: " << flag << std::endl; std::list::iterator it; - for (it = pgpList.ids.begin(); it != pgpList.ids.end(); it++) { + for (it = pgpList.ids.begin(); it != pgpList.ids.end(); ++it) { printIndent(out, int_Indent); out << "peerId: " << it->toStdString() << std::endl; } diff --git a/libretroshare/src/serialiser/rsgxschannelitems.cc b/libretroshare/src/serialiser/rsgxschannelitems.cc index 39b3f1d39..a61824948 100644 --- a/libretroshare/src/serialiser/rsgxschannelitems.cc +++ b/libretroshare/src/serialiser/rsgxschannelitems.cc @@ -357,7 +357,7 @@ bool RsGxsChannelPostItem::fromChannelPost(RsGxsChannelPost &post, bool moveImag } std::list::iterator fit; - for(fit = post.mFiles.begin(); fit != post.mFiles.end(); fit++) + for(fit = post.mFiles.begin(); fit != post.mFiles.end(); ++fit) { RsTlvFileItem fi; fi.name = fit->mName; @@ -388,7 +388,7 @@ bool RsGxsChannelPostItem::toChannelPost(RsGxsChannelPost &post, bool moveImage) post.mCount = 0; post.mSize = 0; std::list::iterator fit; - for(fit = mAttachment.items.begin(); fit != mAttachment.items.end(); fit++) + for(fit = mAttachment.items.begin(); fit != mAttachment.items.end(); ++fit) { RsGxsFile fi; fi.mName = RsDirUtil::getTopDir(fit->name); diff --git a/libretroshare/src/serialiser/rsgxsupdateitems.cc b/libretroshare/src/serialiser/rsgxsupdateitems.cc index 496e7cc06..a9e72286c 100644 --- a/libretroshare/src/serialiser/rsgxsupdateitems.cc +++ b/libretroshare/src/serialiser/rsgxsupdateitems.cc @@ -68,7 +68,7 @@ std::ostream& RsGxsMsgUpdateItem::print(std::ostream& out, uint16_t indent) std::map::const_iterator cit = msgUpdateTS.begin(); out << "msgUpdateTS map:" << std::endl; int_Indent += 2; - for(; cit != msgUpdateTS.end(); cit++) + for(; cit != msgUpdateTS.end(); ++cit) { out << "grpId: " << cit->first << std::endl; printIndent(out, int_Indent); @@ -459,7 +459,7 @@ uint32_t RsGxsUpdateSerialiser::sizeGxsMsgUpdate(RsGxsMsgUpdateItem* item) const std::map& msgUpdateTS = item->msgUpdateTS; std::map::const_iterator cit = msgUpdateTS.begin(); - for(; cit != msgUpdateTS.end(); cit++) + for(; cit != msgUpdateTS.end(); ++cit) { s += cit->first.serial_size(); s += 4; @@ -516,7 +516,7 @@ bool RsGxsUpdateSerialiser::serialiseGxsMsgUpdate(RsGxsMsgUpdateItem* item, uint32_t numItems = msgUpdateTS.size(); ok &= setRawUInt32(data, *size, &offset, numItems); - for(; cit != msgUpdateTS.end(); cit++) + for(; cit != msgUpdateTS.end(); ++cit) { ok &= cit->first.serialise(data, *size, offset); ok &= setRawUInt32(data, *size, &offset, cit->second); diff --git a/libretroshare/src/serialiser/rsmsgitems.cc b/libretroshare/src/serialiser/rsmsgitems.cc index c138f0901..8e5961572 100644 --- a/libretroshare/src/serialiser/rsmsgitems.cc +++ b/libretroshare/src/serialiser/rsmsgitems.cc @@ -1585,7 +1585,7 @@ std::ostream& RsMsgTags::print(std::ostream &out, uint16_t indent) std::list::iterator it; - for(it=tagIds.begin(); it != tagIds.end(); it++) + for(it=tagIds.begin(); it != tagIds.end(); ++it) { printIndent(out, int_Indent); out << "tagId : " << *it << std::endl; @@ -1982,7 +1982,7 @@ bool RsMsgTags::serialise(void *data, uint32_t& pktsize,bool config) ok &= setRawUInt32(data,tlvsize,&offset, msgId); std::list::iterator mit = tagIds.begin(); - for(;mit != tagIds.end(); mit++) + for(;mit != tagIds.end(); ++mit) ok &= setRawUInt32(data, tlvsize, &offset, *mit); if (offset != tlvsize) diff --git a/libretroshare/src/serialiser/rsserial.cc b/libretroshare/src/serialiser/rsserial.cc index d8b978d76..8abe5bf7c 100644 --- a/libretroshare/src/serialiser/rsserial.cc +++ b/libretroshare/src/serialiser/rsserial.cc @@ -244,7 +244,7 @@ RsSerialiser::~RsSerialiser() { /* clean up the map */ std::map::iterator it; - for(it = serialisers.begin(); it != serialisers.end(); it++) + for(it = serialisers.begin(); it != serialisers.end(); ++it) { delete (it->second); } diff --git a/libretroshare/src/serialiser/rstlvkeys.cc b/libretroshare/src/serialiser/rstlvkeys.cc index b95ff5123..0afa1b767 100644 --- a/libretroshare/src/serialiser/rstlvkeys.cc +++ b/libretroshare/src/serialiser/rstlvkeys.cc @@ -563,7 +563,7 @@ std::ostream &RsTlvKeySignatureSet::print(std::ostream &out, uint16_t indent) co std::map::const_iterator mit = keySignSet.begin(); - for(; mit != keySignSet.end(); mit++) + for(; mit != keySignSet.end(); ++mit) { out << "SignType: " << mit->first << std::endl; const RsTlvKeySignature& sign = mit->second; diff --git a/libretroshare/src/services/p3banlist.cc b/libretroshare/src/services/p3banlist.cc index af2b83948..5b3170058 100644 --- a/libretroshare/src/services/p3banlist.cc +++ b/libretroshare/src/services/p3banlist.cc @@ -151,8 +151,8 @@ bool p3BanList::recvBanItem(RsBanListItem *item) bool updated = false; std::list::const_iterator it; - //for(it = item->peerList.entries.begin(); it != item->peerList.entries.end(); it++) - for(it = item->peerList.mList.begin(); it != item->peerList.mList.end(); it++) + //for(it = item->peerList.entries.begin(); it != item->peerList.entries.end(); ++it) + for(it = item->peerList.mList.begin(); it != item->peerList.mList.end(); ++it) { // Order is important!. updated = (addBanEntry(item->PeerId(), it->addr.addr, it->level, @@ -274,7 +274,7 @@ int p3BanList::condenseBanSources_locked() #endif std::map::const_iterator it; - for(it = mBanSources.begin(); it != mBanSources.end(); it++) + for(it = mBanSources.begin(); it != mBanSources.end(); ++it) { if (now - it->second.mLastUpdate > RSBANLIST_ENTRY_MAX_AGE) { @@ -294,7 +294,7 @@ int p3BanList::condenseBanSources_locked() std::map::const_iterator lit; for(lit = it->second.mBanPeers.begin(); - lit != it->second.mBanPeers.end(); lit++) + lit != it->second.mBanPeers.end(); ++lit) { /* check timestamp */ if (now - lit->second.mTs > RSBANLIST_ENTRY_MAX_AGE) @@ -415,7 +415,7 @@ void p3BanList::sendBanLists() /* prepare packets */ std::set::iterator it; - for(it = idList.begin(); it != idList.end(); it++) + for(it = idList.begin(); it != idList.end(); ++it) { #ifdef DEBUG_BANLIST std::cerr << "p3VoRS::sendBanList() To: " << *it; @@ -438,7 +438,7 @@ int p3BanList::sendBanSet(const RsPeerId& peerid) { RsStackMutex stack(mBanMtx); /****** LOCKED MUTEX *******/ std::map::iterator it; - for(it = mBanSet.begin(); it != mBanSet.end(); it++) + for(it = mBanSet.begin(); it != mBanSet.end(); ++it) { if (it->second.level >= RSBANLIST_SOURCE_FRIEND) { @@ -469,7 +469,7 @@ int p3BanList::printBanSet_locked(std::ostream &out) time_t now = time(NULL); std::map::iterator it; - for(it = mBanSet.begin(); it != mBanSet.end(); it++) + for(it = mBanSet.begin(); it != mBanSet.end(); ++it) { out << "Ban: " << sockaddr_storage_iptostring(it->second.addr); out << " Reason: " << it->second.reason; @@ -492,7 +492,7 @@ int p3BanList::printBanSources_locked(std::ostream &out) time_t now = time(NULL); std::map::const_iterator it; - for(it = mBanSources.begin(); it != mBanSources.end(); it++) + for(it = mBanSources.begin(); it != mBanSources.end(); ++it) { out << "BanList from: " << it->first; out << " LastUpdate: " << now - it->second.mLastUpdate; @@ -500,7 +500,7 @@ int p3BanList::printBanSources_locked(std::ostream &out) std::map::const_iterator lit; for(lit = it->second.mBanPeers.begin(); - lit != it->second.mBanPeers.end(); lit++) + lit != it->second.mBanPeers.end(); ++lit) { out << "\t"; out << "Ban: " << sockaddr_storage_iptostring(lit->second.addr); diff --git a/libretroshare/src/services/p3bwctrl.cc b/libretroshare/src/services/p3bwctrl.cc index b33a909da..100b3446a 100644 --- a/libretroshare/src/services/p3bwctrl.cc +++ b/libretroshare/src/services/p3bwctrl.cc @@ -128,7 +128,7 @@ bool p3BandwidthControl::checkAvailableBandwidth() time_t now = time(NULL); std::list oldIds; // unused for now! - for(bit = mBwMap.begin(); bit != mBwMap.end(); bit++) + for(bit = mBwMap.begin(); bit != mBwMap.end(); ++bit) { /* check alloc rate */ //time_t age = now - bit->second.mLastSend; @@ -255,7 +255,7 @@ int p3BandwidthControl::getAllBandwidthRates(std::map::iterator bit; - for(bit = mBwMap.begin(); bit != mBwMap.end(); bit++) + for(bit = mBwMap.begin(); bit != mBwMap.end(); ++bit) { RsConfigDataRates rates; @@ -299,7 +299,7 @@ int p3BandwidthControl::printRateInfo_locked(std::ostream &out) out << std::endl; std::map::iterator bit; - for(bit = mBwMap.begin(); bit != mBwMap.end(); bit++) + for(bit = mBwMap.begin(); bit != mBwMap.end(); ++bit) { out << "\t" << bit->first; out << " In: " << bit->second.mRates.mRateIn; @@ -315,7 +315,7 @@ int p3BandwidthControl::printRateInfo_locked(std::ostream &out) void p3BandwidthControl::statusChange(const std::list &plist) { std::list::const_iterator it; - for (it = plist.begin(); it != plist.end(); it++) + for (it = plist.begin(); it != plist.end(); ++it) { RsStackMutex stack(mBwMtx); /****** LOCKED MUTEX *******/ diff --git a/libretroshare/src/services/p3chatservice.cc b/libretroshare/src/services/p3chatservice.cc index 5c77d399b..51128d496 100644 --- a/libretroshare/src/services/p3chatservice.cc +++ b/libretroshare/src/services/p3chatservice.cc @@ -182,7 +182,7 @@ int p3ChatService::sendPublicChat(const std::string &msg) std::cerr << std::endl; #endif - for(it = ids.begin(); it != ids.end(); it++) + for(it = ids.begin(); it != ids.end(); ++it) { RsChatMsgItem *ci = new RsChatMsgItem(); @@ -967,7 +967,7 @@ void p3ChatService::handleRecvChatLobbyList(RsChatLobbyListItem *item) } std::list::iterator it; - for (it = chatLobbyToSubscribe.begin(); it != chatLobbyToSubscribe.end(); it++) + for (it = chatLobbyToSubscribe.begin(); it != chatLobbyToSubscribe.end(); ++it) joinVisibleChatLobby(*it); for(std::list::const_iterator it = invitationNeeded.begin();it!=invitationNeeded.end();++it) @@ -1524,7 +1524,7 @@ bool p3ChatService::getPrivateChatQueueIds(bool incoming, std::list &i } std::list::iterator it; - for (it = list->begin(); it != list->end(); it++) { + for (it = list->begin(); it != list->end(); ++it) { RsChatMsgItem *c = *it; if (std::find(ids.begin(), ids.end(), c->PeerId()) == ids.end()) { @@ -1553,7 +1553,7 @@ bool p3ChatService::getPrivateChatQueue(bool incoming, const RsPeerId &id, std:: } std::list::iterator it; - for (it = list->begin(); it != list->end(); it++) { + for (it = list->begin(); it != list->end(); ++it) { RsChatMsgItem *c = *it; if (c->PeerId() == id) { @@ -1603,7 +1603,7 @@ bool p3ChatService::clearPrivateChatQueue(bool incoming, const RsPeerId &id) continue; } - it++; + ++it; } } /* UNLOCKED */ @@ -1656,7 +1656,7 @@ void p3ChatService::setOwnCustomStateString(const std::string& s) // alert your online peers to your newly set status std::set::iterator it(onlineList.begin()); - for(; it != onlineList.end(); it++){ + for(; it != onlineList.end(); ++it){ RsChatStatusItem *cs = new RsChatStatusItem(); cs->flags = RS_CHAT_FLAG_CUSTOM_STATE_AVAILABLE; @@ -2095,7 +2095,7 @@ RsSerialiser *p3ChatService::setupSerialiser() void p3ChatService::statusChange(const std::list &plist) { std::list::const_iterator it; - for (it = plist.begin(); it != plist.end(); it++) { + for (it = plist.begin(); it != plist.end(); ++it) { if (it->actions & RS_SERVICE_PEER_CONNECTED) { /* send the saved outgoing messages */ @@ -2125,7 +2125,7 @@ void p3ChatService::statusChange(const std::list &plist) continue; } - cit++; + ++cit; } } /* UNLOCKED */ diff --git a/libretroshare/src/services/p3discovery2.cc b/libretroshare/src/services/p3discovery2.cc index 61162ff81..16be50bd8 100644 --- a/libretroshare/src/services/p3discovery2.cc +++ b/libretroshare/src/services/p3discovery2.cc @@ -77,7 +77,7 @@ bool populateContactInfo(const peerState &detail, RsDiscContactItem *pkt) void DiscPgpInfo::mergeFriendList(const std::list &friends) { std::list::const_iterator it; - for(it = friends.begin(); it != friends.end(); it++) + for(it = friends.begin(); it != friends.end(); ++it) { mFriendSet.insert(*it); } @@ -494,7 +494,7 @@ void p3discovery2::sendPGPList(const SSLID &toId) pkt->mode = DISC_PGP_LIST_MODE_FRIENDS; std::map::const_iterator it; - for(it = mFriendList.begin(); it != mFriendList.end(); it++) + for(it = mFriendList.begin(); it != mFriendList.end(); ++it) { pkt->pgpIdSet.ids.push_back(it->first); } @@ -544,7 +544,7 @@ void p3discovery2::updatePgpFriendList() pgpList.push_back(ownPgpId); // convert to set for ordering. - for(lit = pgpList.begin(); lit != pgpList.end(); lit++) + for(lit = pgpList.begin(); lit != pgpList.end(); ++lit) { pgpSet.insert(*lit); } @@ -578,18 +578,18 @@ void p3discovery2::updatePgpFriendList() } /* more to add? */ - for(; sit != pgpSet.end(); sit++) + for(; sit != pgpSet.end(); ++sit) { pgpToAdd.push_back(*sit); } - for(; it != mFriendList.end(); it++) + for(; it != mFriendList.end(); ++it) { /* more to remove */ pgpToRemove.push_back(it->first); } - for(lit = pgpToRemove.begin(); lit != pgpToRemove.end(); lit++) + for(lit = pgpToRemove.begin(); lit != pgpToRemove.end(); ++lit) { #ifdef P3DISC_DEBUG std::cerr << "p3discovery2::updatePgpFriendList() Removing pgpId: " << *lit; @@ -600,7 +600,7 @@ void p3discovery2::updatePgpFriendList() mFriendList.erase(it); } - for(lit = pgpToAdd.begin(); lit != pgpToAdd.end(); lit++) + for(lit = pgpToAdd.begin(); lit != pgpToAdd.end(); ++lit) { #ifdef P3DISC_DEBUG std::cerr << "p3discovery2::updatePgpFriendList() Adding pgpId: " << *lit; @@ -663,7 +663,7 @@ void p3discovery2::processPGPList(const SSLID &fromId, const RsDiscPgpListItem * if (requestUnknownPgpCerts) { std::list::const_iterator fit; - for(fit = item->pgpIdSet.ids.begin(); fit != item->pgpIdSet.ids.end(); fit++) + for(fit = item->pgpIdSet.ids.begin(); fit != item->pgpIdSet.ids.end(); ++fit) { if (!AuthGPG::getAuthGPG()->isGPGId(*fit)) { @@ -717,7 +717,7 @@ void p3discovery2::updatePeers_locked(const SSLID &aboutId) const std::set &friendSet = ait->second.mFriendSet; std::set::const_iterator fit; - for(fit = friendSet.begin(); fit != friendSet.end(); fit++) + for(fit = friendSet.begin(); fit != friendSet.end(); ++fit) { #ifdef P3DISC_DEBUG @@ -749,7 +749,7 @@ void p3discovery2::updatePeers_locked(const SSLID &aboutId) std::map::const_iterator mit; for(mit = ffit->second.mSslIds.begin(); - mit != ffit->second.mSslIds.end(); mit++) + mit != ffit->second.mSslIds.end(); ++mit) { SSLID sslid = mit->first; if (mServiceCtrl->isPeerConnected(getServiceInfo().mServiceType, sslid)) @@ -770,7 +770,7 @@ void p3discovery2::updatePeers_locked(const SSLID &aboutId) std::cerr << std::endl; #endif // update aboutId about Other Peers. - for(fit = mutualFriends.begin(); fit != mutualFriends.end(); fit++) + for(fit = mutualFriends.begin(); fit != mutualFriends.end(); ++fit) { sendContactInfo_locked(*fit, aboutId); } @@ -780,7 +780,7 @@ void p3discovery2::updatePeers_locked(const SSLID &aboutId) std::cerr << std::endl; #endif // update Other Peers about aboutPgpId. - for(sit = onlineFriends.begin(); sit != onlineFriends.end(); sit++) + for(sit = onlineFriends.begin(); sit != onlineFriends.end(); ++sit) { // This could be more efficient, and only be specific about aboutId. // but we'll leave it like this for the moment. @@ -816,7 +816,7 @@ void p3discovery2::sendContactInfo_locked(const PGPID &aboutId, const SSLID &toI } std::map::const_iterator sit; - for(sit = it->second.mSslIds.begin(); sit != it->second.mSslIds.end(); sit++) + for(sit = it->second.mSslIds.begin(); sit != it->second.mSslIds.end(); ++sit) { #ifdef P3DISC_DEBUG std::cerr << "p3discovery2::sendContactInfo_locked() related sslId: " << sit->first; @@ -984,7 +984,7 @@ void p3discovery2::recvPGPCertificateRequest(const SSLID &fromId, const RsDiscPg #endif std::list::const_iterator it; - for(it = item->pgpIdSet.ids.begin(); it != item->pgpIdSet.ids.end(); it++) + for(it = item->pgpIdSet.ids.begin(); it != item->pgpIdSet.ids.end(); ++it) { // NB: This doesn't include own certificates? why not. // shouldn't be a real problem. Peer must have own PgpCert already. @@ -1071,7 +1071,7 @@ void p3discovery2::statusChange(const std::list &plist) //#endif std::list::const_iterator pit; - for(pit = plist.begin(); pit != plist.end(); pit++) + for(pit = plist.begin(); pit != plist.end(); ++pit) { if (pit->actions & RS_SERVICE_PEER_CONNECTED) { @@ -1131,7 +1131,7 @@ bool p3discovery2::getDiscFriends(const RsPeerId& id, std::list &proxy // For each of their friends that we know, grab that set of SSLIDs. const std::set &friendSet = it->second.mFriendSet; std::set::const_iterator fit; - for(fit = friendSet.begin(); fit != friendSet.end(); fit++) + for(fit = friendSet.begin(); fit != friendSet.end(); ++fit) { it = mFriendList.find(*fit); if (it == mFriendList.end()) @@ -1141,7 +1141,7 @@ bool p3discovery2::getDiscFriends(const RsPeerId& id, std::list &proxy std::map::const_iterator sit; for(sit = it->second.mSslIds.begin(); - sit != it->second.mSslIds.end(); sit++) + sit != it->second.mSslIds.end(); ++sit) { proxyIds.push_back(sit->first); } @@ -1169,7 +1169,7 @@ bool p3discovery2::getDiscPgpFriends(const PGPID &pgp_id, std::list &prox } std::set::const_iterator fit; - for(fit = it->second.mFriendSet.begin(); fit != it->second.mFriendSet.end(); fit++) + for(fit = it->second.mFriendSet.begin(); fit != it->second.mFriendSet.end(); ++fit) { proxyPgpIds.push_back(*fit); } diff --git a/libretroshare/src/services/p3dsdv.cc b/libretroshare/src/services/p3dsdv.cc index c90a86d7a..6373dea8e 100644 --- a/libretroshare/src/services/p3dsdv.cc +++ b/libretroshare/src/services/p3dsdv.cc @@ -163,7 +163,7 @@ void p3Dsdv::advanceLocalSequenceNumbers() time_t now = time(NULL); std::map::iterator it; - for(it = mTable.begin(); it != mTable.end(); it++) + for(it = mTable.begin(); it != mTable.end(); ++it) { RsDsdvTableEntry &v = (it->second); if (v.mOwnSource) @@ -179,7 +179,7 @@ void p3Dsdv::clearSignificantChangesFlags() RsStackMutex stack(mDsdvMtx); /****** LOCKED MUTEX *******/ std::map::iterator it; - for(it = mTable.begin(); it != mTable.end(); it++) + for(it = mTable.begin(); it != mTable.end(); ++it) { RsDsdvTableEntry &v = (it->second); if (v.mFlags & RSDSDV_FLAGS_SIGNIFICANT_CHANGE) @@ -211,7 +211,7 @@ int p3Dsdv::generateRoutingTables(bool incremental) /* prepare packets */ std::set::iterator it; - for(it = idList.begin(); it != idList.end(); it++) + for(it = idList.begin(); it != idList.end(); ++it) { #ifdef DEBUG_DSDV std::cerr << "p3Dsdv::generateRoutingTables() For: " << *it; @@ -236,7 +236,7 @@ int p3Dsdv::generateRoutingTable(const RsPeerId &peerId, bool incremental) RsStackMutex stack(mDsdvMtx); /****** LOCKED MUTEX *******/ std::map::iterator it; - for(it = mTable.begin(); it != mTable.end(); it++) + for(it = mTable.begin(); it != mTable.end(); ++it) { RsDsdvTableEntry &v = (it->second); @@ -331,8 +331,8 @@ int p3Dsdv::handleDSDV(RsDsdvRouteItem *dsdv) #endif std::list::iterator it; - //for(it = dsdv->routes.entries.begin(); it != dsdv->routes.entries.end(); it++) - for(it = dsdv->routes.mList.begin(); it != dsdv->routes.mList.end(); it++) + //for(it = dsdv->routes.entries.begin(); it != dsdv->routes.entries.end(); ++it) + for(it = dsdv->routes.mList.begin(); it != dsdv->routes.mList.end(); ++it) { /* check for existing */ RsTlvDsdvEntry &entry = *it; @@ -471,7 +471,7 @@ int p3Dsdv::selectStableRoutes() /* find the entry */ std::map::iterator tit; - for(tit = mTable.begin(); tit != mTable.end(); tit++) + for(tit = mTable.begin(); tit != mTable.end(); ++tit) { #ifdef DEBUG_DSDV @@ -497,7 +497,7 @@ int p3Dsdv::selectStableRoutes() /* find newest sequence number */ for(rit = tit->second.mAllRoutes.begin(); - rit != tit->second.mAllRoutes.end(); rit++) + rit != tit->second.mAllRoutes.end(); ++rit) { if ((now - rit->second.mReceived <= DSDV_DISCARD_PERIOD) && (rit->second.mSequence >= newest)) @@ -531,7 +531,7 @@ int p3Dsdv::selectStableRoutes() /* find closest distance - with valid seq & max valid time */ for(rit = tit->second.mAllRoutes.begin(); - rit != tit->second.mAllRoutes.end(); rit++) + rit != tit->second.mAllRoutes.end(); ++rit) { /* Maximum difference in Sequence number is 2*DISTANCE * Otherwise it must be old. @@ -617,7 +617,7 @@ int p3Dsdv::clearOldRoutes() /* find the entry */ std::map::iterator it, it2; - for(it = mTable.begin(); it != mTable.end(); it++) + for(it = mTable.begin(); it != mTable.end(); ++it) { if (it->second.mOwnSource) { @@ -652,7 +652,7 @@ int p3Dsdv::clearOldRoutes() void p3Dsdv::statusChange(const std::list &plist) { std::list::const_iterator it; - for(it = plist.begin(); it != plist.end(); it++) + for(it = plist.begin(); it != plist.end(); ++it) { /* only care about disconnected / not friends cases */ if ( 1 ) @@ -676,8 +676,7 @@ int p3Dsdv::addTestService() std::string realHash; std::string seedHash; - int i; - for(i = 0; i < SHA_DIGEST_LENGTH / 4; i++) + for(int i = 0; i < SHA_DIGEST_LENGTH / 4; i++) { rndhash1[i] = RSRandom::random_u32(); rndhash2[i] = RSRandom::random_u32(); @@ -796,7 +795,7 @@ int p3Dsdv::printDsdvTable(std::ostream &out) /* iterate over the entries */ std::map::iterator it; - for(it = mTable.begin(); it != mTable.end(); it++) + for(it = mTable.begin(); it != mTable.end(); ++it) { RsDsdvTableEntry &v = it->second; out << v; @@ -813,7 +812,7 @@ uint32_t p3Dsdv::getLocalServices(std::list &hashes) /* iterate over the entries */ std::map::iterator it; - for(it = mTable.begin(); it != mTable.end(); it++) + for(it = mTable.begin(); it != mTable.end(); ++it) { if (it->second.mOwnSource) { @@ -830,7 +829,7 @@ uint32_t p3Dsdv::getAllServices(std::list &hashes) /* iterate over the entries */ std::map::iterator it; - for(it = mTable.begin(); it != mTable.end(); it++) + for(it = mTable.begin(); it != mTable.end(); ++it) { hashes.push_back(it->first); } @@ -905,7 +904,7 @@ std::ostream &operator<<(std::ostream &out, const RsDsdvTableEntry &entry) } std::map::const_iterator it; - for(it = entry.mAllRoutes.begin(); it != entry.mAllRoutes.end(); it++) + for(it = entry.mAllRoutes.begin(); it != entry.mAllRoutes.end(); ++it) { out << "\t\t" << it->second << std::endl; } diff --git a/libretroshare/src/services/p3gxschannels.cc b/libretroshare/src/services/p3gxschannels.cc index 720a2aa81..7ad7aac28 100644 --- a/libretroshare/src/services/p3gxschannels.cc +++ b/libretroshare/src/services/p3gxschannels.cc @@ -132,7 +132,7 @@ void p3GxsChannels::notifyChanges(std::vector &changes) std::list unprocessedGroups; std::vector::iterator it; - for(it = changes.begin(); it != changes.end(); it++) + for(it = changes.begin(); it != changes.end(); ++it) { RsGxsMsgChange *msgChange = dynamic_cast(*it); if (msgChange && !msgChange->metaChange()) @@ -142,7 +142,7 @@ void p3GxsChannels::notifyChanges(std::vector &changes) std::map > &msgChangeMap = msgChange->msgChangeMap; std::map >::iterator mit; - for(mit = msgChangeMap.begin(); mit != msgChangeMap.end(); mit++) + for(mit = msgChangeMap.begin(); mit != msgChangeMap.end(); ++mit) { std::cerr << "p3GxsChannels::notifyChanges() Msgs for Group: " << mit->first; std::cerr << std::endl; @@ -198,7 +198,7 @@ bool p3GxsChannels::getGroupData(const uint32_t &token, std::vector::iterator vit = grpData.begin(); - for(; vit != grpData.end(); vit++) + for(; vit != grpData.end(); ++vit) { RsGxsChannelGroupItem* item = dynamic_cast(*vit); if (item) @@ -249,13 +249,13 @@ bool p3GxsChannels::getPostData(const uint32_t &token, std::vectorfirst; std::vector& msgItems = mit->second; std::vector::iterator vit = msgItems.begin(); - for(; vit != msgItems.end(); vit++) + for(; vit != msgItems.end(); ++vit) { RsGxsChannelPostItem* item = dynamic_cast(*vit); @@ -296,12 +296,12 @@ bool p3GxsChannels::getRelatedPosts(const uint32_t &token, std::vector& msgItems = mit->second; std::vector::iterator vit = msgItems.begin(); - for(; vit != msgItems.end(); vit++) + for(; vit != msgItems.end(); ++vit) { RsGxsChannelPostItem* item = dynamic_cast(*vit); @@ -413,7 +413,7 @@ void p3GxsChannels::load_SubscribedGroups(const uint32_t &token) getGroupMeta(token, groups); std::list::iterator it; - for(it = groups.begin(); it != groups.end(); it++) + for(it = groups.begin(); it != groups.end(); ++it) { if (it->mSubscribeFlags & (GXS_SERV::GROUP_SUBSCRIBE_ADMIN | @@ -508,7 +508,7 @@ void p3GxsChannels::request_SpecificUnprocessedPosts(std::list >::iterator it; - for(it = ids.begin(); it != ids.end(); it++) + for(it = ids.begin(); it != ids.end(); ++it) { std::vector &vect_msgIds = msgIds[it->first]; vect_msgIds.push_back(it->second); @@ -556,7 +556,7 @@ void p3GxsChannels::load_SpecificUnprocessedPosts(const uint32_t &token) std::vector::iterator it; - for(it = posts.begin(); it != posts.end(); it++) + for(it = posts.begin(); it != posts.end(); ++it) { /* autodownload the files */ handleUnprocessedPost(*it); @@ -579,7 +579,7 @@ void p3GxsChannels::load_GroupUnprocessedPosts(const uint32_t &token) std::vector::iterator it; - for(it = posts.begin(); it != posts.end(); it++) + for(it = posts.begin(); it != posts.end(); ++it) { handleUnprocessedPost(*it); } @@ -620,7 +620,7 @@ void p3GxsChannels::handleUnprocessedPost(const RsGxsChannelPost &msg) std::cerr << std::endl; std::list::const_iterator fit; - for(fit = msg.mFiles.begin(); fit != msg.mFiles.end(); fit++) + for(fit = msg.mFiles.begin(); fit != msg.mFiles.end(); ++fit) { std::string fname = fit->mName; Sha1CheckSum hash = Sha1CheckSum(fit->mHash); @@ -1166,7 +1166,7 @@ bool p3GxsChannels::generateComment(uint32_t &token, const RsGxsGroupId &grpId, uint32_t idx = (uint32_t) (ownIds.size() * RSRandom::random_f32()); uint32_t i = 0; - for(it = ownIds.begin(); (it != ownIds.end()) && (i < idx); it++, i++); + for(it = ownIds.begin(); (it != ownIds.end()) && (i < idx); ++it, ++i); if (it != ownIds.end()) { @@ -1203,7 +1203,7 @@ bool p3GxsChannels::generateVote(uint32_t &token, const RsGxsGroupId &grpId, con uint32_t idx = (uint32_t) (ownIds.size() * RSRandom::random_f32()); uint32_t i = 0; - for(it = ownIds.begin(); (it != ownIds.end()) && (i < idx); it++, i++) ; + for(it = ownIds.begin(); (it != ownIds.end()) && (i < idx); ++it, ++i) ; if (it != ownIds.end()) { diff --git a/libretroshare/src/services/p3gxscircles.cc b/libretroshare/src/services/p3gxscircles.cc index 45b1c03a4..f8afd4658 100644 --- a/libretroshare/src/services/p3gxscircles.cc +++ b/libretroshare/src/services/p3gxscircles.cc @@ -180,7 +180,7 @@ void p3GxsCircles::notifyChanges(std::vector &changes) #endif std::vector::iterator it; - for(it = changes.begin(); it != changes.end(); it++) + for(it = changes.begin(); it != changes.end(); ++it) { RsGxsGroupChange *groupChange = dynamic_cast(*it); RsGxsMsgChange *msgChange = dynamic_cast(*it); @@ -193,7 +193,7 @@ void p3GxsCircles::notifyChanges(std::vector &changes) std::map > &msgChangeMap = msgChange->msgChangeMap; std::map >::iterator mit; - for(mit = msgChangeMap.begin(); mit != msgChangeMap.end(); mit++) + for(mit = msgChangeMap.begin(); mit != msgChangeMap.end(); ++mit) { #ifdef DEBUG_CIRCLES std::cerr << "p3GxsCircles::notifyChanges() Msgs for Group: " << mit->first; @@ -212,7 +212,7 @@ void p3GxsCircles::notifyChanges(std::vector &changes) std::list &groupList = groupChange->mGrpIdList; std::list::iterator git; - for(git = groupList.begin(); git != groupList.end(); git++) + for(git = groupList.begin(); git != groupList.end(); ++git) { #ifdef DEBUG_CIRCLES std::cerr << "p3GxsCircles::notifyChanges() Incoming Group: " << *git; @@ -290,7 +290,7 @@ bool p3GxsCircles:: getCirclePersonalIdList(std::list &circleIds) else { std::list::const_iterator it; - for(it = mCirclePersonalIdList.begin(); it != mCirclePersonalIdList.begin(); it++) + for(it = mCirclePersonalIdList.begin(); it != mCirclePersonalIdList.begin(); ++it) { circleIds.push_back(*it); } @@ -315,7 +315,7 @@ bool p3GxsCircles:: getCircleExternalIdList(std::list &circleIds) else { std::list::const_iterator it; - for(it = mCircleExternalIdList.begin(); it != mCircleExternalIdList.begin(); it++) + for(it = mCircleExternalIdList.begin(); it != mCircleExternalIdList.begin(); ++it) { circleIds.push_back(*it); } @@ -396,7 +396,7 @@ bool p3GxsCircles::getGroupData(const uint32_t &token, std::vector::iterator vit = grpData.begin(); - for(; vit != grpData.end(); vit++) + for(; vit != grpData.end(); ++vit) { RsGxsCircleGroupItem* item = dynamic_cast(*vit); if (item) @@ -536,7 +536,7 @@ bool RsGxsCircleCache::loadSubCircle(const RsGxsCircleCache &subcircle) bool RsGxsCircleCache::getAllowedPeersList(std::list &friendlist) { std::map >::iterator it; - for(it = mAllowedPeers.begin(); it != mAllowedPeers.end(); it++) + for(it = mAllowedPeers.begin(); it != mAllowedPeers.end(); ++it) { friendlist.push_back(it->first); } @@ -613,7 +613,7 @@ bool p3GxsCircles::load_CircleIdList(uint32_t token) mCircleExternalIdList.clear(); } - for(std::list::iterator it = groups.begin(); it != groups.end(); it++) + for(std::list::iterator it = groups.begin(); it != groups.end(); ++it) { addCircleIdToList(RsGxsCircleId(it->mGroupId), it->mCircleType); } @@ -667,7 +667,7 @@ bool p3GxsCircles::cachetest_handlerequest(uint32_t token) if(ok) { std::list::iterator vit = grpIds.begin(); - for(; vit != grpIds.end(); vit++) + for(; vit != grpIds.end(); ++vit) { /* 5% chance of checking it! */ if (RSRandom::random_f32() < 0.25) @@ -816,7 +816,7 @@ bool p3GxsCircles::cache_start_load() /* now we process the modGroupList -> a map so we can use it easily later, and create id list too */ std::list::iterator it; - for(it = mCacheLoad_ToCache.begin(); it != mCacheLoad_ToCache.end(); it++) + for(it = mCacheLoad_ToCache.begin(); it != mCacheLoad_ToCache.end(); ++it) { #ifdef DEBUG_CIRCLES std::cerr << "p3GxsCircles::cache_start_load() GroupId: " << *it; @@ -862,7 +862,7 @@ bool p3GxsCircles::cache_load_for_token(uint32_t token) { std::vector::iterator vit = grpData.begin(); - for(; vit != grpData.end(); vit++) + for(; vit != grpData.end(); ++vit) { RsGxsCircleGroupItem *item = dynamic_cast(*vit); if (!item) @@ -917,7 +917,7 @@ bool p3GxsCircles::cache_load_for_token(uint32_t token) std::list::const_iterator pit; // need to trigger the searches. - for(pit = peers.begin(); pit != peers.end(); pit++) + for(pit = peers.begin(); pit != peers.end(); ++pit) { #ifdef DEBUG_CIRCLES std::cerr << "p3GxsCircles::cache_load_for_token() Invited Member: " << *pit; @@ -978,7 +978,7 @@ bool p3GxsCircles::cache_load_for_token(uint32_t token) #if 0 std::list &circles = group.mSubCircles; std::list::const_iterator cit; - for(cit = circles.begin(); cit != circles.end(); cit++) + for(cit = circles.begin(); cit != circles.end(); ++cit) { /* if its cached already -> then its complete. */ if (mCircleCache.is_loaded(*cit)) @@ -1022,7 +1022,7 @@ bool p3GxsCircles::cache_load_for_token(uint32_t token) std::list::const_iterator pit; // need to trigger the searches. - for(pit = peers.begin(); pit != peers.end(); pit++) + for(pit = peers.begin(); pit != peers.end(); ++pit) { #ifdef DEBUG_CIRCLES std::cerr << "p3GxsCircles::cache_load_for_token() Local Friend: " << *pit; @@ -1105,7 +1105,7 @@ bool p3GxsCircles::cache_reloadids(const RsGxsCircleId &circleId) /* try reload Ids */ std::set::const_iterator pit; for(pit = cache.mUnprocessedPeers.begin(); - pit != cache.mUnprocessedPeers.end(); pit++) + pit != cache.mUnprocessedPeers.end(); ++pit) { /* check cache */ if (mIdentities->haveKey(*pit)) @@ -1294,7 +1294,7 @@ bool p3GxsCircles::cache_load_subcircles(uint32_t token) { std::vector::iterator vit = grpData.begin(); - for(; vit != grpData.end(); vit++) + for(; vit != grpData.end(); ++vit) { RsGxsIdGroupItem* item = dynamic_cast(*vit); @@ -1337,7 +1337,7 @@ bool p3GxsCircles::cache_load_subcircles(uint32_t token) std::list::const_iterator pit; // need to trigger the searches. - for(pit = peers.begin(); pit != peers.end(); pit++) + for(pit = peers.begin(); pit != peers.end(); ++pit) { /* check cache */ if (mIdentities->is_cached(*pit)) @@ -1352,7 +1352,7 @@ bool p3GxsCircles::cache_load_subcircles(uint32_t token) // TODO. //cache.mAllowedPeers[details.mPgpId] = *pit; - for(uit = updateCaches.begin(); uit != updateCaches.end(); uit++) + for(uit = updateCaches.begin(); uit != updateCaches.end(); ++uit) { /* fetch the cache - and update */ mLoadingCache[id] = RsGxsCircleCache(); @@ -1387,7 +1387,7 @@ bool p3GxsCircles::cache_load_subcircles(uint32_t token) std::list &circles = group.circles; std::list::const_iterator cit; - for(cit = circles.begin(); cit != circles.end(); cit++) + for(cit = circles.begin(); cit != circles.end(); ++cit) { /* if its cached already -> then its complete. */ if (mCircleCache.is_loaded(*cit)) @@ -1514,7 +1514,7 @@ void p3GxsCircles::checkDummyIdData() } std::vector::iterator it; - for(it = ids.begin(); it != ids.end(); it++) + for(it = ids.begin(); it != ids.end(); ++it) { if (it->mMeta.mGroupFlags & RSGXSID_GROUPFLAG_REALID) { @@ -1580,7 +1580,7 @@ void p3GxsCircles::generateDummyCircle() int selection = (RSRandom::random_u32() % npgps); std::list::iterator it = mDummyPgpLinkedIds.begin(); - for(int j = 0; (it != mDummyPgpLinkedIds.end()) && (j < selection); j++, it++) ; + for(int j = 0; (it != mDummyPgpLinkedIds.end()) && (j < selection); j++, ++it) ; if (it != mDummyPgpLinkedIds.end()) { idset.insert(*it); @@ -1594,7 +1594,7 @@ void p3GxsCircles::generateDummyCircle() int selection = (RSRandom::random_u32() % mDummyOwnIds.size()); std::list::iterator it = mDummyOwnIds.begin(); mDummyOwnIds.push_back(*it); - for(int j = 0; (it != mDummyOwnIds.end()) && (j < selection); j++, it++) ; + for(int j = 0; (it != mDummyOwnIds.end()) && (j < selection); j++, ++it) ; if (it != mDummyOwnIds.end()) { idset.insert(*it); @@ -1608,7 +1608,7 @@ void p3GxsCircles::generateDummyCircle() #endif // DEBUG_CIRCLES std::set::iterator it; - for(it = idset.begin(); it != idset.end(); it++) + for(it = idset.begin(); it != idset.end(); ++it) { group.mInvitedMembers.push_back(*it); #ifdef DEBUG_CIRCLES @@ -1637,14 +1637,14 @@ std::ostream &operator<<(std::ostream &out, const RsGxsCircleGroup &grp) std::list::const_iterator it; std::list::const_iterator sit; for(it = grp.mInvitedMembers.begin(); - it != grp.mInvitedMembers.begin(); it++) + it != grp.mInvitedMembers.begin(); ++it) { out << "\t" << *it; out << std::endl; } for(sit = grp.mSubCircles.begin(); - sit != grp.mSubCircles.begin(); sit++) + sit != grp.mSubCircles.begin(); ++sit) { out << "\t" << *it; out << std::endl; diff --git a/libretroshare/src/services/p3gxscommon.cc b/libretroshare/src/services/p3gxscommon.cc index 8fd2a9cc6..9a849e0b6 100644 --- a/libretroshare/src/services/p3gxscommon.cc +++ b/libretroshare/src/services/p3gxscommon.cc @@ -178,7 +178,7 @@ bool p3GxsCommentService::getGxsCommentData(const uint32_t &token, std::vector voteMap; - for(; mit != msgData.end(); mit++) + for(; mit != msgData.end(); ++mit) { RsGxsGroupId grpId = mit->first; std::vector& msgItems = mit->second; @@ -186,7 +186,7 @@ bool p3GxsCommentService::getGxsCommentData(const uint32_t &token, std::vector(*vit); @@ -216,9 +216,9 @@ bool p3GxsCommentService::getGxsCommentData(const uint32_t &token, std::vector::iterator cit; std::multimap::iterator it; - for(cit = comments.begin(); cit != comments.end(); cit++) + for(cit = comments.begin(); cit != comments.end(); ++cit) { - for (it = voteMap.lower_bound(cit->mMeta.mMsgId); it != voteMap.upper_bound(cit->mMeta.mMsgId); it++) + for (it = voteMap.lower_bound(cit->mMeta.mMsgId); it != voteMap.upper_bound(cit->mMeta.mMsgId); ++it) { if (it->second->mMsg.mVoteType == GXS_VOTE_UP) { @@ -255,7 +255,7 @@ bool p3GxsCommentService::getGxsCommentData(const uint32_t &token, std::vectorsecond; } @@ -283,12 +283,12 @@ bool p3GxsCommentService::getGxsRelatedComments(const uint32_t &token, std::vect GxsMsgRelatedDataMap::iterator mit = msgData.begin(); std::multimap voteMap; - for(; mit != msgData.end(); mit++) + for(; mit != msgData.end(); ++mit) { std::vector& msgItems = mit->second; std::vector::iterator vit = msgItems.begin(); - for(; vit != msgItems.end(); vit++) + for(; vit != msgItems.end(); ++vit) { RsGxsCommentItem* item = dynamic_cast(*vit); @@ -318,9 +318,9 @@ bool p3GxsCommentService::getGxsRelatedComments(const uint32_t &token, std::vect /* now iterate through comments - and set the vote counts */ std::vector::iterator cit; std::multimap::iterator it; - for(cit = comments.begin(); cit != comments.end(); cit++) + for(cit = comments.begin(); cit != comments.end(); ++cit) { - for (it = voteMap.lower_bound(cit->mMeta.mMsgId); it != voteMap.upper_bound(cit->mMeta.mMsgId); it++) + for (it = voteMap.lower_bound(cit->mMeta.mMsgId); it != voteMap.upper_bound(cit->mMeta.mMsgId); ++it) { if (it->second->mMsg.mVoteType == GXS_VOTE_UP) { @@ -357,7 +357,7 @@ bool p3GxsCommentService::getGxsRelatedComments(const uint32_t &token, std::vect std::cerr << std::endl; /* delete the votes */ - for (it = voteMap.begin(); it != voteMap.end(); it++) + for (it = voteMap.begin(); it != voteMap.end(); ++it) { delete it->second; } @@ -497,10 +497,10 @@ void p3GxsCommentService::load_PendingVoteParent(const uint32_t &token) } GxsMsgMetaMap::iterator it; - for(it = msginfo.begin(); it != msginfo.end(); it++) + for(it = msginfo.begin(); it != msginfo.end(); ++it) { std::vector::iterator mit; - for(mit = it->second.begin(); mit != it->second.end(); mit++) + for(mit = it->second.begin(); mit != it->second.end(); ++mit) { /* find the matching Pending Vote */ RsMsgMetaData &meta = *mit; @@ -567,7 +567,7 @@ void p3GxsCommentService::completeInternalVote(uint32_t &token) std::cerr << "p3GxsCommentService::completeInternalVote() token: " << token; std::cerr << std::endl; std::map::iterator it; - for (it = mPendingVotes.begin(); it != mPendingVotes.end(); it++) + for (it = mPendingVotes.begin(); it != mPendingVotes.end(); ++it) { if (it->second.mVoteToken == token) { @@ -596,7 +596,7 @@ bool p3GxsCommentService::acknowledgeVote(const uint32_t& token, RsGxsGrpMsgIdPa std::cerr << std::endl; std::map::iterator it; - for (it = mPendingVotes.begin(); it != mPendingVotes.end(); it++) + for (it = mPendingVotes.begin(); it != mPendingVotes.end(); ++it) { if (it->second.mReqToken == token) { diff --git a/libretroshare/src/services/p3gxsforums.cc b/libretroshare/src/services/p3gxsforums.cc index efb725dff..f995beace 100644 --- a/libretroshare/src/services/p3gxsforums.cc +++ b/libretroshare/src/services/p3gxsforums.cc @@ -117,7 +117,7 @@ bool p3GxsForums::getGroupData(const uint32_t &token, std::vector::iterator vit = grpData.begin(); - for(; vit != grpData.end(); vit++) + for(; vit != grpData.end(); ++vit) { RsGxsForumGroupItem* item = dynamic_cast(*vit); if (item) @@ -152,13 +152,13 @@ bool p3GxsForums::getMsgData(const uint32_t &token, std::vector & { GxsMsgDataMap::iterator mit = msgData.begin(); - for(; mit != msgData.end(); mit++) + for(; mit != msgData.end(); ++mit) { RsGxsGroupId grpId = mit->first; std::vector& msgItems = mit->second; std::vector::iterator vit = msgItems.begin(); - for(; vit != msgItems.end(); vit++) + for(; vit != msgItems.end(); ++vit) { RsGxsForumMsgItem* item = dynamic_cast(*vit); @@ -191,12 +191,12 @@ bool p3GxsForums::getRelatedMessages(const uint32_t &token, std::vector& msgItems = mit->second; std::vector::iterator vit = msgItems.begin(); - for(; vit != msgItems.end(); vit++) + for(; vit != msgItems.end(); ++vit) { RsGxsForumMsgItem* item = dynamic_cast(*vit); @@ -456,7 +456,7 @@ bool p3GxsForums::generateMessage(uint32_t &token, const RsGxsGroupId &grpId, co uint32_t idx = (uint32_t) (ownIds.size() * RSRandom::random_f32()); int i = 0; - for(it = ownIds.begin(); (it != ownIds.end()) && (i < idx); it++, i++) ; + for(it = ownIds.begin(); (it != ownIds.end()) && (i < idx); ++it, i++) ; if (it != ownIds.end()) { diff --git a/libretroshare/src/services/p3gxsreputation.cc b/libretroshare/src/services/p3gxsreputation.cc index a86910a20..a475a5fab 100644 --- a/libretroshare/src/services/p3gxsreputation.cc +++ b/libretroshare/src/services/p3gxsreputation.cc @@ -253,7 +253,7 @@ bool p3GxsReputation::SendReputations(RsGxsReputationRequestItem *request) int totalcount = 0; RsGxsReputationUpdateItem *pkt = new RsGxsReputationUpdateItem(); pkt->PeerId(peerId); - for(;tit != mUpdated.end(); tit++) + for(;tit != mUpdated.end(); ++tit) { /* find */ std::map::iterator rit; @@ -326,7 +326,7 @@ bool p3GxsReputation::RecvReputations(RsGxsReputationUpdateItem *item) RsPeerId peerid = item->PeerId(); std::map::iterator it; - for(it = item->mOpinions.begin(); it != item->mOpinions.end(); it++) + for(it = item->mOpinions.begin(); it != item->mOpinions.end(); ++it) { RsStackMutex stack(mReputationMtx); /****** LOCKED MUTEX *******/ @@ -406,7 +406,7 @@ bool p3GxsReputation::updateOpinion(const RsGxsId& gxsid, int opinion) std::multimap::iterator uit, euit; uit = mUpdated.lower_bound(reputation.mOwnOpinionTs); euit = mUpdated.upper_bound(reputation.mOwnOpinionTs); - for(; uit != euit; uit++) + for(; uit != euit; ++uit) { if (uit->second == gxsid) { @@ -449,7 +449,7 @@ bool p3GxsReputation::saveList(bool& cleanup, std::list &savelist) /* save */ std::map::iterator it; - for(it = mConfig.begin(); it != mConfig.end(); it++) + for(it = mConfig.begin(); it != mConfig.end(); ++it) { if (!rsPeers->isFriend(it->first)) { @@ -466,7 +466,7 @@ bool p3GxsReputation::saveList(bool& cleanup, std::list &savelist) int count = 0; std::map::iterator rit; - for(rit = mReputations.begin(); rit != mReputations.end(); rit++, count++) + for(rit = mReputations.begin(); rit != mReputations.end(); ++rit, count++) { RsGxsReputationSetItem *item = new RsGxsReputationSetItem(); item->mGxsId = rit->first.toStdString(); @@ -497,7 +497,7 @@ bool p3GxsReputation::loadList(std::list& loadList) std::list::iterator it; std::set peerSet; - for(it = loadList.begin(); it != loadList.end(); it++) + for(it = loadList.begin(); it != loadList.end(); ++it) { RsGxsReputationConfigItem *item = dynamic_cast(*it); // Configurations are loaded first. (to establish peerSet). @@ -542,7 +542,7 @@ bool p3GxsReputation::loadReputationSet(RsGxsReputationSetItem *item, const std: // install opinions. std::map::const_iterator oit; - for(oit = item->mOpinions.begin(); oit != item->mOpinions.end(); oit++) + for(oit = item->mOpinions.begin(); oit != item->mOpinions.end(); ++oit) { // expensive ... but necessary. RsPeerId peerId(oit->first); @@ -635,7 +635,7 @@ void p3GxsReputation::sendReputationRequests() /* prepare packets */ std::list::iterator it; - for(it = idList.begin(); it != idList.end(); it++) + for(it = idList.begin(); it != idList.end(); ++it) { #ifdef DEBUG_REPUTATION std::cerr << "p3GxsReputation::sendReputationRequest() To: " << *it; diff --git a/libretroshare/src/services/p3idservice.cc b/libretroshare/src/services/p3idservice.cc index f504dba8b..05a256a8a 100644 --- a/libretroshare/src/services/p3idservice.cc +++ b/libretroshare/src/services/p3idservice.cc @@ -220,7 +220,7 @@ void p3IdService::notifyChanges(std::vector &changes) std::list unprocessedGroups; std::vector::iterator it; - for(it = changes.begin(); it != changes.end(); it++) + for(it = changes.begin(); it != changes.end(); ++it) { RsGxsGroupChange *groupChange = dynamic_cast(*it); RsGxsMsgChange *msgChange = dynamic_cast(*it); @@ -233,7 +233,7 @@ void p3IdService::notifyChanges(std::vector &changes) std::map > &msgChangeMap = msgChange->msgChangeMap; std::map >::iterator mit; - for(mit = msgChangeMap.begin(); mit != msgChangeMap.end(); mit++) + for(mit = msgChangeMap.begin(); mit != msgChangeMap.end(); ++mit) { #ifdef DEBUG_IDS std::cerr << "p3IdService::notifyChanges() Msgs for Group: " << mit->first; @@ -252,7 +252,7 @@ void p3IdService::notifyChanges(std::vector &changes) std::list &groupList = groupChange->mGrpIdList; std::list::iterator git; - for(git = groupList.begin(); git != groupList.end(); git++) + for(git = groupList.begin(); git != groupList.end(); ++git) { #ifdef DEBUG_IDS std::cerr << "p3IdService::notifyChanges() Auto Subscribe to Incoming Groups: " << *git; @@ -715,7 +715,7 @@ bool p3IdService::getGroupData(const uint32_t &token, std::vector { std::vector::iterator vit = grpData.begin(); - for(; vit != grpData.end(); vit++) + for(; vit != grpData.end(); ++vit) { RsGxsIdGroupItem* item = dynamic_cast(*vit); if (item) @@ -1309,7 +1309,7 @@ void RsGxsIdCache::updateServiceString(std::string serviceString) { std::list::iterator it; int i = 0; - for(it = mRecognTags.begin(); it != mRecognTags.end(); it++, i++) + for(it = mRecognTags.begin(); it != mRecognTags.end(); ++it, i++) { if (ssdata.recogntags.tagValid(i) && it->valid) { @@ -1369,7 +1369,7 @@ bool p3IdService::recogn_extract_taginfo(const RsGxsIdGroupItem *item, std::list std::list::const_iterator rit; int count = 0; - for(rit = item->group.mRecognTags.begin(); rit != item->group.mRecognTags.end(); rit++) + for(rit = item->group.mRecognTags.begin(); rit != item->group.mRecognTags.end(); ++rit) { if (++count > RSRECOGN_MAX_TAGINFO) { @@ -1453,7 +1453,7 @@ bool p3IdService::cache_process_recogntaginfo(const RsGxsIdGroupItem *item, std: recogn_extract_taginfo(item, tagItems); //time_t now = time(NULL); - for(it = tagItems.begin(); it != tagItems.end(); it++) + for(it = tagItems.begin(); it != tagItems.end(); ++it) { RsRecognTag info((*it)->tag_class, (*it)->tag_type, false); bool isPending = false; @@ -1522,7 +1522,7 @@ bool p3IdService::cache_store(const RsGxsIdGroupItem *item) //std::cerr << "p3IdService::cache_store() KeySet is:"; //keySet.print(std::cerr, 10); - for (kit = keySet.keys.begin(); kit != keySet.keys.end(); kit++) + for (kit = keySet.keys.begin(); kit != keySet.keys.end(); ++kit) { if (kit->second.keyFlags & RSTLV_KEY_DISTRIB_ADMIN) { @@ -1624,7 +1624,7 @@ bool p3IdService::cache_start_load() /* now we process the modGroupList -> a map so we can use it easily later, and create id list too */ std::map >::iterator it; - for(it = mCacheLoad_ToCache.begin(); it != mCacheLoad_ToCache.end(); it++) + for(it = mCacheLoad_ToCache.begin(); it != mCacheLoad_ToCache.end(); ++it) { #ifdef DEBUG_IDS std::cerr << "p3IdService::cache_start_load() GroupId: " << it->first; @@ -1670,7 +1670,7 @@ bool p3IdService::cache_load_for_token(uint32_t token) { std::vector::iterator vit = grpData.begin(); - for(; vit != grpData.end(); vit++) + for(; vit != grpData.end(); ++vit) { RsGxsIdGroupItem* item = dynamic_cast(*vit); if (!item) @@ -1728,7 +1728,7 @@ void p3IdService::requestIdsFromNet() std::map > requests; // transform to appropriate structure ( > map) to make request to nes - for(cit = mIdsNotPresent.begin(); cit != mIdsNotPresent.end(); cit++) + for(cit = mIdsNotPresent.begin(); cit != mIdsNotPresent.end(); ++cit) { { #ifdef DEBUG_IDS @@ -1741,20 +1741,20 @@ void p3IdService::requestIdsFromNet() const std::list& peers = cit->second; std::list::const_iterator cit2; - for(cit2 = peers.begin(); cit2 != peers.end(); cit2++) + for(cit2 = peers.begin(); cit2 != peers.end(); ++cit2) requests[*cit2].push_back(cit->first); } std::map >::const_iterator cit2; - for(cit2 = requests.begin(); cit2 != requests.end(); cit2++) + for(cit2 = requests.begin(); cit2 != requests.end(); ++cit2) { if(mNes) { std::list::const_iterator gxs_id_it = cit2->second.begin(); std::list grpIds; - for(; gxs_id_it != cit2->second.end(); gxs_id_it++) + for(; gxs_id_it != cit2->second.end(); ++gxs_id_it) grpIds.push_back(RsGxsGroupId(gxs_id_it->toStdString())); mNes->requestGrp(grpIds, cit2->first); @@ -1847,7 +1847,7 @@ bool p3IdService::cache_load_ownids(uint32_t token) RsStackMutex stack(mIdMtx); /********** STACK LOCKED MTX ******/ mOwnIds.clear(); - for(vit = grpData.begin(); vit != grpData.end(); vit++) + for(vit = grpData.begin(); vit != grpData.end(); ++vit) { RsGxsIdGroupItem* item = dynamic_cast(*vit); if (!item) @@ -1869,7 +1869,7 @@ bool p3IdService::cache_load_ownids(uint32_t token) // as it just causes the cache to be flushed. #if 0 // Cache Items too. - for(vit = grpData.begin(); vit != grpData.end(); vit++) + for(vit = grpData.begin(); vit != grpData.end(); ++vit) { RsGxsIdGroupItem* item = dynamic_cast(*vit); if (item->meta.mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_ADMIN) @@ -1932,13 +1932,13 @@ bool p3IdService::cachetest_handlerequest(uint32_t token) bool ok = RsGenExchange::getGroupList(token, grpIdsC); std::list::const_iterator cit = grpIdsC.begin(); - for(; cit != grpIdsC.end(); cit++) + for(; cit != grpIdsC.end(); ++cit) grpIds.push_back(RsGxsId(cit->toStdString())); if(ok) { std::list::iterator vit = grpIds.begin(); - for(; vit != grpIds.end(); vit++) + for(; vit != grpIds.end(); ++vit) { /* 5% chance of checking it! */ if (RSRandom::random_f32() < 0.25) @@ -2136,7 +2136,7 @@ RsGenExchange::ServiceCreate_Return p3IdService::service_CreateGroup(RsGxsGrpIte /********************* TEMP HACK UNTIL GXS FILLS IN GROUP_ID *****************/ // find private admin key std::map::iterator mit = keySet.keys.begin(); - for(; mit != keySet.keys.end(); mit++) + for(; mit != keySet.keys.end(); ++mit) { RsTlvSecurityKey& pk = mit->second; @@ -2369,7 +2369,7 @@ bool p3IdService::pgphash_handlerequest(uint32_t token) #endif // DEBUG_IDS std::vector::iterator vit; - for(vit = groups.begin(); vit != groups.end(); vit++) + for(vit = groups.begin(); vit != groups.end(); ++vit) { #ifdef DEBUG_IDS std::cerr << "p3IdService::pgphash_request() Group Id: " << vit->mMeta.mGroupId; @@ -2562,7 +2562,7 @@ bool p3IdService::checkId(const RsGxsIdGroup &grp, RsPgpId &pgpId) RsStackMutex stack(mIdMtx); /********** STACK LOCKED MTX ******/ std::map::iterator mit; - for(mit = mPgpFingerprintMap.begin(); mit != mPgpFingerprintMap.end(); mit++) + for(mit = mPgpFingerprintMap.begin(); mit != mPgpFingerprintMap.end(); ++mit) { Sha1CheckSum hash; calcPGPHash(RsGxsId(grp.mMeta.mGroupId.toStdString()), mit->second, hash); @@ -2636,7 +2636,7 @@ void p3IdService::getPgpIdList() mPgpFingerprintMap.clear(); std::list::iterator it; - for(it = list.begin(); it != list.end(); it++) + for(it = list.begin(); it != list.end(); ++it) { RsPgpId pgpId(*it); PGPFingerprintType fp; @@ -2803,7 +2803,7 @@ bool p3IdService::recogn_handlerequest(uint32_t token) std::vector::iterator vit = grpData.begin(); - for(; vit != grpData.end(); vit++) + for(; vit != grpData.end(); ++vit) { RsGxsIdGroupItem* item = dynamic_cast(*vit); if (item) @@ -2879,7 +2879,7 @@ bool p3IdService::recogn_process() bool isPending = false; int i = 1; uint32_t tagValidFlags = 0; - for(it = tagItems.begin(); it != tagItems.end(); it++) + for(it = tagItems.begin(); it != tagItems.end(); ++it) { bool isTagPending = false; bool isTagOk = recogn_checktag(RsGxsId(item->meta.mGroupId.toStdString()), item->meta.mGroupName, *it, true, isPending); @@ -3134,7 +3134,7 @@ void p3IdService::generateDummy_FriendPGP() int idx = RSRandom::random_f32() * (gpgids.size() - 1); it = gpgids.begin(); - for(int j = 0; j < idx; j++, it++) ; + for(int j = 0; j < idx; j++, ++it) ; #if 0 // HACK FOR DUMMY GENERATION. diff --git a/libretroshare/src/services/p3msgservice.cc b/libretroshare/src/services/p3msgservice.cc index 307cc19a4..3b2b53787 100644 --- a/libretroshare/src/services/p3msgservice.cc +++ b/libretroshare/src/services/p3msgservice.cc @@ -277,7 +277,7 @@ void p3MsgService::statusChange(const std::list &plist) /* only do this when a new peer is connected */ bool newPeers = false; std::list::const_iterator it; - for(it = plist.begin(); it != plist.end(); it++) + for(it = plist.begin(); it != plist.end(); ++it) { if (it->actions & RS_SERVICE_PEER_CONNECTED) { @@ -349,7 +349,7 @@ int p3MsgService::checkOutgoingMessages() RsStackMutex stack(mMsgMtx); /********** STACK LOCKED MTX ******/ std::map::iterator mit; - for(mit = msgOutgoing.begin(); mit != msgOutgoing.end(); mit++) + for(mit = msgOutgoing.begin(); mit != msgOutgoing.end(); ++mit) { if (mit->second->msgFlags & RS_MSG_FLAGS_TRASH) continue; @@ -392,7 +392,7 @@ int p3MsgService::checkOutgoingMessages() } /* clean up */ - for(it = toErase.begin(); it != toErase.end(); it++) + for(it = toErase.begin(); it != toErase.end(); ++it) { mit = msgOutgoing.find(*it); if (mit != msgOutgoing.end()) @@ -437,23 +437,23 @@ bool p3MsgService::saveList(bool& cleanup, std::list& itemList) mMsgMtx.lock(); - for(mit = imsg.begin(); mit != imsg.end(); mit++) + for(mit = imsg.begin(); mit != imsg.end(); ++mit) itemList.push_back(mit->second); - for(lit = mSrcIds.begin(); lit != mSrcIds.end(); lit++) + for(lit = mSrcIds.begin(); lit != mSrcIds.end(); ++lit) itemList.push_back(lit->second); - for(mit = msgOutgoing.begin(); mit != msgOutgoing.end(); mit++) + for(mit = msgOutgoing.begin(); mit != msgOutgoing.end(); ++mit) itemList.push_back(mit->second) ; - for(mit2 = mTags.begin(); mit2 != mTags.end(); mit2++) + for(mit2 = mTags.begin(); mit2 != mTags.end(); ++mit2) itemList.push_back(mit2->second); - for(mit3 = mMsgTags.begin(); mit3 != mMsgTags.end(); mit3++) + for(mit3 = mMsgTags.begin(); mit3 != mMsgTags.end(); ++mit3) itemList.push_back(mit3->second); - for(mit4 = mParentId.begin(); mit4 != mParentId.end(); mit4++) + for(mit4 = mParentId.begin(); mit4 != mParentId.end(); ++mit4) itemList.push_back(mit4->second); RsConfigKeyValueSet *vitem = new RsConfigKeyValueSet ; @@ -504,7 +504,7 @@ void p3MsgService::initStandardTagTypes() getStandardTagTypes(tags); std::map >::iterator tit; - for (tit = tags.types.begin(); tit != tags.types.end(); tit++) { + for (tit = tags.types.begin(); tit != tags.types.end(); ++tit) { std::map::iterator mit = mTags.find(tit->first); if (mit == mTags.end()) { RsMsgTagType* tagType = new RsMsgTagType(); @@ -542,7 +542,7 @@ bool p3MsgService::loadList(std::list& load) bool distant_messaging_set = false ; // load items and calculate next unique msgId - for(it = load.begin(); it != load.end(); it++) + for(it = load.begin(); it != load.end(); ++it) { if (NULL != (mitem = dynamic_cast(*it))) @@ -606,7 +606,7 @@ bool p3MsgService::loadList(std::list& load) // sort items into lists std::list::iterator msgIt; - for (msgIt = items.begin(); msgIt != items.end(); msgIt++) + for (msgIt = items.begin(); msgIt != items.end(); ++msgIt) { mitem = *msgIt; @@ -644,7 +644,7 @@ bool p3MsgService::loadList(std::list& load) RsStackMutex stack(mMsgMtx); /********** STACK LOCKED MTX ******/ /* remove missing msgId in mSrcIds */ - for (srcIt = srcIdMsgMap.begin(); srcIt != srcIdMsgMap.end(); srcIt++) { + for (srcIt = srcIdMsgMap.begin(); srcIt != srcIdMsgMap.end(); ++srcIt) { std::map::iterator it = mSrcIds.find(srcIt->first); if (it != mSrcIds.end()) { delete(it->second); @@ -663,7 +663,7 @@ bool p3MsgService::loadList(std::list& load) } } - mit++; + ++mit; } return true; @@ -714,14 +714,14 @@ bool p3MsgService::getMessageSummaries(std::list &msgList) RsStackMutex stack(mMsgMtx); /********** STACK LOCKED MTX ******/ std::map::iterator mit; - for(mit = imsg.begin(); mit != imsg.end(); mit++) + for(mit = imsg.begin(); mit != imsg.end(); ++mit) { MsgInfoSummary mis; initRsMIS(mit->second, mis); msgList.push_back(mis); } - for(mit = msgOutgoing.begin(); mit != msgOutgoing.end(); mit++) + for(mit = msgOutgoing.begin(); mit != msgOutgoing.end(); ++mit) { MsgInfoSummary mis; initRsMIS(mit->second, mis); @@ -772,7 +772,7 @@ void p3MsgService::getMessageCount(unsigned int *pnInbox, unsigned int *pnInboxN std::map *apMsg [2] = { &imsg, &msgOutgoing }; for (int i = 0; i < 2; i++) { - for (mit = apMsg [i]->begin(); mit != apMsg [i]->end(); mit++) { + for (mit = apMsg [i]->begin(); mit != apMsg [i]->end(); ++mit) { MsgInfoSummary mis; initRsMIS(mit->second, mis); @@ -1034,13 +1034,13 @@ int p3MsgService::sendMessage(RsMsgItem *item) bool p3MsgService::MessageSend(MessageInfo &info) { - for(std::list::const_iterator pit = info.rspeerid_msgto.begin(); pit != info.rspeerid_msgto.end(); pit++) sendMessage(initMIRsMsg(info, *pit)); - for(std::list::const_iterator pit = info.rspeerid_msgcc.begin(); pit != info.rspeerid_msgcc.end(); pit++) sendMessage(initMIRsMsg(info, *pit)); - for(std::list::const_iterator pit = info.rspeerid_msgbcc.begin(); pit != info.rspeerid_msgbcc.end(); pit++) sendMessage(initMIRsMsg(info, *pit)); + for(std::list::const_iterator pit = info.rspeerid_msgto.begin(); pit != info.rspeerid_msgto.end(); ++pit) sendMessage(initMIRsMsg(info, *pit)); + for(std::list::const_iterator pit = info.rspeerid_msgcc.begin(); pit != info.rspeerid_msgcc.end(); ++pit) sendMessage(initMIRsMsg(info, *pit)); + for(std::list::const_iterator pit = info.rspeerid_msgbcc.begin(); pit != info.rspeerid_msgbcc.end(); ++pit) sendMessage(initMIRsMsg(info, *pit)); - for(std::list::const_iterator pit = info.rsgxsid_msgto.begin(); pit != info.rsgxsid_msgto.end(); pit++) sendMessage(initMIRsMsg(info, *pit)); - for(std::list::const_iterator pit = info.rsgxsid_msgcc.begin(); pit != info.rsgxsid_msgcc.end(); pit++) sendMessage(initMIRsMsg(info, *pit)); - for(std::list::const_iterator pit = info.rsgxsid_msgbcc.begin(); pit != info.rsgxsid_msgbcc.end(); pit++) sendMessage(initMIRsMsg(info, *pit)); + for(std::list::const_iterator pit = info.rsgxsid_msgto.begin(); pit != info.rsgxsid_msgto.end(); ++pit) sendMessage(initMIRsMsg(info, *pit)); + for(std::list::const_iterator pit = info.rsgxsid_msgcc.begin(); pit != info.rsgxsid_msgcc.end(); ++pit) sendMessage(initMIRsMsg(info, *pit)); + for(std::list::const_iterator pit = info.rsgxsid_msgbcc.begin(); pit != info.rsgxsid_msgbcc.end(); ++pit) sendMessage(initMIRsMsg(info, *pit)); /* send to ourselves as well */ RsMsgItem *msg = initMIRsMsg(info, mServiceCtrl->getOwnId()); @@ -1155,7 +1155,7 @@ bool p3MsgService::getMessageTagTypes(MsgTagType& tags) std::map::iterator mit; - for(mit = mTags.begin(); mit != mTags.end(); mit++) { + for(mit = mTags.begin(); mit != mTags.end(); ++mit) { std::pair p(mit->second->text, mit->second->rgb_color); tags.types.insert(std::pair >(mit->first, p)); } @@ -1256,7 +1256,7 @@ bool p3MsgService::removeMessageTagType(uint32_t tagId) continue; } } - mit1++; + ++mit1; } /* remove tag type */ @@ -1389,7 +1389,7 @@ bool p3MsgService::resetMessageStandardTagTypes(MsgTagType& tags) getStandardTagTypes(standardTags); std::map >::iterator mit; - for (mit = standardTags.types.begin(); mit != standardTags.types.end(); mit++) { + for (mit = standardTags.types.begin(); mit != standardTags.types.end(); ++mit) { tags.types[mit->first] = mit->second; } @@ -1504,7 +1504,7 @@ void p3MsgService::initRsMI(RsMsgItem *msg, MessageInfo &mi) mi.count = 0; mi.size = 0; - for(std::list::iterator it = msg->attachment.items.begin(); it != msg->attachment.items.end(); it++) + for(std::list::iterator it = msg->attachment.items.begin(); it != msg->attachment.items.end(); ++it) { FileInfo fi; fi.fname = RsDirUtil::getTopDir(it->name); @@ -1622,7 +1622,7 @@ void p3MsgService::initMIRsMsg(RsMsgItem *msg,const MessageInfo& info) msg -> attachment.title = info.attach_title; msg -> attachment.comment = info.attach_comment; - for(std::list::const_iterator it = info.files.begin(); it != info.files.end(); it++) + for(std::list::const_iterator it = info.files.begin(); it != info.files.end(); ++it) { RsTlvFileItem mfi; mfi.hash = it -> hash; diff --git a/libretroshare/src/services/p3photoservice.cc b/libretroshare/src/services/p3photoservice.cc index 9eeba701d..1821c8d69 100644 --- a/libretroshare/src/services/p3photoservice.cc +++ b/libretroshare/src/services/p3photoservice.cc @@ -153,7 +153,7 @@ void p3PhotoService::groupsChanged(std::list& grpIds) RsGxsGroupChange* gc = mGroupChange.back(); std::list& gList = gc->mGrpIdList; std::list::iterator lit = gList.begin(); - for(; lit != gList.end(); lit++) + for(; lit != gList.end(); ++lit) grpIds.push_back(*lit); mGroupChange.pop_back(); @@ -221,7 +221,7 @@ bool p3PhotoService::getAlbum(const uint32_t& token, std::vector& { std::vector::iterator vit = grpData.begin(); - for(; vit != grpData.end(); vit++) + for(; vit != grpData.end(); ++vit) { RsGxsPhotoAlbumItem* item = dynamic_cast(*vit); if (item) @@ -252,13 +252,13 @@ bool p3PhotoService::getPhoto(const uint32_t& token, PhotoResult& photos) { GxsMsgDataMap::iterator mit = msgData.begin(); - for(; mit != msgData.end(); mit++) + for(; mit != msgData.end(); ++mit) { RsGxsGroupId grpId = mit->first; std::vector& msgItems = mit->second; std::vector::iterator vit = msgItems.begin(); - for(; vit != msgItems.end(); vit++) + for(; vit != msgItems.end(); ++vit) { RsGxsPhotoPhotoItem* item = dynamic_cast(*vit); @@ -289,13 +289,13 @@ bool p3PhotoService::getPhotoComment(const uint32_t &token, PhotoCommentResult & { GxsMsgDataMap::iterator mit = msgData.begin(); - for(; mit != msgData.end(); mit++) + for(; mit != msgData.end(); ++mit) { RsGxsGroupId grpId = mit->first; std::vector& msgItems = mit->second; std::vector::iterator vit = msgItems.begin(); - for(; vit != msgItems.end(); vit++) + for(; vit != msgItems.end(); ++vit) { RsGxsPhotoCommentItem* item = dynamic_cast(*vit); @@ -348,7 +348,7 @@ void p3PhotoService::notifyChanges(std::vector& changes) std::vector::iterator vit = changes.begin(); - for(; vit != changes.end(); vit++) + for(; vit != changes.end(); ++vit) { RsGxsNotify* n = *vit; RsGxsGroupChange* gc; diff --git a/libretroshare/src/services/p3postbase.cc b/libretroshare/src/services/p3postbase.cc index 997908f71..3c3e6b01f 100644 --- a/libretroshare/src/services/p3postbase.cc +++ b/libretroshare/src/services/p3postbase.cc @@ -88,7 +88,7 @@ void p3PostBase::notifyChanges(std::vector &changes) std::vector::iterator it; - for(it = changes.begin(); it != changes.end(); it++) + for(it = changes.begin(); it != changes.end(); ++it) { RsGxsGroupChange *groupChange = dynamic_cast(*it); RsGxsMsgChange *msgChange = dynamic_cast(*it); @@ -99,7 +99,7 @@ void p3PostBase::notifyChanges(std::vector &changes) std::map > &msgChangeMap = msgChange->msgChangeMap; std::map >::iterator mit; - for(mit = msgChangeMap.begin(); mit != msgChangeMap.end(); mit++) + for(mit = msgChangeMap.begin(); mit != msgChangeMap.end(); ++mit) { std::cerr << "p3PostBase::notifyChanges() Msgs for Group: " << mit->first; std::cerr << std::endl; @@ -118,7 +118,7 @@ void p3PostBase::notifyChanges(std::vector &changes) std::list &groupList = groupChange->mGrpIdList; std::list::iterator git; - for(git = groupList.begin(); git != groupList.end(); git++) + for(git = groupList.begin(); git != groupList.end(); ++git) { std::cerr << "p3PostBase::notifyChanges() Incoming Group: " << *git; std::cerr << std::endl; @@ -243,7 +243,7 @@ void p3PostBase::background_loadGroups(const uint32_t &token) } std::list::iterator it; - for(it = groupList.begin(); it != groupList.end(); it++) + for(it = groupList.begin(); it != groupList.end(); ++it) { addGroupForProcessing(*it); } @@ -390,10 +390,10 @@ void p3PostBase::background_loadMsgs(const uint32_t &token, bool unprocessed) RsGxsGroupId groupId; std::map >::iterator mit; std::vector::iterator vit; - for (mit = msgData.begin(); mit != msgData.end(); mit++) + for (mit = msgData.begin(); mit != msgData.end(); ++mit) { groupId = mit->first; - for (vit = mit->second.begin(); vit != mit->second.end(); vit++) + for (vit = mit->second.begin(); vit != mit->second.end(); ++vit) { RsGxsMessageId parentId = (*vit)->meta.mParentId; RsGxsMessageId threadId = (*vit)->meta.mThreadId; @@ -596,9 +596,9 @@ void p3PostBase::background_updateVoteCounts(const uint32_t &token) std::vector changes; RsGxsMsgChange *msgChanges = new RsGxsMsgChange(RsGxsNotify::TYPE_PROCESSED, false); - for(mit = parentMsgList.begin(); mit != parentMsgList.end(); mit++) + for(mit = parentMsgList.begin(); mit != parentMsgList.end(); ++mit) { - for(vit = mit->second.begin(); vit != mit->second.end(); vit++) + for(vit = mit->second.begin(); vit != mit->second.end(); ++vit) { std::cerr << "p3PostBase::background_updateVoteCounts() Processing Msg(" << mit->first; std::cerr << ", " << vit->mMsgId << ")"; diff --git a/libretroshare/src/services/p3posted.cc b/libretroshare/src/services/p3posted.cc index c8ab5faf3..fb4634df6 100644 --- a/libretroshare/src/services/p3posted.cc +++ b/libretroshare/src/services/p3posted.cc @@ -77,7 +77,7 @@ bool p3Posted::getGroupData(const uint32_t &token, std::vector &g { std::vector::iterator vit = grpData.begin(); - for(; vit != grpData.end(); vit++) + for(; vit != grpData.end(); ++vit) { RsGxsPostedGroupItem* item = dynamic_cast(*vit); if (item) @@ -108,13 +108,13 @@ bool p3Posted::getPostData(const uint32_t &token, std::vector &msg { GxsMsgDataMap::iterator mit = msgData.begin(); - for(; mit != msgData.end(); mit++) + for(; mit != msgData.end(); ++mit) { RsGxsGroupId grpId = mit->first; std::vector& msgItems = mit->second; std::vector::iterator vit = msgItems.begin(); - for(; vit != msgItems.end(); vit++) + for(; vit != msgItems.end(); ++vit) { RsGxsPostedPostItem* item = dynamic_cast(*vit); @@ -150,12 +150,12 @@ bool p3Posted::getRelatedPosts(const uint32_t &token, std::vector { GxsMsgRelatedDataMap::iterator mit = msgData.begin(); - for(; mit != msgData.end(); mit++) + for(; mit != msgData.end(); ++mit) { std::vector& msgItems = mit->second; std::vector::iterator vit = msgItems.begin(); - for(; vit != msgItems.end(); vit++) + for(; vit != msgItems.end(); ++vit) { RsGxsPostedPostItem* item = dynamic_cast(*vit); diff --git a/libretroshare/src/services/p3rtt.cc b/libretroshare/src/services/p3rtt.cc index 7f280f124..f5baed4e8 100644 --- a/libretroshare/src/services/p3rtt.cc +++ b/libretroshare/src/services/p3rtt.cc @@ -199,7 +199,7 @@ void p3rtt::sendPingMeasurements() /* prepare packets */ std::set::iterator it; - for(it = idList.begin(); it != idList.end(); it++) + for(it = idList.begin(); it != idList.end(); ++it) { #ifdef DEBUG_RTT std::cerr << "p3rtt::sendPingMeasurements() Pinging: " << *it; @@ -389,7 +389,7 @@ uint32_t p3rtt::getPongResults(const RsPeerId& id, int n, std::list::reverse_iterator it; int i = 0; - for(it = peer->mPongResults.rbegin(); (it != peer->mPongResults.rend()) && (i < n); it++, i++) + for(it = peer->mPongResults.rbegin(); (it != peer->mPongResults.rend()) && (i < n); ++it, i++) { /* reversing order - so its easy to trim later */ results.push_back(*it); diff --git a/libretroshare/src/services/p3serviceinfo.cc b/libretroshare/src/services/p3serviceinfo.cc index 25cd332e7..90ccbe49a 100644 --- a/libretroshare/src/services/p3serviceinfo.cc +++ b/libretroshare/src/services/p3serviceinfo.cc @@ -184,7 +184,7 @@ bool p3ServiceInfo::sendPackets() RsStackMutex stack(mInfoMtx); /****** LOCKED MUTEX *******/ std::set::iterator it; - for(it = updateSet.begin(); it != updateSet.end(); it++) + for(it = updateSet.begin(); it != updateSet.end(); ++it) { sendServiceInfoList(*it); } @@ -232,7 +232,7 @@ void p3ServiceInfo::statusChange(const std::list &plist) std::cerr << std::endl; std::list::const_iterator it; - for (it = plist.begin(); it != plist.end(); it++) + for (it = plist.begin(); it != plist.end(); ++it) { if (it->state & RS_PEER_S_FRIEND) { diff --git a/libretroshare/src/services/p3statusservice.cc b/libretroshare/src/services/p3statusservice.cc index 15dd8d381..533672d60 100644 --- a/libretroshare/src/services/p3statusservice.cc +++ b/libretroshare/src/services/p3statusservice.cc @@ -119,7 +119,7 @@ bool p3StatusService::getStatusList(std::list& statusInfo) // fill up statusInfo list with this information std::map::iterator mit; - for(mit = mStatusInfoMap.begin(); mit != mStatusInfoMap.end(); mit++){ + for(mit = mStatusInfoMap.begin(); mit != mStatusInfoMap.end(); ++mit){ statusInfo.push_back(mit->second); } @@ -193,7 +193,7 @@ bool p3StatusService::sendStatus(const RsPeerId &id, uint32_t status) #endif // send to all peers online - for(it = onlineList.begin(); it != onlineList.end(); it++){ + for(it = onlineList.begin(); it != onlineList.end(); ++it){ RsStatusItem* statusItem = new RsStatusItem(); statusItem->sendTime = time(NULL); statusItem->status = statusInfo.status; @@ -260,7 +260,7 @@ void p3StatusService::receiveStatusQueue() if (changed.size()) { std::map::iterator it; - for (it = changed.begin(); it != changed.end(); it++) { + for (it = changed.begin(); it != changed.end(); ++it) { RsServer::notify()->notifyPeerStatusChanged(it->first.toStdString(), it->second); } RsServer::notify()->notifyPeerStatusChangedSummary(); @@ -320,7 +320,7 @@ bool p3StatusService::loadList(std::list& load){ return false; } - for(; it != load.end(); it++){ + for(; it != load.end(); ++it){ RsStatusItem* own_status = dynamic_cast(*it); @@ -369,7 +369,7 @@ void p3StatusService::statusChange(const std::list &plist) StatusInfo statusInfo; std::list::const_iterator it; - for (it = plist.begin(); it != plist.end(); it++) + for (it = plist.begin(); it != plist.end(); ++it) { if (it->actions & RS_SERVICE_PEER_DISCONNECTED) { diff --git a/libretroshare/src/services/p3wiki.cc b/libretroshare/src/services/p3wiki.cc index bcf245a41..d91e3d5df 100644 --- a/libretroshare/src/services/p3wiki.cc +++ b/libretroshare/src/services/p3wiki.cc @@ -123,7 +123,7 @@ bool p3Wiki::getCollections(const uint32_t &token, std::vector { std::vector::iterator vit = grpData.begin(); - for(; vit != grpData.end(); vit++) + for(; vit != grpData.end(); ++vit) { RsGxsWikiCollectionItem* item = dynamic_cast(*vit); @@ -160,13 +160,13 @@ bool p3Wiki::getSnapshots(const uint32_t &token, std::vector &sn { GxsMsgDataMap::iterator mit = msgData.begin(); - for(; mit != msgData.end(); mit++) + for(; mit != msgData.end(); ++mit) { RsGxsGroupId grpId = mit->first; std::vector& msgItems = mit->second; std::vector::iterator vit = msgItems.begin(); - for(; vit != msgItems.end(); vit++) + for(; vit != msgItems.end(); ++vit) { RsGxsWikiSnapshotItem* item = dynamic_cast(*vit); @@ -199,12 +199,12 @@ bool p3Wiki::getRelatedSnapshots(const uint32_t &token, std::vector& msgItems = mit->second; std::vector::iterator vit = msgItems.begin(); - for(; vit != msgItems.end(); vit++) + for(; vit != msgItems.end(); ++vit) { RsGxsWikiSnapshotItem* item = dynamic_cast(*vit); @@ -237,7 +237,7 @@ bool p3Wiki::getComments(const uint32_t &token, std::vector &comm { GxsMsgDataMap::iterator mit = msgData.begin(); - for(; mit != msgData.end(); mit++) + for(; mit != msgData.end(); ++mit) { RsGxsGroupId grpId = mit->first; std::vector& msgItems = mit->second; @@ -522,7 +522,7 @@ RsGxsId chooseRandomAuthorId() uint32_t idx = (uint32_t) (RSRandom::random_u32() % (int)ownIds.size()) ; int i = 0; - for(it = ownIds.begin(); (it != ownIds.end()) && (i < idx); it++, i++) ; + for(it = ownIds.begin(); (it != ownIds.end()) && (i < idx); ++it, i++) ; return *it ; } diff --git a/libretroshare/src/services/p3wire.cc b/libretroshare/src/services/p3wire.cc index 469565267..0e525d689 100644 --- a/libretroshare/src/services/p3wire.cc +++ b/libretroshare/src/services/p3wire.cc @@ -109,7 +109,7 @@ bool p3Wire::getGroupData(const uint32_t &token, std::vector &group { std::vector::iterator vit = grpData.begin(); - for(; vit != grpData.end(); vit++) + for(; vit != grpData.end(); ++vit) { RsGxsWireGroupItem* item = dynamic_cast(*vit); @@ -146,13 +146,13 @@ bool p3Wire::getPulseData(const uint32_t &token, std::vector &pulse { GxsMsgDataMap::iterator mit = msgData.begin(); - for(; mit != msgData.end(); mit++) + for(; mit != msgData.end(); ++mit) { RsGxsGroupId grpId = mit->first; std::vector& msgItems = mit->second; std::vector::iterator vit = msgItems.begin(); - for(; vit != msgItems.end(); vit++) + for(; vit != msgItems.end(); ++vit) { RsGxsWirePulseItem* item = dynamic_cast(*vit); diff --git a/libretroshare/src/tcponudp/tcpstream.cc b/libretroshare/src/tcponudp/tcpstream.cc index ab8ef4f3f..7c452daf3 100644 --- a/libretroshare/src/tcponudp/tcpstream.cc +++ b/libretroshare/src/tcponudp/tcpstream.cc @@ -1596,7 +1596,7 @@ int TcpStream::check_InPkts() } else { - it++; + ++it; } } if (found) diff --git a/libretroshare/src/tcponudp/tou.cc b/libretroshare/src/tcponudp/tou.cc index fbb73e023..ce0e3ed3f 100644 --- a/libretroshare/src/tcponudp/tou.cc +++ b/libretroshare/src/tcponudp/tou.cc @@ -689,7 +689,7 @@ static int tou_passall() * check if idle are still idle. */ std::vector::iterator it; - for(it = tou_streams.begin(); it != tou_streams.end(); it++) + for(it = tou_streams.begin(); it != tou_streams.end(); ++it) { if ((*it) && ((*it)->tcp)) { diff --git a/libretroshare/src/tcponudp/udppeer.cc b/libretroshare/src/tcponudp/udppeer.cc index 20642e314..d7b904c9a 100644 --- a/libretroshare/src/tcponudp/udppeer.cc +++ b/libretroshare/src/tcponudp/udppeer.cc @@ -83,7 +83,7 @@ int UdpPeerReceiver::status(std::ostream &out) out << "UdpPeerReceiver::status()" << std::endl; out << "UdpPeerReceiver::peers:" << std::endl; std::map::iterator it; - for(it = streams.begin(); it != streams.end(); it++) + for(it = streams.begin(); it != streams.end(); ++it) { out << "\t" << it->first << std::endl; } @@ -123,7 +123,7 @@ int UdpPeerReceiver::removeUdpPeer(UdpPeer *peer) /* check for duplicate */ std::map::iterator it; - for(it = streams.begin(); it != streams.end(); it++) + for(it = streams.begin(); it != streams.end(); ++it) { if (it->second == peer) { diff --git a/libretroshare/src/tcponudp/udprelay.cc b/libretroshare/src/tcponudp/udprelay.cc index 9245af31a..fb490bc65 100644 --- a/libretroshare/src/tcponudp/udprelay.cc +++ b/libretroshare/src/tcponudp/udprelay.cc @@ -139,7 +139,7 @@ int UdpRelayReceiver::removeUdpPeer(UdpPeer *peer) RsStackMutex stack(udppeerMtx); /********** LOCK MUTEX *********/ std::map::iterator it; - for(it = mPeers.begin(); it != mPeers.end(); it++) + for(it = mPeers.begin(); it != mPeers.end(); ++it) { if (it->second == peer) { @@ -190,7 +190,7 @@ int UdpRelayReceiver::getRelayEnds(std::list &relayEnds) std::map::iterator rit; - for(rit = mStreams.begin(); rit != mStreams.end(); rit++) + for(rit = mStreams.begin(); rit != mStreams.end(); ++rit) { relayEnds.push_back(rit->second); } @@ -205,7 +205,7 @@ int UdpRelayReceiver::getRelayProxies(std::list &relayProxies) std::map::iterator rit; - for(rit = mRelays.begin(); rit != mRelays.end(); rit++) + for(rit = mRelays.begin(); rit != mRelays.end(); ++rit) { relayProxies.push_back(rit->second); } @@ -239,7 +239,7 @@ int UdpRelayReceiver::checkRelays() #define BANDWIDTH_FILTER_K (0.8) - for(rit = mRelays.begin(); rit != mRelays.end(); rit++) + for(rit = mRelays.begin(); rit != mRelays.end(); ++rit) { /* calc bandwidth */ //rit->second.mBandwidth = rit->second.mDataSize / (float) (now - rit->second.mLastBandwidthTS); @@ -327,7 +327,7 @@ int UdpRelayReceiver::checkRelays() } std::list::iterator it; - for(it = eraseList.begin(); it != eraseList.end(); it++) + for(it = eraseList.begin(); it != eraseList.end(); ++it) { removeUdpRelay_relayLocked(&(*it)); } @@ -611,7 +611,7 @@ int UdpRelayReceiver::RelayStatus(std::ostream &out) out << std::endl; std::map::iterator rit; - for(rit = mRelays.begin(); rit != mRelays.end(); rit++) + for(rit = mRelays.begin(); rit != mRelays.end(); ++rit) { out << "Relay for: " << rit->first; out << std::endl; @@ -649,7 +649,7 @@ int UdpRelayReceiver::status(std::ostream &out) out << "UdpRelayReceiver::Connections:" << std::endl; std::map::iterator pit; - for(pit = mStreams.begin(); pit != mStreams.end(); pit++) + for(pit = mStreams.begin(); pit != mStreams.end(); ++pit) { out << "\t" << pit->first << " : " << pit->second; out << std::endl; @@ -670,7 +670,7 @@ int UdpRelayReceiver::UdpPeersStatus(std::ostream &out) out << std::endl; std::map::iterator pit; - for(pit = mPeers.begin(); pit != mPeers.end(); pit++) + for(pit = mPeers.begin(); pit != mPeers.end(); ++pit) { out << "UdpPeer for: " << pit->first; out << " is: " << pit->second; diff --git a/libretroshare/src/tcponudp/udpstunner.cc b/libretroshare/src/tcponudp/udpstunner.cc index 537122634..06e1748ad 100644 --- a/libretroshare/src/tcponudp/udpstunner.cc +++ b/libretroshare/src/tcponudp/udpstunner.cc @@ -649,7 +649,7 @@ bool UdpStunner::storeStunPeer(const struct sockaddr_in &remote, const char * RsStackMutex stack(stunMtx); /********** LOCK MUTEX *********/ std::list::iterator it; - for(it = mStunList.begin(); it != mStunList.end(); it++) + for(it = mStunList.begin(); it != mStunList.end(); ++it) { if ((remote.sin_addr.s_addr == it->remote.sin_addr.s_addr) && (remote.sin_port == it->remote.sin_port)) @@ -719,7 +719,7 @@ bool UdpStunner::dropStunPeer(const struct sockaddr_in &remote) } else { - it++; + ++it; } } @@ -956,7 +956,7 @@ bool UdpStunner::locked_recvdStun(const struct sockaddr_in &remote, const str bool found = true; std::list::iterator it; - for(it = mStunList.begin(); it != mStunList.end(); it++) + for(it = mStunList.begin(); it != mStunList.end(); ++it) { if ((remote.sin_addr.s_addr == it->remote.sin_addr.s_addr) && (remote.sin_port == it->remote.sin_port)) @@ -1038,7 +1038,7 @@ bool UdpStunner::locked_checkExternalAddress() std::list::reverse_iterator it; std::list::reverse_iterator p1; std::list::reverse_iterator p2; - for(it = mStunList.rbegin(); it != mStunList.rend(); it++) + for(it = mStunList.rbegin(); it != mStunList.rend(); ++it) { /* check: 1) have response. @@ -1138,7 +1138,7 @@ bool UdpStunner::locked_printStunList() rs_sprintf_append(out, "\tLastRecvAny: %ld\n", now - mStunLastRecvAny); std::list::iterator it; - for(it = mStunList.begin(); it != mStunList.end(); it++) + for(it = mStunList.begin(); it != mStunList.end(); ++it) { out += "id:" + RsUtil::BinToHex(it->id); rs_sprintf_append(out, " addr: %s:%u", rs_inet_ntoa(it->remote.sin_addr).c_str(), htons(it->remote.sin_port)); @@ -1162,7 +1162,7 @@ bool UdpStunner::getStunPeer(int idx, std::string &id, std::list::iterator it; int i; - for(i=0, it=mStunList.begin(); (isecond; currKey = cit->first; @@ -303,7 +303,7 @@ void ContentValue::clearData(){ std::map >::iterator mit = mKvData.begin(); - for(; mit != mKvData.end(); mit++){ + for(; mit != mKvData.end(); ++mit){ if(mit->second.first != 0) delete[] (mit->second.second); diff --git a/libretroshare/src/util/retrodb.cc b/libretroshare/src/util/retrodb.cc index 62e47f416..b5e651ba6 100644 --- a/libretroshare/src/util/retrodb.cc +++ b/libretroshare/src/util/retrodb.cc @@ -179,13 +179,13 @@ RetroCursor* RetroDb::sqlQuery(const std::string& tableName, const std::list::const_iterator it = columns.begin(); - for(; it != columns.end(); it++){ + for(; it != columns.end(); ++it){ columnSelection += *it; - it++; + ++it; if(it != columns.end()) columnSelection += ","; - it--; + --it; } // construct query @@ -225,11 +225,11 @@ bool RetroDb::sqlInsert(const std::string &table, const std::string& /* nullColu // build columns part of insertion std::string qColumns = table + "("; - for(; mit != keyTypeMap.end(); mit++){ + for(; mit != keyTypeMap.end(); ++mit){ qColumns += mit->first; - mit++; + ++mit; // add comma if more columns left if(mit == keyTypeMap.end()) @@ -237,7 +237,7 @@ bool RetroDb::sqlInsert(const std::string &table, const std::string& /* nullColu else qColumns += ","; - mit--; + --mit; } // build values part of insertion @@ -283,7 +283,7 @@ bool RetroDb::execSQL_bind(const std::string &query, std::list ¶ std::list::iterator lit = paramBindings.begin(); - for(; lit != paramBindings.end(); lit++){ + for(; lit != paramBindings.end(); ++lit){ RetroBind* rb = *lit; if(!rb->bind(stm)) @@ -351,7 +351,7 @@ void RetroDb::buildInsertQueryValue(const std::map keyType parameter = "VALUES("; int index = 0; - for(mit=keyTypeMap.begin(); mit!=keyTypeMap.end(); mit++) + for(mit=keyTypeMap.begin(); mit!=keyTypeMap.end(); ++mit) { uint8_t type = mit->second; @@ -400,14 +400,14 @@ void RetroDb::buildInsertQueryValue(const std::map keyType { paramBindings.push_back(rb); - mit++; + ++mit; if(mit == keyTypeMap.end()) parameter += "?"; else parameter += "?,"; - mit--; + --mit; } } @@ -423,7 +423,7 @@ void RetroDb::buildUpdateQueryValue(const std::map keyType std::map::const_iterator mit = keyTypeMap.begin(); int index = 0; - for(mit=keyTypeMap.begin(); mit!=keyTypeMap.end(); mit++) + for(mit=keyTypeMap.begin(); mit!=keyTypeMap.end(); ++mit) { uint8_t type = mit->second; @@ -472,14 +472,14 @@ void RetroDb::buildUpdateQueryValue(const std::map keyType { paramBindings.push_back(rb); - mit++; + ++mit; if(mit == keyTypeMap.end()) parameter += key + "=?"; else parameter += key + "=?,"; - mit--; + --mit; } } diff --git a/libretroshare/src/util/rsmemcache.h b/libretroshare/src/util/rsmemcache.h index 08a4e3a9a..dfe7c33d6 100644 --- a/libretroshare/src/util/rsmemcache.h +++ b/libretroshare/src/util/rsmemcache.h @@ -317,7 +317,7 @@ template bool RsMemCache::update_lrumap(cons typename std::multimap::iterator sit = mLruMap.lower_bound(old_ts); typename std::multimap::iterator eit = mLruMap.upper_bound(old_ts); - for(mit = sit; mit != eit; mit++) + for(mit = sit; mit != eit; ++mit) { if (mit->second == key) { diff --git a/libretroshare/src/util/rsprint.cc b/libretroshare/src/util/rsprint.cc index cfdb93891..97848b3c0 100644 --- a/libretroshare/src/util/rsprint.cc +++ b/libretroshare/src/util/rsprint.cc @@ -59,7 +59,7 @@ std::string RsUtil::HashId(const std::string &id, bool reverse) if (reverse) { std::string::const_reverse_iterator rit; - for(rit = id.rbegin(); rit != id.rend(); rit++) + for(rit = id.rbegin(); rit != id.rend(); ++rit) { tohash += (*rit); } diff --git a/libretroshare/src/util/rstickevent.cc b/libretroshare/src/util/rstickevent.cc index 69781a4f2..0da21cf4d 100644 --- a/libretroshare/src/util/rstickevent.cc +++ b/libretroshare/src/util/rstickevent.cc @@ -46,7 +46,7 @@ void RsTickEvent::tick_events() { std::multimap::iterator it; - for(it = mEvents.begin(); it != mEvents.end(); it++) + for(it = mEvents.begin(); it != mEvents.end(); ++it) { std::cerr << "\tEvent type: "; std::cerr << it->second << " in " << it->first - now << " secs"; @@ -84,7 +84,7 @@ void RsTickEvent::tick_events() } } - for(it = toProcess.begin(); it != toProcess.end(); it++) + for(it = toProcess.begin(); it != toProcess.end(); ++it) { #ifdef DEBUG_EVENTS std::cerr << "RsTickEvent::tick_events() calling handle_event(";