Fix some unitialized fields in modules.

They are not used before OnLoad anyway, but Coverity will be happier.
This commit is contained in:
Alexey Sokolov
2015-10-30 14:52:51 +00:00
parent c8edabb035
commit 096dc5b320
10 changed files with 31 additions and 34 deletions
+1 -1
View File
@@ -174,7 +174,7 @@ private:
LOG_TO_SYSLOG = 1 << 1,
LOG_TO_BOTH = LOG_TO_FILE | LOG_TO_SYSLOG
};
LogMode m_eLogMode;
LogMode m_eLogMode = LOG_TO_FILE;
CString m_sLogFile;
};
+2 -2
View File
@@ -22,8 +22,8 @@ using std::set;
class CClientNotifyMod : public CModule {
protected:
CString m_sMethod;
bool m_bNewOnly;
bool m_bOnDisconnect;
bool m_bNewOnly{};
bool m_bOnDisconnect{};
set<CString> m_sClientsSeen;
+4 -7
View File
@@ -20,9 +20,6 @@
class CCtcpFloodMod : public CModule {
public:
MODCONSTRUCTOR(CCtcpFloodMod) {
m_tLastCTCP = 0;
m_iNumCTCP = 0;
AddHelpCommand();
AddCommand("Secs", static_cast<CModCommand::ModCmdFunc>(&CCtcpFloodMod::OnSecsCommand), "<limit>", "Set seconds limit");
AddCommand("Lines", static_cast<CModCommand::ModCmdFunc>(&CCtcpFloodMod::OnLinesCommand), "<limit>", "Set lines limit");
@@ -130,11 +127,11 @@ public:
}
private:
time_t m_tLastCTCP;
unsigned int m_iNumCTCP;
time_t m_tLastCTCP = 0;
unsigned int m_iNumCTCP = 0;
time_t m_iThresholdSecs;
unsigned int m_iThresholdMsgs;
time_t m_iThresholdSecs{};
unsigned int m_iThresholdMsgs{};
};
template<> void TModInfo<CCtcpFloodMod>(CModInfo& Info) {
+7 -7
View File
@@ -31,6 +31,13 @@ public:
MODCONSTRUCTOR(CSASLAuthMod) {
m_Cache.SetTTL(60000/*ms*/);
m_cbs[0].id = SASL_CB_GETOPT;
m_cbs[0].proc = reinterpret_cast<int(*)()>(CSASLAuthMod::getopt);
m_cbs[0].context = this;
m_cbs[1].id = SASL_CB_LIST_END;
m_cbs[1].proc = NULL;
m_cbs[1].context = NULL;
AddHelpCommand();
AddCommand("CreateUser", static_cast<CModCommand::ModCmdFunc>(&CSASLAuthMod::CreateUserCommand),
"[yes|no]");
@@ -77,13 +84,6 @@ public:
return false;
}
m_cbs[0].id = SASL_CB_GETOPT;
m_cbs[0].proc = reinterpret_cast<int(*)()>(CSASLAuthMod::getopt);
m_cbs[0].context = this;
m_cbs[1].id = SASL_CB_LIST_END;
m_cbs[1].proc = NULL;
m_cbs[1].context = NULL;
return true;
}
+1 -1
View File
@@ -100,7 +100,7 @@ public:
private:
TCacheMap<CString, unsigned int> m_Cache;
unsigned int m_uiAllowedFailed;
unsigned int m_uiAllowedFailed{};
};
template<> void TModInfo<CFailToBanMod>(CModInfo& Info) {
+1 -1
View File
@@ -192,7 +192,7 @@ public:
private:
// If this is NULL, we are turned off for some reason
CKeepNickTimer* m_pTimer;
CKeepNickTimer* m_pTimer = nullptr;
};
CKeepNickTimer::CKeepNickTimer(CKeepNickMod *pMod) : CTimer(pMod, 30, 0,
+1 -1
View File
@@ -47,7 +47,7 @@ protected:
class CRejoinMod : public CModule {
private:
unsigned int delay;
unsigned int delay = 10;
public:
MODCONSTRUCTOR(CRejoinMod) {
+3 -3
View File
@@ -19,7 +19,7 @@
using std::stringstream;
class CNotesMod : public CModule {
bool bShowNotesOnLogin;
bool m_bShowNotesOnLogin{};
void ListCommand(const CString &sLine) {
ListNotes();
@@ -85,14 +85,14 @@ public:
virtual ~CNotesMod() {}
virtual bool OnLoad(const CString& sArgs, CString& sMessage) override {
bShowNotesOnLogin = !sArgs.Equals("-disableNotesOnLogin");
m_bShowNotesOnLogin = !sArgs.Equals("-disableNotesOnLogin");
return true;
}
virtual CString GetWebMenuTitle() override { return "Notes"; }
virtual void OnClientLogin() override {
if (bShowNotesOnLogin) {
if (m_bShowNotesOnLogin) {
ListNotes(true);
}
}
+10 -10
View File
@@ -372,11 +372,11 @@ public:
}
private:
bool m_bCloaked;
bool m_bAuthed;
bool m_bRequestedWhoami;
bool m_bRequestedChallenge;
bool m_bCatchResponse;
bool m_bCloaked{};
bool m_bAuthed{};
bool m_bRequestedWhoami{};
bool m_bRequestedChallenge{};
bool m_bCatchResponse{};
MCString m_msChanModes;
void PutQ(const CString& sMessage) {
@@ -590,11 +590,11 @@ private:
/* Settings */
CString m_sUsername;
CString m_sPassword;
bool m_bUseCloakedHost;
bool m_bUseChallenge;
bool m_bRequestPerms;
bool m_bJoinOnInvite;
bool m_bJoinAfterCloaked;
bool m_bUseCloakedHost{};
bool m_bUseChallenge{};
bool m_bRequestPerms{};
bool m_bJoinOnInvite{};
bool m_bJoinAfterCloaked{};
void SetUsername(const CString& sUsername) {
m_sUsername = sUsername;
+1 -1
View File
@@ -61,7 +61,7 @@ public:
}
private:
unsigned int m_uiIndex;
unsigned int m_uiIndex = 0;
};
class CSASLMod : public CModule {