Prefer prefix ++/-- operators where possible, for performance reasons (per CppCheck)

This commit is contained in:
Brian Cox 2017-03-23 19:30:52 -07:00
parent 5c1cfe4702
commit 9c38b49839
32 changed files with 87 additions and 87 deletions

View File

@ -140,7 +140,7 @@ void cBlockFile::Close()
void cBlockFile::Flush() void cBlockFile::Flush()
{ {
ASSERT( mpArchive ); ASSERT( mpArchive );
for( BlockVector::iterator i = mvPagedBlocks.begin(); i != mvPagedBlocks.end(); i++ ) for( BlockVector::iterator i = mvPagedBlocks.begin(); i != mvPagedBlocks.end(); ++i )
{ {
FlushBlock( &(*i) ); FlushBlock( &(*i) );
} }
@ -171,7 +171,7 @@ cBlockFile::Block* cBlockFile::GetBlock( int blockNum ) //throw (eArchive)
mTimer++; mTimer++;
if( mTimer == 0 ) if( mTimer == 0 )
{ {
for( BlockVector::iterator i = mvPagedBlocks.begin(); i != mvPagedBlocks.end(); i++ ) for( BlockVector::iterator i = mvPagedBlocks.begin(); i != mvPagedBlocks.end(); ++i )
{ {
i->SetTimestamp( 0 ); i->SetTimestamp( 0 );
} }
@ -179,7 +179,7 @@ cBlockFile::Block* cBlockFile::GetBlock( int blockNum ) //throw (eArchive)
// //
// now, see if the desired block is in memory... // now, see if the desired block is in memory...
// //
for( BlockVector::iterator i = mvPagedBlocks.begin(); i != mvPagedBlocks.end(); i++ ) for( BlockVector::iterator i = mvPagedBlocks.begin(); i != mvPagedBlocks.end(); ++i )
{ {
if( i->GetBlockNum() == blockNum ) if( i->GetBlockNum() == blockNum )
{ {
@ -201,9 +201,9 @@ cBlockFile::Block* cBlockFile::GetBlock( int blockNum ) //throw (eArchive)
uint32 earliestTime = mvPagedBlocks[0].GetTimestamp(); uint32 earliestTime = mvPagedBlocks[0].GetTimestamp();
BlockVector::iterator it = mvPagedBlocks.begin(); BlockVector::iterator it = mvPagedBlocks.begin();
BlockVector::iterator earliestIter = it; BlockVector::iterator earliestIter = it;
it++; // since we don't want to check the first one ++it; // since we don't want to check the first one
ASSERT(it != mvPagedBlocks.end()); ASSERT(it != mvPagedBlocks.end());
for( ; it != mvPagedBlocks.end(); it++ ) for( ; it != mvPagedBlocks.end(); ++it )
{ {
if( it->GetTimestamp() < earliestTime ) if( it->GetTimestamp() < earliestTime )
{ {

View File

@ -277,7 +277,7 @@ int cBlockRecordFile::FindRoomForData( int32 dataSize ) //throw (eArchive)
// //
BlockArray::iterator it; BlockArray::iterator it;
int cnt = 0; int cnt = 0;
for( it = mvBlocks.begin(); it != mvBlocks.end(); it++, cnt++ ) for( it = mvBlocks.begin(); it != mvBlocks.end(); ++it, ++cnt )
{ {
util_InitBlockArray( *it ); util_InitBlockArray( *it );
if( it->GetAvailableSpace() >= dataSize ) if( it->GetAvailableSpace() >= dataSize )
@ -310,7 +310,7 @@ void cBlockRecordFile::TraceContents(int dl) const
{ {
// TODO -- this is probably not what I want to do, but it helps me right now... // TODO -- this is probably not what I want to do, but it helps me right now...
// //
for( BlockArray::const_iterator i = mvBlocks.begin(); i != mvBlocks.end(); i++ ) for( BlockArray::const_iterator i = mvBlocks.begin(); i != mvBlocks.end(); ++i )
{ {
i->TraceContents( dl ); i->TraceContents( dl );
} }
@ -330,7 +330,7 @@ void cBlockRecordFile::AssertValid() const
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
void cBlockRecordFile::AssertAllBlocksValid() void cBlockRecordFile::AssertAllBlocksValid()
{ {
for( BlockArray::iterator i = mvBlocks.begin(); i != mvBlocks.end(); i++ ) for( BlockArray::iterator i = mvBlocks.begin(); i != mvBlocks.end(); ++i )
{ {
i->AssertValid(); i->AssertValid();
} }

View File

@ -405,7 +405,7 @@ bool cHierDatabaseIter::Done() const
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
void cHierDatabaseIter::Next() void cHierDatabaseIter::Next()
{ {
mIter++; ++mIter;
} }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
@ -552,10 +552,10 @@ void cHierDatabaseIter::CreateEntry( const TSTRING& name ) //throw (eArchive, eH
{ {
// altering the previous node... // altering the previous node...
// //
mIter--; --mIter;
mIter->mNext = newAddr; mIter->mNext = newAddr;
util_RewriteObject( mpDb, &(*mIter), GetCurrentAddr() ); util_RewriteObject( mpDb, &(*mIter), GetCurrentAddr() );
mIter++; ++mIter;
} }
} }
@ -672,10 +672,10 @@ void cHierDatabaseIter::DeleteEntry() //throw (eArchive, eHierDatabase)
{ {
// altering the previous node... // altering the previous node...
// //
mIter--; --mIter;
mIter->mNext = (mIter+1)->mNext; mIter->mNext = (mIter+1)->mNext;
util_RewriteObject( mpDb, &(*mIter), GetCurrentAddr() ); util_RewriteObject( mpDb, &(*mIter), GetCurrentAddr() );
mIter++; ++mIter;
} }
// //
// now, delete the node from the file and from our array... // now, delete the node from the file and from our array...

View File

@ -75,7 +75,7 @@ cFCODataSourceIterImpl& cFCODataSourceIterImpl::operator=( const cFCODataSourceI
// //
// we need to addref all of the fcos we just got... // we need to addref all of the fcos we just got...
// //
for( FCOList::const_iterator i = mPeers.begin(); i != mPeers.end(); i++ ) for( FCOList::const_iterator i = mPeers.begin(); i != mPeers.end(); ++i )
{ {
(*i)->AddRef(); (*i)->AddRef();
} }
@ -191,7 +191,7 @@ bool cFCODataSourceIterImpl::Done() const
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
void cFCODataSourceIterImpl::Next() void cFCODataSourceIterImpl::Next()
{ {
mCurPos++; ++mCurPos;
} }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
@ -282,7 +282,7 @@ bool cFCODataSourceIterImpl::IsCaseSensitive() const
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
void cFCODataSourceIterImpl::ClearList() void cFCODataSourceIterImpl::ClearList()
{ {
for( mCurPos = mPeers.begin(); mCurPos != mPeers.end(); mCurPos++ ) for( mCurPos = mPeers.begin(); mCurPos != mPeers.end(); ++mCurPos )
{ {
(*mCurPos)->Release(); (*mCurPos)->Release();
} }
@ -316,7 +316,7 @@ void cFCODataSourceIterImpl::GeneratePeers()
// //
std::vector<TSTRING>::iterator i; std::vector<TSTRING>::iterator i;
cFCOName curName = mParentName; cFCOName curName = mParentName;
for( i = vChildrenNames.begin(); i != vChildrenNames.end(); i++) for( i = vChildrenNames.begin(); i != vChildrenNames.end(); ++i)
{ {
curName.Push( *i ); curName.Push( *i );
@ -369,7 +369,7 @@ void cFCODataSourceIterImpl::TraceContents(int dl) const
d.Trace( dl, "FCO Iterator; parent = %s\n", mParentName.AsString().c_str() ); d.Trace( dl, "FCO Iterator; parent = %s\n", mParentName.AsString().c_str() );
d.Trace( dl, "---- Peers ---- (current has a * by it)\n" ); d.Trace( dl, "---- Peers ---- (current has a * by it)\n" );
int cnt = 0; int cnt = 0;
for( FCOList::const_iterator iter = mPeers.begin(); iter != mPeers.end(); iter++, cnt++ ) for( FCOList::const_iterator iter = mPeers.begin(); iter != mPeers.end(); ++iter, ++cnt )
{ {
d.Trace( dl, "[%d]%c\t:%s\n", cnt, iter == mCurPos ? _T('*') : _T(' '), (*iter)->GetName().AsString().c_str() ); d.Trace( dl, "[%d]%c\t:%s\n", cnt, iter == mCurPos ? _T('*') : _T(' '), (*iter)->GetName().AsString().c_str() );
} }

View File

@ -288,7 +288,7 @@ TSTRING cFCOName::AsString() const
TSTRING current = (*i)->GetString(); TSTRING current = (*i)->GetString();
// the loop is constructed in this odd fashion because I don't want a trailing mDelimiter // the loop is constructed in this odd fashion because I don't want a trailing mDelimiter
str += current; str += current;
i++; ++i;
if(i != mpPathName->mNames.end() && current != "/") if(i != mpPathName->mNames.end() && current != "/")
str += mDelimiter; str += mDelimiter;
@ -343,7 +343,7 @@ cFCOName::Relationship cFCOName::GetRelationship(const cFCOName& rhs) const
for(myIter = mpPathName->mNames.begin(), rhsIter = rhs.mpPathName->mNames.begin(); for(myIter = mpPathName->mNames.begin(), rhsIter = rhs.mpPathName->mNames.begin();
(myIter != mpPathName->mNames.end() && rhsIter != rhs.mpPathName->mNames.end()); (myIter != mpPathName->mNames.end() && rhsIter != rhs.mpPathName->mNames.end());
myIter++, rhsIter++) ++myIter, ++rhsIter)
{ {
if(bCaseSensitive) if(bCaseSensitive)
bEqual = (*myIter == *rhsIter); bEqual = (*myIter == *rhsIter);
@ -522,7 +522,7 @@ bool cFCOName::operator<(const cFCOName& rhs) const
for(myIter = mpPathName->mNames.begin(), rhsIter = rhs.mpPathName->mNames.begin(); for(myIter = mpPathName->mNames.begin(), rhsIter = rhs.mpPathName->mNames.begin();
(myIter != mpPathName->mNames.end() && rhsIter != rhs.mpPathName->mNames.end()); (myIter != mpPathName->mNames.end() && rhsIter != rhs.mpPathName->mNames.end());
myIter++, rhsIter++) ++myIter, ++rhsIter)
{ {
if(bCaseSensitive) if(bCaseSensitive)
{ {
@ -593,7 +593,7 @@ void cFCONameIter::SeekBegin()
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
void cFCONameIter::Next() void cFCONameIter::Next()
{ {
mIter++; ++mIter;
} }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
@ -619,7 +619,7 @@ const TCHAR* cFCONameIter::GetName() const
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
void cFCONameIter::Prev() void cFCONameIter::Prev()
{ {
mIter--; --mIter;
} }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////

View File

@ -204,7 +204,7 @@ void cFCOSetImpl::Write(iSerializer* pSerializer) const
pSerializer->WriteInt32(mFCOSet.size()); pSerializer->WriteInt32(mFCOSet.size());
std::set<cFCONode>::const_iterator itr; std::set<cFCONode>::const_iterator itr;
for( itr = mFCOSet.begin(); itr != mFCOSet.end(); itr++) for( itr = mFCOSet.begin(); itr != mFCOSet.end(); ++itr)
{ {
pSerializer->WriteObjectDynCreate(itr->mpFCO); pSerializer->WriteObjectDynCreate(itr->mpFCO);
} }
@ -286,7 +286,7 @@ bool cFCOIterImpl::IsEmpty() const
void cFCOIterImpl::Next() const void cFCOIterImpl::Next() const
{ {
ASSERT(mpSet != 0); ASSERT(mpSet != 0);
mIter++; ++mIter;
} }

View File

@ -171,7 +171,7 @@ inline bool cFCOSpecAttrEmailIter::IsEmpty() const
} }
inline void cFCOSpecAttrEmailIter::Next() const inline void cFCOSpecAttrEmailIter::Next() const
{ {
mIter++; ++mIter;
} }
inline const TSTRING& cFCOSpecAttrEmailIter::EmailAddress() const inline const TSTRING& cFCOSpecAttrEmailIter::EmailAddress() const
{ {

View File

@ -221,7 +221,7 @@ void cFCOSpecStopPointSet::Add(const cFCOName& name)
break; break;
default: default:
i++; ++i;
} }
} }
@ -306,7 +306,7 @@ iFCOSpecHelper::CompareResult cFCOSpecStopPointSet::Compare(const iFCOSpecHelper
std::set<cFCOName>::const_iterator myIter = mStopPoints.begin(), std::set<cFCOName>::const_iterator myIter = mStopPoints.begin(),
rhsIter = pStopPtSet->mStopPoints.begin(); rhsIter = pStopPtSet->mStopPoints.begin();
for(; myIter != mStopPoints.end(); myIter++, rhsIter++) for(; myIter != mStopPoints.end(); ++myIter, ++rhsIter)
{ {
if(*myIter != *rhsIter) if(*myIter != *rhsIter)
return ((*myIter < *rhsIter) ? CMP_LT : CMP_GT); return ((*myIter < *rhsIter) ? CMP_LT : CMP_GT);

View File

@ -257,7 +257,7 @@ inline bool cFCOSpecStopPointIter::IsEmpty() const
inline void cFCOSpecStopPointIter::Next() const inline void cFCOSpecStopPointIter::Next() const
{ {
mIter++; ++mIter;
} }
inline void cFCOSpecStopPointIter::Remove() inline void cFCOSpecStopPointIter::Remove()

View File

@ -61,7 +61,7 @@ void cFCOSpecList::Clear()
{ {
std::list<PairType>::iterator itr; std::list<PairType>::iterator itr;
for (itr = mAddedList.begin(); itr != mAddedList.end(); itr++) for (itr = mAddedList.begin(); itr != mAddedList.end(); ++itr)
{ {
itr->first->Release(); itr->first->Release();
itr->second->Release(); itr->second->Release();
@ -227,7 +227,7 @@ void cFCOSpecListAddedIter::Remove()
// the tricky part is finding the spec in the other list... // the tricky part is finding the spec in the other list...
std::list<cFCOSpecList::PairType>::iterator i; std::list<cFCOSpecList::PairType>::iterator i;
for(i = mpSpecList->mCanonicalList.begin(); i != mpSpecList->mCanonicalList.end(); i++) for(i = mpSpecList->mCanonicalList.begin(); i != mpSpecList->mCanonicalList.end(); ++i)
{ {
if(i->first == mIter->first) if(i->first == mIter->first)
break; break;

View File

@ -223,7 +223,7 @@ cGenre::Genre cGenreSwitcher::StringToGenre( const wchar_t* wsz )
cGenreInfoVec::const_iterator cGenreInfoVec::find( cGenre::Genre g ) const cGenreInfoVec::const_iterator cGenreInfoVec::find( cGenre::Genre g ) const
{ {
const_iterator i; const_iterator i;
for( i = begin(); i != end(); i++ ) for( i = begin(); i != end(); ++i )
{ {
ASSERT( (*i)->m_ID != cGenre::GENRE_INVALID ); ASSERT( (*i)->m_ID != cGenre::GENRE_INVALID );
@ -244,7 +244,7 @@ cGenreInfoVec::const_iterator cGenreInfoVec::find( const cGenreInfo* pGI ) const
cGenreInfoVec::const_iterator cGenreInfoVec::find( const TSTRING& sGenre ) const cGenreInfoVec::const_iterator cGenreInfoVec::find( const TSTRING& sGenre ) const
{ {
const_iterator i; const_iterator i;
for( i = begin(); i != end(); i++ ) for( i = begin(); i != end(); ++i )
{ {
ASSERT( (*i)->m_ID != cGenre::GENRE_INVALID ); ASSERT( (*i)->m_ID != cGenre::GENRE_INVALID );

View File

@ -139,7 +139,7 @@ static inline void trim_leading_whitespace(std::string &str)
void cFSParserUtil::InterpretFCOName( const std::list<TSTRING>& l, cFCOName& nameOut ) const void cFSParserUtil::InterpretFCOName( const std::list<TSTRING>& l, cFCOName& nameOut ) const
{ {
TSTRING strT; TSTRING strT;
for( std::list<TSTRING>::const_iterator i = l.begin(); i != l.end(); i++ ) for( std::list<TSTRING>::const_iterator i = l.begin(); i != l.end(); ++i )
strT += *i; strT += *i;
#if USES_DEVICE_PATH #if USES_DEVICE_PATH

View File

@ -151,7 +151,7 @@ void cFSPropDisplayer::Merge( const iFCOPropDisplayer* const ppd )
// merge mapping info // merge mapping info
for( INT64_TO_STRING_MAP::const_iterator iterUID = pfspd->uidToUsername.begin(); for( INT64_TO_STRING_MAP::const_iterator iterUID = pfspd->uidToUsername.begin();
iterUID != pfspd->uidToUsername.end(); iterUID != pfspd->uidToUsername.end();
iterUID++ ++iterUID
) )
{ {
AddUsernameMapping( iterUID->first, iterUID->second ); AddUsernameMapping( iterUID->first, iterUID->second );
@ -159,7 +159,7 @@ void cFSPropDisplayer::Merge( const iFCOPropDisplayer* const ppd )
for( INT64_TO_STRING_MAP::const_iterator iterGID = pfspd->gidToGroupname.begin(); for( INT64_TO_STRING_MAP::const_iterator iterGID = pfspd->gidToGroupname.begin();
iterGID != pfspd->gidToGroupname.end(); iterGID != pfspd->gidToGroupname.end();
iterGID++ ++iterGID
) )
{ {
AddGroupnameMapping( iterGID->first, iterGID->second ); AddGroupnameMapping( iterGID->first, iterGID->second );
@ -401,7 +401,7 @@ void cFSPropDisplayer::Write( iSerializer* pSerializer ) const
{ {
// write UID mapping // write UID mapping
pSerializer->WriteInt32( uidToUsername.size() ); pSerializer->WriteInt32( uidToUsername.size() );
for( INT64_TO_STRING_MAP::const_iterator iterUid = uidToUsername.begin(); iterUid != uidToUsername.end(); iterUid++ ) for( INT64_TO_STRING_MAP::const_iterator iterUid = uidToUsername.begin(); iterUid != uidToUsername.end(); ++iterUid )
{ {
pSerializer->WriteInt64( iterUid->first ); pSerializer->WriteInt64( iterUid->first );
pSerializer->WriteString( iterUid->second ); pSerializer->WriteString( iterUid->second );
@ -409,7 +409,7 @@ void cFSPropDisplayer::Write( iSerializer* pSerializer ) const
// write GID mapping // write GID mapping
pSerializer->WriteInt32( gidToGroupname.size() ); pSerializer->WriteInt32( gidToGroupname.size() );
for( INT64_TO_STRING_MAP::const_iterator iterGid = gidToGroupname.begin(); iterGid != gidToGroupname.end(); iterGid++ ) for( INT64_TO_STRING_MAP::const_iterator iterGid = gidToGroupname.begin(); iterGid != gidToGroupname.end(); ++iterGid )
{ {
pSerializer->WriteInt64( iterGid->first ); pSerializer->WriteInt64( iterGid->first );
pSerializer->WriteString( iterGid->second ); pSerializer->WriteString( iterGid->second );

View File

@ -78,7 +78,7 @@ void TestGenerateDb()
// ok, time to integrity check! // ok, time to integrity check!
// //
cGenreSpecListVector::iterator at; cGenreSpecListVector::iterator at;
for( at = slv.begin(); at != slv.end(); at++ ) for( at = slv.begin(); at != slv.end(); ++at )
{ {
cGenerateDb::Execute( cGenerateDb::Execute(
at->GetSpecList(), at->GetSpecList(),

View File

@ -593,7 +593,7 @@ void cIntegrityCheck::ExecuteOnObjectList( const std::list<cFCOName>& fcoNames,
// iterate over all the objects to integrity check.. // iterate over all the objects to integrity check..
// //
std::list<cFCOName>::const_iterator it; std::list<cFCOName>::const_iterator it;
for( it = fcoNames.begin(); it != fcoNames.end(); it++ ) for( it = fcoNames.begin(); it != fcoNames.end(); ++it )
{ {
TW_NOTIFY_VERBOSE( _T("%s%s\n"), TW_NOTIFY_VERBOSE( _T("%s%s\n"),
TSS_GetString( cTripwire, tripwire::STR_NOTIFY_CHECKING ).c_str(), TSS_GetString( cTripwire, tripwire::STR_NOTIFY_CHECKING ).c_str(),

View File

@ -80,7 +80,7 @@ void TestIntegrityCheck()
// ok, time to integrity check! // ok, time to integrity check!
// //
cGenreSpecListVector::iterator at; cGenreSpecListVector::iterator at;
for( at = slv.begin(); at != slv.end(); at++ ) for( at = slv.begin(); at != slv.end(); ++at )
{ {
cIntegrityCheck ic( at->GetGenre(), at->GetSpecList(), db, report, &et ); cIntegrityCheck ic( at->GetGenre(), at->GetSpecList(), db, report, &et );
ic.Execute(); ic.Execute();

View File

@ -130,7 +130,7 @@ bool cMailMessage::GetAttachmentsAsString( std::string& s )
bool allOK = true; bool allOK = true;
for( std::vector<TSTRING>::const_iterator at = mvstrAttachments.begin(); for( std::vector<TSTRING>::const_iterator at = mvstrAttachments.begin();
at != mvstrAttachments.end(); at != mvstrAttachments.end();
at++ ) ++at )
{ {
s += "\r\n"; s += "\r\n";
@ -349,7 +349,7 @@ cQuotedPrintableEncoding::Encode( const std::string& sIn,
std::string::size_type lineLen = 0; std::string::size_type lineLen = 0;
for( at = sIn.begin(); for( at = sIn.begin();
at != sIn.end(); at != sIn.end();
at++, lineLen += _ENCODED_CHAR_LEN ) ++at, lineLen += _ENCODED_CHAR_LEN )
{ {
if( NeedsEncoding( *at ) ) if( NeedsEncoding( *at ) )
{ {
@ -481,7 +481,7 @@ cMailMessageUtil::HasNonAsciiChars( const std::string& s )
{ {
for( std::string::const_iterator at = s.begin(); for( std::string::const_iterator at = s.begin();
at != s.end(); at != s.end();
at ++ ) ++at )
{ {
if( (unsigned char)*at > (unsigned char)0x7F ) if( (unsigned char)*at > (unsigned char)0x7F )
return true; return true;

View File

@ -1123,7 +1123,7 @@ int cTWModeIC::Execute(cErrorQueue* pQueue)
// //
// now, we will iterate over the list, performing an integrity check for each genre // now, we will iterate over the list, performing an integrity check for each genre
// //
for( cTWUtil::GenreObjList::iterator genreIter = listOut.begin(); genreIter != listOut.end(); genreIter++ ) for( cTWUtil::GenreObjList::iterator genreIter = listOut.begin(); genreIter != listOut.end(); ++genreIter )
{ {
dbIter.SeekToGenre( genreIter->first ); dbIter.SeekToGenre( genreIter->first );
if( ! dbIter.Done() ) if( ! dbIter.Done() )
@ -1134,7 +1134,7 @@ int cTWModeIC::Execute(cErrorQueue* pQueue)
// I have to turn this into a list of cFCONames // I have to turn this into a list of cFCONames
// //
std::list<cFCOName> fcoNames; std::list<cFCOName> fcoNames;
for(cTWUtil::ObjList::iterator it = genreIter->second.begin(); it != genreIter->second.end(); it++) for(cTWUtil::ObjList::iterator it = genreIter->second.begin(); it != genreIter->second.end(); ++it)
{ {
// if this is not an absolute path, warn and continue... // if this is not an absolute path, warn and continue...
// //

View File

@ -179,7 +179,7 @@ static void SplitString( const TSTRING& str, TCHAR c, std::vector<TSTRING>& vStr
vStrings.clear(); vStrings.clear();
TSTRING::const_iterator i, prev; TSTRING::const_iterator i, prev;
for( prev = i = str.begin(); i != str.end(); i++ ) for( prev = i = str.begin(); i != str.end(); ++i )
{ {
if( *i == c ) if( *i == c )
{ {
@ -284,7 +284,7 @@ void cDbExplore::Execute( cFCODatabaseFileIter& dbIter )
GetNoun(noun); GetNoun(noun);
std::vector<TSTRING> vDirs; std::vector<TSTRING> vDirs;
SplitString( noun, pIter->GetParentName().GetDelimiter(), vDirs ); SplitString( noun, pIter->GetParentName().GetDelimiter(), vDirs );
for( std::vector<TSTRING>::iterator i = vDirs.begin(); i != vDirs.end(); i++ ) for( std::vector<TSTRING>::iterator i = vDirs.begin(); i != vDirs.end(); ++i )
{ {
if( i->compare( _T("..") ) == 0 ) if( i->compare( _T("..") ) == 0 )

View File

@ -72,7 +72,7 @@ cFCODatabaseFile::cFCODatabaseFile()
cFCODatabaseFile::~cFCODatabaseFile() cFCODatabaseFile::~cFCODatabaseFile()
{ {
for( DbList::iterator i = mDbList.begin(); i != mDbList.end(); i++ ) for( DbList::iterator i = mDbList.begin(); i != mDbList.end(); ++i )
{ {
delete *i; delete *i;
} }
@ -152,7 +152,7 @@ void cFCODatabaseFile::Write(iSerializer* pSerializer) const //throw( eFCODbFile
// //
// TODO -- the database is not really const-correct; therefore I have the sick casts below... // TODO -- the database is not really const-correct; therefore I have the sick casts below...
// //
for( DbList::iterator i = const_cast<DbList*>(&mDbList)->begin(); i != const_cast<DbList*>(&mDbList)->end(); i++ ) for( DbList::iterator i = const_cast<DbList*>(&mDbList)->begin(); i != const_cast<DbList*>(&mDbList)->end(); ++i )
{ {
pSerializer->WriteInt32 ( (*i)->mGenre ); pSerializer->WriteInt32 ( (*i)->mGenre );
pSerializer->WriteObject ( &(*i)->mGenreHeader ); pSerializer->WriteObject ( &(*i)->mGenreHeader );
@ -193,7 +193,7 @@ void cFCODatabaseFile::AddGenre( cGenre::Genre genreId, cFCODatabaseFileIter* pI
// //
// first, lets make sure this genre doesn't exist... // first, lets make sure this genre doesn't exist...
// //
for( DbList::iterator i = mDbList.begin(); i != mDbList.end(); i++ ) for( DbList::iterator i = mDbList.begin(); i != mDbList.end(); ++i )
{ {
if( (*i)->mGenre == genreId ) if( (*i)->mGenre == genreId )
{ {
@ -254,7 +254,7 @@ void cFCODatabaseFileIter::SeekBegin()
void cFCODatabaseFileIter::Next() void cFCODatabaseFileIter::Next()
{ {
mIter++; ++mIter;
} }
bool cFCODatabaseFileIter::Done() const bool cFCODatabaseFileIter::Done() const

View File

@ -433,7 +433,7 @@ void cFCOReportSpecIter::SeekBegin() const
void cFCOReportSpecIter::Next() const void cFCOReportSpecIter::Next() const
{ {
ASSERT(mpData != 0); ASSERT(mpData != 0);
mpData->mIter++; ++(mpData->mIter);
} }
bool cFCOReportSpecIter::Done() const bool cFCOReportSpecIter::Done() const
@ -450,7 +450,7 @@ const iFCOSpec* cFCOReportSpecIter::GetSpec() const
bool cFCOReportSpecIter::SeekToSpec(const iFCOSpec* pSpec) bool cFCOReportSpecIter::SeekToSpec(const iFCOSpec* pSpec)
{ {
if (mpData) if (mpData)
for(mpData->mIter = mpData->mpList->begin(); mpData->mIter != mpData->mpList->end(); mpData->mIter++) for(mpData->mIter = mpData->mpList->begin(); mpData->mIter != mpData->mpList->end(); ++(mpData->mIter))
{ {
if(iFCOSpecUtil::FCOSpecEqual(*mpData->mIter->mpSpec, *pSpec)) if(iFCOSpecUtil::FCOSpecEqual(*mpData->mIter->mpSpec, *pSpec))
return true; return true;
@ -563,7 +563,7 @@ void cFCOReportChangeIter::SeekBegin() const
void cFCOReportChangeIter::Next() const void cFCOReportChangeIter::Next() const
{ {
ASSERT(mpData->mpList != 0); ASSERT(mpData->mpList != 0);
mpData->mIter++; ++(mpData->mIter);
} }
bool cFCOReportChangeIter::Done() const bool cFCOReportChangeIter::Done() const
@ -707,7 +707,7 @@ void cFCOReport::AddSpec(cGenre::Genre genre, const iFCOSpec* pSpec, const cFCOS
if (pIter && pIter->mpData && pIter->mpData->mpList == &genreIter->mSpecList) if (pIter && pIter->mpData && pIter->mpData->mpList == &genreIter->mSpecList)
{ {
pIter->mpData->mIter = genreIter->mSpecList.end(); pIter->mpData->mIter = genreIter->mSpecList.end();
pIter->mpData->mIter--; --(pIter->mpData->mIter);
ASSERT(pIter->GetSpec() == node.mpSpec); ASSERT(pIter->GetSpec() == node.mpSpec);
} }
} }

View File

@ -162,7 +162,7 @@ cTextReportViewer::~cTextReportViewer()
{ {
if( mfUpdate ) if( mfUpdate )
{ {
for( GenreList::iterator i = mFCOsRemoveFromReport.begin(); i != mFCOsRemoveFromReport.end(); i++ ) for( GenreList::iterator i = mFCOsRemoveFromReport.begin(); i != mFCOsRemoveFromReport.end(); ++i )
{ {
ASSERT( i->second != 0 ); ASSERT( i->second != 0 );
i->second->clear(); i->second->clear();
@ -1051,7 +1051,7 @@ void cTextReportViewer::RemoveFCOsFromReport() //throw (eTextReportViewer)
// //
// see if any FCOs to remove are in this set // see if any FCOs to remove are in this set
// //
for( iter = pFCOList->begin(); iter != pFCOList->end(); iter++ ) for( iter = pFCOList->begin(); iter != pFCOList->end(); ++iter )
{ {
fcoIter = pAddedSet->Lookup( *iter ); fcoIter = pAddedSet->Lookup( *iter );
if( fcoIter ) if( fcoIter )
@ -1071,7 +1071,7 @@ void cTextReportViewer::RemoveFCOsFromReport() //throw (eTextReportViewer)
// //
// see if any FCOs to remove are in this set // see if any FCOs to remove are in this set
// //
for( iter = pFCOList->begin(); iter != pFCOList->end(); iter++ ) for( iter = pFCOList->begin(); iter != pFCOList->end(); ++iter )
{ {
fcoIter = pRemovedSet->Lookup( *iter ); fcoIter = pRemovedSet->Lookup( *iter );
if( fcoIter ) if( fcoIter )
@ -1084,7 +1084,7 @@ void cTextReportViewer::RemoveFCOsFromReport() //throw (eTextReportViewer)
} }
for( iter = pFCOList->begin(); iter != pFCOList->end(); iter++ ) for( iter = pFCOList->begin(); iter != pFCOList->end(); ++iter )
{ {
// search changed // search changed
// get changed set iterator // get changed set iterator
@ -1110,7 +1110,7 @@ void cTextReportViewer::RemoveFCOsFromReport() //throw (eTextReportViewer)
// //
int nFCOsToRemove = 0; int nFCOsToRemove = 0;
cTextReportViewer::GenreList::const_iterator iter = mFCOsRemoveFromReport.begin(); cTextReportViewer::GenreList::const_iterator iter = mFCOsRemoveFromReport.begin();
for( ; iter != mFCOsRemoveFromReport.end(); iter++ ) for( ; iter != mFCOsRemoveFromReport.end(); ++iter )
nFCOsToRemove += iter->second->size(); nFCOsToRemove += iter->second->size();
if( nFCOsToRemove != nFCOsRemoved ) if( nFCOsToRemove != nFCOsRemoved )

View File

@ -1228,7 +1228,7 @@ void cTWUtil::ParseObjectList( cTWUtil::GenreObjList& listOut, const cTWUtil::Ob
// iterate over all of the input... // iterate over all of the input...
// //
for( ObjList::const_iterator i = listIn.begin(); i != listIn.end(); i++ ) for( ObjList::const_iterator i = listIn.begin(); i != listIn.end(); ++i )
{ {
// first, try to interperate the current string as a genre name... // first, try to interperate the current string as a genre name...
// 17 Mar 99 mdb -- we now only do this if the string ends in a ':' // 17 Mar 99 mdb -- we now only do this if the string ends in a ':'
@ -1261,7 +1261,7 @@ void cTWUtil::ParseObjectList( cTWUtil::GenreObjList& listOut, const cTWUtil::Ob
{ {
// seek to right list; create it if it is not there... // seek to right list; create it if it is not there...
// //
for( curIter = listOut.begin(); curIter != listOut.end(); curIter++ ) for( curIter = listOut.begin(); curIter != listOut.end(); ++curIter )
{ {
if( curIter->first == curGenre ) if( curIter->first == curGenre )
break; break;
@ -1282,7 +1282,7 @@ void cTWUtil::ParseObjectList( cTWUtil::GenreObjList& listOut, const cTWUtil::Ob
// add this to the list; assert that it has not been added yet. // add this to the list; assert that it has not been added yet.
// //
ObjList::iterator oi; ObjList::iterator oi;
for( oi = curIter->second.begin(); oi != curIter->second.end(); oi++ ) for( oi = curIter->second.begin(); oi != curIter->second.end(); ++oi )
{ {
if( *oi == *i ) if( *oi == *i )
{ {

View File

@ -108,7 +108,7 @@ bool cGenreParseInfo::RulePointAlreadyDefined( const cFCOName& fcoName )
bool fFound = false; bool fFound = false;
// check start points // check start points
for( RuleListType::iterator i = mRuleList.begin(); i != mRuleList.end(); i++ ) for( RuleListType::iterator i = mRuleList.begin(); i != mRuleList.end(); ++i )
{ {
if( (*i)->GetName() == fcoName ) if( (*i)->GetName() == fcoName )
fFound = true; fFound = true;
@ -117,7 +117,7 @@ bool cGenreParseInfo::RulePointAlreadyDefined( const cFCOName& fcoName )
// check stop points // check stop points
if( ! fFound ) if( ! fFound )
{ {
for( StopListType::iterator j = mStopList.begin(); j != mStopList.end(); j++ ) for( StopListType::iterator j = mStopList.begin(); j != mStopList.end(); ++j )
{ {
if( *j == fcoName ) if( *j == fcoName )
fFound = true; fFound = true;

View File

@ -144,7 +144,7 @@ void cParserHelper::Finit( cGenreSpecListVector* pPolicy )
int nRulesInPolicy = 0; int nRulesInPolicy = 0;
GenreContainer::iterator i; GenreContainer::iterator i;
for( i = mAph.begin(); i != mAph.end(); i++ ) for( i = mAph.begin(); i != mAph.end(); ++i )
{ {
cGenreSpecListPair slp; cGenreSpecListPair slp;
cGenre::Genre g = i->first; cGenre::Genre g = i->first;
@ -193,7 +193,7 @@ void cParserHelper::Finit( cGenreSpecListVector* pPolicy )
void cParserHelper::CleanUp() void cParserHelper::CleanUp()
{ {
GenreContainer::iterator i; GenreContainer::iterator i;
for( i = mAph.begin(); i != mAph.end(); i++ ) for( i = mAph.begin(); i != mAph.end(); ++i )
delete i->second; delete i->second;
while( ! cPreprocessor::Empty() ) while( ! cPreprocessor::Empty() )
cPreprocessor::PopState(); cPreprocessor::PopState();
@ -390,7 +390,7 @@ bool cParserUtil::AnyOfTheseHostsExists( cParseStringList* pList )
std::transform( strHostName.begin(), strHostName.end(), strHostName.begin(), _totlower ); std::transform( strHostName.begin(), strHostName.end(), strHostName.begin(), _totlower );
// if the host name matches any in the list, return true // if the host name matches any in the list, return true
for( std::list<TSTRING>::iterator iter = pList->begin(); iter != pList->end(); iter++ ) for( std::list<TSTRING>::iterator iter = pList->begin(); iter != pList->end(); ++iter )
{ {
// want to do case-insensitive compare // want to do case-insensitive compare
std::transform( (*iter).begin(), (*iter).end(), (*iter).begin(), _totlower ); std::transform( (*iter).begin(), (*iter).end(), (*iter).begin(), _totlower );
@ -531,7 +531,7 @@ void cParserUtil::CreateFCOSpecs( cGenre::Genre g, cGenreParseInfo* pgpi, cFCOSp
// foreach rule // foreach rule
std::list<const cParseRule *>::iterator rule; std::list<const cParseRule *>::iterator rule;
for (rule = pgpi->GetRules()->begin(); rule != pgpi->GetRules()->end(); rule++) for (rule = pgpi->GetRules()->begin(); rule != pgpi->GetRules()->end(); ++rule)
{ {
// //
// create the spec with its the last element of its start point as its name. // create the spec with its the last element of its start point as its name.
@ -557,7 +557,7 @@ void cParserUtil::CreateFCOSpecs( cGenre::Genre g, cGenreParseInfo* pgpi, cFCOSp
// set stop points // set stop points
cGenreParseInfo::StopListType::iterator stop; cGenreParseInfo::StopListType::iterator stop;
for (stop = pgpi->GetStopList()->begin(); stop != pgpi->GetStopList()->end(); stop++) for (stop = pgpi->GetStopList()->begin(); stop != pgpi->GetStopList()->end(); ++stop)
{ {
// add stop point if below start point // add stop point if below start point
cFCOName::Relationship relate = startpoint.GetRelationship(*stop); cFCOName::Relationship relate = startpoint.GetRelationship(*stop);
@ -677,7 +677,7 @@ void cParserUtil::CreatePropVector( const TSTRING& strPropListC, class cFCOPropV
TSTRING::const_iterator iter; TSTRING::const_iterator iter;
TSTRING::size_type i; // index into string TSTRING::size_type i; // index into string
for ( iter = strPropList.begin(), i = 0; iter != strPropList.end(); iter++, i++ ) for ( iter = strPropList.begin(), i = 0; iter != strPropList.end(); ++iter, ++i )
{ {
int propIndex = -1; // index into propvector int propIndex = -1; // index into propvector
@ -825,7 +825,7 @@ cParseNamedAttrList* cParserHelper::GetGlobalAttrList()
void cParserHelper::IncrementScopeStatementCount() void cParserHelper::IncrementScopeStatementCount()
{ {
// must add count to ALL previous scopes. // must add count to ALL previous scopes.
for( ScopedAttrContainer::iterator i = mScopedAttrs.begin(); i != mScopedAttrs.end(); i++ ) for( ScopedAttrContainer::iterator i = mScopedAttrs.begin(); i != mScopedAttrs.end(); ++i )
(*i)->IncrementStatementCount(); (*i)->IncrementStatementCount();
} }

View File

@ -211,7 +211,7 @@ void
cParseSpecMaskList::Dump(cDebug &d) const cParseSpecMaskList::Dump(cDebug &d) const
{ {
std::list<cParseSpecMask *>::const_iterator ispec; std::list<cParseSpecMask *>::const_iterator ispec;
for (ispec = mList.begin(); ispec != mList.end(); ispec++) { for (ispec = mList.begin(); ispec != mList.end(); ++ispec) {
(*ispec)->Dump(d); (*ispec)->Dump(d);
} }
} }
@ -295,7 +295,7 @@ cParseNamedAttrList::~cParseNamedAttrList()
void cParseNamedAttrList::Clear() void cParseNamedAttrList::Clear()
{ {
for( std::list<cParseNamedAttr*>::iterator iter = mList.begin(); iter != mList.end(); iter++ ) for( std::list<cParseNamedAttr*>::iterator iter = mList.begin(); iter != mList.end(); ++iter )
{ {
delete *iter; delete *iter;
} }
@ -307,7 +307,7 @@ cParseNamedAttrList::Dump(cDebug &d) const
{ {
// dump out each named attribute // dump out each named attribute
std::list<cParseNamedAttr *>::const_iterator iattr; std::list<cParseNamedAttr *>::const_iterator iattr;
for (iattr = mList.begin(); iattr != mList.end(); iattr++) { for (iattr = mList.begin(); iattr != mList.end(); ++iattr) {
(*iattr)->Dump(d); (*iattr)->Dump(d);
} }
} }
@ -339,7 +339,7 @@ cParseNamedAttrList::constListIter cParseNamedAttrList::Find( const cParseNamedA
for( for(
std::list< cParseNamedAttr * >::const_iterator iter = mList.begin(); std::list< cParseNamedAttr * >::const_iterator iter = mList.begin();
iter != mList.end(); iter != mList.end();
iter++ ++iter
) )
{ {
if( (*iter)->GetName() == pa->GetName() ) if( (*iter)->GetName() == pa->GetName() )
@ -356,7 +356,7 @@ void cParseNamedAttrList::MergeNoOverwrite( const cParseNamedAttrList* const pal
if( pal ) if( pal )
{ {
// foreach attribute in pal // foreach attribute in pal
for( constListIter newIter = pal->mList.begin(); newIter != pal->mList.end(); newIter++ ) for( constListIter newIter = pal->mList.begin(); newIter != pal->mList.end(); ++newIter )
{ {
// look for this attribute in this list // look for this attribute in this list
constListIter thisIter = Find( *newIter ); constListIter thisIter = Find( *newIter );
@ -384,7 +384,7 @@ const cParseNamedAttr* cParseNamedAttrList::Lookup( const TSTRING& tstrAttrName
{ {
constListIter i; constListIter i;
for( i = mList.begin(); i != mList.end(); i++) for( i = mList.begin(); i != mList.end(); ++i)
{ {
if( 0 == tstrAttrName.compare( (*i)->GetName() ) ) if( 0 == tstrAttrName.compare( (*i)->GetName() ) )
{ {

View File

@ -64,7 +64,7 @@ class iParserGenreUtil;
// INLINE FUNCTIONS // INLINE FUNCTIONS
//========================================================================= //=========================================================================
#define KILL_LIST(type, name) do { for( std::list<type*>::iterator iter = mList.begin(); iter != mList.end(); iter++ ) { delete *iter; } } while(0) #define KILL_LIST(type, name) do { for( std::list<type*>::iterator iter = mList.begin(); iter != mList.end(); ++iter ) { delete *iter; } } while(0)
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////

View File

@ -719,7 +719,7 @@ int cTWPrintDBMode::Execute(cErrorQueue* pQueue)
// now, iterate through the list of objects... // now, iterate through the list of objects...
// //
cFCODatabaseFile::iterator dbIter( db ); cFCODatabaseFile::iterator dbIter( db );
for( cTWUtil::GenreObjList::iterator genreIter = listOut.begin(); genreIter != listOut.end(); genreIter++ ) for( cTWUtil::GenreObjList::iterator genreIter = listOut.begin(); genreIter != listOut.end(); ++genreIter )
{ {
dbIter.SeekToGenre( genreIter->first ); dbIter.SeekToGenre( genreIter->first );
if( ! dbIter.Done() ) if( ! dbIter.Done() )
@ -731,7 +731,7 @@ int cTWPrintDBMode::Execute(cErrorQueue* pQueue)
// //
// iterate over all the objects in this genre.... // iterate over all the objects in this genre....
// //
for(cTWUtil::ObjList::iterator it = genreIter->second.begin(); it != genreIter->second.end(); it++) for(cTWUtil::ObjList::iterator it = genreIter->second.begin(); it != genreIter->second.end(); ++it)
{ {
try try
{ {

View File

@ -57,7 +57,7 @@
template< class CharT > bool IsPrintable( const std::basic_string< CharT >& str ) template< class CharT > bool IsPrintable( const std::basic_string< CharT >& str )
{ {
const std::ctype< CharT > *pct = 0, &ct = tss::GetFacet( std::locale(), pct ); const std::ctype< CharT > *pct = 0, &ct = tss::GetFacet( std::locale(), pct );
for( std::basic_string< CharT >::const_iterator at = str.begin(); at != str.end(); at++ ) for( std::basic_string< CharT >::const_iterator at = str.begin(); at != str.end(); ++at )
{ {
if( ! ct.is( std::ctype_base::print, *at ) ) // if not printable if( ! ct.is( std::ctype_base::print, *at ) ) // if not printable
return false; return false;

View File

@ -416,7 +416,7 @@ void MakeFile( TSTRING& strNameMakeMe )
pFSServices->MakeTempFilename( strNameMakeMe ); pFSServices->MakeTempFilename( strNameMakeMe );
std::string strA; std::string strA;
for( TSTRING::iterator i = strNameMakeMe.begin(); i != strNameMakeMe.end(); i++ ) for( TSTRING::iterator i = strNameMakeMe.begin(); i != strNameMakeMe.end(); ++i )
{ {
char ach[6]; char ach[6];
ASSERT( MB_CUR_MAX <= 6 ); ASSERT( MB_CUR_MAX <= 6 );

View File

@ -69,7 +69,7 @@ void TestUnixFSServices()
std::vector <TSTRING>::iterator p; std::vector <TSTRING>::iterator p;
size_t n = 0; size_t n = 0;
for (p = v.begin(); p != v.end(); p++) { for (p = v.begin(); p != v.end(); ++p) {
d.TraceDetail(" %s\n", p->c_str()); d.TraceDetail(" %s\n", p->c_str());
n++; n++;
} }

View File

@ -120,7 +120,7 @@ TSTRING& cStringEncoder::Encode( const TSTRING& in, TSTRING& out )
// //
out.reserve( in.length() ); out.reserve( in.length() );
for( TSTRING::const_iterator i = in.begin(); i != in.end(); i++ ) for( TSTRING::const_iterator i = in.begin(); i != in.end(); ++i )
ce.EncodeChar( i, out ); ce.EncodeChar( i, out );
return out; return out;
@ -143,7 +143,7 @@ TSTRING& cStringEncoder::Unencode( const TSTRING& in, TSTRING& out )
out.reserve( in.length() ); out.reserve( in.length() );
TSTRING::const_iterator end = in.end(); TSTRING::const_iterator end = in.end();
for( TSTRING::const_iterator i = in.begin(); i != end; i++ ) for( TSTRING::const_iterator i = in.begin(); i != end; ++i )
out += ce.DecodeChar( i, end ); out += ce.DecodeChar( i, end );
return out; return out;