diff --git a/modules/adminlog.cpp b/modules/adminlog.cpp index d96670ca..db0ecea9 100644 --- a/modules/adminlog.cpp +++ b/modules/adminlog.cpp @@ -35,7 +35,7 @@ class CAdminLogMod : public CModule { openlog("znc", LOG_PID, LOG_DAEMON); } - virtual ~CAdminLogMod() { + ~CAdminLogMod() override { Log("Logging ended."); closelog(); } diff --git a/modules/autoattach.cpp b/modules/autoattach.cpp index 23709227..4b93a224 100644 --- a/modules/autoattach.cpp +++ b/modules/autoattach.cpp @@ -155,7 +155,7 @@ class CChanAttach : public CModule { "", "List all entries"); } - virtual ~CChanAttach() {} + ~CChanAttach() override {} bool OnLoad(const CString& sArgs, CString& sMessage) override { VCString vsChans; diff --git a/modules/autocycle.cpp b/modules/autocycle.cpp index 3d29b068..24a0a09f 100644 --- a/modules/autocycle.cpp +++ b/modules/autocycle.cpp @@ -36,7 +36,7 @@ class CAutoCycleMod : public CModule { m_recentlyCycled.SetTTL(15 * 1000); } - virtual ~CAutoCycleMod() {} + ~CAutoCycleMod() override {} bool OnLoad(const CString& sArgs, CString& sMessage) override { VCString vsChans; diff --git a/modules/autoop.cpp b/modules/autoop.cpp index b4281558..309fbea6 100644 --- a/modules/autoop.cpp +++ b/modules/autoop.cpp @@ -33,7 +33,7 @@ class CAutoOpTimer : public CTimer { m_pParent = pModule; } - virtual ~CAutoOpTimer() {} + ~CAutoOpTimer() override {} private: protected: @@ -195,7 +195,7 @@ class CAutoOpMod : public CModule { return true; } - virtual ~CAutoOpMod() { + ~CAutoOpMod() override { for (const auto& it : m_msUsers) { delete it.second; } diff --git a/modules/autoreply.cpp b/modules/autoreply.cpp index f868ec43..91336283 100644 --- a/modules/autoreply.cpp +++ b/modules/autoreply.cpp @@ -31,7 +31,7 @@ class CAutoReplyMod : public CModule { m_Messaged.SetTTL(1000 * 120); } - virtual ~CAutoReplyMod() {} + ~CAutoReplyMod() override {} bool OnLoad(const CString& sArgs, CString& sMessage) override { if (!sArgs.empty()) { diff --git a/modules/autovoice.cpp b/modules/autovoice.cpp index fd7f355e..c4bcbb67 100644 --- a/modules/autovoice.cpp +++ b/modules/autovoice.cpp @@ -163,7 +163,7 @@ class CAutoVoiceMod : public CModule { return true; } - virtual ~CAutoVoiceMod() { + ~CAutoVoiceMod() override { for (const auto& it : m_msUsers) { delete it.second; } diff --git a/modules/awaystore.cpp b/modules/awaystore.cpp index c928b599..40cc2c52 100644 --- a/modules/awaystore.cpp +++ b/modules/awaystore.cpp @@ -49,7 +49,7 @@ class CAwayJob : public CTimer { const CString& sLabel, const CString& sDescription) : CTimer(pModule, uInterval, uCycles, sLabel, sDescription) {} - virtual ~CAwayJob() {} + ~CAwayJob() override {} protected: void RunJob() override; @@ -250,7 +250,7 @@ class CAway : public CModule { static_cast(&CAway::TimerCommand)); } - virtual ~CAway() { + ~CAway() override { if (!m_bBootError) SaveBufferToDisk(); } diff --git a/modules/block_motd.cpp b/modules/block_motd.cpp index c77b63eb..eca3be96 100644 --- a/modules/block_motd.cpp +++ b/modules/block_motd.cpp @@ -27,7 +27,7 @@ class CBlockMotd : public CModule { "specify which server to query."); } - virtual ~CBlockMotd() {} + ~CBlockMotd() override {} void OverrideCommand(const CString& sLine) { m_bTemporaryAcceptMotd = true; diff --git a/modules/blockuser.cpp b/modules/blockuser.cpp index 39fb05a5..3e7faff3 100644 --- a/modules/blockuser.cpp +++ b/modules/blockuser.cpp @@ -36,7 +36,7 @@ class CBlockUser : public CModule { "", "Unblock a user"); } - virtual ~CBlockUser() {} + ~CBlockUser() override {} bool OnLoad(const CString& sArgs, CString& sMessage) override { VCString vArgs; diff --git a/modules/bouncedcc.cpp b/modules/bouncedcc.cpp index 8d30ba63..121330b0 100644 --- a/modules/bouncedcc.cpp +++ b/modules/bouncedcc.cpp @@ -30,7 +30,7 @@ class CDCCBounce : public CSocket { unsigned short uPort, const CString& sRemoteNick, const CString& sRemoteIP, const CString& sFileName, int iTimeout = 60, bool bIsChat = false); - virtual ~CDCCBounce(); + ~CDCCBounce() override; static unsigned short DCCRequest(const CString& sNick, unsigned long uLongIP, @@ -158,7 +158,7 @@ class CBounceDCCMod : public CModule { ""); } - virtual ~CBounceDCCMod() {} + ~CBounceDCCMod() override {} CString GetLocalDCCIP() { return GetUser()->GetLocalDCCIP(); } diff --git a/modules/buffextras.cpp b/modules/buffextras.cpp index 68df26c5..fae89dcf 100644 --- a/modules/buffextras.cpp +++ b/modules/buffextras.cpp @@ -23,7 +23,7 @@ class CBuffExtras : public CModule { public: MODCONSTRUCTOR(CBuffExtras) {} - virtual ~CBuffExtras() {} + ~CBuffExtras() override {} void AddBuffer(CChan& Channel, const CString& sMessage, const timeval* tv = nullptr, diff --git a/modules/cert.cpp b/modules/cert.cpp index 7c28d8d4..d3558e05 100644 --- a/modules/cert.cpp +++ b/modules/cert.cpp @@ -57,7 +57,7 @@ class CCertMod : public CModule { "Show the current certificate"); } - virtual ~CCertMod() {} + ~CCertMod() override {} CString PemFile() const { return GetSavePath() + "/user.pem"; } diff --git a/modules/certauth.cpp b/modules/certauth.cpp index 84dc9319..535fe65b 100644 --- a/modules/certauth.cpp +++ b/modules/certauth.cpp @@ -43,7 +43,7 @@ class CSSLClientCertMod : public CModule { "", "Print your current key"); } - virtual ~CSSLClientCertMod() {} + ~CSSLClientCertMod() override {} bool OnBoot() override { const vector& vListeners = CZNC::Get().GetListeners(); diff --git a/modules/chansaver.cpp b/modules/chansaver.cpp index edca67e7..cd6aafd1 100644 --- a/modules/chansaver.cpp +++ b/modules/chansaver.cpp @@ -22,7 +22,7 @@ class CChanSaverMod : public CModule { public: MODCONSTRUCTOR(CChanSaverMod) {} - virtual ~CChanSaverMod() {} + ~CChanSaverMod() override {} bool OnLoad(const CString& sArgsi, CString& sMessage) override { switch (GetType()) { diff --git a/modules/controlpanel.cpp b/modules/controlpanel.cpp index e78203ae..871cfb4c 100644 --- a/modules/controlpanel.cpp +++ b/modules/controlpanel.cpp @@ -1557,7 +1557,7 @@ class CAdminMod : public CModule { "[username]", "List all networks for a user"); } - virtual ~CAdminMod() {} + ~CAdminMod() override {} }; template <> diff --git a/modules/crypt.cpp b/modules/crypt.cpp index 1281b970..0645e89d 100644 --- a/modules/crypt.cpp +++ b/modules/crypt.cpp @@ -67,7 +67,7 @@ class CCryptMod : public CModule { "", "List all keys"); } - virtual ~CCryptMod() {} + ~CCryptMod() override {} EModRet OnUserMsg(CString& sTarget, CString& sMessage) override { sTarget.TrimPrefix(NickPrefix()); diff --git a/modules/ctcpflood.cpp b/modules/ctcpflood.cpp index 379336a6..797b7653 100644 --- a/modules/ctcpflood.cpp +++ b/modules/ctcpflood.cpp @@ -33,7 +33,7 @@ class CCtcpFloodMod : public CModule { "", "Show the current limits"); } - ~CCtcpFloodMod() {} + ~CCtcpFloodMod() override {} void Save() { // We save the settings twice because the module arguments can diff --git a/modules/cyrusauth.cpp b/modules/cyrusauth.cpp index 29be5d12..35efd0a6 100644 --- a/modules/cyrusauth.cpp +++ b/modules/cyrusauth.cpp @@ -50,7 +50,7 @@ class CSASLAuthMod : public CModule { &CSASLAuthMod::DisableCloneUserCommand)); } - virtual ~CSASLAuthMod() { sasl_done(); } + ~CSASLAuthMod() override { sasl_done(); } void OnModCommand(const CString& sCommand) override { if (GetUser()->IsAdmin()) { diff --git a/modules/dcc.cpp b/modules/dcc.cpp index 2774435d..490b2ece 100644 --- a/modules/dcc.cpp +++ b/modules/dcc.cpp @@ -30,7 +30,7 @@ class CDCCSock : public CSocket { CDCCSock(CDCCMod* pMod, const CString& sRemoteNick, const CString& sRemoteIP, unsigned short uRemotePort, const CString& sLocalFile, unsigned long uFileSize); - virtual ~CDCCSock(); + ~CDCCSock() override; void ReadData(const char* data, size_t len) override; void ConnectionRefused() override; @@ -95,7 +95,7 @@ class CDCCMod : public CModule { &CDCCMod::ListTransfersCommand)); } - virtual ~CDCCMod() {} + ~CDCCMod() override {} #ifndef MOD_DCC_ALLOW_EVERYONE bool OnLoad(const CString& sArgs, CString& sMessage) override { diff --git a/modules/fail2ban.cpp b/modules/fail2ban.cpp index e946587d..9f9868a1 100644 --- a/modules/fail2ban.cpp +++ b/modules/fail2ban.cpp @@ -38,7 +38,7 @@ class CFailToBanMod : public CModule { &CFailToBanMod::OnListCommand), "", "List banned hosts."); } - virtual ~CFailToBanMod() {} + ~CFailToBanMod() override {} bool OnLoad(const CString& sArgs, CString& sMessage) override { CString sTimeout = sArgs.Token(0); diff --git a/modules/flooddetach.cpp b/modules/flooddetach.cpp index ac4c27cc..43c2b9c3 100644 --- a/modules/flooddetach.cpp +++ b/modules/flooddetach.cpp @@ -41,7 +41,7 @@ class CFloodDetachMod : public CModule { "[yes|no]"); } - ~CFloodDetachMod() {} + ~CFloodDetachMod() override {} void Save() { // We save the settings twice because the module arguments can diff --git a/modules/identfile.cpp b/modules/identfile.cpp index 14ee4f76..546172e5 100644 --- a/modules/identfile.cpp +++ b/modules/identfile.cpp @@ -44,7 +44,7 @@ class CIdentFileModule : public CModule { m_pIRCSock = nullptr; } - virtual ~CIdentFileModule() { ReleaseISpoof(); } + ~CIdentFileModule() override { ReleaseISpoof(); } void GetFile(const CString& sLine) { PutModule("File is set to: " + GetNV("File")); diff --git a/modules/imapauth.cpp b/modules/imapauth.cpp index f37937e4..76c0562e 100644 --- a/modules/imapauth.cpp +++ b/modules/imapauth.cpp @@ -30,7 +30,7 @@ class CIMAPSock : public CSocket { EnableReadLine(); } - virtual ~CIMAPSock() { + ~CIMAPSock() override { if (!m_bSentReply) { m_spAuth->RefuseLogin( "IMAP server is down, please try again later"); @@ -56,7 +56,7 @@ class CIMAPAuthMod : public CModule { m_bSSL = false; } - virtual ~CIMAPAuthMod() {} + ~CIMAPAuthMod() override {} bool OnBoot() override { return true; } diff --git a/modules/keepnick.cpp b/modules/keepnick.cpp index 296c70fc..66cc046d 100644 --- a/modules/keepnick.cpp +++ b/modules/keepnick.cpp @@ -24,7 +24,7 @@ class CKeepNickMod; class CKeepNickTimer : public CTimer { public: CKeepNickTimer(CKeepNickMod* pMod); - ~CKeepNickTimer() {} + ~CKeepNickTimer() override {} void RunJob() override; @@ -47,7 +47,7 @@ class CKeepNickMod : public CModule { "", "Show the current state"); } - ~CKeepNickMod() {} + ~CKeepNickMod() override {} bool OnLoad(const CString& sArgs, CString& sMessage) override { m_pTimer = nullptr; diff --git a/modules/kickrejoin.cpp b/modules/kickrejoin.cpp index 0b07f524..53dbc2f0 100644 --- a/modules/kickrejoin.cpp +++ b/modules/kickrejoin.cpp @@ -31,7 +31,7 @@ class CRejoinJob : public CTimer { const CString& sLabel, const CString& sDescription) : CTimer(pModule, uInterval, uCycles, sLabel, sDescription) {} - virtual ~CRejoinJob() {} + ~CRejoinJob() override {} protected: void RunJob() override { @@ -60,7 +60,7 @@ class CRejoinMod : public CModule { &CRejoinMod::OnShowDelayCommand), "", "Show the rejoin delay"); } - virtual ~CRejoinMod() {} + ~CRejoinMod() override {} bool OnLoad(const CString& sArgs, CString& sErrorMsg) override { if (sArgs.empty()) { diff --git a/modules/lastseen.cpp b/modules/lastseen.cpp index e6d155e2..11fa036a 100644 --- a/modules/lastseen.cpp +++ b/modules/lastseen.cpp @@ -77,7 +77,7 @@ class CLastSeenMod : public CModule { "", "Shows list of users and when they last logged in"); } - virtual ~CLastSeenMod() {} + ~CLastSeenMod() override {} // Event stuff: diff --git a/modules/listsockets.cpp b/modules/listsockets.cpp index cc538047..d9dfe606 100644 --- a/modules/listsockets.cpp +++ b/modules/listsockets.cpp @@ -245,7 +245,7 @@ class CListSockets : public CModule { return; } - virtual ~CListSockets() {} + ~CListSockets() override {} }; template <> diff --git a/modules/modperl.cpp b/modules/modperl.cpp index 31adfe6f..78ad1b68 100644 --- a/modules/modperl.cpp +++ b/modules/modperl.cpp @@ -118,10 +118,9 @@ class CModPerl : public CModule { return true; } - virtual EModRet OnModuleLoading(const CString& sModName, - const CString& sArgs, - CModInfo::EModuleType eType, bool& bSuccess, - CString& sRetMsg) override { + EModRet OnModuleLoading(const CString& sModName, const CString& sArgs, + CModInfo::EModuleType eType, bool& bSuccess, + CString& sRetMsg) override { EModRet result = HALT; PSTART; PUSH_STR(sModName); @@ -192,8 +191,8 @@ class CModPerl : public CModule { return CONTINUE; } - virtual EModRet OnGetModInfo(CModInfo& ModInfo, const CString& sModule, - bool& bSuccess, CString& sRetMsg) override { + EModRet OnGetModInfo(CModInfo& ModInfo, const CString& sModule, + bool& bSuccess, CString& sRetMsg) override { PSTART; PUSH_STR(sModule); PUSH_PTR(CModInfo*, &ModInfo); @@ -268,7 +267,7 @@ class CModPerl : public CModule { } } - virtual ~CModPerl() { + ~CModPerl() override { if (m_pPerl) { PSTART; PCALL("ZNC::Core::UnloadAll"); diff --git a/modules/modpython.cpp b/modules/modpython.cpp index 90272407..27f9a2eb 100644 --- a/modules/modpython.cpp +++ b/modules/modpython.cpp @@ -146,10 +146,9 @@ class CModPython : public CModule { return true; } - virtual EModRet OnModuleLoading(const CString& sModName, - const CString& sArgs, - CModInfo::EModuleType eType, bool& bSuccess, - CString& sRetMsg) override { + EModRet OnModuleLoading(const CString& sModName, const CString& sArgs, + CModInfo::EModuleType eType, bool& bSuccess, + CString& sRetMsg) override { PyObject* pyFunc = PyObject_GetAttrString(m_PyZNCModule, "load_module"); if (!pyFunc) { sRetMsg = GetPyExceptionStr(); @@ -240,8 +239,8 @@ class CModPython : public CModule { return CONTINUE; } - virtual EModRet OnGetModInfo(CModInfo& ModInfo, const CString& sModule, - bool& bSuccess, CString& sRetMsg) override { + EModRet OnGetModInfo(CModInfo& ModInfo, const CString& sModule, + bool& bSuccess, CString& sRetMsg) override { PyObject* pyFunc = PyObject_GetAttrString(m_PyZNCModule, "get_mod_info"); if (!pyFunc) { @@ -361,7 +360,7 @@ class CModPython : public CModule { } } - virtual ~CModPython() { + ~CModPython() override { if (!m_PyZNCModule) { DEBUG( "~CModPython(): seems like CModPython::OnLoad() didn't " diff --git a/modules/modtcl.cpp b/modules/modtcl.cpp index c6c7a714..fd4ee6f8 100644 --- a/modules/modtcl.cpp +++ b/modules/modtcl.cpp @@ -44,7 +44,7 @@ class CModTclTimer : public CTimer { const CString& sLabel, const CString& sDescription) : CTimer(pModule, uInterval, uCycles, sLabel, sDescription), m_pParent(nullptr) {} - virtual ~CModTclTimer() {} + ~CModTclTimer() override {} protected: void RunJob() override; @@ -58,7 +58,7 @@ class CModTclStartTimer : public CTimer { const CString& sDescription) : CTimer(pModule, uInterval, uCycles, sLabel, sDescription), m_pParent(nullptr) {} - virtual ~CModTclStartTimer() {} + ~CModTclStartTimer() override {} protected: void RunJob() override; @@ -69,7 +69,7 @@ class CModTcl : public CModule { public: MODCONSTRUCTOR(CModTcl) { interp = nullptr; } - virtual ~CModTcl() { + ~CModTcl() override { if (interp) { Tcl_DeleteInterp(interp); } diff --git a/modules/modules_online.cpp b/modules/modules_online.cpp index f5b5132f..1fa833da 100644 --- a/modules/modules_online.cpp +++ b/modules/modules_online.cpp @@ -21,7 +21,7 @@ class CFOModule : public CModule { public: MODCONSTRUCTOR(CFOModule) {} - virtual ~CFOModule() {} + ~CFOModule() override {} bool IsOnlineModNick(const CString& sNick) { const CString& sPrefix = GetUser()->GetStatusPrefix(); diff --git a/modules/nickserv.cpp b/modules/nickserv.cpp index fcc0fea7..705d80cc 100644 --- a/modules/nickserv.cpp +++ b/modules/nickserv.cpp @@ -81,7 +81,7 @@ class CNickServ : public CModule { "cmd new-pattern", "Set pattern for commands"); } - virtual ~CNickServ() {} + ~CNickServ() override {} bool OnLoad(const CString& sArgs, CString& sMessage) override { if (!sArgs.empty() && sArgs != "") { diff --git a/modules/notes.cpp b/modules/notes.cpp index eb607186..07d195a1 100644 --- a/modules/notes.cpp +++ b/modules/notes.cpp @@ -87,7 +87,7 @@ class CNotesMod : public CModule { [this](const CString& sLine) { GetCommand(sLine); }); } - virtual ~CNotesMod() {} + ~CNotesMod() override {} bool OnLoad(const CString& sArgs, CString& sMessage) override { m_bShowNotesOnLogin = !sArgs.Equals("-disableNotesOnLogin"); diff --git a/modules/partyline.cpp b/modules/partyline.cpp index 9e294398..deacc1b6 100644 --- a/modules/partyline.cpp +++ b/modules/partyline.cpp @@ -84,7 +84,7 @@ class CPartylineMod : public CModule { "", "List all open channels"); } - virtual ~CPartylineMod() { + ~CPartylineMod() override { // Kick all clients who are in partyline channels for (set::iterator it = m_ssChannels.begin(); it != m_ssChannels.end(); ++it) { diff --git a/modules/perform.cpp b/modules/perform.cpp index 8de0d786..8254b5ba 100644 --- a/modules/perform.cpp +++ b/modules/perform.cpp @@ -107,7 +107,7 @@ class CPerform : public CModule { " ", "Swap two perform commands"); } - virtual ~CPerform() {} + ~CPerform() override {} CString ParsePerform(const CString& sArg) const { CString sPerf = sArg; diff --git a/modules/q.cpp b/modules/q.cpp index c5e33a7f..fb077351 100644 --- a/modules/q.cpp +++ b/modules/q.cpp @@ -28,7 +28,7 @@ using std::set; class CQModule : public CModule { public: MODCONSTRUCTOR(CQModule) {} - virtual ~CQModule() {} + ~CQModule() override {} bool OnLoad(const CString& sArgs, CString& sMessage) override { if (!sArgs.empty()) { diff --git a/modules/raw.cpp b/modules/raw.cpp index ff53350d..984a8187 100644 --- a/modules/raw.cpp +++ b/modules/raw.cpp @@ -19,7 +19,7 @@ class CRawMod : public CModule { public: MODCONSTRUCTOR(CRawMod) {} - virtual ~CRawMod() {} + ~CRawMod() override {} EModRet OnRaw(CString& sLine) override { PutModule("IRC -> [" + sLine + "]"); diff --git a/modules/route_replies.cpp b/modules/route_replies.cpp index 24c603d0..3482297f 100644 --- a/modules/route_replies.cpp +++ b/modules/route_replies.cpp @@ -186,7 +186,7 @@ class CRouteTimeout : public CTimer { unsigned int uCycles, const CString& sLabel, const CString& sDescription) : CTimer(pModule, uInterval, uCycles, sLabel, sDescription) {} - virtual ~CRouteTimeout() {} + ~CRouteTimeout() override {} protected: void RunJob() override; @@ -212,7 +212,7 @@ class CRouteRepliesMod : public CModule { "Decides whether to show the timeout messages or not"); } - virtual ~CRouteRepliesMod() { + ~CRouteRepliesMod() override { requestQueue::iterator it; while (!m_vsPending.empty()) { diff --git a/modules/sample.cpp b/modules/sample.cpp index 0e535912..97bfe465 100644 --- a/modules/sample.cpp +++ b/modules/sample.cpp @@ -26,7 +26,7 @@ class CSampleJob : public CModuleJob { CSampleJob(CModule* pModule) : CModuleJob(pModule, "sample", "Message the user after a delay") {} - ~CSampleJob() { + ~CSampleJob() override { if (wasCancelled()) { GetModule()->PutModule("Sample job cancelled"); } else { @@ -55,7 +55,7 @@ class CSampleTimer : public CTimer { CSampleTimer(CModule* pModule, unsigned int uInterval, unsigned int uCycles, const CString& sLabel, const CString& sDescription) : CTimer(pModule, uInterval, uCycles, sLabel, sDescription) {} - virtual ~CSampleTimer() {} + ~CSampleTimer() override {} private: protected: @@ -78,7 +78,7 @@ class CSampleMod : public CModule { return true; } - virtual ~CSampleMod() { PutModule("I'm being unloaded!"); } + ~CSampleMod() override { PutModule("I'm being unloaded!"); } bool OnBoot() override { // This is called when the app starts up (only modules that are loaded diff --git a/modules/savebuff.cpp b/modules/savebuff.cpp index a4369948..9fa13572 100644 --- a/modules/savebuff.cpp +++ b/modules/savebuff.cpp @@ -50,7 +50,7 @@ class CSaveBuffJob : public CTimer { const CString& sLabel, const CString& sDescription) : CTimer(pModule, uInterval, uCycles, sLabel, sDescription) {} - virtual ~CSaveBuffJob() {} + ~CSaveBuffJob() override {} protected: void RunJob() override; @@ -72,7 +72,7 @@ class CSaveBuff : public CModule { &CSaveBuff::OnSaveCommand), "", "Saves all buffers"); } - virtual ~CSaveBuff() { + ~CSaveBuff() override { if (!m_bBootError) { SaveBuffersToDisk(); } diff --git a/modules/schat.cpp b/modules/schat.cpp index faaf13ee..c492d621 100644 --- a/modules/schat.cpp +++ b/modules/schat.cpp @@ -40,7 +40,7 @@ class CRemMarkerJob : public CTimer { const CString& sDescription) : CTimer(pModule, uInterval, uCycles, sLabel, sDescription) {} - virtual ~CRemMarkerJob() {} + ~CRemMarkerJob() override {} void SetNick(const CString& sNick) { m_sNick = sNick; } protected: @@ -53,7 +53,7 @@ class CSChatSock : public CSocket { CSChatSock(CSChat* pMod, const CString& sChatNick); CSChatSock(CSChat* pMod, const CString& sChatNick, const CString& sHost, u_short iPort, int iTimeout = 60); - ~CSChatSock() {} + ~CSChatSock() override {} Csock* GetSockObj(const CS_STRING& sHostname, u_short iPort) override { CSChatSock* p = @@ -104,7 +104,7 @@ class CSChatSock : public CSocket { class CSChat : public CModule { public: MODCONSTRUCTOR(CSChat) {} - virtual ~CSChat() {} + ~CSChat() override {} bool OnLoad(const CString& sArgs, CString& sMessage) override { m_sPemFile = sArgs; diff --git a/modules/send_raw.cpp b/modules/send_raw.cpp index 952eae9d..01aa4bba 100644 --- a/modules/send_raw.cpp +++ b/modules/send_raw.cpp @@ -66,7 +66,7 @@ class CSendRaw_Mod : public CModule { } public: - virtual ~CSendRaw_Mod() {} + ~CSendRaw_Mod() override {} bool OnLoad(const CString& sArgs, CString& sErrorMsg) override { if (!GetUser()->IsAdmin()) { diff --git a/modules/shell.cpp b/modules/shell.cpp index 58b1a742..55f52932 100644 --- a/modules/shell.cpp +++ b/modules/shell.cpp @@ -59,7 +59,7 @@ class CShellMod : public CModule { public: MODCONSTRUCTOR(CShellMod) { m_sPath = CZNC::Get().GetHomePath(); } - virtual ~CShellMod() { + ~CShellMod() override { vector vSocks = GetManager()->FindSocksByName("SHELL"); for (unsigned int a = 0; a < vSocks.size(); a++) { diff --git a/modules/simple_away.cpp b/modules/simple_away.cpp index a3ed8568..498551cf 100644 --- a/modules/simple_away.cpp +++ b/modules/simple_away.cpp @@ -30,7 +30,7 @@ class CSimpleAwayJob : public CTimer { const CString& sDescription) : CTimer(pModule, uInterval, uCycles, sLabel, sDescription) {} - virtual ~CSimpleAwayJob() {} + ~CSimpleAwayJob() override {} protected: void RunJob() override; @@ -76,7 +76,7 @@ class CSimpleAway : public CModule { "", "Get or set the minimum number of clients before going away"); } - virtual ~CSimpleAway() {} + ~CSimpleAway() override {} bool OnLoad(const CString& sArgs, CString& sMessage) override { CString sReasonArg; diff --git a/modules/stickychan.cpp b/modules/stickychan.cpp index 6a375098..7f3d8a81 100644 --- a/modules/stickychan.cpp +++ b/modules/stickychan.cpp @@ -33,7 +33,7 @@ class CStickyChan : public CModule { &CStickyChan::OnListCommand), "", "Lists sticky channels"); } - virtual ~CStickyChan() {} + ~CStickyChan() override {} bool OnLoad(const CString& sArgs, CString& sMessage) override; @@ -56,9 +56,8 @@ class CStickyChan : public CModule { return CONTINUE; } - virtual void OnMode(const CNick& pOpNick, CChan& Channel, char uMode, - const CString& sArg, bool bAdded, - bool bNoChange) override { + void OnMode(const CNick& pOpNick, CChan& Channel, char uMode, + const CString& sArg, bool bAdded, bool bNoChange) override { if (uMode == CChan::M_Key) { if (bAdded) { // We ignore channel key "*" because of some broken nets. diff --git a/modules/watch.cpp b/modules/watch.cpp index 66980199..b797724e 100644 --- a/modules/watch.cpp +++ b/modules/watch.cpp @@ -177,7 +177,7 @@ class CWatcherMod : public CModule { Load(); } - virtual ~CWatcherMod() {} + ~CWatcherMod() override {} void OnRawMode(const CNick& OpNick, CChan& Channel, const CString& sModes, const CString& sArgs) override { diff --git a/modules/webadmin.cpp b/modules/webadmin.cpp index dc27b9c7..27aa1682 100644 --- a/modules/webadmin.cpp +++ b/modules/webadmin.cpp @@ -97,7 +97,7 @@ class CWebAdminMod : public CModule { CWebSubPage::F_ADMIN)); } - virtual ~CWebAdminMod() {} + ~CWebAdminMod() override {} bool OnLoad(const CString& sArgStr, CString& sMessage) override { if (sArgStr.empty() || CModInfo::GlobalModule != GetType()) return true; diff --git a/src/IRCNetwork.cpp b/src/IRCNetwork.cpp index 07bb9f55..b0758ea7 100644 --- a/src/IRCNetwork.cpp +++ b/src/IRCNetwork.cpp @@ -39,7 +39,7 @@ class CIRCNetworkPingTimer : public CCron { Start(CIRCNetwork::PING_SLACK); } - virtual ~CIRCNetworkPingTimer() {} + ~CIRCNetworkPingTimer() override {} CIRCNetworkPingTimer(const CIRCNetworkPingTimer&) = delete; CIRCNetworkPingTimer& operator=(const CIRCNetworkPingTimer&) = delete; @@ -77,7 +77,7 @@ class CIRCNetworkJoinTimer : public CCron { Start(CIRCNetwork::JOIN_FREQUENCY); } - virtual ~CIRCNetworkJoinTimer() {} + ~CIRCNetworkJoinTimer() override {} CIRCNetworkJoinTimer(const CIRCNetworkJoinTimer&) = delete; CIRCNetworkJoinTimer& operator=(const CIRCNetworkJoinTimer&) = delete; diff --git a/src/User.cpp b/src/User.cpp index 1a507ea9..ae4cbd52 100644 --- a/src/User.cpp +++ b/src/User.cpp @@ -34,7 +34,7 @@ class CUserTimer : public CCron { SetName("CUserTimer::" + m_pUser->GetUserName()); Start(CIRCNetwork::PING_SLACK); } - virtual ~CUserTimer() {} + ~CUserTimer() override {} CUserTimer(const CUserTimer&) = delete; CUserTimer& operator=(const CUserTimer&) = delete; diff --git a/src/Utils.cpp b/src/Utils.cpp index bd7db211..2a1727f6 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -416,7 +416,7 @@ inline CString FixGMT(CString sTZ) { } return sTZ; } -} +} // namespace CString CUtils::CTime(time_t t, const CString& sTimezone) { char s[30] = {}; // should have at least 26 bytes @@ -537,7 +537,7 @@ void FillTimezones(const CString& sPath, SCString& result, } } } -} +} // namespace SCString CUtils::GetTimezones() { static SCString result; diff --git a/src/WebModules.cpp b/src/WebModules.cpp index 43eddd0d..0f7a94b6 100644 --- a/src/WebModules.cpp +++ b/src/WebModules.cpp @@ -53,7 +53,7 @@ class CWebAuth : public CAuthBase { public: CWebAuth(CWebSock* pWebSock, const CString& sUsername, const CString& sPassword, bool bBasic); - virtual ~CWebAuth() {} + ~CWebAuth() override {} CWebAuth(const CWebAuth&) = delete; CWebAuth& operator=(const CWebAuth&) = delete; diff --git a/src/znc.cpp b/src/znc.cpp index 755f6783..2a9e193b 100644 --- a/src/znc.cpp +++ b/src/znc.cpp @@ -1929,7 +1929,7 @@ class CConnectQueueTimer : public CCron { // Don't wait iSecs seconds for first timer run m_bRunOnNextCall = true; } - virtual ~CConnectQueueTimer() { + ~CConnectQueueTimer() override { // This is only needed when ZNC shuts down: // CZNC::~CZNC() sets its CConnectQueueTimer pointer to nullptr and // calls the manager's Cleanup() which destroys all sockets and diff --git a/test/BufferTest.cpp b/test/BufferTest.cpp index 266f1a44..fbcb84f6 100644 --- a/test/BufferTest.cpp +++ b/test/BufferTest.cpp @@ -24,8 +24,8 @@ using ::testing::ContainerEq; class BufferTest : public ::testing::Test { protected: - void SetUp() { CZNC::CreateInstance(); } - void TearDown() { CZNC::DestroyInstance(); } + void SetUp() override { CZNC::CreateInstance(); } + void TearDown() override { CZNC::DestroyInstance(); } }; TEST_F(BufferTest, BufLine) { diff --git a/test/ConfigTest.cpp b/test/ConfigTest.cpp index a5c6a527..515ca377 100644 --- a/test/ConfigTest.cpp +++ b/test/ConfigTest.cpp @@ -20,7 +20,7 @@ class CConfigTest : public ::testing::Test { public: - virtual ~CConfigTest() { m_File.Delete(); } + ~CConfigTest() override { m_File.Delete(); } protected: CFile& WriteFile(const CString& sConfig) { diff --git a/test/Integration.cpp b/test/Integration.cpp index fc64abbc..53d03a07 100644 --- a/test/Integration.cpp +++ b/test/Integration.cpp @@ -137,7 +137,7 @@ class Process : public IO { m_proc.setProcessEnvironment(env); m_proc.start(cmd, args); } - ~Process() { + ~Process() override { if (m_kill) m_proc.terminate(); [this]() { ASSERT_TRUE(m_proc.waitForFinished()); diff --git a/test/ModulesTest.cpp b/test/ModulesTest.cpp index 2b880130..a57f10f1 100644 --- a/test/ModulesTest.cpp +++ b/test/ModulesTest.cpp @@ -20,8 +20,8 @@ class ModulesTest : public ::testing::Test { protected: - void SetUp() { CZNC::CreateInstance(); } - void TearDown() { CZNC::DestroyInstance(); } + void SetUp() override { CZNC::CreateInstance(); } + void TearDown() override { CZNC::DestroyInstance(); } }; class CLegacyModule : public CModule { diff --git a/test/NetworkTest.cpp b/test/NetworkTest.cpp index b3186b66..542a10aa 100644 --- a/test/NetworkTest.cpp +++ b/test/NetworkTest.cpp @@ -21,8 +21,8 @@ class NetworkTest : public ::testing::Test { protected: - void SetUp() { CZNC::CreateInstance(); } - void TearDown() { CZNC::DestroyInstance(); } + void SetUp() override { CZNC::CreateInstance(); } + void TearDown() override { CZNC::DestroyInstance(); } }; TEST_F(NetworkTest, FindChan) { diff --git a/test/QueryTest.cpp b/test/QueryTest.cpp index 01b27c42..c29e87f3 100644 --- a/test/QueryTest.cpp +++ b/test/QueryTest.cpp @@ -25,8 +25,8 @@ using ::testing::MatchesRegex; class QueryTest : public ::testing::Test { protected: - void SetUp() { CZNC::CreateInstance(); } - void TearDown() { CZNC::DestroyInstance(); } + void SetUp() override { CZNC::CreateInstance(); } + void TearDown() override { CZNC::DestroyInstance(); } }; TEST_F(QueryTest, Name) { diff --git a/test/ThreadTest.cpp b/test/ThreadTest.cpp index c896f6c2..2aba9db7 100644 --- a/test/ThreadTest.cpp +++ b/test/ThreadTest.cpp @@ -27,7 +27,7 @@ class CWaitingJob : public CJob { m_bThreadReady(false), m_bThreadDone(false){}; - ~CWaitingJob() { + ~CWaitingJob() override { EXPECT_TRUE(m_bThreadReady); EXPECT_TRUE(m_bThreadDone); EXPECT_FALSE(wasCancelled()); @@ -44,7 +44,7 @@ class CWaitingJob : public CJob { m_CV.notify_all(); } - virtual void runThread() { + void runThread() override { CMutexLocker locker(m_Mutex); // We are running m_bThreadReady = true; @@ -54,7 +54,7 @@ class CWaitingJob : public CJob { while (!m_bThreadDone) m_CV.wait(m_Mutex); } - virtual void runMain() {} + void runMain() override {} private: bool& m_bDestroyed; @@ -82,7 +82,7 @@ class CCancelJob : public CJob { m_CVThreadReady(), m_bThreadReady(false) {} - ~CCancelJob() { + ~CCancelJob() override { EXPECT_TRUE(wasCancelled()); m_bDestroyed = true; } @@ -93,7 +93,7 @@ class CCancelJob : public CJob { while (!m_bThreadReady) m_CVThreadReady.wait(m_Mutex); } - virtual void runThread() { + void runThread() override { m_Mutex.lock(); // We are running, tell the main thread m_bThreadReady = true; @@ -113,7 +113,7 @@ class CCancelJob : public CJob { } } - virtual void runMain() {} + void runMain() override {} private: bool& m_bDestroyed; @@ -152,13 +152,13 @@ class CEmptyJob : public CJob { public: CEmptyJob(bool& destroyed) : m_bDestroyed(destroyed) {} - ~CEmptyJob() { + ~CEmptyJob() override { EXPECT_TRUE(wasCancelled()); m_bDestroyed = true; } - virtual void runThread() {} - virtual void runMain() {} + void runThread() override {} + void runMain() override {} private: bool& m_bDestroyed;