Skip to content
Browse files

Cleaned up more warnings.

  • Loading branch information...
1 parent c256116 commit 82a708d6a161407b6df653c5789f7638d31e6fb1 baines committed
View
2 modules/autovoice.cpp
@@ -123,7 +123,7 @@ class CAutoVoiceMod : public CModule {
}
// Load the saved users
- for (MCString::iterator it = BeginNV(); it != EndNV(); it++) {
+ for (MCString::iterator it = BeginNV(); it != EndNV(); ++it) {
const CString& sLine = it->second;
CAutoVoiceUser* pUser = new CAutoVoiceUser;
View
16 modules/certauth.cpp
@@ -39,11 +39,11 @@ class CSSLClientCertMod : public CModule {
// We need the SSL_VERIFY_PEER flag on all listeners, or else
// the client doesn't send a ssl cert
- for (it = vListeners.begin(); it != vListeners.end(); it++)
+ for (it = vListeners.begin(); it != vListeners.end(); ++it)
(*it)->GetRealListener()->SetRequireClientCertFlags(SSL_VERIFY_PEER);
MCString::iterator it1;
- for (it1 = BeginNV(); it1 != EndNV(); it1++) {
+ for (it1 = BeginNV(); it1 != EndNV(); ++it1) {
VCString vsKeys;
VCString::iterator it2;
@@ -53,7 +53,7 @@ class CSSLClientCertMod : public CModule {
}
it1->second.Split(" ", vsKeys, false);
- for (it2 = vsKeys.begin(); it2 != vsKeys.end(); it2++) {
+ for (it2 = vsKeys.begin(); it2 != vsKeys.end(); ++it2) {
m_PubKeys[it1->first].insert(*it2);
}
}
@@ -75,10 +75,10 @@ class CSSLClientCertMod : public CModule {
MSCString::iterator it;
ClearNV(false);
- for (it = m_PubKeys.begin(); it != m_PubKeys.end(); it++) {
+ for (it = m_PubKeys.begin(); it != m_PubKeys.end(); ++it) {
CString sVal;
SCString::iterator it2;
- for (it2 = it->second.begin(); it2 != it->second.end(); it2++) {
+ for (it2 = it->second.begin(); it2 != it->second.end(); ++it2) {
sVal += *it2 + " ";
}
@@ -176,7 +176,7 @@ class CSSLClientCertMod : public CModule {
SCString::iterator it2;
unsigned int id = 1;
- for (it2 = it->second.begin(); it2 != it->second.end(); it2++) {
+ for (it2 = it->second.begin(); it2 != it->second.end(); ++it2) {
Table.AddRow();
Table.SetCell("Id", CString(id++));
Table.SetCell("Key", *it2);
@@ -205,7 +205,7 @@ class CSSLClientCertMod : public CModule {
SCString::iterator it2 = it->second.begin();
while (id > 1) {
- it2++;
+ ++it2;
id--;
}
@@ -245,7 +245,7 @@ class CSSLClientCertMod : public CModule {
if (it != m_PubKeys.end()) {
SCString::iterator it2;
- for (it2 = it->second.begin(); it2 != it->second.end(); it2++) {
+ for (it2 = it->second.begin(); it2 != it->second.end(); ++it2) {
CTemplate& row = Tmpl.AddRow("KeyLoop");
row["Key"] = *it2;
}
View
6 modules/charset.cpp
@@ -151,7 +151,7 @@ class CCharsetMod : public CModule
bool bConverted = false;
// try all possible source charsets:
- for(VCString::const_iterator itf = vsFrom.begin(); itf != vsFrom.end(); itf++)
+ for(VCString::const_iterator itf = vsFrom.begin(); itf != vsFrom.end(); ++itf)
{
if(ConvertCharset(*itf, sTo, sDataCopy))
{
@@ -201,9 +201,9 @@ class CCharsetMod : public CModule
sArgs.Token(uIndex + 1).Split(",", vsTo);
// probe conversions:
- for(VCString::const_iterator itf = vsFrom.begin(); itf != vsFrom.end(); itf++)
+ for(VCString::const_iterator itf = vsFrom.begin(); itf != vsFrom.end(); ++itf)
{
- for(VCString::const_iterator itt = vsTo.begin(); itt != vsTo.end(); itt++)
+ for(VCString::const_iterator itt = vsTo.begin(); itt != vsTo.end(); ++itt)
{
iconv_t icTest = iconv_open(itt->c_str(), itf->c_str());
if(icTest == (iconv_t)-1)
View
2 modules/controlpanel.cpp
@@ -913,7 +913,7 @@ class CAdminMod : public CModule {
CTable Table;
Table.AddColumn("Request");
Table.AddColumn("Reply");
- for (MCString::const_iterator it = msCTCPReplies.begin(); it != msCTCPReplies.end(); it++) {
+ for (MCString::const_iterator it = msCTCPReplies.begin(); it != msCTCPReplies.end(); ++it) {
Table.AddRow();
Table.SetCell("Request", it->first);
Table.SetCell("Reply", it->second);
View
4 modules/modtcl.cpp
@@ -34,7 +34,7 @@ class CModTcl;
class CModTclTimer : public CTimer {
public:
- CModTclTimer(CModule* pModule, unsigned int uInterval, unsigned int uCycles, const CString& sLabel, const CString& sDescription) : CTimer(pModule, uInterval, uCycles, sLabel, sDescription) {}
+ CModTclTimer(CModule* pModule, unsigned int uInterval, unsigned int uCycles, const CString& sLabel, const CString& sDescription) : CTimer(pModule, uInterval, uCycles, sLabel, sDescription), mpParent(NULL) {}
virtual ~CModTclTimer() {}
protected:
virtual void RunJob();
@@ -44,7 +44,7 @@ class CModTclTimer : public CTimer {
class CModTclStartTimer : public CTimer {
public:
- CModTclStartTimer(CModule* pModule, unsigned int uInterval, unsigned int uCycles, const CString& sLabel, const CString& sDescription) : CTimer(pModule, uInterval, uCycles, sLabel, sDescription) {}
+ CModTclStartTimer(CModule* pModule, unsigned int uInterval, unsigned int uCycles, const CString& sLabel, const CString& sDescription) : CTimer(pModule, uInterval, uCycles, sLabel, sDescription), m_pParent(NULL) {}
virtual ~CModTclStartTimer() {}
protected:
virtual void RunJob();
View
6 modules/partyline.cpp
@@ -47,7 +47,7 @@ class CPartylineChannel {
class CPartylineMod : public CModule {
public:
void ListChannelsCommand(const CString& sLine) {
- if (!m_ssChannels.size()) {
+ if (m_ssChannels.empty()) {
PutModule("There are no open channels.");
return;
}
@@ -89,7 +89,7 @@ class CPartylineMod : public CModule {
}
}
- while (m_ssChannels.size()) {
+ while (!m_ssChannels.empty()) {
delete *m_ssChannels.begin();
m_ssChannels.erase(m_ssChannels.begin());
}
@@ -174,7 +174,7 @@ class CPartylineMod : public CModule {
CPartylineChannel *pChan = *it;
// RemoveUser() might delete channels, so make sure our
// iterator doesn't break.
- it++;
+ ++it;
RemoveUser(&User, pChan, "KICK", "User deleted", true);
}
View
2 modules/perform.cpp
@@ -45,7 +45,7 @@ class CPerform : public CModule {
Table.AddColumn("Perform");
Table.AddColumn("Expanded");
- for (VCString::const_iterator it = m_vPerform.begin(); it != m_vPerform.end(); it++, index++) {
+ for (VCString::const_iterator it = m_vPerform.begin(); it != m_vPerform.end(); ++it, index++) {
Table.AddRow();
Table.SetCell("Id", CString(index));
Table.SetCell("Perform", *it);
View
2 modules/schat.cpp
@@ -89,7 +89,7 @@ class CSChatSock : public CSocket
} else {
// Buffer playback
vector<CS_STRING>::reverse_iterator it = m_vBuffer.rbegin();
- for (; it != m_vBuffer.rend(); it++)
+ for (; it != m_vBuffer.rend(); ++it)
ReadLine(*it);
m_vBuffer.clear();
View
12 modules/watch.cpp
@@ -68,7 +68,7 @@ class CWatchEntry {
bool bGoodSource = true;
- if (sSource.size() && m_vsSources.size()) {
+ if (!sSource.empty() && !m_vsSources.empty()) {
bGoodSource = false;
for (unsigned int a = 0; a < m_vsSources.size(); a++) {
@@ -325,7 +325,7 @@ class CWatcherMod : public CModule {
list<CWatchEntry>::iterator it = m_lsWatchers.begin();
for (unsigned int a = 0; a < uIdx; a++)
- it++;
+ ++it;
(*it).SetDisabled(bDisabled);
PutModule("Id " + CString(uIdx +1) + ((bDisabled) ? " Disabled" : " Enabled"));
@@ -343,7 +343,7 @@ class CWatcherMod : public CModule {
unsigned int uIdx = 1;
- for (list<CWatchEntry>::iterator it = m_lsWatchers.begin(); it != m_lsWatchers.end(); it++, uIdx++) {
+ for (list<CWatchEntry>::iterator it = m_lsWatchers.begin(); it != m_lsWatchers.end(); ++it, uIdx++) {
CWatchEntry& WatchEntry = *it;
Table.AddRow();
@@ -373,7 +373,7 @@ class CWatcherMod : public CModule {
unsigned int uIdx = 1;
- for (list<CWatchEntry>::iterator it = m_lsWatchers.begin(); it != m_lsWatchers.end(); it++, uIdx++) {
+ for (list<CWatchEntry>::iterator it = m_lsWatchers.begin(); it != m_lsWatchers.end(); ++it, uIdx++) {
CWatchEntry& WatchEntry = *it;
PutModule("/msg " + GetModNick() + " ADD " + WatchEntry.GetHostMask() + " " +
@@ -401,7 +401,7 @@ class CWatcherMod : public CModule {
list<CWatchEntry>::iterator it = m_lsWatchers.begin();
for (unsigned int a = 0; a < uIdx; a++)
- it++;
+ ++it;
(*it).SetSources(sSources);
PutModule("Sources set for Id " + CString(uIdx +1) + ".");
@@ -417,7 +417,7 @@ class CWatcherMod : public CModule {
list<CWatchEntry>::iterator it = m_lsWatchers.begin();
for (unsigned int a = 0; a < uIdx; a++)
- it++;
+ ++it;
m_lsWatchers.erase(it);
PutModule("Id " + CString(uIdx +1) + " Removed.");
View
6 modules/webadmin.cpp
@@ -941,7 +941,7 @@ class CWebAdminMod : public CModule {
}
}
- for (set<CString>::iterator it2 = ssUnloadMods.begin(); it2 != ssUnloadMods.end(); it2++) {
+ for (set<CString>::iterator it2 = ssUnloadMods.begin(); it2 != ssUnloadMods.end(); ++it2) {
pNetwork->GetModules().UnloadModule(*it2);
}
@@ -1069,7 +1069,7 @@ class CWebAdminMod : public CModule {
}
const MCString& msCTCPReplies = pUser->GetCTCPReplies();
- for (MCString::const_iterator it2 = msCTCPReplies.begin(); it2 != msCTCPReplies.end(); it2++) {
+ for (MCString::const_iterator it2 = msCTCPReplies.begin(); it2 != msCTCPReplies.end(); ++it2) {
CTemplate& l = Tmpl.AddRow("CTCPLoop");
l["CTCP"] = it2->first + " " + it2->second;
}
@@ -1645,7 +1645,7 @@ class CWebAdminMod : public CModule {
}
}
- for (set<CString>::iterator it2 = ssUnloadMods.begin(); it2 != ssUnloadMods.end(); it2++) {
+ for (set<CString>::iterator it2 = ssUnloadMods.begin(); it2 != ssUnloadMods.end(); ++it2) {
CZNC::Get().GetModules().UnloadModule(*it2);
}
View
8 src/ClientCommand.cpp
@@ -66,7 +66,7 @@ void CClient::UserCommand(CString& sLine) {
CIRCSock* pIRCSock = m_pNetwork->GetIRCSock();
const CString& sPerms = (pIRCSock) ? pIRCSock->GetPerms() : "";
- if (!msNicks.size()) {
+ if (msNicks.empty()) {
PutStatus("No nicks on [" + sChan + "]");
return;
}
@@ -414,7 +414,7 @@ void CClient::UserCommand(CString& sLine) {
CIRCSock* pIRCSock = pNetwork->GetIRCSock();
const CString& sPerms = (pIRCSock) ? pIRCSock->GetPerms() : "";
- if (!vChans.size()) {
+ if (vChans.empty()) {
PutStatus("There are no channels defined.");
return;
}
@@ -831,7 +831,7 @@ void CClient::UserCommand(CString& sLine) {
set<CModInfo> ssUserMods;
CZNC::Get().GetModules().GetAvailableMods(ssUserMods);
- if (!ssUserMods.size()) {
+ if (ssUserMods.empty()) {
PutStatus("No user modules available.");
} else {
PutStatus("User modules:");
@@ -853,7 +853,7 @@ void CClient::UserCommand(CString& sLine) {
set<CModInfo> ssNetworkMods;
CZNC::Get().GetModules().GetAvailableMods(ssNetworkMods, CModInfo::NetworkModule);
- if (!ssNetworkMods.size()) {
+ if (ssNetworkMods.empty()) {
PutStatus("No network modules available.");
} else {
PutStatus("Network modules:");
View
9 src/Csocket.cpp
@@ -757,7 +757,7 @@ bool CSMonitorFD::CheckFDs( const std::map< int, short > & miiReadyFds )
if( itFD != miiReadyFds.end() )
miiTriggerdFds[itFD->first] = itFD->second;
}
- if( miiTriggerdFds.size() )
+ if( !miiTriggerdFds.empty() )
return( FDsThatTriggered( miiTriggerdFds ) );
return( m_bEnabled );
}
@@ -1269,10 +1269,9 @@ bool Csock::Listen( uint16_t iPort, int iMaxConns, const CS_STRING & sBindHost,
cs_sock_t Csock::Accept( CS_STRING & sHost, uint16_t & iRPort )
{
- cs_sock_t iSock = CS_INVALID_SOCK;
struct sockaddr_storage cAddr;
socklen_t iAddrLen = sizeof( cAddr );
- iSock = accept( m_iReadSock, ( struct sockaddr * )&cAddr, &iAddrLen );
+ cs_sock_t iSock = accept( m_iReadSock, ( struct sockaddr * )&cAddr, &iAddrLen );
if( iSock != CS_INVALID_SOCK && getpeername( iSock, ( struct sockaddr * )&cAddr, &iAddrLen ) == 0 )
{
ConvertAddress( &cAddr, iAddrLen, sHost, &iRPort );
@@ -2816,7 +2815,7 @@ void CSocketManager::Loop()
{
case SUCCESS:
{
- for( std::map<Csock *, EMessages>::iterator itSock = mpeSocks.begin(); itSock != mpeSocks.end(); itSock++ )
+ for( std::map<Csock *, EMessages>::iterator itSock = mpeSocks.begin(); itSock != mpeSocks.end(); ++itSock )
{
Csock * pcSock = itSock->first;
EMessages iErrno = itSock->second;
@@ -2968,7 +2967,7 @@ Csock * CSocketManager::FindSockByName( const CS_STRING & sName )
{
std::vector<Csock *>::iterator it;
std::vector<Csock *>::iterator it_end = this->end();
- for( it = this->begin(); it != it_end; it++ )
+ for( it = this->begin(); it != it_end; ++it )
{
if( (*it)->GetSockName() == sName )
return( *it );
View
2 test/ConfigTest.cpp
@@ -106,7 +106,7 @@ class CConfigSuccessTest : public CConfigTest {
else
while (i != vsEntries.end()) {
sRes += sKey + "=" + *i + "\n";
- i++;
+ ++i;
}
++it;
}

0 comments on commit 82a708d

Please sign in to comment.
Something went wrong with that request. Please try again.