summaryrefslogtreecommitdiff
path: root/include/modules/dns.h
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 /include/modules/dns.h
parentdfcc025a19d7d49179d75f34553c36e0d47eaded (diff)
Use C++11 style class/struct initialisation.
Diffstat (limited to 'include/modules/dns.h')
-rw-r--r--include/modules/dns.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/include/modules/dns.h b/include/modules/dns.h
index 1fe642c3b..afbac2944 100644
--- a/include/modules/dns.h
+++ b/include/modules/dns.h
@@ -73,10 +73,10 @@ namespace DNS
struct Question
{
Anope::string name;
- QueryType type;
- unsigned short qclass;
+ QueryType type = QUERY_NONE;
+ unsigned short qclass = 0;
- Question() : type(QUERY_NONE), qclass(0) { }
+ Question() = default;
Question(const Anope::string &n, QueryType t, unsigned short c = 1) : name(n), type(t), qclass(c) { }
inline bool operator==(const Question & other) const { return name == other.name && type == other.type && qclass == other.qclass; }
@@ -91,12 +91,12 @@ namespace DNS
struct ResourceRecord : Question
{
- unsigned int ttl;
+ unsigned int ttl = 0;
Anope::string rdata;
time_t created;
- ResourceRecord(const Anope::string &n, QueryType t, unsigned short c = 1) : Question(n, t, c), ttl(0), created(Anope::CurTime) { }
- ResourceRecord(const Question &q) : Question(q), ttl(0), created(Anope::CurTime) { }
+ ResourceRecord(const Anope::string &n, QueryType t, unsigned short c = 1) : Question(n, t, c), created(Anope::CurTime) { }
+ ResourceRecord(const Question &q) : Question(q), created(Anope::CurTime) { }
};
struct Query
@@ -139,12 +139,12 @@ namespace DNS
/* Use result cache if available */
bool use_cache;
/* Request id */
- unsigned short id;
+ unsigned short id = 0;
/* Creator of this request */
Module *creator;
Request(Manager *mgr, Module *c, const Anope::string &addr, QueryType qt, bool cache = false) : Timer(0), Question(addr, qt), manager(mgr),
- use_cache(cache), id(0), creator(c) { }
+ use_cache(cache), creator(c) { }
virtual ~Request()
{