changed post fixed operator++ into prefixed. More efficient on some systems. Patch from Phenom.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7630 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2014-10-24 22:07:26 +00:00
parent 880efee332
commit d547cb6fdb
82 changed files with 717 additions and 718 deletions

View File

@ -242,7 +242,7 @@ bool CacheSource::cachesAvailable(const RsPeerId& pid, std::map<CacheId, RsCa
/* can overwrite for more control! */
CacheSet::iterator it;
for(it = caches.begin(); it != caches.end(); it++)
for(it = caches.begin(); it != caches.end(); ++it)
{
ids[(it->second).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<RsCacheData> &data)
lockData(); /* LOCK MUTEX */
std::map<RsPeerId, CacheSet>::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<pqiServicePeer> &plist)
{
std::list<pqiServicePeer>::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<pqiServicePeer> &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<CacheId,RsC
*/
std::map<uint16_t, CachePair>::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<uint16_t, CachePair>::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<RsItem *>& saveData)
const RsPeerId& ownId = mServiceCtrl->getOwnId();
std::map<uint16_t, CachePair>::iterator it;
for(it = caches.begin(); it != caches.end(); it++)
for(it = caches.begin(); it != caches.end(); ++it)
{
std::map<CacheId, RsCacheData>::iterator tit;
std::map<CacheId, RsCacheData> 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<RsItem *>& 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<RsItem *>& load)
std::map<std::string, std::set<std::string> > saveFiles;
std::map<std::string, std::set<std::string> >::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<RsCacheConfig *>(*it)))
@ -1060,7 +1060,7 @@ bool CacheStrapper::loadList(std::list<RsItem *>& load)
std::set<std::string>::iterator fit;
#endif
std::map<uint16_t, CachePair>::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<RsItem *>& 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<RsItem *>& load)
#endif
std::set<std::string> 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<RsItem *>& 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<RsFileHash, RsCacheData>::iterator dit;
std::map<RsFileHash, CacheStore *>::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) &&

View File

@ -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<std::string, FileEntry *>::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<SharedDirInfo>& 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<SharedDirInfo> &dirs)
/* get actual list (not pending stuff) */
std::map<std::string, SharedDirInfo>::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<SharedDirInfo>::iterator it;
std::map<std::string, SharedDirInfo>::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<std::string> topdirs;
for(cit = directoryMap.begin(); cit != directoryMap.end(); cit++)
for(cit = directoryMap.begin(); cit != directoryMap.end(); ++cit)
{
topdirs.push_back(cit->first);
}

View File

@ -77,14 +77,14 @@ DirEntry::~DirEntry()
std::map<std::string, DirEntry *>::iterator dit;
std::map<std::string, FileEntry *>::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<std::string, DirEntry *>::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<std::string, DirEntry *>::iterator dit;
std::map<std::string, FileEntry *>::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<DirEntry *> removeList;
std::map<std::string, DirEntry *>::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<DirEntry *>::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<FileEntry *> removeFileList;
std::map<std::string, FileEntry *>::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<FileEntry *>::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<std::string, DirEntry *>::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<std::string, DirEntry *>::iterator it;
for(it = subdirs.begin(); it != subdirs.end(); it++)
for(it = subdirs.begin(); it != subdirs.end(); ++it)
{
(it->second)->print(out);
}
std::map<std::string, FileEntry *>::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<std::string> &inlist, time_t u
{
/* set update time to zero */
std::map<std::string, DirEntry *>::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<std::string> &inlist, time_t u
std::list<std::string>::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<std::string> &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<std::string> &outlist)
{
/* set update time to zero */
std::map<std::string, DirEntry *>::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<std::string, DirEntry *>::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<std::string, DirEntry *>::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<std::string, DirEntry *>::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<std::string, FileEntry *>::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<std::string, DirEntry *>::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<FileEntry *> &result
dirlist.pop_back();
/* add subdirs to stack */
std::map<std::string, DirEntry *>::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<std::string, FileEntry *>::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<std::string>& terms, std::list<FileEn
{
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 (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<std::string>& terms, std::list<FileEn
if (it2 != str1.end()) {
/* first search to see if its parent is in the results list */
bool addDir = true;
for (std::list<FileEntry *>::iterator rit(results.begin()); rit != results.end() && addDir; rit ++) {
for (std::list<FileEntry *>::iterator rit(results.begin()); rit != results.end() && addDir; ++rit) {
DirEntry *de = dynamic_cast<DirEntry *>(*rit);
if (de && (de == root))
continue;
@ -1263,10 +1263,10 @@ int FileIndex::searchTerms(const std::list<std::string>& terms, std::list<FileEn
}
}
for(fit = ndir->files.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<FileEntry *> &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);

View File

@ -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<FileDetail> &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<FileDetail> &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<std::string> keywords, std::list<Di
std::cerr << "FileIndexStore::SearchKeywords()" << std::endl;
#endif
if(flags & RS_FILE_HINTS_REMOTE)
for(pit = indices.begin(); pit != indices.end(); pit++)
for(pit = indices.begin(); pit != indices.end(); ++pit)
{
firesults.clear();
(pit->second)->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<std::string> keywords, std::list<Di
localindex->searchTerms(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<DirDetails> &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<DirDetails> &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);

View File

@ -135,7 +135,7 @@ bool StringExpression :: evalStr ( const std::string &str ){
std::list<std::string>::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;
}

View File

@ -54,7 +54,7 @@ int p3BitDht::getDhtPeers(int lvl, std::list<RsDhtPeer> &peers)
std::list<bdPeer>::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<RsPeerId> &peerIds)
{
RsStackMutex stack(dhtMtx); /*********** LOCKED **********/
std::map<bdNodeId, DhtPeerDetails>::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<RsDhtRelayEnd> &relayEnds)
std::list<UdpRelayEnd>::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<RsDhtRelayProxy> &relayProxies)
std::list<UdpRelayProxy>::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);

View File

@ -2145,7 +2145,7 @@ void p3BitDht::monitorConnections()
std::map<bdNodeId, DhtPeerDetails>::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)

View File

@ -100,7 +100,7 @@ int p3BitDht::pushRelayServers()
}
std::list<std::string>::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<RsItem *> &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<RsItem *> &saveList)
/* add Servers */
std::list<std::string>::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<RsItem *>& load)
int mode = 0;
std::list<RsTlvKeyValue>::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<RsItem *>& 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]);
}

View File

@ -284,14 +284,14 @@ void ftController::searchForDirectSources()
{
RsStackMutex stack(ctrlMutex); /******* LOCKED ********/
for(std::map<RsFileHash,ftFileControl*>::iterator it(mDownloads.begin()); it != mDownloads.end(); it++)
for(std::map<RsFileHash,ftFileControl*>::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<TransferInfo>::const_iterator pit = info.peers.begin(); pit != info.peers.end(); pit++)
for(std::list<TransferInfo>::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<RsFileHash,ftFileControl*>::iterator it(mDownloads.begin()); it != mDownloads.end(); it++)
for(std::map<RsFileHash,ftFileControl*>::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<RsFileHash> &hashs)
RsStackMutex stack(ctrlMutex); /******* LOCKED ********/
std::map<RsFileHash, ftFileControl*>::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<SharedDirInfo>::iterator it;
std::list<SharedDirInfo> 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<RsFileHash, ftFileControl>::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<pqiServicePeer> &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<pqiServicePeer> &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<pqiServicePeer> &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<RsItem *>& 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<RsItem *>& saveData)
std::list<RsFileHash> 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<RsItem *>& 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<RsConfigKeyValueSet *>(*it)))
@ -2174,7 +2174,7 @@ bool ftController::loadList(std::list<RsItem *>& load)
/* make into map */
std::map<std::string, std::string> configMap;
for(kit = rskv->tlvkvs.pairs.begin();
kit != rskv->tlvkvs.pairs.end(); kit++)
kit != rskv->tlvkvs.pairs.end(); ++kit)
{
configMap[kit->key] = kit->value;
}

View File

@ -124,7 +124,7 @@ bool ftDataMultiplex::FileUploads(std::list<RsFileHash> &hashs)
{
RsStackMutex stack(dataMtx); /******* LOCK MUTEX ******/
std::map<RsFileHash, ftFileProvider *>::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<RsFileHash> &hashs)
{
RsStackMutex stack(dataMtx); /******* LOCK MUTEX ******/
std::map<RsFileHash, ftClient>::iterator cit;
for(cit = mClients.begin(); cit != mClients.end(); cit++)
for(cit = mClients.begin(); cit != mClients.end(); ++cit)
{
hashs.push_back(cit->first);
}

View File

@ -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<RsItem *>& 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<RsItem *>& sList)
RsConfigKeyValueSet *rskv = new RsConfigKeyValueSet();
/* Convert to TLV */
for(std::map<std::string,std::string>::const_iterator mit = configMap.begin(); mit != configMap.end(); mit++)
for(std::map<std::string,std::string>::const_iterator mit = configMap.begin(); mit != configMap.end(); ++mit)
{
RsTlvKeyValue kv;
kv.key = mit->first;
@ -298,7 +298,7 @@ bool ftFiMonitor::loadList(std::list<RsItem *>& load)
std::list<SharedDirInfo> dirList;
std::list<RsItem *>::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<RsItem *>& load)
std::map<std::string, std::string> configMap;
std::map<std::string, std::string>::const_iterator mit ;
for(std::list<RsTlvKeyValue>::const_iterator kit = rskv->tlvkvs.pairs.begin(); kit != rskv->tlvkvs.pairs.end(); kit++)
for(std::list<RsTlvKeyValue>::const_iterator kit = rskv->tlvkvs.pairs.begin(); kit != rskv->tlvkvs.pairs.end(); ++kit)
{
configMap[kit->key] = kit->value;
}

View File

