diff --git a/Buffer.cpp b/Buffer.cpp index 763694b1..8648ff18 100644 --- a/Buffer.cpp +++ b/Buffer.cpp @@ -43,7 +43,7 @@ int CBuffer::AddLine(const CString& sPre, const CString& sPost, bool bIncNick) { } int CBuffer::UpdateLine(const CString& sPre, const CString& sPost, bool bIncNick) { - for (iterator it = begin(); it != end(); it++) { + for (iterator it = begin(); it != end(); ++it) { if (it->GetPre() == sPre) { it->SetPost(sPost); it->SetIncNick(bIncNick); @@ -55,7 +55,7 @@ int CBuffer::UpdateLine(const CString& sPre, const CString& sPost, bool bIncNick } int CBuffer::UpdateExactLine(const CString& sPre, const CString& sPost, bool bIncNick) { - for (iterator it = begin(); it != end(); it++) { + for (iterator it = begin(); it != end(); ++it) { if (it->GetPre() == sPre && it->GetPost() == sPost) return size(); } diff --git a/Chan.cpp b/Chan.cpp index e203a2f0..ae49a0e6 100644 --- a/Chan.cpp +++ b/Chan.cpp @@ -111,14 +111,14 @@ void CChan::JoinUser(bool bForce, const CString& sKey, CClient* pClient) { CString sPerm, sNick; vector& vpClients = m_pUser->GetClients(); - for (vector::iterator it = vpClients.begin(); it != vpClients.end(); it++) { + for (vector::iterator it = vpClients.begin(); it != vpClients.end(); ++it) { CClient* pThisClient; if (!pClient) pThisClient = *it; else pThisClient = pClient; - for (map::iterator a = m_msNicks.begin(); a != m_msNicks.end(); a++) { + for (map::iterator a = m_msNicks.begin(); a != m_msNicks.end(); ++a) { if (pThisClient->HasNamesx()) { sPerm = a->second->GetPermStr(); } else { @@ -172,7 +172,7 @@ void CChan::AttachUser() { CString CChan::GetModeString() const { CString sModes, sArgs; - for (map::const_iterator it = m_musModes.begin(); it != m_musModes.end(); it++) { + for (map::const_iterator it = m_musModes.begin(); it != m_musModes.end(); ++it) { sModes += it->first; if (it->second.size()) { sArgs += " " + it->second; @@ -185,7 +185,7 @@ CString CChan::GetModeString() const { CString CChan::GetModeForNames() const { CString sMode; - for (map::const_iterator it = m_musModes.begin(); it != m_musModes.end(); it++) { + for (map::const_iterator it = m_musModes.begin(); it != m_musModes.end(); ++it) { if (it->first == 's') { sMode = "@"; } else if ((it->first == 'p') && sMode.empty()){ @@ -365,7 +365,7 @@ CString CChan::GetModeArg(CString& sArgs) const { } void CChan::ClearNicks() { - for (map::iterator a = m_msNicks.begin(); a != m_msNicks.end(); a++) { + for (map::iterator a = m_msNicks.begin(); a != m_msNicks.end(); ++a) { delete a->second; } @@ -379,7 +379,7 @@ int CChan::AddNicks(const CString& sNicks) { sNicks.Split(" ", vsNicks, false); - for (it = vsNicks.begin(); it != vsNicks.end(); it++) { + for (it = vsNicks.begin(); it != vsNicks.end(); ++it) { if (AddNick(*it)) { iRet++; } @@ -439,7 +439,7 @@ map CChan::GetPermCounts() const { map mRet; map::const_iterator it; - for (it = m_msNicks.begin(); it != m_msNicks.end(); it++) { + for (it = m_msNicks.begin(); it != m_msNicks.end(); ++it) { CString sPerms = it->second->GetPermStr(); for (unsigned int p = 0; p < sPerms.size(); p++) { diff --git a/ClientCommand.cpp b/ClientCommand.cpp index bf8ae445..11527a2c 100644 --- a/ClientCommand.cpp +++ b/ClientCommand.cpp @@ -71,7 +71,7 @@ void CClient::UserCommand(CString& sLine) { Table.AddColumn("Ident"); Table.AddColumn("Host"); - for (map::const_iterator a = msNicks.begin(); a != msNicks.end(); a++) { + for (map::const_iterator a = msNicks.begin(); a != msNicks.end(); ++a) { Table.AddRow(); for (unsigned int b = 0; b < sPerms.size(); b++) { @@ -168,7 +168,7 @@ void CClient::UserCommand(CString& sLine) { Table.AddColumn("IRC User"); Table.AddColumn("Channels"); - for (map::const_iterator it = msUsers.begin(); it != msUsers.end(); it++) { + for (map::const_iterator it = msUsers.begin(); it != msUsers.end(); ++it) { Table.AddRow(); Table.SetCell("Username", it->first); Table.SetCell("Clients", CString(it->second->GetClients().size())); @@ -611,7 +611,7 @@ void CClient::UserCommand(CString& sLine) { GTable.AddColumn("Description"); set::iterator it; - for (it = ssGlobalMods.begin(); it != ssGlobalMods.end(); it++) { + for (it = ssGlobalMods.begin(); it != ssGlobalMods.end(); ++it) { const CModInfo& Info = *it; GTable.AddRow(); GTable.SetCell("Name", (CZNC::Get().GetModules().FindModule(Info.GetName()) ? "*" : " ") + Info.GetName()); @@ -634,7 +634,7 @@ void CClient::UserCommand(CString& sLine) { Table.AddColumn("Description"); set::iterator it; - for (it = ssUserMods.begin(); it != ssUserMods.end(); it++) { + for (it = ssUserMods.begin(); it != ssUserMods.end(); ++it) { const CModInfo& Info = *it; Table.AddRow(); Table.SetCell("Name", (m_pUser->GetModules().FindModule(Info.GetName()) ? "*" : " ") + Info.GetName()); @@ -834,7 +834,7 @@ void CClient::UserCommand(CString& sLine) { Table.AddColumn("VHost"); VCString::const_iterator it; - for (it = vsVHosts.begin(); it != vsVHosts.end(); it++) { + for (it = vsVHosts.begin(); it != vsVHosts.end(); ++it) { Table.AddRow(); Table.SetCell("VHost", *it); } @@ -857,7 +857,7 @@ void CClient::UserCommand(CString& sLine) { VCString::const_iterator it; bool bFound = false; - for (it = vsVHosts.begin(); it != vsVHosts.end(); it++) { + for (it = vsVHosts.begin(); it != vsVHosts.end(); ++it) { if (sVHost.Equals(*it)) { bFound = true; break; @@ -927,7 +927,7 @@ void CClient::UserCommand(CString& sLine) { vector::const_iterator it; const vector& vChans = m_pUser->GetChans(); - for (it = vChans.begin(); it != vChans.end(); it++) { + for (it = vChans.begin(); it != vChans.end(); ++it) { (*it)->ClearBuffer(); } PutStatus("All channel buffers have been cleared"); @@ -968,7 +968,7 @@ void CClient::UserCommand(CString& sLine) { Table.AddColumn("Out"); Table.AddColumn("Total"); - for (it = traffic.begin(); it != traffic.end(); it++) { + for (it = traffic.begin(); it != traffic.end(); ++it) { Table.AddRow(); Table.SetCell("Username", it->first); Table.SetCell("In", CString::ToByteStr(it->second.first)); diff --git a/DCCBounce.cpp b/DCCBounce.cpp index f01dabcd..c3b5e23d 100644 --- a/DCCBounce.cpp +++ b/DCCBounce.cpp @@ -86,12 +86,10 @@ void CDCCBounce::ReachedMaxBuffer() { } void CDCCBounce::ReadData(const char* data, size_t len) { - size_t BufLen; - if (m_pPeer) { m_pPeer->Write(data, len); - BufLen = m_pPeer->GetInternalWriteBuffer().length(); + size_t BufLen = m_pPeer->GetInternalWriteBuffer().length(); if (BufLen >= m_uiMaxDCCBuffer) { DEBUG(GetSockName() << " The send buffer is over the " diff --git a/FileUtils.cpp b/FileUtils.cpp index 0383ab48..961ec2af 100644 --- a/FileUtils.cpp +++ b/FileUtils.cpp @@ -490,7 +490,7 @@ bool CDir::MakeDir(const CString& sPath, mode_t iMode) { // For every single subpath, do... sPath.Split("/", dirs, false); - for (it = dirs.begin(); it != dirs.end(); it++) { + for (it = dirs.begin(); it != dirs.end(); ++it) { // Add this to the path we already created sDir += *it; diff --git a/HTTPSock.cpp b/HTTPSock.cpp index e9ee2d10..f83e709e 100644 --- a/HTTPSock.cpp +++ b/HTTPSock.cpp @@ -407,7 +407,7 @@ bool CHTTPSock::PrintHeader(off_t uContentLength, const CString& sContentType, u } Write("Content-Type: " + m_sContentType + "\r\n"); - for (MCString::iterator it = m_msHeaders.begin(); it != m_msHeaders.end(); it++) { + for (MCString::iterator it = m_msHeaders.begin(); it != m_msHeaders.end(); ++it) { Write(it->first + ": " + it->second + "\r\n"); } diff --git a/IRCSock.cpp b/IRCSock.cpp index 5fcb99c6..bbaa1428 100644 --- a/IRCSock.cpp +++ b/IRCSock.cpp @@ -49,7 +49,7 @@ CIRCSock::~CIRCSock() { m_pUser->IRCDisconnected(); - for (map::iterator a = m_msChans.begin(); a != m_msChans.end(); a++) { + for (map::iterator a = m_msChans.begin(); a != m_msChans.end(); ++a) { delete a->second; } @@ -861,7 +861,7 @@ void CIRCSock::Disconnected() { // otherwise, on reconnect, it might think it still // had user modes that it actually doesn't have. CString sUserMode; - for (set::const_iterator it = m_scUserModes.begin(); it != m_scUserModes.end(); it++) { + for (set::const_iterator it = m_scUserModes.begin(); it != m_scUserModes.end(); ++it) { sUserMode += *it; } if (!sUserMode.empty()) { @@ -1101,7 +1101,7 @@ CIRCSock::EChanModeArgs CIRCSock::GetModeType(unsigned char uMode) const { } void CIRCSock::ResetChans() { - for (map::iterator a = m_msChans.begin(); a != m_msChans.end(); a++) { + for (map::iterator a = m_msChans.begin(); a != m_msChans.end(); ++a) { a->second->Reset(); } } diff --git a/Modules.cpp b/Modules.cpp index 212b8774..5b127b1e 100644 --- a/Modules.cpp +++ b/Modules.cpp @@ -744,7 +744,7 @@ bool CModules::UnloadModule(const CString& sModule, CString& sRetMsg) { } if (pModule->IsFake()) { - for (iterator it = begin(); it != end(); it++) { + for (iterator it = begin(); it != end(); ++it) { if (*it == pModule) { erase(it); sRetMsg = "Fake module [" + sMod + "] unloaded"; @@ -765,7 +765,7 @@ bool CModules::UnloadModule(const CString& sModule, CString& sRetMsg) { if (Unload) { Unload(pModule); - for (iterator it = begin(); it != end(); it++) { + for (iterator it = begin(); it != end(); ++it) { if (*it == pModule) { erase(it); break; diff --git a/Nick.cpp b/Nick.cpp index b84ca118..c4aefdd7 100644 --- a/Nick.cpp +++ b/Nick.cpp @@ -57,7 +57,7 @@ unsigned int CNick::GetCommonChans(vector& vRetChans, CUser* pUser) cons CChan* pChan = vChans[a]; const map& msNicks = pChan->GetNicks(); - for (map::const_iterator it = msNicks.begin(); it != msNicks.end(); it++) { + for (map::const_iterator it = msNicks.begin(); it != msNicks.end(); ++it) { if (it->first.Equals(m_sNick)) { vRetChans.push_back(pChan); continue; diff --git a/Socket.cpp b/Socket.cpp index 1d6661a5..cce185e7 100644 --- a/Socket.cpp +++ b/Socket.cpp @@ -15,7 +15,7 @@ unsigned int CSockManager::GetAnonConnectionCount(const CString &sIP) const { const_iterator it; unsigned int ret = 0; - for (it = begin(); it != end(); it++) { + for (it = begin(); it != end(); ++it) { CZNCSock *pSock = *it; // Logged in CClients have "USR::" as their sockname if (pSock->GetRemoteIP() == sIP && pSock->GetSockName().Left(5) != "USR::") { diff --git a/Template.cpp b/Template.cpp index 7bb81950..2a205b46 100644 --- a/Template.cpp +++ b/Template.cpp @@ -69,7 +69,7 @@ CString CTemplateLoopContext::GetValue(const CString& sName, bool bFromIf) { } CTemplate::~CTemplate() { - for (map >::iterator it = m_mvLoops.begin(); it != m_mvLoops.end(); it++) { + for (map >::iterator it = m_mvLoops.begin(); it != m_mvLoops.end(); ++it) { vector& vLoop = it->second; for (unsigned int a = 0; a < vLoop.size(); a++) { delete vLoop[a]; @@ -101,7 +101,7 @@ CString CTemplate::ExpandFile(const CString& sFilename) { CString sFile(ResolveLiteral(sFilename)); - for (LCString::iterator it = m_lsPaths.begin(); it != m_lsPaths.end(); it++) { + for (LCString::iterator it = m_lsPaths.begin(); it != m_lsPaths.end(); ++it) { CString sRoot = *it; CString sFilePath(CDir::ChangeDir(sRoot, sFile)); @@ -323,7 +323,7 @@ bool CTemplate::Print(const CString& sFileName, ostream& oOut) { if (sArgs.Token(1, true, " ").OptionSplit(msRow)) { CTemplate& NewRow = AddRow(sLoopName); - for (MCString::iterator it = msRow.begin(); it != msRow.end(); it++) { + for (MCString::iterator it = msRow.begin(); it != msRow.end(); ++it) { NewRow[it->first] = it->second; } } @@ -767,11 +767,11 @@ CString CTemplate::GetValue(const CString& sArgs, bool bFromIf) { if (!vspTagHandlers.empty()) { // @todo this should go up to the top to grab handlers CTemplate* pTmpl = GetCurTemplate(); - CString sCustomOutput; if (sRet.empty()) { for (unsigned int j = 0; j < vspTagHandlers.size(); j++) { CSmartPtr spTagHandler = vspTagHandlers[j]; + CString sCustomOutput; if (!bFromIf && spTagHandler->HandleVar(*pTmpl, sArgs.Token(0), sArgs.Token(1, true), sCustomOutput)) { sRet = sCustomOutput; diff --git a/User.cpp b/User.cpp index 08f799a4..9fd0ad5b 100644 --- a/User.cpp +++ b/User.cpp @@ -125,7 +125,7 @@ bool CUser::UpdateModule(const CString &sModule) { map::iterator it2; bool error = false; - for (it = Users.begin(); it != Users.end(); it++) { + for (it = Users.begin(); it != Users.end(); ++it) { CModule *pMod = it->second->GetModules().FindModule(sModule); if (pMod) { Affected[it->second] = pMod->GetArgs(); @@ -134,7 +134,7 @@ bool CUser::UpdateModule(const CString &sModule) { } CString sErr; - for (it2 = Affected.begin(); it2 != Affected.end(); it2++) { + for (it2 = Affected.begin(); it2 != Affected.end(); ++it2) { if (!it2->first->GetModules().LoadModule(sModule, it2->second, it2->first, sErr)) { error = true; DEBUG("Failed to reload [" << sModule << "] for [" << it2->first->GetUserName() @@ -287,7 +287,7 @@ void CUser::UserConnected(CClient* pClient) { CString sUserMode(""); const set& scUserModes = GetIRCSock()->GetUserModes(); for (set::const_iterator it = scUserModes.begin(); - it != scUserModes.end(); it++) { + it != scUserModes.end(); ++it) { sUserMode += *it; } if (!sUserMode.empty()) { @@ -366,7 +366,7 @@ bool CUser::Clone(const CUser& User, CString& sErrorRet, bool bCloneChans) { // Allowed Hosts m_ssAllowedHosts.clear(); const set& ssHosts = User.GetAllowedHosts(); - for (set::const_iterator it = ssHosts.begin(); it != ssHosts.end(); it++) { + for (set::const_iterator it = ssHosts.begin(); it != ssHosts.end(); ++it) { AddAllowedHost(*it); } @@ -444,7 +444,7 @@ bool CUser::Clone(const CUser& User, CString& sErrorRet, bool bCloneChans) { // CTCP Replies m_mssCTCPReplies.clear(); const MCString& msReplies = User.GetCTCPReplies(); - for (MCString::const_iterator it = msReplies.begin(); it != msReplies.end(); it++) { + for (MCString::const_iterator it = msReplies.begin(); it != msReplies.end(); ++it) { AddCTCPReply(it->first, it->second); } // !CTCP Replies @@ -490,7 +490,7 @@ bool CUser::Clone(const CUser& User, CString& sErrorRet, bool bCloneChans) { } } - for (set::iterator it = ssUnloadMods.begin(); it != ssUnloadMods.end(); it++) { + for (set::iterator it = ssUnloadMods.begin(); it != ssUnloadMods.end(); ++it) { vCurMods.UnloadModule(*it); } // !Modules @@ -514,7 +514,7 @@ bool CUser::IsHostAllowed(const CString& sHostMask) const { return true; } - for (set::const_iterator a = m_ssAllowedHosts.begin(); a != m_ssAllowedHosts.end(); a++) { + for (set::const_iterator a = m_ssAllowedHosts.begin(); a != m_ssAllowedHosts.end(); ++a) { if (sHostMask.WildCmp(*a)) { return true; } @@ -597,7 +597,7 @@ bool CUser::AddChan(const CString& sName, bool bInConfig) { } bool CUser::DelChan(const CString& sName) { - for (vector::iterator a = m_vChans.begin(); a != m_vChans.end(); a++) { + for (vector::iterator a = m_vChans.begin(); a != m_vChans.end(); ++a) { if (sName.Equals((*a)->GetName())) { delete *a; m_vChans.erase(a); @@ -664,7 +664,7 @@ bool CUser::WriteConfig(CFile& File) { // Allow Hosts if (!m_ssAllowedHosts.empty()) { - for (set::iterator it = m_ssAllowedHosts.begin(); it != m_ssAllowedHosts.end(); it++) { + for (set::iterator it = m_ssAllowedHosts.begin(); it != m_ssAllowedHosts.end(); ++it) { PrintLine(File, "Allow", *it); } @@ -673,7 +673,7 @@ bool CUser::WriteConfig(CFile& File) { // CTCP Replies if (!m_mssCTCPReplies.empty()) { - for (MCString::iterator itb = m_mssCTCPReplies.begin(); itb != m_mssCTCPReplies.end(); itb++) { + for (MCString::iterator itb = m_mssCTCPReplies.begin(); itb != m_mssCTCPReplies.end(); ++itb) { PrintLine(File, "CTCPReply", itb->first.AsUpper() + " " + itb->second); } diff --git a/Utils.cpp b/Utils.cpp index 918fb969..09c44590 100644 --- a/Utils.cpp +++ b/Utils.cpp @@ -40,7 +40,7 @@ void CUtils::GenerateCert(FILE *pOut, const CString& sHost) { EVP_PKEY *pKey = NULL; X509 *pCert = NULL; X509_NAME *pName = NULL; - int days = 365; + const int days = 365; u_int iSeed = time(NULL); int serial = (rand_r(&iSeed) % 9999); diff --git a/ZNCString.cpp b/ZNCString.cpp index 0c9a9b4d..ffda177b 100644 --- a/ZNCString.cpp +++ b/ZNCString.cpp @@ -1018,7 +1018,7 @@ int MCString::WriteToDisk(const CString& sPath, mode_t iMode) { return MCS_EOPEN; } - for (MCString::iterator it = this->begin(); it != this->end(); it++) { + for (MCString::iterator it = this->begin(); it != this->end(); ++it) { CString sKey = it->first; CString sValue = it->second; if (!WriteFilter(sKey, sValue)) { @@ -1070,7 +1070,7 @@ static const char hexdigits[] = "0123456789abcdef"; CString& MCString::Encode(CString& sValue) { CString sTmp; - for (CString::iterator it = sValue.begin(); it != sValue.end(); it++) { + for (CString::iterator it = sValue.begin(); it != sValue.end(); ++it) { if (isalnum(*it)) { sTmp += *it; } else { diff --git a/modules/admin.cpp b/modules/admin.cpp index e30f84fb..1dffb126 100644 --- a/modules/admin.cpp +++ b/modules/admin.cpp @@ -433,7 +433,7 @@ class CAdminMod : public CModule { Table.AddColumn("Ident"); Table.AddColumn("VHost"); - for (map::const_iterator it = msUsers.begin(); it != msUsers.end(); it++) { + for (map::const_iterator it = msUsers.begin(); it != msUsers.end(); ++it) { Table.AddRow(); Table.SetCell("Username", it->first); Table.SetCell("Realname", it->second->GetRealName()); diff --git a/modules/autoattach.cpp b/modules/autoattach.cpp index 87af9a78..82ba9303 100644 --- a/modules/autoattach.cpp +++ b/modules/autoattach.cpp @@ -30,7 +30,7 @@ public: // Load our saved settings, ignore errors MCString::iterator it; - for (it = BeginNV(); it != EndNV(); it++) { + for (it = BeginNV(); it != EndNV(); ++it) { Add(it->first); } @@ -125,12 +125,12 @@ public: if (sInput.Left(1) == "!") { CString sChan = sInput.substr(1); for (it = m_vsNegChans.begin(); it != m_vsNegChans.end(); - it++) { + ++it) { if (*it == sChan) return true; } } else { - for (it = m_vsChans.begin(); it != m_vsChans.end(); it++) { + for (it = m_vsChans.begin(); it != m_vsChans.end(); ++it) { if (*it == sInput) return true; } diff --git a/modules/autocycle.cpp b/modules/autocycle.cpp index 882c4b2b..fc086b5e 100644 --- a/modules/autocycle.cpp +++ b/modules/autocycle.cpp @@ -28,7 +28,7 @@ public: // Load our saved settings, ignore errors MCString::iterator it; - for (it = BeginNV(); it != EndNV(); it++) { + for (it = BeginNV(); it != EndNV(); ++it) { Add(it->first); } @@ -137,12 +137,12 @@ protected: if (sInput.Left(1) == "!") { CString sChan = sInput.substr(1); for (it = m_vsNegChans.begin(); it != m_vsNegChans.end(); - it++) { + ++it) { if (*it == sChan) return true; } } else { - for (it = m_vsChans.begin(); it != m_vsChans.end(); it++) { + for (it = m_vsChans.begin(); it != m_vsChans.end(); ++it) { if (*it == sInput) return true; } diff --git a/modules/autoop.cpp b/modules/autoop.cpp index e5c2e7ad..f50f5bb7 100644 --- a/modules/autoop.cpp +++ b/modules/autoop.cpp @@ -52,7 +52,7 @@ public: const CString& GetHostmask() const { return m_sHostmask; } bool ChannelMatches(const CString& sChan) const { - for (set::const_iterator it = m_ssChans.begin(); it != m_ssChans.end(); it++) { + for (set::const_iterator it = m_ssChans.begin(); it != m_ssChans.end(); ++it) { if (sChan.AsLower().WildCmp(*it)) { return true; } @@ -68,7 +68,7 @@ public: CString GetChannels() const { CString sRet; - for (set::const_iterator it = m_ssChans.begin(); it != m_ssChans.end(); it++) { + for (set::const_iterator it = m_ssChans.begin(); it != m_ssChans.end(); ++it) { if (!sRet.empty()) { sRet += " "; } @@ -100,7 +100,7 @@ public: CString ToString() const { CString sChans; - for (set::const_iterator it = m_ssChans.begin(); it != m_ssChans.end(); it++) { + for (set::const_iterator it = m_ssChans.begin(); it != m_ssChans.end(); ++it) { if (!sChans.empty()) { sChans += " "; } @@ -135,7 +135,7 @@ public: AddTimer(new CAutoOpTimer(this)); // Load the users - for (MCString::iterator it = BeginNV(); it != EndNV(); it++) { + for (MCString::iterator it = BeginNV(); it != EndNV(); ++it) { const CString& sLine = it->second; CAutoOpUser* pUser = new CAutoOpUser; @@ -150,7 +150,7 @@ public: } virtual ~CAutoOpMod() { - for (map::iterator it = m_msUsers.begin(); it != m_msUsers.end(); it++) { + for (map::iterator it = m_msUsers.begin(); it != m_msUsers.end(); ++it) { delete it->second; } @@ -160,7 +160,7 @@ public: virtual void OnJoin(const CNick& Nick, CChan& Channel) { // If we have ops in this chan if (Channel.HasPerm(CChan::Op)) { - for (map::iterator it = m_msUsers.begin(); it != m_msUsers.end(); it++) { + for (map::iterator it = m_msUsers.begin(); it != m_msUsers.end(); ++it) { // and the nick who joined is a valid user if (it->second->HostMatches(Nick.GetHostMask()) && it->second->ChannelMatches(Channel.GetName())) { if (it->second->GetUserKey().Equals("__NOKEY__")) { @@ -249,7 +249,7 @@ public: Table.AddColumn("Key"); Table.AddColumn("Channels"); - for (map::iterator it = m_msUsers.begin(); it != m_msUsers.end(); it++) { + for (map::iterator it = m_msUsers.begin(); it != m_msUsers.end(); ++it) { Table.AddRow(); Table.SetCell("User", it->second->GetUsername()); Table.SetCell("Hostmask", it->second->GetHostmask()); @@ -295,7 +295,7 @@ public: } CAutoOpUser* FindUserByHost(const CString& sHostmask, const CString& sChannel = "") { - for (map::iterator it = m_msUsers.begin(); it != m_msUsers.end(); it++) { + for (map::iterator it = m_msUsers.begin(); it != m_msUsers.end(); ++it) { CAutoOpUser* pUser = it->second; if (pUser->HostMatches(sHostmask) && (sChannel.empty() || pUser->ChannelMatches(sChannel))) { @@ -337,7 +337,7 @@ public: bool bMatchedHost = false; CAutoOpUser* pUser = NULL; - for (map::iterator it = m_msUsers.begin(); it != m_msUsers.end(); it++) { + for (map::iterator it = m_msUsers.begin(); it != m_msUsers.end(); ++it) { pUser = it->second; // First verify that the guy who challenged us matches a user's host @@ -396,7 +396,7 @@ public: CString sChallenge = itQueue->second; m_msQueue.erase(itQueue); - for (map::iterator it = m_msUsers.begin(); it != m_msUsers.end(); it++) { + for (map::iterator it = m_msUsers.begin(); it != m_msUsers.end(); ++it) { if (it->second->HostMatches(Nick.GetHostMask())) { if (sResponse == CString(it->second->GetUserKey() + "::" + sChallenge).MD5()) { OpUser(Nick, *it->second); @@ -420,7 +420,7 @@ public: while (bRemoved) { bRemoved = false; - for (MCString::iterator it = m_msQueue.begin(); it != m_msQueue.end(); it++) { + for (MCString::iterator it = m_msQueue.begin(); it != m_msQueue.end(); ++it) { if (!it->second.empty()) { m_msQueue.erase(it); bRemoved = true; @@ -430,7 +430,7 @@ public: } // Now issue challenges for the new users in the queue - for (MCString::iterator it = m_msQueue.begin(); it != m_msQueue.end(); it++) { + for (MCString::iterator it = m_msQueue.begin(); it != m_msQueue.end(); ++it) { it->second = CString::RandomString(AUTOOP_CHALLENGE_LENGTH); PutIRC("NOTICE " + it->first + " :!ZNCAO CHALLENGE " + it->second); } diff --git a/modules/away.cpp b/modules/away.cpp index c10b7c5c..9b6bbb75 100644 --- a/modules/away.cpp +++ b/modules/away.cpp @@ -96,7 +96,7 @@ public: sFile.Split("\n", vsLines); - for (it = vsLines.begin(); it != vsLines.end(); it++) { + for (it = vsLines.begin(); it != vsLines.end(); ++it) { CString sLine(*it); sLine.Trim(); AddMessage(sLine); @@ -248,7 +248,7 @@ public: sTmp += sMessage; msvOutput[sWhom].push_back(sTmp); } - for (map< CString, vector< CString> >::iterator it = msvOutput.begin(); it != msvOutput.end(); it++) + for (map< CString, vector< CString> >::iterator it = msvOutput.begin(); it != msvOutput.end(); ++it) { PutModule(it->first, "away"); for (u_int a = 0; a < it->second.size(); a++) diff --git a/modules/buffextras.cpp b/modules/buffextras.cpp index 7aa8ef8a..5d7e379b 100644 --- a/modules/buffextras.cpp +++ b/modules/buffextras.cpp @@ -38,7 +38,7 @@ public: virtual void OnQuit(const CNick& Nick, const CString& sMessage, const vector& vChans) { vector::const_iterator it; CString sMsg = Nick.GetNickMask() + " quit with message: [" + sMessage + "]"; - for (it = vChans.begin(); it != vChans.end(); it++) { + for (it = vChans.begin(); it != vChans.end(); ++it) { AddBuffer(**it, sMsg); } } @@ -54,7 +54,7 @@ public: virtual void OnNick(const CNick& OldNick, const CString& sNewNick, const vector& vChans) { vector::const_iterator it; CString sMsg = OldNick.GetNickMask() + " is now known as " + sNewNick; - for (it = vChans.begin(); it != vChans.end(); it++) { + for (it = vChans.begin(); it != vChans.end(); ++it) { AddBuffer(**it, sMsg); } } diff --git a/modules/chansaver.cpp b/modules/chansaver.cpp index f7e7fb44..a60c4d40 100644 --- a/modules/chansaver.cpp +++ b/modules/chansaver.cpp @@ -19,7 +19,7 @@ public: m_bWriteConf = false; - for (; it != end; it++) { + for (; it != end; ++it) { CChan *pChan = *it; // If that channel isn't yet in the config, diff --git a/modules/crypt.cpp b/modules/crypt.cpp index 986bf8d3..876818f6 100644 --- a/modules/crypt.cpp +++ b/modules/crypt.cpp @@ -124,7 +124,7 @@ public: Table.AddColumn("Target"); Table.AddColumn("Key"); - for (MCString::iterator it = BeginNV(); it != EndNV(); it++) { + for (MCString::iterator it = BeginNV(); it != EndNV(); ++it) { Table.AddRow(); Table.SetCell("Target", it->first); Table.SetCell("Key", it->second);