mirror of
https://github.com/znc/znc.git
synced 2026-07-05 17:31:06 +02:00
Cleaned up more warnings.
This commit is contained in:
@@ -123,7 +123,7 @@ public:
|
||||
}
|
||||
|
||||
// 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;
|
||||
|
||||
|
||||
@@ -39,11 +39,11 @@ public:
|
||||
|
||||
// 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 @@ public:
|
||||
}
|
||||
|
||||
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 @@ public:
|
||||
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 @@ public:
|
||||
|
||||
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 @@ public:
|
||||
|
||||
SCString::iterator it2 = it->second.begin();
|
||||
while (id > 1) {
|
||||
it2++;
|
||||
++it2;
|
||||
id--;
|
||||
}
|
||||
|
||||
@@ -245,7 +245,7 @@ public:
|
||||
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;
|
||||
}
|
||||
|
||||
+3
-3
@@ -151,7 +151,7 @@ private:
|
||||
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 @@ public:
|
||||
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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
+2
-2
@@ -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 @@ protected:
|
||||
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();
|
||||
|
||||
@@ -47,7 +47,7 @@ protected:
|
||||
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 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
while (m_ssChannels.size()) {
|
||||
while (!m_ssChannels.empty()) {
|
||||
delete *m_ssChannels.begin();
|
||||
m_ssChannels.erase(m_ssChannels.begin());
|
||||
}
|
||||
@@ -174,7 +174,7 @@ public:
|
||||
CPartylineChannel *pChan = *it;
|
||||
// RemoveUser() might delete channels, so make sure our
|
||||
// iterator doesn't break.
|
||||
it++;
|
||||
++it;
|
||||
RemoveUser(&User, pChan, "KICK", "User deleted", true);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
+1
-1
@@ -89,7 +89,7 @@ public:
|
||||
} 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();
|
||||
|
||||
+6
-6
@@ -68,7 +68,7 @@ public:
|
||||
|
||||
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 @@ private:
|
||||
|
||||
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 @@ private:
|
||||
|
||||
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 @@ private:
|
||||
|
||||
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 @@ private:
|
||||
|
||||
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 @@ private:
|
||||
|
||||
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.");
|
||||
|
||||
@@ -941,7 +941,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
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 @@ public:
|
||||
}
|
||||
|
||||
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 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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:");
|
||||
|
||||
+4
-5
@@ -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 );
|
||||
|
||||
+1
-1
@@ -106,7 +106,7 @@ public:
|
||||
else
|
||||
while (i != vsEntries.end()) {
|
||||
sRes += sKey + "=" + *i + "\n";
|
||||
i++;
|
||||
++i;
|
||||
}
|
||||
++it;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user