@ -250,7 +250,7 @@ bool ftExtraList::cleanupOldFiles()
std::list<RsFileHash>::iterator rit;
std::map<RsFileHash, FileDetails>::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<RsItem *>& sList)
std::map<RsFileHash, FileDetails>::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<RsItem *>& load)
std::list<RsItem *>::iterator it;
for(it = load.begin(); it != load.end(); it++)
for(it = load.begin(); it != load.end(); ++it)
{
RsFileConfigItem *fi = dynamic_cast<RsFileConfigItem *>(*it);

View File

@ -555,7 +555,7 @@ bool ftFileCreator::locked_printChunkMap()
std::map<uint64_t, ftChunk>::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 ;

View File

@ -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();

View File

@ -115,7 +115,7 @@ bool ftTransferModule::setFileSources(const std::list<RsPeerId>& peerIds)
#endif
std::list<RsPeerId>::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<RsPeerId> &peerIds)
{
RsStackMutex stack(tfMtx); /******* STACK LOCKED ******/
std::map<RsPeerId,peerInfo>::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<RsPeerId,peerInfo>::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<RsPeerId,peerInfo>::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()";

View File

@ -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);
}

View File

@ -565,7 +565,7 @@ int RsDataService::storeMessage(std::map<RsNxsMsg *, RsGxsMsgMetaData *> &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<RsNxsMsg *, RsGxsMsgMetaData *> &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<RsNxsGrp *, RsGxsGrpMetaData *> &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<RsNxsGrp *, RsGxsGrpMetaData *> &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<RsNxsGrp *, RsGxsGrpMetaData *> &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<RsNxsGrp *, RsGxsGrpMetaData *> &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<RsGxsGroupId, RsNxsGrp *> &grp, bool
locked_retrieveGroups(c, grps);
std::vector<RsNxsGrp*>::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<RsGxsGroupId, RsNxsGrp *> &grp, bool
std::list<RsGxsGroupId> 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<RsGxsGroupId, RsNxsGrp *> &grp, bool
{
std::map<RsGxsGroupId, RsGxsGrpMetaData*> metaMap;
std::map<RsGxsGroupId, RsNxsGrp *>::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<RsGxsMessageId>::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<RsNxsMsg*>::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<RsNxsMsg*>& 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<RsGxsMsgMetaData*>& msgMetaV = metaResult[grpId];
std::vector<RsGxsMsgMetaData*>::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<RsGxsMessageId>::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<RsGxsGroupId, RsGxsGrpMetaDat
{
std::map<RsGxsGroupId, RsGxsGrpMetaData *>::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<RsGxsMessageId>& msgIdV = mit->second;
@ -1358,7 +1358,7 @@ int RsDataService::removeMsgs(const GxsMsgReq& msgIds)
std::vector<MsgOffset>::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<MsgOffset>::size_type i = 0; i < msgOffsets.size(); i++)
for(std::vector<MsgOffset>::size_type i = 0; i < msgOffsets.size(); ++i)
{
const MsgOffset& m = msgOffsets[i];
@ -1431,7 +1431,7 @@ int RsDataService::removeGroups(const std::vector<RsGxsGroupId> &grpIds)
// from db
std::vector<RsGxsGroupId>::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<MsgUpdate>& updateV = mit->second;
std::vector<MsgUpdate>::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<RsGxsMessageId>& msgsV = mit->second;
std::vector<RsGxsMessageId>::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<RsGxsGroupId>& g
std::vector<RsGxsGroupId>::const_iterator vit = grpIds.begin();
for(; vit != grpIds.end(); vit++)
for(; vit != grpIds.end(); ++vit)
{
const RsGxsGroupId& grpId = *vit;

View File

@ -378,7 +378,7 @@ uint8_t RsGenExchange::createGroup(RsNxsGrp *grp, RsTlvSecurityKeySet& privateKe
std::map<RsGxsId, RsTlvSecurityKey>::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<RsGxsId, RsTlvSecurityKey>::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<RsGxsId, RsTlvSecurityKey>::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<RsGxsNotify*>& changes)
#endif
std::vector<RsGxsNotify*>::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<RsGxsGroupId>& grpIds, std::list<RsG
RsGxsGroupChange* gc = mGroupChange.back();
std::list<RsGxsGroupId>& gList = gc->mGrpIdList;
std::list<RsGxsGroupId>::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<RsGroupMetaDat
std::list<RsGxsGrpMetaData*>::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<RsGxsMsgMetaData*>& metaV = mit->second;
@ -1181,7 +1181,7 @@ bool RsGenExchange::getMsgMeta(const uint32_t &token,
std::vector<RsGxsMsgMetaData*>::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<RsGxsMsgMetaData*>& metaV = mit->second;
@ -1210,7 +1210,7 @@ bool RsGenExchange::getMsgRelatedMeta(const uint32_t &token, GxsMsgRelatedMetaMa
std::vector<RsGxsMsgMetaData*>::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::vector<RsGxsGrpItem
if(ok)
{
for(; lit != nxsGrps.end(); lit++)
for(; lit != nxsGrps.end(); ++lit)
{
RsTlvBinaryData& data = (*lit)->grp;
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<RsGxsMsgItem*> gxsMsgItems;
const RsGxsGroupId& grpId = mit->first;
std::vector<RsNxsMsg*>& nxsMsgsV = mit->second;
std::vector<RsNxsMsg*>::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<RsGxsMsgItem*> gxsMsgItems;
const RsGxsGrpMsgIdPair& msgId = mit->first;
std::vector<RsNxsMsg*>& nxsMsgsV = mit->second;
std::vector<RsNxsMsg*>::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<RsNxsGrp *> &groups)
std::vector<RsNxsGrp*>::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<RsNxsMsg *>& messages)
std::vector<RsNxsMsg*>::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<uint32_t, MsgLocMetaData>::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<uint32_t, GrpLocMetaData>::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<RsGxsMsgItem*, uint32_t>& item = sign_it->second;
mMsgsToPublish.insert(std::make_pair(sign_it->first, item.mItem));
@ -1791,7 +1791,7 @@ void RsGenExchange::publishMsgs()
std::map<RsGxsGroupId, std::vector<RsGxsMessageId> > msgChangeMap;
std::map<uint32_t, RsGxsMsgItem*>::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<RsGxsGroupId, RsGxsGrpMetaData*> grpMeta;
std::vector<GroupUpdatePublish>::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<uint32_t, GrpNote> toNotify;
std::vector<GroupDeletePublish>::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<RsGxsGroupId> grpDeleted;
std::map<uint32_t, GrpNote>::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<RsGxsId, RsTlvSecurityKey>::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<uint32_t, GrpNote>::iterator mit = toNotify.begin();
std::list<RsGxsGroupId> 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<RsGxsGroupId, RsGxsGrpMetaData*> 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<RsGxsGroupId, RsGxsGrpMetaData*> grpMetas;
std::vector<GroupUpdate>::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<RsGxsGroupId, RsGxsGrpMetaData*>::iterator mit =
@ -2753,7 +2753,7 @@ void RsGenExchange::performUpdateValidation()
vit = mGroupUpdates.begin();
std::map<RsNxsGrp*, RsGxsGrpMetaData*> 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];

View File

@ -323,7 +323,7 @@ protected:
bool ok = getGroupData(token, items);
std::vector<RsGxsGrpItem*>::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<RsGxsMsgItem*>& mv = mit->second;
std::vector<RsGxsMsgItem*>::iterator vit = mv.begin();
for(; vit != mv.end(); vit++)
for(; vit != mv.end(); ++vit)
{
RsGxsMsgItem* mi = *vit;
MsgType* mt = dynamic_cast<MsgType*>(mi);
@ -415,14 +415,14 @@ protected:
if(ok)
{
for(; mit != msgResult.end(); mit++)
for(; mit != msgResult.end(); ++mit)
{
std::vector<MsgType> gxsMsgItems;
const RsGxsGrpMsgIdPair& msgId = mit->first;
std::vector<RsNxsMsg*>& nxsMsgsV = mit->second;
std::vector<RsNxsMsg*>::iterator vit
= nxsMsgsV.begin();
for(; vit != nxsMsgsV.end(); vit++)
for(; vit != nxsMsgsV.end(); ++vit)
{
RsNxsMsg*& msg = *vit;
RsItem* item = NULL;

View File

@ -184,7 +184,7 @@ bool RsGxsDataAccess::requestMsgInfo(uint32_t &token, uint32_t ansType,
GxsMsgReq::const_iterator mit = msgIds.begin();
std::vector<RsGxsGroupId> 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<RsGxsMessageId>();
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<RsGxsMessageId>();
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<RsGxsMessageId>();
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<RsGxsGroupId>::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<RsGxsGroupId, RsNxsGrp*>::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<RsGxsGroupId>::const_iterator lit = grpIdsOut.begin();
for(; lit != grpIdsOut.end(); lit++)
for(; lit != grpIdsOut.end(); ++lit)
grpMeta[*lit] = NULL;
mDataStore->retrieveGxsGrpMetaData(grpMeta);
std::map<RsGxsGroupId, RsGxsGrpMetaData*>::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<RsGxsGroupId>& grpIdsIn, cons
std::list<RsGxsGroupId>::const_iterator lit = grpIdsIn.begin();
for(; lit != grpIdsIn.end(); lit++)
for(; lit != grpIdsIn.end(); ++lit)
grpMeta[*lit] = NULL;
mDataStore->retrieveGxsGrpMetaData(grpMeta);
std::map<RsGxsGroupId, RsGxsGrpMetaData*>::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<RsGxsMessageId, std::pair<RsGxsMessageId, time_t> > origMsgTs;
std::map<RsGxsMessageId, std::pair<RsGxsMessageId, time_t> >::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<RsGxsMsgMetaData*>::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<RsGxsGrpMsgIdPair>::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<RsGxsMessageId> 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<RsGxsMessageId, std::pair<RsGxsMessageId, time_t> > origMsgTs;
std::map<RsGxsMessageId, std::pair<RsGxsMessageId, time_t> >::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<RsGxsMsgMetaData*>& metaV = mit->second;
std::vector<RsGxsMsgMetaData*>::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<RsGxsMsgMetaData*>& msgMetaV = mit->second;
std::vector<RsGxsMsgMetaData*>::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<RsGxsGroupId> &grpIds, const RsTok
if(keep)
{
lit++;
++lit;
}else
{
lit = grpIds.erase(lit);
@ -1749,7 +1749,7 @@ void RsGxsDataAccess::tokenList(std::list<uint32_t>& tokens)
std::map<uint32_t, GxsRequest*>::iterator mit = mRequests.begin();
for(; mit != mRequests.end(); mit++)
for(; mit != mRequests.end(); ++mit)
{
tokens.push_back(mit->first);
}

View File

@ -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<RsNxsItem*> 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<RsNxsItem*> 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<GrpIdCircleVet>::iterator cit = grpPend->mGrpCircleV.begin();
uint32_t transN = locked_getTransactionId();
std::list<RsNxsItem*> 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<RsGxsGroupId> grpIds;
for(; vit != fragments.end(); vit++)
for(; vit != fragments.end(); ++vit)
grpIds.insert( (*vit)->grpId );
std::set<RsGxsGroupId>::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<RsGxs
MsgFragments::iterator vit = fragments.begin();
std::set<RsGxsMessageId> msgIds;
for(; vit != fragments.end(); vit++)
for(; vit != fragments.end(); ++vit)
msgIds.insert( (*vit)->msgId );
std::set<RsGxsMessageId>::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::map<RsGxs
MsgFragCollate(msgId));
// something will always be found for a group id
for(vit = fragments.begin(); vit != bound; vit++ )
for(vit = fragments.begin(); vit != bound; ++vit )
{
partFragments[msgId].push_back(*vit);
}
@ -604,7 +604,7 @@ void RsGxsNetService::collateMsgFragments(MsgFragments fragments, std::map<RsGxs
{
MsgFragments::iterator vit2 = f.begin();
for(; vit2 != f.end(); vit2++)
for(; vit2 != f.end(); ++vit2)
delete *vit2;
partFragments.erase(msgId);
@ -974,7 +974,7 @@ void RsGxsNetService::updateServerSyncTS()
bool change = false;
for(; mit != gxsMap.end(); mit++)
for(; mit != gxsMap.end(); ++mit)
{
const RsGxsGroupId& grpId = mit->first;
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<uint32_t>::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<RsGxsGroupId, MsgFragments >::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<RsNxsItem*>::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<RsNxsSyncMsgItem*>(*lit);
if(item)
@ -1569,7 +1569,7 @@ void RsGxsNetService::locked_genReqMsgTransaction(NxsTransaction* tr)
std::set<RsGxsMessageId> 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<RsPeerId> 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<RsNxsItem*>::iterator lit = tr->mItems.begin();
for(; lit != tr->mItems.end(); lit++)
for(; lit != tr->mItems.end(); ++lit)
{
RsNxsSyncGrpItem* item = dynamic_cast<RsNxsSyncGrpItem*>(*lit);
if(item)
@ -1729,7 +1729,7 @@ void RsGxsNetService::locked_genReqGrpTransaction(NxsTransaction* tr)
std::list<RsPeerId> 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<RsGxsGroupId, RsGxsGrpMetaData*>::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<RsGxsGroupId, RsNxsGrp*> grps;
for(;lit != tr->mItems.end(); lit++)
for(;lit != tr->mItems.end(); ++lit)
{
RsNxsSyncGrpItem* item = dynamic_cast<RsNxsSyncGrpItem*>(*lit);
if (item)
@ -1845,7 +1845,7 @@ void RsGxsNetService::locked_genSendGrpsTransaction(NxsTransaction* tr)
// store grp items to send in transaction
std::map<RsGxsGroupId, RsNxsGrp*>::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<RsNxsSyncMsgItem*>(*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<RsNxsMsg*>& msgV = mit->second;
std::vector<RsNxsMsg*>::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<RsNxsItem*>::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<RsGxsMsgMetaData*>::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<RsGxsMsgMetaData*>::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<RsGxsMsgMetaData*>& msgMet
std::vector<MsgIdCircleVet> toVet;
std::vector<RsGxsMsgMetaData*>::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<RsGxsMsgMetaData*>& msgMet
std::vector<MsgIdCircleVet> toVet;
std::vector<RsGxsMsgMetaData*>::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<RsPeerId, std::list<RsGxsGroupId> >::const_iterator cit = mExplicitRequest.begin();
for(; cit != mExplicitRequest.end(); cit++)
for(; cit != mExplicitRequest.end(); ++cit)
{
const RsPeerId& peerId = cit->first;
const std::list<RsGxsGroupId>& groupIdList = cit->second;
@ -2723,7 +2723,7 @@ void RsGxsNetService::processExplicitGroupRequests()
std::list<RsNxsItem*> grpSyncItems;
std::list<RsGxsGroupId>::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<RsGxsGroupId>::const_iterator lit = toDelete.begin(); lit != toDelete.end(); lit++)
for(std::list<RsGxsGroupId>::const_iterator lit = toDelete.begin(); lit != toDelete.end(); ++lit)
mPendingPublishKeyRecipients.erase(*lit);
}

View File

@ -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<RsNxsItem*>::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<GrpIdCircleVet>::size_type i, count;
for(i = 0; i < mGrpCircleV.size(); i++)
for(i = 0; i < mGrpCircleV.size(); ++i)
{
GrpIdCircleVet& gic = mGrpCircleV[i];

View File

@ -39,7 +39,7 @@ RsGxsMessageCleanUp::RsGxsMessageCleanUp(RsGeneralDataService* const dataService
std::map<RsGxsGroupId, RsGxsGrpMetaData*>::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<RsGxsMsgMetaData*>& metaV = mit->second;
std::vector<RsGxsMsgMetaData*>::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<RsGxsGroupId, RsNxsGrp*>::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<RsNxsMsg*>& msgV = mit->second;
std::vector<RsNxsMsg*>::iterator vit = msgV.begin();
for(; vit != msgV.end(); vit++)
for(; vit != msgV.end(); ++vit)
{
RsNxsMsg* msg = *vit;
RsFileHash currHash;

View File

@ -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;

View File

@ -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<RsPgpId,PGPCertificateInfo>::const_iterator it(_public_keyring_map.begin()); it != _public_keyring_map.end(); it++)
for(std::map<RsPgpId,PGPCertificateInfo>::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<RsPgpId>::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) ;

View File

@ -444,7 +444,7 @@ bool RsPluginManager::loadList(std::list<RsItem*>& list)
RsFileHash reference_executable_hash ;
std::list<RsItem *>::iterator it;
for(it = list.begin(); it != list.end(); it++)
for(it = list.begin(); it != list.end(); ++it)
{
RsConfigKeyValueSet *witem = dynamic_cast<RsConfigKeyValueSet *>(*it) ;

View File

@ -213,7 +213,7 @@ void AuthGPG::processServices()
RsStackMutex stack(gpgMtxService); /******* LOCKED ******/
std::list<AuthGPGService*>::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<RsItem*>& load)
RsStackMutex stack(gpgMtxData); /******* LOCKED ******/
/* load the list of accepted gpg keys */
std::list<RsItem *>::iterator it;
for(it = load.begin(); it != load.end(); it++)
for(it = load.begin(); it != load.end(); ++it)
{
RsConfigKeyValueSet *vitem = dynamic_cast<RsConfigKeyValueSet *>(*it);
if(vitem)
@ -707,7 +707,7 @@ bool AuthGPG::loadList(std::list<RsItem*>& load)
#endif
std::list<RsTlvKeyValue>::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"));
}

View File

@ -1633,7 +1633,7 @@ bool AuthSSLimpl::saveList(bool& cleanup, std::list<RsItem*>& lst)
// Now save config for network digging strategies
RsConfigKeyValueSet *vitem = new RsConfigKeyValueSet ;
std::map<RsPeerId, sslcert*>::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<RsItem*>& load)
/* load the list of accepted gpg keys */
std::list<RsItem *>::iterator it;
for(it = load.begin(); it != load.end(); it++) {
for(it = load.begin(); it != load.end(); ++it) {
RsConfigKeyValueSet *vitem = dynamic_cast<RsConfigKeyValueSet *>(*it);
if(vitem) {
@ -1669,7 +1669,7 @@ bool AuthSSLimpl::loadList(std::list<RsItem*>& load)
#endif
std::list<RsTlvKeyValue>::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;
}

View File

@ -58,7 +58,7 @@ void p3ConfigMgr::tick()
/* iterate through and check if any have changed */
std::list<pqiConfig *>::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<pqiConfig *>::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<pqiConfig *>::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<RsItem *>& savelist)
RsConfigKeyValueSet *item = new RsConfigKeyValueSet();
std::map<std::string, std::string>::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<RsItem *>& 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;
}

View File

@ -218,8 +218,8 @@ bool p3HistoryMgr::saveList(bool& cleanup, std::list<RsItem*>& saveData)
std::map<RsPeerId, std::map<uint32_t, RsHistoryMsgItem*> >::iterator mit;
std::map<uint32_t, RsHistoryMsgItem*>::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<RsItem*>& load)
RsHistoryMsgItem *msgItem;
std::list<RsItem*>::iterator it;
for (it = load.begin(); it != load.end(); it++) {
for (it = load.begin(); it != load.end(); ++it) {
if (NULL != (msgItem = dynamic_cast<RsHistoryMsgItem*>(*it))) {
std::map<RsPeerId, std::map<uint32_t, RsHistoryMsgItem*> >::iterator mit = mMessages.find(msgItem->chatPeerId);
@ -307,7 +307,7 @@ bool p3HistoryMgr::loadList(std::list<RsItem*>& load)
RsConfigKeyValueSet *rskv ;
if (NULL != (rskv = dynamic_cast<RsConfigKeyValueSet*>(*it))) {
for (std::list<RsTlvKeyValue>::const_iterator kit = rskv->tlvkvs.pairs.begin(); kit != rskv->tlvkvs.pairs.end(); kit++) {
for (std::list<RsTlvKeyValue>::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<HistoryMsg>
{
std::map<uint32_t, RsHistoryMsgItem*>::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<RsPeerId, std::map<uint32_t, RsHistoryMsgItem*> >::iterator mit;
for (mit = mMessages.begin(); mit != mMessages.end(); mit++) {
for (mit = mMessages.begin(); mit != mMessages.end(); ++mit) {
std::map<uint32_t, RsHistoryMsgItem*>::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<uint32_t, RsHistoryMsgItem*>::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();

View File

@ -221,7 +221,7 @@ void p3LinkMgrIMPL::getOnlineList(std::list<RsPeerId> &ssl_peers)
RsStackMutex stack(mLinkMtx); /****** STACK LOCK MUTEX *******/
std::map<RsPeerId, peerConnectState>::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<RsPeerId> &ssl_peers)
RsStackMutex stack(mLinkMtx); /****** STACK LOCK MUTEX *******/
std::map<RsPeerId, peerConnectState>::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<RsPeerId, peerConnectState>::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<pqiMonitor *>::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<pqiMonitor *>::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<struct sockaddr_storage>::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<peerConnectAddress> &addrList,
#endif
std::list<peerConnectAddress>::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<RsPeerId, peerConnectState>::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;

View File

@ -280,7 +280,7 @@ void p3NetMgrIMPL::netReset()
std::cerr << "p3NetMgrIMPL::netReset() resetting listeners" << std::endl;
#endif
std::list<pqiNetListener *>::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<uint32_t, pqiNetAssistFirewall *>::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<uint32_t, pqiNetAssistFirewall *>::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<uint32_t, pqiNetAssistFirewall *>::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<uint32_t, pqiNetAssistFirewall *>::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<uint32_t, pqiNetAssistFirewall *>::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<uint32_t, pqiNetAssistFirewall *>::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<uint32_t, pqiNetAssistConnect *>::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<uint32_t, pqiNetAssistConnect *>::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<uint32_t, pqiNetAssistConnect *>::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<uint32_t, pqiNetAssistConnect *>::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<uint32_t, pqiNetAssistConnect *>::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<uint32_t, pqiNetAssistConnect *>::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<uint32_t, pqiNetAssistConnect *>::iterator it;
for(it = mDhts.begin(); it != mDhts.end(); it++)
for(it = mDhts.begin(); it != mDhts.end(); ++it)
{
(it->second)->tick();
}
std::map<uint32_t, pqiNetAssistFirewall *>::iterator fit;
for(fit = mFwAgents.begin(); fit != mFwAgents.end(); fit++)
for(fit = mFwAgents.begin(); fit != mFwAgents.end(); ++fit)
{
(fit->second)->tick();
}

View File

@ -218,7 +218,7 @@ bool p3Notify::ClearFeedItems(uint32_t type)
}
else
{
it++;
++it;
}
}
return true;

View File

@ -601,7 +601,7 @@ bool p3PeerMgrIMPL::haveOnceConnected()
/* check for existing */
std::map<RsPeerId, peerState>::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<RsPeerId, peerState>::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<RsPeerId>::iterator rit = sslid_toRemove.begin(); rit != sslid_toRemove.end(); rit++)
for(std::list<RsPeerId>::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<RsPeerId>::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<RsPeerId, peerState>::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<RsPeerId>::iterator rit = sslid_toRemove.begin(); rit != sslid_toRemove.end(); rit++)
for(std::list<RsPeerId>::iterator rit = sslid_toRemove.begin(); rit != sslid_toRemove.end(); ++rit)
if (mFriendList.end() != (it = mFriendList.find(*rit)))
mFriendList.erase(it);
std::map<RsPgpId,ServicePermissionFlags>::iterator it2 ;
for(std::list<RsPgpId>::iterator rit = pgpid_toRemove.begin(); rit != pgpid_toRemove.end(); rit++)
for(std::list<RsPgpId>::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<RsPeerId>::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<RsPeerId, peerState>::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<RsItem *>& saveData)
/* iterate through all friends and save */
std::map<RsPeerId, peerState>::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<RsItem *>& saveData)
/* save groups */
std::list<RsPeerGroupItem *>::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<RsItem *>::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<RsItem *>& load)
/* load the list of peers */
std::list<RsItem *>::iterator it;
for(it = load.begin(); it != load.end(); it++)
for(it = load.begin(); it != load.end(); ++it)
{
RsPeerNetItem *pitem = dynamic_cast<RsPeerNetItem *>(*it);
if (pitem)
@ -1717,7 +1717,7 @@ bool p3PeerMgrIMPL::loadList(std::list<RsItem *>& load)
std::cerr << std::endl;
#endif
std::list<RsTlvKeyValue>::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<RsItem *>& load)
bool foundStandardGroup[standardGroupCount] = { false, false, false, false, false };
std::list<RsPeerGroupItem *>::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<RsItem *>& 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<RsPeerGroupItem*>::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<RsPeerGroupItem*>::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<RsPeerGroupItem*>::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<RsGroupInfo> &groupInfoList)
RsStackMutex stack(mPeerMtx); /****** STACK LOCK MUTEX *******/
std::list<RsPeerGroupItem*>::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<RsPeerGroupItem*>::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<RsPgpId>::const_iterator peerIt;
for (peerIt = peerIds.begin(); peerIt != peerIds.end(); peerIt++) {
for (peerIt = peerIds.begin(); peerIt != peerIds.end(); ++peerIt) {
std::list<RsPgpId>::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<RsPeerId>::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<RsPeerId
int count = 0;
std::map<RsPeerId, peerState>::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<RsPeerId, peerState>::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<RsPeerId>::iterator it;
for(it = toRemove.begin(); it != toRemove.end(); it++)
for(it = toRemove.begin(); it != toRemove.end(); ++it)
{
removeFriend(*it,false);
}

View File

@ -152,7 +152,7 @@ void p3ServiceControl::getServiceChanges(std::set<RsPeerId> &updateSet)
#endif
std::set<RsPeerId>::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<uint32_t, RsServiceInfo>::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<RsPeerId>::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<RsPeerId>::const_iterator pit;
std::map<RsPeerId, RsPeerServiceInfo>::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<RsPeerId, ServicePeerFilter>::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<uint32_t, bool>::const_iterator cit;
for(cit = changes.begin(); cit != changes.end(); cit++)
for(cit = changes.begin(); cit != changes.end(); ++cit)
{
ServiceNotifications &notes = mNotifications[cit->first];
if (cit->second)
@ -988,7 +988,7 @@ void p3ServiceControl::statusChange(const std::list<pqipeer> &plist)
#endif
std::list<pqipeer>::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<uint32_t, pqiServiceMonitor *>::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<uint32_t, ServiceNotifications>::const_iterator it;
std::multimap<uint32_t, pqiServiceMonitor *>::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<pqiServicePeer> peers;
std::set<RsPeerId>::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<uint32_t, RsServiceInfo>::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<uint32_t>::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 << " ";
}

View File

@ -70,7 +70,7 @@ int pqihandler::tick()
// tick all interfaces...
std::map<RsPeerId, SearchModule *>::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<RsPeerId, SearchModule *>::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<RsPeerId, RsBwRates> &ratemap, RsBwRat
RsStackMutex stack(coreMtx); /**************** LOCKED MUTEX ****************/
std::map<RsPeerId, SearchModule *>::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) {

View File

@ -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<pqiIpAddress>::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<pqiIpAddress>::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))
{

View File

@ -171,7 +171,7 @@ bool getLocalInterfaces_ipv4(struct in_addr &/*routeAddr*/, std::list<struct in_
}
// loop through the interfaces.
for(; ifptr->if_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<struct soc
if (getLocalInterfaces_ipv4(existing_addr, local_addrs))
{
std::list<struct in_addr>::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 */

View File

@ -56,7 +56,7 @@ pqiperson::~pqiperson()
// clean up the children.
std::map<uint32_t, pqiconnect *>::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<uint32_t, pqiconnect *>::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<uint32_t, pqiconnect *>::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<uint32_t, pqiconnect *>::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<uint32_t, pqiconnect *>::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<uint32_t, pqiconnect *>::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<uint32_t, pqiconnect *>::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<uint32_t, pqiconnect *>::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);
}

View File

@ -272,7 +272,7 @@ void pqipersongrp::statusChange(const std::list<pqipeer> &plist)
/* iterate through, only worry about the friends */
std::list<pqipeer>::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<RsPeerId>::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<RsPeerId>::iterator cit;
for(cit = toConnect.begin(); cit != toConnect.end(); cit++)
for(cit = toConnect.begin(); cit != toConnect.end(); ++cit)
{
connectPeer(*cit, true);
}

View File

@ -182,7 +182,7 @@ int p3ServiceServer::tick()
std::map<uint32_t, pqiService *>::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

View File

@ -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<RsPeerId, pqissl *>::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<RsPeerId, pqissl *>::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;
}
}

View File

@ -389,12 +389,12 @@ bool pqiSSLstore::encryptedSendItems(const std::list<RsItem*>& 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);

View File

@ -333,7 +333,7 @@ bool p3Peers::getPeerDetails(const RsPeerId& id, RsPeerDetails &d)
std::list<pqiIpAddress>::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<RsPgpId>::const_iterator it;
for(it = detail.gpgSigners.begin();
it != detail.gpgSigners.end(); it++)
it != detail.gpgSigners.end(); ++it)
{
out << "\t" << *it;
out << std::endl;

View File

@ -116,7 +116,7 @@ bool RsAccountsDetail::selectAccountByString(const std::string &prefUserString)
bool pgpNameFound = false;
std::map<RsPeerId, AccountDetails>::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<RsPeerId> &ids)
std::map<RsPeerId, AccountDetails>::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<RsPeerId, AccountDetails> &
/* 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

View File

@ -1028,7 +1028,7 @@ int RsServer::StartupRetroShare()
//load all the SSL certs as friends
// std::list<std::string> sslIds;
// AuthSSL::getAuthSSL()->getAuthenticatedList(sslIds);
// for (std::list<std::string>::iterator sslIdsIt = sslIds.begin(); sslIdsIt != sslIds.end(); sslIdsIt++) {
// for (std::list<std::string>::iterator sslIdsIt = sslIds.begin(); sslIdsIt != sslIds.end(); ++sslIdsIt) {
// mConnMgr->addFriend(*sslIdsIt);
// }
//p3DhtMgr *mDhtMgr = new OpenDHTMgr(ownId, mConnMgr, rsInitConfig->configDir);

View File

@ -1179,7 +1179,7 @@ std::ostream &RsPeerGroupItem::print(std::ostream &out, uint16_t indent)
out << "groupFlag: " << flag << std::endl;
std::list<RsPgpId>::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;
}

View File

@ -357,7 +357,7 @@ bool RsGxsChannelPostItem::fromChannelPost(RsGxsChannelPost &post, bool moveImag
}
std::list<RsGxsFile>::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<RsTlvFileItem>::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);

View File

@ -68,7 +68,7 @@ std::ostream& RsGxsMsgUpdateItem::print(std::ostream& out, uint16_t indent)
std::map<RsGxsGroupId, uint32_t>::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<RsGxsGroupId, uint32_t>& msgUpdateTS = item->msgUpdateTS;
std::map<RsGxsGroupId, uint32_t>::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);

View File

@ -1585,7 +1585,7 @@ std::ostream& RsMsgTags::print(std::ostream &out, uint16_t indent)
std::list<uint32_t>::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<uint32_t>::iterator mit = tagIds.begin();
for(;mit != tagIds.end(); mit++)
for(;mit != tagIds.end(); ++mit)
ok &= setRawUInt32(data, tlvsize, &offset, *mit);
if (offset != tlvsize)

View File

@ -244,7 +244,7 @@ RsSerialiser::~RsSerialiser()
{
/* clean up the map */
std::map<uint32_t, RsSerialType *>::iterator it;
for(it = serialisers.begin(); it != serialisers.end(); it++)
for(it = serialisers.begin(); it != serialisers.end(); ++it)
{
delete (it->second);
}

View File

@ -563,7 +563,7 @@ std::ostream &RsTlvKeySignatureSet::print(std::ostream &out, uint16_t indent) co
std::map<SignType, RsTlvKeySignature>::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;

View File

@ -151,8 +151,8 @@ bool p3BanList::recvBanItem(RsBanListItem *item)
bool updated = false;
std::list<RsTlvBanListEntry>::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<RsPeerId, BanList>::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<struct sockaddr_storage, BanListPeer>::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<RsPeerId>::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<struct sockaddr_storage, BanListPeer>::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<struct sockaddr_storage, BanListPeer>::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<RsPeerId, BanList>::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<struct sockaddr_storage, BanListPeer>::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);

View File

@ -128,7 +128,7 @@ bool p3BandwidthControl::checkAvailableBandwidth()
time_t now = time(NULL);
std::list<RsPeerId> 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<RsPeerId, RsConfigDataRate
RsStackMutex stack(mBwMtx); /****** LOCKED MUTEX *******/
std::map<RsPeerId, BwCtrlData>::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<RsPeerId, BwCtrlData>::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<pqiServicePeer> &plist)
{
std::list<pqiServicePeer>::const_iterator it;
for (it = plist.begin(); it != plist.end(); it++)
for (it = plist.begin(); it != plist.end(); ++it)
{
RsStackMutex stack(mBwMtx); /****** LOCKED MUTEX *******/

View File

@ -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<ChatLobbyId>::iterator it;
for (it = chatLobbyToSubscribe.begin(); it != chatLobbyToSubscribe.end(); it++)
for (it = chatLobbyToSubscribe.begin(); it != chatLobbyToSubscribe.end(); ++it)
joinVisibleChatLobby(*it);
for(std::list<ChatLobbyId>::const_iterator it = invitationNeeded.begin();it!=invitationNeeded.end();++it)
@ -1524,7 +1524,7 @@ bool p3ChatService::getPrivateChatQueueIds(bool incoming, std::list<RsPeerId> &i
}
std::list<RsChatMsgItem *>::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<RsChatMsgItem *>::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<RsPeerId>::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<pqiServicePeer> &plist)
{
std::list<pqiServicePeer>::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<pqiServicePeer> &plist)
continue;
}
cit++;
++cit;
}
} /* UNLOCKED */

View File

@ -77,7 +77,7 @@ bool populateContactInfo(const peerState &detail, RsDiscContactItem *pkt)
void DiscPgpInfo::mergeFriendList(const std::list<PGPID> &friends)
{
std::list<PGPID>::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<PGPID, DiscPgpInfo>::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<PGPID>::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<PGPID> &friendSet = ait->second.mFriendSet;
std::set<PGPID>::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<SSLID, DiscSslInfo>::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<SSLID, DiscSslInfo>::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<RsPgpId>::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<pqiServicePeer> &plist)
//#endif
std::list<pqiServicePeer>::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<RsPeerId> &proxy
// For each of their friends that we know, grab that set of SSLIDs.
const std::set<PGPID> &friendSet = it->second.mFriendSet;
std::set<PGPID>::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<RsPeerId> &proxy
std::map<SSLID, DiscSslInfo>::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<PGPID> &prox
}
std::set<PGPID>::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);
}

View File

@ -163,7 +163,7 @@ void p3Dsdv::advanceLocalSequenceNumbers()
time_t now = time(NULL);
std::map<std::string, RsDsdvTableEntry>::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<std::string, RsDsdvTableEntry>::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<RsPeerId>::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<std::string, RsDsdvTableEntry>::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<RsTlvDsdvEntry>::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<std::string, RsDsdvTableEntry>::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<std::string, RsDsdvTableEntry>::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<pqiServicePeer> &plist)
{
std::list<pqiServicePeer>::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<std::string, RsDsdvTableEntry>::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<std::string> &hashes)
/* iterate over the entries */
std::map<std::string, RsDsdvTableEntry>::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<std::string> &hashes)
/* iterate over the entries */
std::map<std::string, RsDsdvTableEntry>::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<RsPeerId, RsDsdvRoute>::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;
}

View File

@ -132,7 +132,7 @@ void p3GxsChannels::notifyChanges(std::vector<RsGxsNotify *> &changes)
std::list<RsGxsGroupId> unprocessedGroups;
std::vector<RsGxsNotify *>::iterator it;
for(it = changes.begin(); it != changes.end(); it++)
for(it = changes.begin(); it != changes.end(); ++it)
{
RsGxsMsgChange *msgChange = dynamic_cast<RsGxsMsgChange *>(*it);
if (msgChange && !msgChange->metaChange())
@ -142,7 +142,7 @@ void p3GxsChannels::notifyChanges(std::vector<RsGxsNotify *> &changes)
std::map<RsGxsGroupId, std::vector<RsGxsMessageId> > &msgChangeMap = msgChange->msgChangeMap;
std::map<RsGxsGroupId, std::vector<RsGxsMessageId> >::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<RsGxsChannel
{
std::vector<RsGxsGrpItem*>::iterator vit = grpData.begin();
for(; vit != grpData.end(); vit++)
for(; vit != grpData.end(); ++vit)
{
RsGxsChannelGroupItem* item = dynamic_cast<RsGxsChannelGroupItem*>(*vit);
if (item)
@ -249,13 +249,13 @@ bool p3GxsChannels::getPostData(const uint32_t &token, std::vector<RsGxsChannelP
{
GxsMsgDataMap::iterator mit = msgData.begin();
for(; mit != msgData.end(); mit++)
for(; mit != msgData.end(); ++mit)
{
RsGxsGroupId grpId = mit->first;
std::vector<RsGxsMsgItem*>& msgItems = mit->second;
std::vector<RsGxsMsgItem*>::iterator vit = msgItems.begin();
for(; vit != msgItems.end(); vit++)
for(; vit != msgItems.end(); ++vit)
{
RsGxsChannelPostItem* item = dynamic_cast<RsGxsChannelPostItem*>(*vit);
@ -296,12 +296,12 @@ bool p3GxsChannels::getRelatedPosts(const uint32_t &token, std::vector<RsGxsChan
{
GxsMsgRelatedDataMap::iterator mit = msgData.begin();
for(; mit != msgData.end(); mit++)
for(; mit != msgData.end(); ++mit)
{
std::vector<RsGxsMsgItem*>& msgItems = mit->second;
std::vector<RsGxsMsgItem*>::iterator vit = msgItems.begin();
for(; vit != msgItems.end(); vit++)
for(; vit != msgItems.end(); ++vit)
{
RsGxsChannelPostItem* item = dynamic_cast<RsGxsChannelPostItem*>(*vit);
@ -413,7 +413,7 @@ void p3GxsChannels::load_SubscribedGroups(const uint32_t &token)
getGroupMeta(token, groups);
std::list<RsGroupMetaData>::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<std::pair<RsGxsGr
/* organise Ids how they want them */
GxsMsgReq msgIds;
std::list<std::pair<RsGxsGroupId, RsGxsMessageId> >::iterator it;
for(it = ids.begin(); it != ids.end(); it++)
for(it = ids.begin(); it != ids.end(); ++it)
{
std::vector<RsGxsMessageId> &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<RsGxsChannelPost>::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<RsGxsChannelPost>::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<RsGxsFile>::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())
{

View File

@ -180,7 +180,7 @@ void p3GxsCircles::notifyChanges(std::vector<RsGxsNotify *> &changes)
#endif
std::vector<RsGxsNotify *>::iterator it;
for(it = changes.begin(); it != changes.end(); it++)
for(it = changes.begin(); it != changes.end(); ++it)
{
RsGxsGroupChange *groupChange = dynamic_cast<RsGxsGroupChange *>(*it);
RsGxsMsgChange *msgChange = dynamic_cast<RsGxsMsgChange *>(*it);
@ -193,7 +193,7 @@ void p3GxsCircles::notifyChanges(std::vector<RsGxsNotify *> &changes)
std::map<RsGxsGroupId, std::vector<RsGxsMessageId> > &msgChangeMap = msgChange->msgChangeMap;
std::map<RsGxsGroupId, std::vector<RsGxsMessageId> >::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<RsGxsNotify *> &changes)
std::list<RsGxsGroupId> &groupList = groupChange->mGrpIdList;
std::list<RsGxsGroupId>::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<RsGxsCircleId> &circleIds)
else
{
std::list<RsGxsCircleId>::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<RsGxsCircleId> &circleIds)
else
{
std::list<RsGxsCircleId>::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<RsGxsCircleGr
{
std::vector<RsGxsGrpItem*>::iterator vit = grpData.begin();
for(; vit != grpData.end(); vit++)
for(; vit != grpData.end(); ++vit)
{
RsGxsCircleGroupItem* item = dynamic_cast<RsGxsCircleGroupItem*>(*vit);
if (item)
@ -536,7 +536,7 @@ bool RsGxsCircleCache::loadSubCircle(const RsGxsCircleCache &subcircle)
bool RsGxsCircleCache::getAllowedPeersList(std::list<RsPgpId> &friendlist)
{
std::map<RsPgpId, std::list<RsGxsId> >::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<RsGroupMetaData>::iterator it = groups.begin(); it != groups.end(); it++)
for(std::list<RsGroupMetaData>::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<RsGxsId>::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<RsGxsCircleId>::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<RsGxsGrpItem*>::iterator vit = grpData.begin();
for(; vit != grpData.end(); vit++)
for(; vit != grpData.end(); ++vit)
{
RsGxsCircleGroupItem *item = dynamic_cast<RsGxsCircleGroupItem*>(*vit);
if (!item)
@ -917,7 +917,7 @@ bool p3GxsCircles::cache_load_for_token(uint32_t token)
std::list<RsGxsId>::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<RsGxsCircleId> &circles = group.mSubCircles;
std::list<RsGxsCircleId>::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<RsPgpId>::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<RsGxsId>::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<RsGxsGrpItem*>::iterator vit = grpData.begin();
for(; vit != grpData.end(); vit++)
for(; vit != grpData.end(); ++vit)
{
RsGxsIdGroupItem* item = dynamic_cast<RsGxsIdGroupItem*>(*vit);
@ -1337,7 +1337,7 @@ bool p3GxsCircles::cache_load_subcircles(uint32_t token)
std::list<RsGxsId>::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<RsGxsCircleId> &circles = group.circles;
std::list<RsGxsCircleId>::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<RsGxsIdGroup>::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<RsGxsId>::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<RsGxsId>::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<RsGxsId>::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<RsGxsId>::const_iterator it;
std::list<RsGxsCircleId>::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;

View File

@ -178,7 +178,7 @@ bool p3GxsCommentService::getGxsCommentData(const uint32_t &token, std::vector<R
GxsMsgDataMap::iterator mit = msgData.begin();
std::multimap<RsGxsMessageId, RsGxsVoteItem *> voteMap;
for(; mit != msgData.end(); mit++)
for(; mit != msgData.end(); ++mit)
{
RsGxsGroupId grpId = mit->first;
std::vector<RsGxsMsgItem*>& msgItems = mit->second;
@ -186,7 +186,7 @@ bool p3GxsCommentService::getGxsCommentData(const uint32_t &token, std::vector<R
/* now split into Comments and Votes */
for(; vit != msgItems.end(); vit++)
for(; vit != msgItems.end(); ++vit)
{
RsGxsCommentItem* item = dynamic_cast<RsGxsCommentItem*>(*vit);
@ -216,9 +216,9 @@ bool p3GxsCommentService::getGxsCommentData(const uint32_t &token, std::vector<R
/* now iterate through comments - and set the vote counts */
std::vector<RsGxsComment>::iterator cit;
std::multimap<RsGxsMessageId, RsGxsVoteItem *>::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::vector<R
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;
}
@ -283,12 +283,12 @@ bool p3GxsCommentService::getGxsRelatedComments(const uint32_t &token, std::vect
GxsMsgRelatedDataMap::iterator mit = msgData.begin();
std::multimap<RsGxsMessageId, RsGxsVoteItem *> voteMap;
for(; mit != msgData.end(); mit++)
for(; mit != msgData.end(); ++mit)
{
std::vector<RsGxsMsgItem*>& msgItems = mit->second;
std::vector<RsGxsMsgItem*>::iterator vit = msgItems.begin();
for(; vit != msgItems.end(); vit++)
for(; vit != msgItems.end(); ++vit)
{
RsGxsCommentItem* item = dynamic_cast<RsGxsCommentItem*>(*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<RsGxsComment>::iterator cit;
std::multimap<RsGxsMessageId, RsGxsVoteItem *>::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<RsMsgMetaData>::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<RsGxsGrpMsgIdPair, VoteHolder>::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<RsGxsGrpMsgIdPair, VoteHolder>::iterator it;
for (it = mPendingVotes.begin(); it != mPendingVotes.end(); it++)
for (it = mPendingVotes.begin(); it != mPendingVotes.end(); ++it)
{
if (it->second.mReqToken == token)
{

View File

@ -117,7 +117,7 @@ bool p3GxsForums::getGroupData(const uint32_t &token, std::vector<RsGxsForumGrou
{
std::vector<RsGxsGrpItem*>::iterator vit = grpData.begin();
for(; vit != grpData.end(); vit++)
for(; vit != grpData.end(); ++vit)
{
RsGxsForumGroupItem* item = dynamic_cast<RsGxsForumGroupItem*>(*vit);
if (item)
@ -152,13 +152,13 @@ bool p3GxsForums::getMsgData(const uint32_t &token, std::vector<RsGxsForumMsg> &
{
GxsMsgDataMap::iterator mit = msgData.begin();
for(; mit != msgData.end(); mit++)
for(; mit != msgData.end(); ++mit)
{
RsGxsGroupId grpId = mit->first;
std::vector<RsGxsMsgItem*>& msgItems = mit->second;
std::vector<RsGxsMsgItem*>::iterator vit = msgItems.begin();
for(; vit != msgItems.end(); vit++)
for(; vit != msgItems.end(); ++vit)
{
RsGxsForumMsgItem* item = dynamic_cast<RsGxsForumMsgItem*>(*vit);
@ -191,12 +191,12 @@ bool p3GxsForums::getRelatedMessages(const uint32_t &token, std::vector<RsGxsFor
{
GxsMsgRelatedDataMap::iterator mit = msgData.begin();
for(; mit != msgData.end(); mit++)
for(; mit != msgData.end(); ++mit)
{
std::vector<RsGxsMsgItem*>& msgItems = mit->second;
std::vector<RsGxsMsgItem*>::iterator vit = msgItems.begin();
for(; vit != msgItems.end(); vit++)
for(; vit != msgItems.end(); ++vit)
{
RsGxsForumMsgItem* item = dynamic_cast<RsGxsForumMsgItem*>(*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())
{

View File

@ -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<RsGxsId, Reputation>::iterator rit;
@ -326,7 +326,7 @@ bool p3GxsReputation::RecvReputations(RsGxsReputationUpdateItem *item)
RsPeerId peerid = item->PeerId();
std::map<RsGxsId, uint32_t>::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<time_t, RsGxsId>::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<RsItem*> &savelist)
/* save */
std::map<RsPeerId, ReputationConfig>::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<RsItem*> &savelist)
int count = 0;
std::map<RsGxsId, Reputation>::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<RsItem *>& loadList)
std::list<RsItem *>::iterator it;
std::set<RsPeerId> peerSet;
for(it = loadList.begin(); it != loadList.end(); it++)
for(it = loadList.begin(); it != loadList.end(); ++it)
{
RsGxsReputationConfigItem *item = dynamic_cast<RsGxsReputationConfigItem *>(*it);
// Configurations are loaded first. (to establish peerSet).
@ -542,7 +542,7 @@ bool p3GxsReputation::loadReputationSet(RsGxsReputationSetItem *item, const std:
// install opinions.
std::map<std::string, uint32_t>::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<RsPeerId>::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;

View File

@ -220,7 +220,7 @@ void p3IdService::notifyChanges(std::vector<RsGxsNotify *> &changes)
std::list<RsGxsGroupId> unprocessedGroups;
std::vector<RsGxsNotify *>::iterator it;
for(it = changes.begin(); it != changes.end(); it++)
for(it = changes.begin(); it != changes.end(); ++it)
{
RsGxsGroupChange *groupChange = dynamic_cast<RsGxsGroupChange *>(*it);
RsGxsMsgChange *msgChange = dynamic_cast<RsGxsMsgChange *>(*it);
@ -233,7 +233,7 @@ void p3IdService::notifyChanges(std::vector<RsGxsNotify *> &changes)
std::map<RsGxsGroupId, std::vector<RsGxsMessageId> > &msgChangeMap = msgChange->msgChangeMap;
std::map<RsGxsGroupId, std::vector<RsGxsMessageId> >::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<RsGxsNotify *> &changes)
std::list<RsGxsGroupId> &groupList = groupChange->mGrpIdList;
std::list<RsGxsGroupId>::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<RsGxsIdGroup>
{
std::vector<RsGxsGrpItem*>::iterator vit = grpData.begin();
for(; vit != grpData.end(); vit++)
for(; vit != grpData.end(); ++vit)
{
RsGxsIdGroupItem* item = dynamic_cast<RsGxsIdGroupItem*>(*vit);
if (item)
@ -1309,7 +1309,7 @@ void RsGxsIdCache::updateServiceString(std::string serviceString)
{
std::list<RsRecognTag>::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<std::string>::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<RsGxsId, std::list<RsPeerId> >::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<RsGxsGrpItem*>::iterator vit = grpData.begin();
for(; vit != grpData.end(); vit++)
for(; vit != grpData.end(); ++vit)
{
RsGxsIdGroupItem* item = dynamic_cast<RsGxsIdGroupItem*>(*vit);
if (!item)
@ -1728,7 +1728,7 @@ void p3IdService::requestIdsFromNet()
std::map<RsPeerId, std::list<RsGxsId> > requests;
// transform to appropriate structure (<peer, std::list<RsGxsId> > 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<RsPeerId>& peers = cit->second;
std::list<RsPeerId>::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<RsPeerId, std::list<RsGxsId> >::const_iterator cit2;
for(cit2 = requests.begin(); cit2 != requests.end(); cit2++)
for(cit2 = requests.begin(); cit2 != requests.end(); ++cit2)
{
if(mNes)
{
std::list<RsGxsId>::const_iterator gxs_id_it = cit2->second.begin();
std::list<RsGxsGroupId> 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<RsGxsIdGroupItem*>(*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<RsGxsIdGroupItem*>(*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<RsGxsGroupId>::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<RsGxsId>::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<RsGxsId, RsTlvSecurityKey>::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<RsGxsIdGroup>::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<RsPgpId, PGPFingerprintType>::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<RsPgpId>::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<RsGxsGrpItem*>::iterator vit = grpData.begin();
for(; vit != grpData.end(); vit++)
for(; vit != grpData.end(); ++vit)
{
RsGxsIdGroupItem* item = dynamic_cast<RsGxsIdGroupItem*>(*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.

View File

@ -277,7 +277,7 @@ void p3MsgService::statusChange(const std::list<pqiServicePeer> &plist)
/* only do this when a new peer is connected */
bool newPeers = false;
std::list<pqiServicePeer>::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<uint32_t, RsMsgItem *>::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<RsItem*>& 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<uint32_t, std::pair<std::string, uint32_t> >::iterator tit;
for (tit = tags.types.begin(); tit != tags.types.end(); tit++) {
for (tit = tags.types.begin(); tit != tags.types.end(); ++tit) {
std::map<uint32_t, RsMsgTagType*>::iterator mit = mTags.find(tit->first);
if (mit == mTags.end()) {
RsMsgTagType* tagType = new RsMsgTagType();
@ -542,7 +542,7 @@ bool p3MsgService::loadList(std::list<RsItem*>& 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<RsMsgItem *>(*it)))
@ -606,7 +606,7 @@ bool p3MsgService::loadList(std::list<RsItem*>& load)
// sort items into lists
std::list<RsMsgItem*>::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<RsItem*>& 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<uint32_t, RsMsgSrcId*>::iterator it = mSrcIds.find(srcIt->first);
if (it != mSrcIds.end()) {
delete(it->second);
@ -663,7 +663,7 @@ bool p3MsgService::loadList(std::list<RsItem*>& load)
}
}
mit++;
++mit;
}
return true;
@ -714,14 +714,14 @@ bool p3MsgService::getMessageSummaries(std::list<MsgInfoSummary> &msgList)
RsStackMutex stack(mMsgMtx); /********** STACK LOCKED MTX ******/
std::map<uint32_t, RsMsgItem *>::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<uint32_t, RsMsgItem *> *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<RsPeerId>::const_iterator pit = info.rspeerid_msgto.begin(); pit != info.rspeerid_msgto.end(); pit++) sendMessage(initMIRsMsg(info, *pit));
for(std::list<RsPeerId>::const_iterator pit = info.rspeerid_msgcc.begin(); pit != info.rspeerid_msgcc.end(); pit++) sendMessage(initMIRsMsg(info, *pit));
for(std::list<RsPeerId>::const_iterator pit = info.rspeerid_msgbcc.begin(); pit != info.rspeerid_msgbcc.end(); pit++) sendMessage(initMIRsMsg(info, *pit));
for(std::list<RsPeerId>::const_iterator pit = info.rspeerid_msgto.begin(); pit != info.rspeerid_msgto.end(); ++pit) sendMessage(initMIRsMsg(info, *pit));
for(std::list<RsPeerId>::const_iterator pit = info.rspeerid_msgcc.begin(); pit != info.rspeerid_msgcc.end(); ++pit) sendMessage(initMIRsMsg(info, *pit));
for(std::list<RsPeerId>::const_iterator pit = info.rspeerid_msgbcc.begin(); pit != info.rspeerid_msgbcc.end(); ++pit) sendMessage(initMIRsMsg(info, *pit));
for(std::list<RsGxsId>::const_iterator pit = info.rsgxsid_msgto.begin(); pit != info.rsgxsid_msgto.end(); pit++) sendMessage(initMIRsMsg(info, *pit));
for(std::list<RsGxsId>::const_iterator pit = info.rsgxsid_msgcc.begin(); pit != info.rsgxsid_msgcc.end(); pit++) sendMessage(initMIRsMsg(info, *pit));
for(std::list<RsGxsId>::const_iterator pit = info.rsgxsid_msgbcc.begin(); pit != info.rsgxsid_msgbcc.end(); pit++) sendMessage(initMIRsMsg(info, *pit));
for(std::list<RsGxsId>::const_iterator pit = info.rsgxsid_msgto.begin(); pit != info.rsgxsid_msgto.end(); ++pit) sendMessage(initMIRsMsg(info, *pit));
for(std::list<RsGxsId>::const_iterator pit = info.rsgxsid_msgcc.begin(); pit != info.rsgxsid_msgcc.end(); ++pit) sendMessage(initMIRsMsg(info, *pit));
for(std::list<RsGxsId>::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<uint32_t, RsMsgTagType*>::iterator mit;
for(mit = mTags.begin(); mit != mTags.end(); mit++) {
for(mit = mTags.begin(); mit != mTags.end(); ++mit) {
std::pair<std::string, uint32_t> p(mit->second->text, mit->second->rgb_color);
tags.types.insert(std::pair<uint32_t, std::pair<std::string, uint32_t> >(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<uint32_t, std::pair<std::string, uint32_t> >::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<RsTlvFileItem>::iterator it = msg->attachment.items.begin(); it != msg->attachment.items.end(); it++)
for(std::list<RsTlvFileItem>::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<FileInfo>::const_iterator it = info.files.begin(); it != info.files.end(); it++)
for(std::list<FileInfo>::const_iterator it = info.files.begin(); it != info.files.end(); ++it)
{
RsTlvFileItem mfi;
mfi.hash = it -> hash;

View File

@ -153,7 +153,7 @@ void p3PhotoService::groupsChanged(std::list<RsGxsGroupId>& grpIds)
RsGxsGroupChange* gc = mGroupChange.back();
std::list<RsGxsGroupId>& gList = gc->mGrpIdList;
std::list<RsGxsGroupId>::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<RsPhotoAlbum>&
{
std::vector<RsGxsGrpItem*>::iterator vit = grpData.begin();
for(; vit != grpData.end(); vit++)
for(; vit != grpData.end(); ++vit)
{
RsGxsPhotoAlbumItem* item = dynamic_cast<RsGxsPhotoAlbumItem*>(*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<RsGxsMsgItem*>& msgItems = mit->second;
std::vector<RsGxsMsgItem*>::iterator vit = msgItems.begin();
for(; vit != msgItems.end(); vit++)
for(; vit != msgItems.end(); ++vit)
{
RsGxsPhotoPhotoItem* item = dynamic_cast<RsGxsPhotoPhotoItem*>(*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<RsGxsMsgItem*>& msgItems = mit->second;
std::vector<RsGxsMsgItem*>::iterator vit = msgItems.begin();
for(; vit != msgItems.end(); vit++)
for(; vit != msgItems.end(); ++vit)
{
RsGxsPhotoCommentItem* item = dynamic_cast<RsGxsPhotoCommentItem*>(*vit);
@ -348,7 +348,7 @@ void p3PhotoService::notifyChanges(std::vector<RsGxsNotify*>& changes)
std::vector<RsGxsNotify*>::iterator vit = changes.begin();
for(; vit != changes.end(); vit++)
for(; vit != changes.end(); ++vit)
{
RsGxsNotify* n = *vit;
RsGxsGroupChange* gc;

View File

@ -88,7 +88,7 @@ void p3PostBase::notifyChanges(std::vector<RsGxsNotify *> &changes)
std::vector<RsGxsNotify *>::iterator it;
for(it = changes.begin(); it != changes.end(); it++)
for(it = changes.begin(); it != changes.end(); ++it)
{
RsGxsGroupChange *groupChange = dynamic_cast<RsGxsGroupChange *>(*it);
RsGxsMsgChange *msgChange = dynamic_cast<RsGxsMsgChange *>(*it);
@ -99,7 +99,7 @@ void p3PostBase::notifyChanges(std::vector<RsGxsNotify *> &changes)
std::map<RsGxsGroupId, std::vector<RsGxsMessageId> > &msgChangeMap = msgChange->msgChangeMap;
std::map<RsGxsGroupId, std::vector<RsGxsMessageId> >::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<RsGxsNotify *> &changes)
std::list<RsGxsGroupId> &groupList = groupChange->mGrpIdList;
std::list<RsGxsGroupId>::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<RsGxsGroupId>::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<RsGxsGroupId, std::vector<RsGxsMsgItem*> >::iterator mit;
std::vector<RsGxsMsgItem*>::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<RsGxsNotify *> 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 << ")";

View File

@ -77,7 +77,7 @@ bool p3Posted::getGroupData(const uint32_t &token, std::vector<RsPostedGroup> &g
{
std::vector<RsGxsGrpItem*>::iterator vit = grpData.begin();
for(; vit != grpData.end(); vit++)
for(; vit != grpData.end(); ++vit)
{
RsGxsPostedGroupItem* item = dynamic_cast<RsGxsPostedGroupItem*>(*vit);
if (item)
@ -108,13 +108,13 @@ bool p3Posted::getPostData(const uint32_t &token, std::vector<RsPostedPost> &msg
{
GxsMsgDataMap::iterator mit = msgData.begin();
for(; mit != msgData.end(); mit++)
for(; mit != msgData.end(); ++mit)
{
RsGxsGroupId grpId = mit->first;
std::vector<RsGxsMsgItem*>& msgItems = mit->second;
std::vector<RsGxsMsgItem*>::iterator vit = msgItems.begin();
for(; vit != msgItems.end(); vit++)
for(; vit != msgItems.end(); ++vit)
{
RsGxsPostedPostItem* item = dynamic_cast<RsGxsPostedPostItem*>(*vit);
@ -150,12 +150,12 @@ bool p3Posted::getRelatedPosts(const uint32_t &token, std::vector<RsPostedPost>
{
GxsMsgRelatedDataMap::iterator mit = msgData.begin();
for(; mit != msgData.end(); mit++)
for(; mit != msgData.end(); ++mit)
{
std::vector<RsGxsMsgItem*>& msgItems = mit->second;
std::vector<RsGxsMsgItem*>::iterator vit = msgItems.begin();
for(; vit != msgItems.end(); vit++)
for(; vit != msgItems.end(); ++vit)
{
RsGxsPostedPostItem* item = dynamic_cast<RsGxsPostedPostItem*>(*vit);

View File

@ -199,7 +199,7 @@ void p3rtt::sendPingMeasurements()
/* prepare packets */
std::set<RsPeerId>::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<RsRttPongRes
std::list<RsRttPongResult>::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);

View File

@ -184,7 +184,7 @@ bool p3ServiceInfo::sendPackets()
RsStackMutex stack(mInfoMtx); /****** LOCKED MUTEX *******/
std::set<RsPeerId>::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<pqipeer> &plist)
std::cerr << std::endl;
std::list<pqipeer>::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)
{

View File

@ -119,7 +119,7 @@ bool p3StatusService::getStatusList(std::list<StatusInfo>& statusInfo)
// fill up statusInfo list with this information
std::map<RsPeerId, StatusInfo>::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<RsPeerId, uint32_t>::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<RsItem*>& load){
return false;
}
for(; it != load.end(); it++){
for(; it != load.end(); ++it){
RsStatusItem* own_status = dynamic_cast<RsStatusItem* >(*it);
@ -369,7 +369,7 @@ void p3StatusService::statusChange(const std::list<pqiServicePeer> &plist)
StatusInfo statusInfo;
std::list<pqiServicePeer>::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)
{

View File

@ -123,7 +123,7 @@ bool p3Wiki::getCollections(const uint32_t &token, std::vector<RsWikiCollection>
{
std::vector<RsGxsGrpItem*>::iterator vit = grpData.begin();
for(; vit != grpData.end(); vit++)
for(; vit != grpData.end(); ++vit)
{
RsGxsWikiCollectionItem* item = dynamic_cast<RsGxsWikiCollectionItem*>(*vit);
@ -160,13 +160,13 @@ bool p3Wiki::getSnapshots(const uint32_t &token, std::vector<RsWikiSnapshot> &sn
{
GxsMsgDataMap::iterator mit = msgData.begin();
for(; mit != msgData.end(); mit++)
for(; mit != msgData.end(); ++mit)
{
RsGxsGroupId grpId = mit->first;
std::vector<RsGxsMsgItem*>& msgItems = mit->second;
std::vector<RsGxsMsgItem*>::iterator vit = msgItems.begin();
for(; vit != msgItems.end(); vit++)
for(; vit != msgItems.end(); ++vit)
{
RsGxsWikiSnapshotItem* item = dynamic_cast<RsGxsWikiSnapshotItem*>(*vit);
@ -199,12 +199,12 @@ bool p3Wiki::getRelatedSnapshots(const uint32_t &token, std::vector<RsWikiSnapsh
{
GxsMsgRelatedDataMap::iterator mit = msgData.begin();
for(; mit != msgData.end(); mit++)
for(; mit != msgData.end(); ++mit)
{
std::vector<RsGxsMsgItem*>& msgItems = mit->second;
std::vector<RsGxsMsgItem*>::iterator vit = msgItems.begin();
for(; vit != msgItems.end(); vit++)
for(; vit != msgItems.end(); ++vit)
{
RsGxsWikiSnapshotItem* item = dynamic_cast<RsGxsWikiSnapshotItem*>(*vit);
@ -237,7 +237,7 @@ bool p3Wiki::getComments(const uint32_t &token, std::vector<RsWikiComment> &comm
{
GxsMsgDataMap::iterator mit = msgData.begin();
for(; mit != msgData.end(); mit++)
for(; mit != msgData.end(); ++mit)
{
RsGxsGroupId grpId = mit->first;
std::vector<RsGxsMsgItem*>& 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 ;
}

View File

@ -109,7 +109,7 @@ bool p3Wire::getGroupData(const uint32_t &token, std::vector<RsWireGroup> &group
{
std::vector<RsGxsGrpItem*>::iterator vit = grpData.begin();
for(; vit != grpData.end(); vit++)
for(; vit != grpData.end(); ++vit)
{
RsGxsWireGroupItem* item = dynamic_cast<RsGxsWireGroupItem*>(*vit);
@ -146,13 +146,13 @@ bool p3Wire::getPulseData(const uint32_t &token, std::vector<RsWirePulse> &pulse
{
GxsMsgDataMap::iterator mit = msgData.begin();
for(; mit != msgData.end(); mit++)
for(; mit != msgData.end(); ++mit)
{
RsGxsGroupId grpId = mit->first;
std::vector<RsGxsMsgItem*>& msgItems = mit->second;
std::vector<RsGxsMsgItem*>::iterator vit = msgItems.begin();
for(; vit != msgItems.end(); vit++)
for(; vit != msgItems.end(); ++vit)
{
RsGxsWirePulseItem* item = dynamic_cast<RsGxsWirePulseItem*>(*vit);

View File

@ -1596,7 +1596,7 @@ int TcpStream::check_InPkts()
}
else
{
it++;
++it;
}
}
if (found)

View File

@ -689,7 +689,7 @@ static int tou_passall()
* check if idle are still idle.
*/
std::vector<TcpOnUdp *>::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))
{

View File

@ -83,7 +83,7 @@ int UdpPeerReceiver::status(std::ostream &out)
out << "UdpPeerReceiver::status()" << std::endl;
out << "UdpPeerReceiver::peers:" << std::endl;
std::map<struct sockaddr_in, UdpPeer *>::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<struct sockaddr_in, UdpPeer *>::iterator it;
for(it = streams.begin(); it != streams.end(); it++)
for(it = streams.begin(); it != streams.end(); ++it)
{
if (it->second == peer)
{

View File

@ -139,7 +139,7 @@ int UdpRelayReceiver::removeUdpPeer(UdpPeer *peer)
RsStackMutex stack(udppeerMtx); /********** LOCK MUTEX *********/
std::map<struct sockaddr_in, UdpPeer *>::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<UdpRelayEnd> &relayEnds)
std::map<struct sockaddr_in, UdpRelayEnd>::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<UdpRelayProxy> &relayProxies)
std::map<UdpRelayAddrSet, UdpRelayProxy>::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<UdpRelayAddrSet>::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<UdpRelayAddrSet, UdpRelayProxy>::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<struct sockaddr_in, UdpRelayEnd>::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<struct sockaddr_in, UdpPeer *>::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;

View File

@ -649,7 +649,7 @@ bool UdpStunner::storeStunPeer(const struct sockaddr_in &remote, const char *
RsStackMutex stack(stunMtx); /********** LOCK MUTEX *********/
std::list<TouStunPeer>::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<TouStunPeer>::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<TouStunPeer>::reverse_iterator it;
std::list<TouStunPeer>::reverse_iterator p1;
std::list<TouStunPeer>::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<TouStunPeer>::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<TouStunPeer>::iterator it;
int i;
for(i=0, it=mStunList.begin(); (i<idx) && (it!=mStunList.end()); it++, i++) ;
for(i=0, it=mStunList.begin(); (i<idx) && (it!=mStunList.end()); ++it, i++) ;
if (it != mStunList.end())
{

View File

@ -64,7 +64,7 @@ ContentValue::ContentValue(const ContentValue &from){
char *src = NULL;
uint32_t data_len = 0;
for(; cit != keyTypeMap.end(); cit++){
for(; cit != keyTypeMap.end(); ++cit){
type = cit->second;
currKey = cit->first;
@ -303,7 +303,7 @@ void ContentValue::clearData(){
std::map<std::string, std::pair<uint32_t, char*> >::iterator
mit = mKvData.begin();
for(; mit != mKvData.end(); mit++){
for(; mit != mKvData.end(); ++mit){
if(mit->second.first != 0)
delete[] (mit->second.second);

View File

@ -179,13 +179,13 @@ RetroCursor* RetroDb::sqlQuery(const std::string& tableName, const std::list<std
sqlite3_stmt* stmt = NULL;
std::list<std::string>::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<RetroBind*> &para
std::list<RetroBind*>::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<std::string, uint8_t> 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<std::string, uint8_t> 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<std::string, uint8_t> keyType
std::map<std::string, uint8_t>::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<std::string, uint8_t> keyType
{
paramBindings.push_back(rb);
mit++;
++mit;
if(mit == keyTypeMap.end())
parameter += key + "=?";
else
parameter += key + "=?,";
mit--;
--mit;
}
}

View File

@ -317,7 +317,7 @@ template<class Key, class Value> bool RsMemCache<Key, Value>::update_lrumap(cons
typename std::multimap<time_t, Key>::iterator sit = mLruMap.lower_bound(old_ts);
typename std::multimap<time_t, Key>::iterator eit = mLruMap.upper_bound(old_ts);
for(mit = sit; mit != eit; mit++)
for(mit = sit; mit != eit; ++mit)
{
if (mit->second == key)
{

View File

@ -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);
}

View File

@ -46,7 +46,7 @@ void RsTickEvent::tick_events()
{
std::multimap<time_t, uint32_t>::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(";