diff options
| author | Sadie Powell <sadie@witchery.services> | 2022-01-03 18:34:16 +0000 |
|---|---|---|
| committer | Sadie Powell <sadie@witchery.services> | 2022-01-04 00:17:13 +0000 |
| commit | 7531e90499d4cd60b6464c692725225e85c00738 (patch) | |
| tree | 930fd946ea495b74c4071a67e12cadb700ab79ab /modules | |
| parent | dfcc025a19d7d49179d75f34553c36e0d47eaded (diff) | |
Use C++11 style class/struct initialisation.
Diffstat (limited to 'modules')
26 files changed, 96 insertions, 115 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) { } diff --git a/modules/database/db_flatfile.cpp b/modules/database/db_flatfile.cpp index 224adffac..21cb7cc22 100644 --- a/modules/database/db_flatfile.cpp +++ b/modules/database/db_flatfile.cpp @@ -19,9 +19,7 @@ class SaveData : public Serialize::Data { public: Anope::string last; - std::fstream *fs; - - SaveData() : fs(NULL) { } + std::fstream *fs = nullptr; std::iostream& operator[](const Anope::string &key) override { @@ -38,13 +36,11 @@ class SaveData : public Serialize::Data class LoadData : public Serialize::Data { public: - std::fstream *fs; - unsigned int id; + std::fstream *fs = nullptr; + unsigned int id = 0; std::map<Anope::string, Anope::string> data; std::stringstream ss; - bool read; - - LoadData() : fs(NULL), id(0), read(false) { } + bool read = false; std::iostream& operator[](const Anope::string &key) override { @@ -106,12 +102,12 @@ class LoadData : public Serialize::Data class DBFlatFile : public Module, public Pipe { /* Day the last backup was on */ - int last_day; + int last_day = 0; /* Backup file names */ std::map<Anope::string, std::list<Anope::string> > backups; - bool loaded; + bool loaded = false; - int child_pid; + int child_pid = -1; void BackupDatabase() { @@ -172,7 +168,7 @@ class DBFlatFile : public Module, public Pipe } public: - DBFlatFile(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, DATABASE | VENDOR), last_day(0), loaded(false), child_pid(-1) + DBFlatFile(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, DATABASE | VENDOR) { } diff --git a/modules/database/db_sql.cpp b/modules/database/db_sql.cpp index 0fa601cfa..0c32310f3 100644 --- a/modules/database/db_sql.cpp +++ b/modules/database/db_sql.cpp @@ -63,10 +63,10 @@ class DBSQL : public Module, public Pipe bool import; std::set<Serializable *> updated_items; - bool shutting_down; - bool loading_databases; - bool loaded; - bool imported; + bool shutting_down = false; + bool loading_databases = false; + bool loaded = false; + bool imported = false; void RunBackground(const Query &q, Interface *iface = NULL) { @@ -90,7 +90,7 @@ class DBSQL : public Module, public Pipe } public: - DBSQL(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, DATABASE | VENDOR), sql("", ""), sqlinterface(this), shutting_down(false), loading_databases(false), loaded(false), imported(false) + DBSQL(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, DATABASE | VENDOR), sql("", ""), sqlinterface(this) { diff --git a/modules/extra/m_ldap.cpp b/modules/extra/m_ldap.cpp index e9182d7d9..b72c9af56 100644 --- a/modules/extra/m_ldap.cpp +++ b/modules/extra/m_ldap.cpp @@ -29,18 +29,15 @@ class LDAPRequest public: LDAPService *service; LDAPInterface *inter; - LDAPMessage *message; /* message returned by ldap_ */ - LDAPResult *result; /* final result */ + LDAPMessage *message = nullptr; /* message returned by ldap_ */ + LDAPResult *result = nullptr; /* final result */ struct timeval tv; - QueryType type; + QueryType type = QUERY_UNKNOWN; LDAPRequest(LDAPService *s, LDAPInterface *i) : service(s) , inter(i) - , message(NULL) - , result(NULL) { - type = QUERY_UNKNOWN; tv.tv_sec = 0; tv.tv_usec = 100000; } @@ -147,7 +144,7 @@ class LDAPService : public LDAPProvider, public Thread, public Condition LDAP *con; - time_t last_connect; + time_t last_connect = 0; public: static LDAPMod **BuildMods(const LDAPMods &attributes) @@ -232,7 +229,7 @@ class LDAPService : public LDAPProvider, public Thread, public Condition query_queue queries, results; Mutex process_mutex; /* held when processing requests not in either queue */ - LDAPService(Module *o, const Anope::string &n, const Anope::string &s, const Anope::string &b, const Anope::string &p) : LDAPProvider(o, n), server(s), admin_binddn(b), admin_pass(p), last_connect(0) + LDAPService(Module *o, const Anope::string &n, const Anope::string &s, const Anope::string &b, const Anope::string &p) : LDAPProvider(o, n), server(s), admin_binddn(b), admin_pass(p) { Connect(); } diff --git a/modules/extra/m_ldap_authentication.cpp b/modules/extra/m_ldap_authentication.cpp index cac2035a0..ab67bd919 100644 --- a/modules/extra/m_ldap_authentication.cpp +++ b/modules/extra/m_ldap_authentication.cpp @@ -22,10 +22,10 @@ struct IdentifyInfo Reference<User> user; IdentifyRequest *req; ServiceReference<LDAPProvider> lprov; - bool admin_bind; + bool admin_bind = true; Anope::string dn; - IdentifyInfo(User *u, IdentifyRequest *r, ServiceReference<LDAPProvider> &lp) : user(u), req(r), lprov(lp), admin_bind(true) + IdentifyInfo(User *u, IdentifyRequest *r, ServiceReference<LDAPProvider> &lp) : user(u), req(r), lprov(lp) { req->Hold(me); } diff --git a/modules/extra/m_mysql.cpp b/modules/extra/m_mysql.cpp index fb9e4888f..3b4b0ea3f 100644 --- a/modules/extra/m_mysql.cpp +++ b/modules/extra/m_mysql.cpp @@ -61,7 +61,7 @@ struct QueryResult */ class MySQLResult : public Result { - MYSQL_RES *res; + MYSQL_RES *res = nullptr; public: MySQLResult(unsigned int i, const Query &q, const Anope::string &fq, MYSQL_RES *r) : Result(i, q, fq), res(r) @@ -94,7 +94,7 @@ class MySQLResult : public Result } } - MySQLResult(const Query &q, const Anope::string &fq, const Anope::string &err) : Result(0, q, fq, err), res(NULL) + MySQLResult(const Query &q, const Anope::string &fq, const Anope::string &err) : Result(0, q, fq, err) { } @@ -117,7 +117,7 @@ class MySQLService : public Provider Anope::string password; int port; - MYSQL *sql; + MYSQL *sql = nullptr; /** Escape a query. * Note the mutex must be held! @@ -300,7 +300,7 @@ class ModuleSQL : public Module, public Pipe }; MySQLService::MySQLService(Module *o, const Anope::string &n, const Anope::string &d, const Anope::string &s, const Anope::string &u, const Anope::string &p, int po) -: Provider(o, n), database(d), server(s), user(u), password(p), port(po), sql(NULL) +: Provider(o, n), database(d), server(s), user(u), password(p), port(po) { Connect(); } diff --git a/modules/extra/m_sqlite.cpp b/modules/extra/m_sqlite.cpp index 39dad2f02..1a2bed1f1 100644 --- a/modules/extra/m_sqlite.cpp +++ b/modules/extra/m_sqlite.cpp @@ -44,7 +44,7 @@ class SQLiteService : public Provider Anope::string database; - sqlite3 *sql; + sqlite3 *sql = nullptr; Anope::string Escape(const Anope::string &query); @@ -134,7 +134,7 @@ class ModuleSQLite : public Module }; SQLiteService::SQLiteService(Module *o, const Anope::string &n, const Anope::string &d) -: Provider(o, n), database(d), sql(NULL) +: Provider(o, n), database(d) { int db = sqlite3_open_v2(database.c_str(), &this->sql, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, 0); if (db != SQLITE_OK) diff --git a/modules/extra/m_ssl_gnutls.cpp b/modules/extra/m_ssl_gnutls.cpp index 18c561266..c6b532269 100644 --- a/modules/extra/m_ssl_gnutls.cpp +++ b/modules/extra/m_ssl_gnutls.cpp @@ -36,7 +36,7 @@ class MySSLService : public SSLService class SSLSocketIO : public SocketIO { public: - gnutls_session_t sess; + gnutls_session_t sess = nullptr; GnuTLS::X509CertCredentials* mycreds; /** Constructor @@ -115,11 +115,9 @@ namespace GnuTLS class DHParams { - gnutls_dh_params_t dh_params; + gnutls_dh_params_t dh_params = nullptr; public: - DHParams() : dh_params(NULL) { } - void Import(const Anope::string &dhstr) { if (dh_params != NULL) @@ -225,7 +223,7 @@ namespace GnuTLS class X509CertCredentials { - unsigned int refcount; + unsigned int refcount = 0; gnutls_certificate_credentials_t cred; DHParams dh; @@ -247,7 +245,7 @@ namespace GnuTLS X509Key key; X509CertCredentials(const Anope::string &certfile, const Anope::string &keyfile) - : refcount(0), certs(LoadFile(certfile)), key(LoadFile(keyfile)) + : certs(LoadFile(certfile)), key(LoadFile(keyfile)) { if (gnutls_certificate_allocate_credentials(&cred) < 0) throw ConfigException("Cannot allocate certificate credentials"); @@ -299,10 +297,10 @@ class GnuTLSModule : public Module GnuTLS::Init libinit; public: - GnuTLS::X509CertCredentials *cred; + GnuTLS::X509CertCredentials *cred = nullptr; MySSLService service; - GnuTLSModule(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, EXTRA | VENDOR), cred(NULL), service(this, "ssl") + GnuTLSModule(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, EXTRA | VENDOR), service(this, "ssl") { me = this; this->SetPermanent(true); @@ -630,7 +628,7 @@ void SSLSocketIO::Destroy() delete this; } -SSLSocketIO::SSLSocketIO() : sess(NULL), mycreds(me->cred) +SSLSocketIO::SSLSocketIO() : mycreds(me->cred) { mycreds->incrref(); } diff --git a/modules/m_dns.cpp b/modules/m_dns.cpp index 1169f6cbe..50c4c60a0 100644 --- a/modules/m_dns.cpp +++ b/modules/m_dns.cpp @@ -209,11 +209,11 @@ class Packet : public Query /* Source or destination of the packet */ sockaddrs addr; /* ID for this packet */ - unsigned short id; + unsigned short id = 0; /* Flags on the packet */ - unsigned short flags; + unsigned short flags = 0; - Packet(Manager *m, sockaddrs *a) : manager(m), id(0), flags(0) + Packet(Manager *m, sockaddrs *a) : manager(m) { if (a) addr = *a; @@ -468,13 +468,13 @@ class TCPSocket : public ListenSocket class Client : public ClientSocket, public Timer, public ReplySocket { Manager *manager; - Packet *packet; + Packet *packet = nullptr; unsigned char packet_buffer[524]; - int length; + int length = 0; public: Client(Manager *m, TCPSocket *l, int fd, const sockaddrs &addr) : Socket(fd, l->IsIPv6()), ClientSocket(l, addr), Timer(5), - manager(m), packet(NULL), length(0) + manager(m) { Log(LOG_DEBUG_2) << "Resolver: New client from " << addr.addr(); } @@ -652,18 +652,17 @@ class MyManager : public Manager, public Timer typedef TR1NS::unordered_map<Question, Query, Question::hash> cache_map; cache_map cache; - TCPSocket *tcpsock; - UDPSocket *udpsock; + TCPSocket *tcpsock = nullptr; + UDPSocket *udpsock = nullptr; - bool listen; + bool listen = false; sockaddrs addrs; std::vector<std::pair<Anope::string, short> > notify; public: std::map<unsigned short, Request *> requests; - MyManager(Module *creator) : Manager(creator), Timer(300, Anope::CurTime, true), serial(Anope::CurTime), tcpsock(NULL), udpsock(NULL), - listen(false), cur_id(rand()) + MyManager(Module *creator) : Manager(creator), Timer(300, Anope::CurTime, true), serial(Anope::CurTime), cur_id(rand()) { } diff --git a/modules/m_dnsbl.cpp b/modules/m_dnsbl.cpp index 3e867ff1d..79fa92a73 100644 --- a/modules/m_dnsbl.cpp +++ b/modules/m_dnsbl.cpp @@ -18,20 +18,18 @@ struct Blacklist { struct Reply { - int code; + int code = 0; Anope::string reason; - bool allow_account; + bool allow_account = false; - Reply() : code(0), allow_account(false) { } + Reply() = default; }; Anope::string name; - time_t bantime; + time_t bantime = 0; Anope::string reason; std::vector<Reply> replies; - Blacklist() : bantime(0) { } - Reply *Find(int code) { for (unsigned int i = 0; i < replies.size(); ++i) diff --git a/modules/m_httpd.cpp b/modules/m_httpd.cpp index 715e42c3d..ad2a28b99 100644 --- a/modules/m_httpd.cpp +++ b/modules/m_httpd.cpp @@ -41,19 +41,19 @@ class MyHTTPClient : public HTTPClient { HTTPProvider *provider; HTTPMessage message; - bool header_done, served; + bool header_done = false, served = false; Anope::string page_name; Reference<HTTPPage> page; Anope::string ip; - unsigned content_length; + unsigned content_length = 0; enum { ACTION_NONE, ACTION_GET, ACTION_POST - } action; + } action = ACTION_NONE; void Serve() { @@ -94,7 +94,7 @@ class MyHTTPClient : public HTTPClient public: time_t created; - MyHTTPClient(HTTPProvider *l, int f, const sockaddrs &a) : Socket(f, l->IsIPv6()), HTTPClient(l, f, a), provider(l), header_done(false), served(false), ip(a.addr()), content_length(0), action(ACTION_NONE), created(Anope::CurTime) + MyHTTPClient(HTTPProvider *l, int f, const sockaddrs &a) : Socket(f, l->IsIPv6()), HTTPClient(l, f, a), provider(l), ip(a.addr()), created(Anope::CurTime) { Log(LOG_DEBUG, "httpd") << "Accepted connection " << f << " from " << a.addr(); } diff --git a/modules/m_redis.cpp b/modules/m_redis.cpp index df3de871c..62c831a44 100644 --- a/modules/m_redis.cpp +++ b/modules/m_redis.cpp @@ -82,13 +82,12 @@ class MyRedisService : public Provider int port; unsigned db; - RedisSocket *sock, *sub; + RedisSocket *sock = nullptr, *sub = nullptr; Transaction ti; - bool in_transaction; + bool in_transaction = false; - MyRedisService(Module *c, const Anope::string &n, const Anope::string &h, int p, unsigned d) : Provider(c, n), host(h), port(p), db(d), sock(NULL), sub(NULL), - ti(c), in_transaction(false) + MyRedisService(Module *c, const Anope::string &n, const Anope::string &h, int p, unsigned d) : Provider(c, n), host(h), port(p), db(d), ti(c) { sock = new RedisSocket(this, host.find(':') != Anope::string::npos); sock->Connect(host, port); diff --git a/modules/m_sasl.cpp b/modules/m_sasl.cpp index 3918a3152..db0ec3d17 100644 --- a/modules/m_sasl.cpp +++ b/modules/m_sasl.cpp @@ -303,7 +303,7 @@ class ModuleSASL : public Module SASLService sasl; Plain plain; - External *external; + External *external = nullptr; std::vector<Anope::string> mechs; @@ -322,7 +322,7 @@ class ModuleSASL : public Module public: ModuleSASL(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR), - sasl(this), plain(this), external(NULL) + sasl(this), plain(this) { try { diff --git a/modules/ns_maxemail.cpp b/modules/ns_maxemail.cpp index aae6f0a63..3d5dec0c7 100644 --- a/modules/ns_maxemail.cpp +++ b/modules/ns_maxemail.cpp @@ -14,7 +14,7 @@ class NSMaxEmail : public Module { - bool clean; + bool clean = false; /* strip dots from username, and remove anything after the first + */ Anope::string CleanMail(const Anope::string &email) @@ -77,7 +77,6 @@ class NSMaxEmail : public Module public: NSMaxEmail(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) - , clean(false) { } diff --git a/modules/protocol/inspircd.cpp b/modules/protocol/inspircd.cpp index 753cb7cd4..fd8d61cb1 100644 --- a/modules/protocol/inspircd.cpp +++ b/modules/protocol/inspircd.cpp @@ -809,21 +809,19 @@ struct IRCDMessageCapab : Message::Capab struct ModeInfo { // The letter assigned to the mode (e.g. o). - char letter; + char letter = 0; // If a prefix mode then the rank of the prefix. - unsigned level; + unsigned level = 0; // The name of the mode. Anope::string name; // If a prefix mode then the symbol associated with the prefix. - char symbol; + char symbol = 0; // The type of mode. Anope::string type; - - ModeInfo() : letter(0), level(0), symbol(0) { } }; static bool ParseMode(const Anope::string& token, ModeInfo& mode) @@ -1296,9 +1294,9 @@ struct IRCDMessageKick : IRCDMessage struct IRCDMessageSave : IRCDMessage { - time_t last_collide; + time_t last_collide = 0; - IRCDMessageSave(Module *creator) : IRCDMessage(creator, "SAVE", 2), last_collide(0) { } + IRCDMessageSave(Module *creator) : IRCDMessage(creator, "SAVE", 2) { } void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override { diff --git a/modules/pseudoclients/chanserv.cpp b/modules/pseudoclients/chanserv.cpp index a98c5bd40..100b0e50b 100644 --- a/modules/pseudoclients/chanserv.cpp +++ b/modules/pseudoclients/chanserv.cpp @@ -25,11 +25,11 @@ class ChanServCore : public Module, public ChanServService std::vector<Anope::string> defaults; ExtensibleItem<bool> inhabit; ExtensibleRef<bool> persist; - bool always_lower; + bool always_lower = false; public: ChanServCore(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, PSEUDOCLIENT | VENDOR), - ChanServService(this), inhabit(this, "inhabit"), persist("PERSIST"), always_lower(false) + ChanServService(this), inhabit(this, "inhabit"), persist("PERSIST") { } diff --git a/modules/webcpanel/pages/index.h b/modules/webcpanel/pages/index.h index fb7f759f9..715fc72ec 100644 --- a/modules/webcpanel/pages/index.h +++ b/modules/webcpanel/pages/index.h @@ -15,10 +15,10 @@ class Index : public WebPanelPage static const int FLUSH_TIME = 60; Anope::hash_map<time_t> last_login_attempt; - time_t last_clear; + time_t last_clear = 0; public: - Index(const Anope::string &u) : WebPanelPage(u), last_clear(0) { } + Index(const Anope::string &u) : WebPanelPage(u) { } bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &) override; }; |
