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:
psychon
2010-02-19 16:21:07 +00:00
parent c095da5602
commit 20e8465b60
22 changed files with 69 additions and 71 deletions
+12 -12
View File
@@ -52,7 +52,7 @@ public:
const CString& GetHostmask() const { return m_sHostmask; }
bool ChannelMatches(const CString& sChan) const {
for (set<CString>::const_iterator it = m_ssChans.begin(); it != m_ssChans.end(); it++) {
for (set<CString>::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<CString>::const_iterator it = m_ssChans.begin(); it != m_ssChans.end(); it++) {
for (set<CString>::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<CString>::const_iterator it = m_ssChans.begin(); it != m_ssChans.end(); it++) {
for (set<CString>::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<CString, CAutoOpUser*>::iterator it = m_msUsers.begin(); it != m_msUsers.end(); it++) {
for (map<CString, CAutoOpUser*>::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<CString, CAutoOpUser*>::iterator it = m_msUsers.begin(); it != m_msUsers.end(); it++) {
for (map<CString, CAutoOpUser*>::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<CString, CAutoOpUser*>::iterator it = m_msUsers.begin(); it != m_msUsers.end(); it++) {
for (map<CString, CAutoOpUser*>::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<CString, CAutoOpUser*>::iterator it = m_msUsers.begin(); it != m_msUsers.end(); it++) {
for (map<CString, CAutoOpUser*>::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<CString, CAutoOpUser*>::iterator it = m_msUsers.begin(); it != m_msUsers.end(); it++) {
for (map<CString, CAutoOpUser*>::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<CString, CAutoOpUser*>::iterator it = m_msUsers.begin(); it != m_msUsers.end(); it++) {
for (map<CString, CAutoOpUser*>::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);
}