mirror of
https://github.com/znc/znc.git
synced 2026-08-08 01:43:03 +02:00
Catch as references
This commit is contained in:
+3
-3
@@ -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); \
|
||||
} \
|
||||
|
||||
+1
-1
@@ -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)
|
||||
|
||||
+6
-6
@@ -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";
|
||||
}
|
||||
|
||||
+1
-1
@@ -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";
|
||||
|
||||
+1
-1
@@ -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;
|
||||
|
||||
+3
-3
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user