aboutsummaryrefslogtreecommitdiff
path: root/include/modules
diff options
context:
space:
mode:
authorGravatar Sadie Powell2020-02-06 11:25:42 +0000
committerGravatar Sadie Powell2020-02-06 11:25:42 +0000
commit98e4ddfb21d285c8b675788c155bb204822fbd4a (patch)
tree030eb18c989bf3c9e4768a538796e3221ca7934e /include/modules
parentIn C++11 [io]fstream has std::string constructors; use them. (diff)
Use C++11 inline initialisation for class members.
Diffstat (limited to 'include/modules')
-rw-r--r--include/modules/cap.h3
-rw-r--r--include/modules/ctctags.h8
-rw-r--r--include/modules/dns.h30
-rw-r--r--include/modules/invite.h2
-rw-r--r--include/modules/ircv3_batch.h13
-rw-r--r--include/modules/ssl.h7
-rw-r--r--include/modules/who.h10
7 files changed, 38 insertions, 35 deletions
diff --git a/include/modules/cap.h b/include/modules/cap.h
index 8ae5df5c7..d5119b10f 100644
--- a/include/modules/cap.h
+++ b/include/modules/cap.h
@@ -130,7 +130,7 @@ namespace Cap
/** True if the cap is active. Only active caps are registered in the manager.
*/
- bool active;
+ bool active = true;
/** Reference to the cap manager object
*/
@@ -172,7 +172,6 @@ namespace Cap
*/
Capability(Module* mod, const std::string& Name)
: ServiceProvider(mod, Name, SERVICE_CUSTOM)
- , active(true)
, manager(mod, "capmanager")
{
Unregister();
diff --git a/include/modules/ctctags.h b/include/modules/ctctags.h
index f1af43c09..f51e5345f 100644
--- a/include/modules/ctctags.h
+++ b/include/modules/ctctags.h
@@ -80,10 +80,10 @@ class CTCTags::TagMessageDetails
{
public:
/** Whether to echo the tags at all. */
- bool echo;
+ bool echo = true;
/* Whether to send the original tags back to clients with echo-message support. */
- bool echo_original;
+ bool echo_original = false;
/** The users who are exempted from receiving this message. */
CUList exemptions;
@@ -95,9 +95,7 @@ class CTCTags::TagMessageDetails
ClientProtocol::TagMap tags_out;
TagMessageDetails(const ClientProtocol::TagMap& tags)
- : echo(true)
- , echo_original(false)
- , tags_in(tags)
+ : tags_in(tags)
{
}
};
diff --git a/include/modules/dns.h b/include/modules/dns.h
index 00d50ffb8..4fc3ae295 100644
--- a/include/modules/dns.h
+++ b/include/modules/dns.h
@@ -103,23 +103,36 @@ namespace DNS
struct ResourceRecord : Question
{
- unsigned int ttl;
+ unsigned int ttl = 0;
std::string rdata;
time_t created;
- ResourceRecord(const std::string& n, QueryType t) : Question(n, t), ttl(0), created(ServerInstance->Time()) { }
- ResourceRecord(const Question& question) : Question(question), ttl(0), created(ServerInstance->Time()) { }
+ ResourceRecord(const std::string& n, QueryType t)
+ : Question(n, t)
+ , created(ServerInstance->Time())
+ {
+ }
+
+ ResourceRecord(const Question& question)
+ : Question(question)
+ , created(ServerInstance->Time())
+ {
+ }
};
struct Query
{
Question question;
std::vector<ResourceRecord> answers;
- Error error;
- bool cached;
+ Error error = ERROR_NONE;
+ bool cached = false;
+
+ Query() = default;
- Query() : error(ERROR_NONE), cached(false) { }
- Query(const Question& q) : question(q), error(ERROR_NONE), cached(false) { }
+ Query(const Question& q)
+ : question(q)
+ {
+ }
const ResourceRecord* FindAnswerOfType(QueryType qtype) const
{
@@ -161,7 +174,7 @@ namespace DNS
/* Use result cache if available */
bool use_cache;
/* Request id */
- RequestId id;
+ RequestId id = 0;
/* Creator of this request */
Module* const creator;
@@ -170,7 +183,6 @@ namespace DNS
, manager(mgr)
, question(addr, qt)
, use_cache(usecache)
- , id(0)
, creator(mod)
{
}
diff --git a/include/modules/invite.h b/include/modules/invite.h
index ba76f577e..5786f7dc3 100644
--- a/include/modules/invite.h
+++ b/include/modules/invite.h
@@ -113,7 +113,7 @@ class Invite::Invite : public insp::intrusive_list_node<Invite, LocalUser>, publ
private:
/** Timer handling expiration. If NULL this invite doesn't expire.
*/
- Timer* expiretimer;
+ Timer* expiretimer = nullptr;
/** Constructor, only available to the module providing the invite API (core_channel).
* To create Invites use InviteAPI::Create().
diff --git a/include/modules/ircv3_batch.h b/include/modules/ircv3_batch.h
index 6f86b5f29..9e64c4fcc 100644
--- a/include/modules/ircv3_batch.h
+++ b/include/modules/ircv3_batch.h
@@ -83,14 +83,14 @@ class IRCv3::Batch::Manager : public DataProvider, public ClientProtocol::Messag
*/
class IRCv3::Batch::Batch
{
- Manager* manager;
+ Manager* manager = nullptr;
const std::string type;
RefTag reftag;
std::string reftagstr;
unsigned int bit;
- BatchInfo* batchinfo;
- ClientProtocol::Message* batchstartmsg;
- ClientProtocol::Message* batchendmsg;
+ BatchInfo* batchinfo = nullptr;
+ ClientProtocol::Message* batchstartmsg = nullptr;
+ ClientProtocol::Message* batchendmsg = nullptr;
void Setup(unsigned int b)
{
@@ -108,10 +108,7 @@ class IRCv3::Batch::Batch
* @param Type Batch type string, used to indicate what kind of grouping the batch does. May be empty.
*/
Batch(const std::string& Type)
- : manager(NULL)
- , type(Type)
- , batchinfo(NULL)
- , batchstartmsg(NULL)
+ : type(Type)
{
}
diff --git a/include/modules/ssl.h b/include/modules/ssl.h
index 88a6751e4..813186650 100644
--- a/include/modules/ssl.h
+++ b/include/modules/ssl.h
@@ -45,9 +45,10 @@ class ssl_cert : public refcountbase
std::string issuer;
std::string error;
std::string fingerprint;
- bool trusted, invalid, unknownsigner, revoked;
-
- ssl_cert() : trusted(false), invalid(true), unknownsigner(true), revoked(false) {}
+ bool trusted = false;
+ bool invalid = true;
+ bool unknownsigner = true;
+ bool revoked = false;
/** Get certificate distinguished name
* @return Certificate DN
diff --git a/include/modules/who.h b/include/modules/who.h
index 36aecbc03..e1f57d149 100644
--- a/include/modules/who.h
+++ b/include/modules/who.h
@@ -55,7 +55,7 @@ class Who::Request
std::bitset<UCHAR_MAX> flags;
/** Whether we are matching using a wildcard or a flag. */
- bool fuzzy_match;
+ bool fuzzy_match = false;
/** The text to match against. */
std::string matchtext;
@@ -64,7 +64,7 @@ class Who::Request
std::vector<Numeric::Numeric> results;
/** Whether the source requested a WHOX response. */
- bool whox;
+ bool whox = false;
/** The fields to include in the WHOX response. */
std::bitset<UCHAR_MAX> whox_fields;
@@ -84,9 +84,5 @@ class Who::Request
virtual bool GetFieldIndex(char flag, size_t& out) const = 0;
protected:
- Request()
- : fuzzy_match(false)
- , whox(false)
- {
- }
+ Request() = default;
};