Fix all those warnings from -Wshadow

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@964 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2008-02-19 20:25:21 +00:00
parent 0dfaa1d706
commit 8f22dcc60d
9 changed files with 61 additions and 57 deletions
+6 -3
View File
@@ -494,15 +494,18 @@ void CChan::IncPermCount(unsigned char uPerm) {
}
bool CChan::RemNick(const CString& sNick) {
map<CString,CNick*>::iterator it = m_msNicks.find(sNick);
map<CString,CNick*>::iterator it;
set<unsigned char>::iterator it2;
it = m_msNicks.find(sNick);
if (it == m_msNicks.end()) {
return false;
}
const set<unsigned char>& suPerms = it->second->GetChanPerms();
for (set<unsigned char>::iterator it = suPerms.begin(); it != suPerms.end(); it++) {
DecPermCount(*it);
for (it2 = suPerms.begin(); it2 != suPerms.end(); it2++) {
DecPermCount(*it2);
}
delete it->second;
+29 -27
View File
@@ -657,10 +657,10 @@ void CClient::UserCommand(const CString& sLine) {
}
unsigned int uTableIdx = 0;
CString sLine;
CString sTmp;
while (Table.GetLine(uTableIdx++, sLine)) {
PutStatus(sLine);
while (Table.GetLine(uTableIdx++, sTmp)) {
PutStatus(sTmp);
}
} else if (sCommand.CaseCmp("DETACH") == 0) {
if (m_pUser) {
@@ -736,10 +736,10 @@ void CClient::UserCommand(const CString& sLine) {
if (Table.size()) {
unsigned int uTableIdx = 0;
CString sLine;
CString sTmp;
while (Table.GetLine(uTableIdx++, sLine)) {
PutStatus(sLine);
while (Table.GetLine(uTableIdx++, sTmp)) {
PutStatus(sTmp);
}
}
}
@@ -767,10 +767,10 @@ void CClient::UserCommand(const CString& sLine) {
if (Table.size()) {
unsigned int uTableIdx = 0;
CString sLine;
CString sTmp;
while (Table.GetLine(uTableIdx++, sLine)) {
PutStatus(sLine);
while (Table.GetLine(uTableIdx++, sTmp)) {
PutStatus(sTmp);
}
}
} else if (m_pUser->IsAdmin() && sCommand.CaseCmp("SetMOTD") == 0) {
@@ -893,10 +893,10 @@ void CClient::UserCommand(const CString& sLine) {
if (Table.size()) {
unsigned int uTableIdx = 0;
CString sLine;
CString sTmp;
while (Table.GetLine(uTableIdx++, sLine)) {
PutStatus(sLine);
while (Table.GetLine(uTableIdx++, sTmp)) {
PutStatus(sTmp);
}
}
}
@@ -959,10 +959,10 @@ void CClient::UserCommand(const CString& sLine) {
if (Table.size()) {
unsigned int uTableIdx = 0;
CString sLine;
CString sTmp;
while (Table.GetLine(uTableIdx++, sLine)) {
PutStatus(sLine);
while (Table.GetLine(uTableIdx++, sTmp)) {
PutStatus(sTmp);
}
}
} else {
@@ -987,10 +987,10 @@ void CClient::UserCommand(const CString& sLine) {
if (Table.size()) {
unsigned int uTableIdx = 0;
CString sLine;
CString sTmp;
while (Table.GetLine(uTableIdx++, sLine)) {
PutStatus(sLine);
while (Table.GetLine(uTableIdx++, sTmp)) {
PutStatus(sTmp);
}
}
}
@@ -1126,10 +1126,10 @@ void CClient::UserCommand(const CString& sLine) {
if (Table.size()) {
unsigned int uTableIdx = 0;
CString sLine;
CString sTmp;
while (Table.GetLine(uTableIdx++, sLine)) {
PutStatus(sLine);
while (Table.GetLine(uTableIdx++, sTmp)) {
PutStatus(sTmp);
}
} else {
PutStatus("You have no active DCCs.");
@@ -1152,10 +1152,11 @@ void CClient::UserCommand(const CString& sLine) {
GTable.SetCell("Description", GModules[b]->GetDescription().Ellipsize(128));
}
unsigned int uTableIdx = 0; CString sLine;
unsigned int uTableIdx = 0;
CString sTmp;
while (GTable.GetLine(uTableIdx++, sLine)) {
PutStatus(sLine);
while (GTable.GetLine(uTableIdx++, sTmp)) {
PutStatus(sTmp);
}
}
}
@@ -1178,9 +1179,10 @@ void CClient::UserCommand(const CString& sLine) {
Table.SetCell("Description", Modules[b]->GetDescription().Ellipsize(128));
}
unsigned int uTableIdx = 0; CString sLine;
while (Table.GetLine(uTableIdx++, sLine)) {
PutStatus(sLine);
unsigned int uTableIdx = 0;
CString sTmp;
while (Table.GetLine(uTableIdx++, sTmp)) {
PutStatus(sTmp);
}
}
#else
+4 -5
View File
@@ -272,7 +272,7 @@ void CIRCSock::ReadLine(const CString& sData) {
CChan* pChan = m_pUser->FindChan(sLine.Token(3));
if (pChan) {
CString sNick = sLine.Token(4);
sNick = sLine.Token(4);
unsigned long ulDate = strtoul(sLine.Token(5).c_str(), NULL, 10);
pChan->SetTopicOwner(sNick);
@@ -283,8 +283,8 @@ void CIRCSock::ReadLine(const CString& sData) {
}
case 352: {
// :irc.yourserver.com 352 yournick #chan ident theirhost.com irc.theirserver.com theirnick H :0 Real Name
CString sServer = sLine.Token(0);
CString sNick = sLine.Token(7);
sServer = sLine.Token(0);
sNick = sLine.Token(7);
CString sIdent = sLine.Token(4);
CString sHost = sLine.Token(5);
@@ -342,7 +342,6 @@ void CIRCSock::ReadLine(const CString& sData) {
// Get everything except the actual user list
CString sTmp = sLine.Token(0, false, " :") + " :";
vector<CClient*>& vClients = m_pUser->GetClients();
CString sNick;
for (unsigned int a = 0; a < vClients.size(); a++) {
if ((!m_bNamesx || vClients[a]->HasNamesx())
@@ -412,7 +411,7 @@ void CIRCSock::ReadLine(const CString& sData) {
}
} else { //if (CUtils::wildcmp(":*!*@* * *", sLine.c_str())) {
CNick Nick(sLine.Token(0).LeftChomp_n());
CString sCmd = sLine.Token(1);
sCmd = sLine.Token(1);
CString sRest = sLine.Token(2, true);
if (sCmd.CaseCmp("NICK") == 0) {
+1 -1
View File
@@ -277,7 +277,7 @@ bool CUser::Clone(const CUser& User, CString& sErrorRet) {
AddAllowedHost(*it);
}
for (unsigned int a = 0; a < m_vClients.size(); a++) {
for (a = 0; a < m_vClients.size(); a++) {
CClient* pSock = m_vClients[a];
if (!IsHostAllowed(pSock->GetRemoteIP())) {
+6 -6
View File
@@ -89,10 +89,10 @@ public:
if (Table.size()) {
unsigned int uTableIdx = 0;
CString sLine;
CString sTmp;
while (Table.GetLine(uTableIdx++, sLine)) {
PutModule(sLine);
while (Table.GetLine(uTableIdx++, sTmp)) {
PutModule(sTmp);
}
} else {
PutModule("You have no entries.");
@@ -116,10 +116,10 @@ public:
if (Table.size()) {
unsigned int uTableIdx = 0;
CString sLine;
CString sTmp;
while (Table.GetLine(uTableIdx++, sLine)) {
PutModule(sLine);
while (Table.GetLine(uTableIdx++, sTmp)) {
PutModule(sTmp);
}
} else {
PutModule("You have no entries.");
+3 -3
View File
@@ -270,11 +270,11 @@ public:
Table.SetCell("Channels", it->second->GetChannels());
}
CString sLine;
CString sTmp;
unsigned int uTableIdx = 0;
while (Table.GetLine(uTableIdx++, sLine)) {
PutModule(sLine);
while (Table.GetLine(uTableIdx++, sTmp)) {
PutModule(sTmp);
}
} else if (sCommand.CaseCmp("ADDCHANS") == 0 || sCommand.CaseCmp("DELCHANS") == 0) {
CString sUser = sLine.Token(1);
+9 -9
View File
@@ -419,10 +419,10 @@ public:
Table.SetCell("Description", "Show which users can not part this channel");
unsigned int uTableIdx = 0;
CString sLine;
CString sTmp;
while (Table.GetLine(uTableIdx++, sLine)) {
PutModule(sLine);
while (Table.GetLine(uTableIdx++, sTmp)) {
PutModule(sTmp);
}
} else if (sCommand.CaseCmp("LIST") == 0) {
if (!m_ssChannels.size()) {
@@ -443,10 +443,10 @@ public:
}
unsigned int uTableIdx = 0;
CString sLine;
CString sTmp;
while (Table.GetLine(uTableIdx++, sLine)) {
PutModule(sLine);
while (Table.GetLine(uTableIdx++, sTmp)) {
PutModule(sTmp);
}
} else if (sCommand.CaseCmp("ADDFIXCHAN") == 0) {
if(!m_pUser->IsAdmin()) {
@@ -577,10 +577,10 @@ public:
void SendNickList(CUser* pUser, const set<CString>& ssNicks, const CString& sChan) {
CString sNickList;
for (set<CString>::iterator it = ssNicks.begin(); it != ssNicks.end(); it++) {
CUser* pUser = CZNC::Get().FindUser(*it);
CUser* pChanUser = CZNC::Get().FindUser(*it);
if (pUser && pUser->IsUserAttached()) {
sNickList += (pUser->IsAdmin()) ? "@" : "+";
if (pChanUser && pChanUser->IsUserAttached()) {
sNickList += (pChanUser->IsAdmin()) ? "@" : "+";
}
sNickList += "?" + (*it) + " ";
+1 -1
View File
@@ -180,7 +180,7 @@ public:
if ( DecryptChannel( sArgs, sFile ) )
{
CString sLine;
CString::size_type iPos = 0;
iPos = 0;
while( ReadLine( sFile, sLine, iPos ) )
{
sLine.Trim();
+2 -2
View File
@@ -713,7 +713,7 @@ bool CZNC::WriteNewConfig(const CString& sConfig) {
do {
CString sHost, sPass;
bool bSSL = false;
unsigned int uPort = 0;
uPort = 0;
while(!CUtils::GetInput("IRC server", sHost, "", "host only") || !CServer::IsValidHostName(sHost)) ;
while(!CUtils::GetNumInput("[" + sHost + "] Port", uPort, 1, 65535, 6667)) ;
@@ -938,7 +938,7 @@ bool CZNC::DoRehash(CString& sError)
sValue.Trim();
if (sLine.Left(1) == "/") {
CString sTag = sLine.substr(1);
sTag = sTag.substr(1);
if (pUser) {
if (pChan) {