summaryrefslogtreecommitdiff
path: root/modules/commands
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2022-01-03 18:34:16 +0000
committerSadie Powell <sadie@witchery.services>2022-01-04 00:17:13 +0000
commit7531e90499d4cd60b6464c692725225e85c00738 (patch)
tree930fd946ea495b74c4071a67e12cadb700ab79ab /modules/commands
parentdfcc025a19d7d49179d75f34553c36e0d47eaded (diff)
Use C++11 style class/struct initialisation.
Diffstat (limited to 'modules/commands')
-rw-r--r--modules/commands/bs_badwords.cpp6
-rw-r--r--modules/commands/cs_access.cpp12
-rw-r--r--modules/commands/cs_akick.cpp4
-rw-r--r--modules/commands/cs_xop.cpp4
-rw-r--r--modules/commands/hs_group.cpp4
-rw-r--r--modules/commands/os_akill.cpp4
-rw-r--r--modules/commands/os_dns.cpp17
-rw-r--r--modules/commands/os_info.cpp4
-rw-r--r--modules/commands/os_session.cpp4
-rw-r--r--modules/commands/os_sxline.cpp4
10 files changed, 30 insertions, 33 deletions
diff --git a/modules/commands/bs_badwords.cpp b/modules/commands/bs_badwords.cpp
index af2085746..3e397786e 100644
--- a/modules/commands/bs_badwords.cpp
+++ b/modules/commands/bs_badwords.cpp
@@ -150,10 +150,10 @@ class BadwordsDelCallback : public NumberList
ChannelInfo *ci;
BadWords *bw;
Command *c;
- unsigned deleted;
- bool override;
+ unsigned deleted = 0;
+ bool override = false;
public:
- BadwordsDelCallback(CommandSource &_source, ChannelInfo *_ci, Command *_c, const Anope::string &list) : NumberList(list, true), source(_source), ci(_ci), c(_c), deleted(0), override(false)
+ BadwordsDelCallback(CommandSource &_source, ChannelInfo *_ci, Command *_c, const Anope::string &list) : NumberList(list, true), source(_source), ci(_ci), c(_c)
{
if (!source.AccessFor(ci).HasPriv("BADWORDS") && source.HasPriv("botserv/administration"))
this->override = true;
diff --git a/modules/commands/cs_access.cpp b/modules/commands/cs_access.cpp
index f6129cdb3..ee6d324c7 100644
--- a/modules/commands/cs_access.cpp
+++ b/modules/commands/cs_access.cpp
@@ -23,9 +23,9 @@ static inline void reset_levels(ChannelInfo *ci)
class AccessChanAccess : public ChanAccess
{
public:
- int level;
+ int level = 0;
- AccessChanAccess(AccessProvider *p) : ChanAccess(p), level(0)
+ AccessChanAccess(AccessProvider *p) : ChanAccess(p)
{
}
@@ -250,12 +250,12 @@ class CommandCSAccess : public Command
CommandSource &source;
ChannelInfo *ci;
Command *c;
- unsigned deleted;
+ unsigned deleted = 0;
Anope::string Nicks;
- bool denied;
- bool override;
+ bool denied = false;
+ bool override = false;
public:
- AccessDelCallback(CommandSource &_source, ChannelInfo *_ci, Command *_c, const Anope::string &numlist) : NumberList(numlist, true), source(_source), ci(_ci), c(_c), deleted(0), denied(false), override(false)
+ AccessDelCallback(CommandSource &_source, ChannelInfo *_ci, Command *_c, const Anope::string &numlist) : NumberList(numlist, true), source(_source), ci(_ci), c(_c)
{
if (!source.AccessFor(ci).HasPriv("ACCESS_CHANGE") && source.HasPriv("chanserv/access/modify"))
this->override = true;
diff --git a/modules/commands/cs_akick.cpp b/modules/commands/cs_akick.cpp
index 99137430d..94e1955ff 100644
--- a/modules/commands/cs_akick.cpp
+++ b/modules/commands/cs_akick.cpp
@@ -211,10 +211,10 @@ class CommandCSAKick : public Command
CommandSource &source;
ChannelInfo *ci;
Command *c;
- unsigned deleted;
+ unsigned deleted = 0;
AccessGroup ag;
public:
- AkickDelCallback(CommandSource &_source, ChannelInfo *_ci, Command *_c, const Anope::string &list) : NumberList(list, true), source(_source), ci(_ci), c(_c), deleted(0), ag(source.AccessFor(ci))
+ AkickDelCallback(CommandSource &_source, ChannelInfo *_ci, Command *_c, const Anope::string &list) : NumberList(list, true), source(_source), ci(_ci), c(_c), ag(source.AccessFor(ci))
{
}
diff --git a/modules/commands/cs_xop.cpp b/modules/commands/cs_xop.cpp
index 8df4f2fca..423bdd552 100644
--- a/modules/commands/cs_xop.cpp
+++ b/modules/commands/cs_xop.cpp
@@ -280,11 +280,11 @@ class CommandCSXOP : public Command
CommandSource &source;
ChannelInfo *ci;
Command *c;
- unsigned deleted;
+ unsigned deleted = 0;
Anope::string nicks;
bool override;
public:
- XOPDelCallback(CommandSource &_source, ChannelInfo *_ci, Command *_c, bool _override, const Anope::string &numlist) : NumberList(numlist, true), source(_source), ci(_ci), c(_c), deleted(0), override(_override)
+ XOPDelCallback(CommandSource &_source, ChannelInfo *_ci, Command *_c, bool _override, const Anope::string &numlist) : NumberList(numlist, true), source(_source), ci(_ci), c(_c), override(_override)
{
}
diff --git a/modules/commands/hs_group.cpp b/modules/commands/hs_group.cpp
index a4aeb5a3c..17dc2dad0 100644
--- a/modules/commands/hs_group.cpp
+++ b/modules/commands/hs_group.cpp
@@ -13,7 +13,7 @@
class CommandHSGroup : public Command
{
- bool setting;
+ bool setting = false;
public:
void Sync(const NickAlias *na)
@@ -37,7 +37,7 @@ class CommandHSGroup : public Command
setting = false;
}
- CommandHSGroup(Module *creator) : Command(creator, "hostserv/group", 0, 0), setting(false)
+ CommandHSGroup(Module *creator) : Command(creator, "hostserv/group", 0, 0)
{
this->SetDesc(_("Syncs the vhost for all nicks in a group"));
}
diff --git a/modules/commands/os_akill.cpp b/modules/commands/os_akill.cpp
index fe53fa14d..8c82cb55c 100644
--- a/modules/commands/os_akill.cpp
+++ b/modules/commands/os_akill.cpp
@@ -16,10 +16,10 @@ static ServiceReference<XLineManager> akills("XLineManager", "xlinemanager/sglin
class AkillDelCallback : public NumberList
{
CommandSource &source;
- unsigned deleted;
+ unsigned deleted = 0;
Command *cmd;
public:
- AkillDelCallback(CommandSource &_source, const Anope::string &numlist, Command *c) : NumberList(numlist, true), source(_source), deleted(0), cmd(c)
+ AkillDelCallback(CommandSource &_source, const Anope::string &numlist, Command *c) : NumberList(numlist, true), source(_source), cmd(c)
{
}
diff --git a/modules/commands/os_dns.cpp b/modules/commands/os_dns.cpp
index 8a18911c6..1a3189d6b 100644
--- a/modules/commands/os_dns.cpp
+++ b/modules/commands/os_dns.cpp
@@ -89,17 +89,17 @@ class DNSServer : public Serializable
{
Anope::string server_name;
std::vector<Anope::string> ips;
- unsigned limit;
+ unsigned limit = 0;
/* wants to be in the pool */
- bool pooled;
+ bool pooled = false;
/* is actually in the pool */
- bool active;
+ bool active = false;
public:
std::set<Anope::string, ci::less> zones;
- time_t repool;
+ time_t repool = 0;
- DNSServer(const Anope::string &sn) : Serializable("DNSServer"), server_name(sn), limit(0), pooled(false), active(false), repool(0)
+ DNSServer(const Anope::string &sn) : Serializable("DNSServer"), server_name(sn)
{
dns_servers->push_back(this);
}
@@ -729,15 +729,12 @@ class ModuleDNS : public Module
bool remove_split_servers;
bool readd_connected_servers;
- time_t last_warn;
+ time_t last_warn = 0;
public:
ModuleDNS(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, EXTRA | VENDOR),
- zone_type("DNSZone", DNSZone::Unserialize), dns_type("DNSServer", DNSServer::Unserialize), commandosdns(this),
- last_warn(0)
+ zone_type("DNSZone", DNSZone::Unserialize), dns_type("DNSServer", DNSServer::Unserialize), commandosdns(this)
{
-
-
for (unsigned j = 0; j < dns_servers->size(); ++j)
{
DNSServer *s = dns_servers->at(j);
diff --git a/modules/commands/os_info.cpp b/modules/commands/os_info.cpp
index 1a05b71d9..652d51593 100644
--- a/modules/commands/os_info.cpp
+++ b/modules/commands/os_info.cpp
@@ -13,9 +13,9 @@ struct OperInfo : Serializable
Anope::string target;
Anope::string info;
Anope::string adder;
- time_t created;
+ time_t created = 0;
- OperInfo() : Serializable("OperInfo"), created(0) { }
+ OperInfo() : Serializable("OperInfo") { }
OperInfo(const Anope::string &t, const Anope::string &i, const Anope::string &a, time_t c) :
Serializable("OperInfo"), target(t), info(i), adder(a), created(c) { }
diff --git a/modules/commands/os_session.cpp b/modules/commands/os_session.cpp
index 4d63b264d..a667cac10 100644
--- a/modules/commands/os_session.cpp
+++ b/modules/commands/os_session.cpp
@@ -132,10 +132,10 @@ class ExceptionDelCallback : public NumberList
{
protected:
CommandSource &source;
- unsigned deleted;
+ unsigned deleted = 0;
Command *cmd;
public:
- ExceptionDelCallback(CommandSource &_source, const Anope::string &numlist, Command *c) : NumberList(numlist, true), source(_source), deleted(0), cmd(c)
+ ExceptionDelCallback(CommandSource &_source, const Anope::string &numlist, Command *c) : NumberList(numlist, true), source(_source), cmd(c)
{
}
diff --git a/modules/commands/os_sxline.cpp b/modules/commands/os_sxline.cpp
index 2f343b8d4..eedf1d02c 100644
--- a/modules/commands/os_sxline.cpp
+++ b/modules/commands/os_sxline.cpp
@@ -16,9 +16,9 @@ class SXLineDelCallback : public NumberList
XLineManager *xlm;
Command *command;
CommandSource &source;
- unsigned deleted;
+ unsigned deleted = 0;
public:
- SXLineDelCallback(XLineManager *x, Command *c, CommandSource &_source, const Anope::string &numlist) : NumberList(numlist, true), xlm(x), command(c), source(_source), deleted(0)
+ SXLineDelCallback(XLineManager *x, Command *c, CommandSource &_source, const Anope::string &numlist) : NumberList(numlist, true), xlm(x), command(c), source(_source)
{
}