Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Catch as references

  • Loading branch information...
commit c256116d8131dd3fd4a4014444bde3125d16bbc2 1 parent d085b1d
baines authored
View
6 src/Client.cpp
@@ -24,7 +24,7 @@ using std::vector;
pModule->SetClient(CLIENT); \
pModule->FUNC; \
pModule->SetClient(NULL); \
- } catch (CModule::EModException e) { \
+ } catch (const CModule::EModException& e) { \
if (e == CModule::UNLOAD) { \
(NETWORK)->GetModules().UnloadModule(MOD); \
} \
@@ -36,7 +36,7 @@ using std::vector;
pModule->FUNC; \
pModule->SetClient(NULL); \
pModule->SetNetwork(NULL); \
- } catch (CModule::EModException e) { \
+ } catch (const CModule::EModException& e) { \
if (e == CModule::UNLOAD) { \
(USER)->GetModules().UnloadModule(MOD); \
} \
@@ -50,7 +50,7 @@ using std::vector;
pModule->SetClient(NULL); \
pModule->SetNetwork(NULL); \
pModule->SetUser(NULL); \
- } catch (CModule::EModException e) { \
+ } catch (const CModule::EModException& e) { \
if (e == CModule::UNLOAD) { \
CZNC::Get().GetModules().UnloadModule(MOD); \
} \
View
2  src/IRCNetwork.cpp
@@ -760,7 +760,7 @@ bool CIRCNetwork::DelServer(const CString& sName, unsigned short uPort, const CS
bool bSawCurrentServer = false;
CServer* pCurServer = GetCurrentServer();
- for (vector<CServer*>::iterator it = m_vServers.begin(); it != m_vServers.end(); it++, a++) {
+ for (vector<CServer*>::iterator it = m_vServers.begin(); it != m_vServers.end(); ++it, a++) {
CServer* pServer = *it;
if (pServer == pCurServer)
View
12 src/Modules.cpp
@@ -48,7 +48,7 @@ bool ZNC_NO_NEED_TO_DO_ANYTHING_ON_MODULE_CALL_EXITER;
if (m_pNetwork) \
pMod->SetNetwork(pNetwork); \
pMod->SetClient(pOldClient); \
- } catch (CModule::EModException e) { \
+ } catch (const CModule::EModException& e) { \
if (e == CModule::UNLOAD) { \
UnloadModule((*this)[a]->GetModName()); \
} \
@@ -88,7 +88,7 @@ bool ZNC_NO_NEED_TO_DO_ANYTHING_ON_MODULE_CALL_EXITER;
bHaltCore = true; \
break; \
} \
- } catch (CModule::EModException e) { \
+ } catch (const CModule::EModException& e) { \
if (e == CModule::UNLOAD) { \
UnloadModule((*this)[a]->GetModName()); \
} \
@@ -689,7 +689,7 @@ bool CModules::OnBoot() {
if (!(*this)[a]->OnBoot()) {
return true;
}
- } catch (CModule::EModException e) {
+ } catch (const CModule::EModException& e) {
if (e == CModule::UNLOAD) {
UnloadModule((*this)[a]->GetModName());
}
@@ -773,7 +773,7 @@ bool CModules::OnServerCapAvailable(const CString& sCap) {
bResult |= pMod->OnServerCapAvailable(sCap);
}
pMod->SetClient(pOldClient);
- } catch (CModule::EModException e) {
+ } catch (const CModule::EModException& e) {
if (CModule::UNLOAD == e) {
UnloadModule((*this)[a]->GetModName());
}
@@ -836,7 +836,7 @@ bool CModules::IsClientCapSupported(CClient* pClient, const CString& sCap, bool
bResult |= pMod->IsClientCapSupported(pClient, sCap, bState);
}
pMod->SetClient(pOldClient);
- } catch (CModule::EModException e) {
+ } catch (const CModule::EModException& e) {
if (CModule::UNLOAD == e) {
UnloadModule((*this)[a]->GetModName());
}
@@ -942,7 +942,7 @@ bool CModules::LoadModule(const CString& sModule, const CString& sArgs, CModInfo
bool bLoaded;
try {
bLoaded = pModule->OnLoad(sArgs, sRetMsg);
- } catch (CModule::EModException) {
+ } catch (const CModule::EModException&) {
bLoaded = false;
sRetMsg = "Caught an exception";
}
View
2  src/User.cpp
@@ -327,7 +327,7 @@ bool CUser::ParseConfig(CConfig* pConfig, CString& sError) {
CZNC::DumpConfig(pSubConf);
return false;
}
- subIt++;
+ ++subIt;
}
if (subIt != subConf.end()) {
sError = "Password defined more than once";
View
2  src/main.cpp
@@ -344,7 +344,7 @@ int main(int argc, char** argv) {
try {
pZNC->Loop();
- } catch (CException e) {
+ } catch (const CException& e) {
switch (e.GetType()) {
case CException::EX_Shutdown:
iRet = 0;
View
6 src/znc.cpp
@@ -711,7 +711,7 @@ bool CZNC::WriteNewConfig(const CString& sConfigFile) {
GetModules().GetAvailableMods(ssUserMods);
size_t uNrOtherUserMods = FilterUncommonModules(ssUserMods);
- if (ssUserMods.size()) {
+ if (!ssUserMods.empty()) {
vsLines.push_back("");
CUtils::PrintMessage("");
CUtils::PrintMessage("-- User Modules --");
@@ -770,7 +770,7 @@ bool CZNC::WriteNewConfig(const CString& sConfigFile) {
GetModules().GetAvailableMods(ssNetworkMods, CModInfo::NetworkModule);
size_t uNrOtherNetworkMods = FilterUncommonModules(ssNetworkMods);
- if (ssNetworkMods.size()) {
+ if (!ssNetworkMods.empty()) {
CUtils::PrintMessage("");
CUtils::PrintMessage("-- Network Modules --");
CUtils::PrintMessage("");
@@ -964,7 +964,7 @@ size_t CZNC::FilterUncommonModules(set<CModInfo>& ssModules) {
size_t uNrRemoved = 0;
for(set<CModInfo>::iterator it = ssModules.begin(); it != ssModules.end(); ) {
if(ssNames.count(it->GetName()) > 0) {
- it++;
+ ++it;
} else {
set<CModInfo>::iterator it2 = it++;
ssModules.erase(it2);
Please sign in to comment.
Something went wrong with that request. Please try again.