mirror of
https://github.com/znc/znc.git
synced 2026-05-08 22:34:45 +02:00
Fix a bunch of style suggestions from cppcheck[1]
Thanks to DarthGandalf for this patch. You must be bored. :P [1] cppcheck.sf.net git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1776 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -125,7 +125,7 @@ bool CUser::UpdateModule(const CString &sModule) {
|
||||
map<CUser*, CString>::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<unsigned char>& scUserModes = GetIRCSock()->GetUserModes();
|
||||
for (set<unsigned char>::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<CString>& ssHosts = User.GetAllowedHosts();
|
||||
for (set<CString>::const_iterator it = ssHosts.begin(); it != ssHosts.end(); it++) {
|
||||
for (set<CString>::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<CString>::iterator it = ssUnloadMods.begin(); it != ssUnloadMods.end(); it++) {
|
||||
for (set<CString>::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<CString>::const_iterator a = m_ssAllowedHosts.begin(); a != m_ssAllowedHosts.end(); a++) {
|
||||
for (set<CString>::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<CChan*>::iterator a = m_vChans.begin(); a != m_vChans.end(); a++) {
|
||||
for (vector<CChan*>::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<CString>::iterator it = m_ssAllowedHosts.begin(); it != m_ssAllowedHosts.end(); it++) {
|
||||
for (set<CString>::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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user