mirror of
https://github.com/anope/anope.git
synced 2026-07-08 01:03:13 +02:00
Use C++11 default initializers and destructors where possible.
This commit is contained in:
@@ -30,14 +30,14 @@ struct BadWord
|
||||
Anope::string word;
|
||||
BadWordType type;
|
||||
|
||||
virtual ~BadWord() { }
|
||||
virtual ~BadWord() = default;
|
||||
protected:
|
||||
BadWord() { }
|
||||
BadWord() = default;
|
||||
};
|
||||
|
||||
struct BadWords
|
||||
{
|
||||
virtual ~BadWords() { }
|
||||
virtual ~BadWords() = default;
|
||||
|
||||
/** Add a badword to the badword list
|
||||
* @param word The badword
|
||||
|
||||
@@ -36,9 +36,9 @@ struct KickerData
|
||||
bool dontkickops, dontkickvoices;
|
||||
|
||||
protected:
|
||||
KickerData() { }
|
||||
KickerData() = default;
|
||||
|
||||
public:
|
||||
virtual ~KickerData() { }
|
||||
virtual ~KickerData() = default;
|
||||
virtual void Check(ChannelInfo *ci) = 0;
|
||||
};
|
||||
|
||||
@@ -13,9 +13,9 @@ struct EntryMsg
|
||||
Anope::string message;
|
||||
time_t when;
|
||||
|
||||
virtual ~EntryMsg() { }
|
||||
virtual ~EntryMsg() = default;
|
||||
protected:
|
||||
EntryMsg() { }
|
||||
EntryMsg() = default;
|
||||
};
|
||||
|
||||
struct EntryMessageList : Serialize::Checker<std::vector<EntryMsg *> >
|
||||
|
||||
@@ -22,9 +22,9 @@ struct LogSetting
|
||||
Anope::string creator;
|
||||
time_t created;
|
||||
|
||||
virtual ~LogSetting() { }
|
||||
virtual ~LogSetting() = default;
|
||||
protected:
|
||||
LogSetting() { }
|
||||
LogSetting() = default;
|
||||
};
|
||||
|
||||
struct LogSettings : Serialize::Checker<std::vector<LogSetting *> >
|
||||
@@ -37,6 +37,6 @@ struct LogSettings : Serialize::Checker<std::vector<LogSetting *> >
|
||||
}
|
||||
|
||||
public:
|
||||
virtual ~LogSettings() { }
|
||||
virtual ~LogSettings() = default;
|
||||
virtual LogSetting *Create() = 0;
|
||||
};
|
||||
|
||||
@@ -18,16 +18,16 @@ struct ModeLock
|
||||
Anope::string setter;
|
||||
time_t created;
|
||||
|
||||
virtual ~ModeLock() { }
|
||||
virtual ~ModeLock() = default;
|
||||
protected:
|
||||
ModeLock() { }
|
||||
ModeLock() = default;
|
||||
};
|
||||
|
||||
struct ModeLocks
|
||||
{
|
||||
typedef std::vector<ModeLock *> ModeList;
|
||||
|
||||
virtual ~ModeLocks() { }
|
||||
virtual ~ModeLocks() = default;
|
||||
|
||||
/** Check if a mode is mlocked
|
||||
* @param mode The mode
|
||||
|
||||
@@ -118,7 +118,7 @@ namespace DNS
|
||||
{
|
||||
public:
|
||||
Manager(Module *creator) : Service(creator, "DNS::Manager", "dns/manager") { }
|
||||
virtual ~Manager() { }
|
||||
virtual ~Manager() = default;
|
||||
|
||||
virtual void Process(Request *req) = 0;
|
||||
virtual void RemoveRequest(Request *req) = 0;
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace Encryption
|
||||
class Context
|
||||
{
|
||||
public:
|
||||
virtual ~Context() { }
|
||||
virtual ~Context() = default;
|
||||
virtual void Update(const unsigned char *data, size_t len) = 0;
|
||||
virtual void Finalize() = 0;
|
||||
virtual Hash GetFinalizedHash() = 0;
|
||||
@@ -27,7 +27,7 @@ namespace Encryption
|
||||
{
|
||||
public:
|
||||
Provider(Module *creator, const Anope::string &sname) : Service(creator, "Encryption::Provider", sname) { }
|
||||
virtual ~Provider() { }
|
||||
virtual ~Provider() = default;
|
||||
|
||||
virtual Context *CreateContext(IV * = NULL) = 0;
|
||||
virtual IV GetDefaultIV() = 0;
|
||||
|
||||
@@ -14,7 +14,7 @@ class LDAPException : public ModuleException
|
||||
public:
|
||||
LDAPException(const Anope::string &reason) : ModuleException(reason) { }
|
||||
|
||||
virtual ~LDAPException() throw() { }
|
||||
virtual ~LDAPException() throw() = default;
|
||||
};
|
||||
|
||||
struct LDAPModification
|
||||
@@ -116,7 +116,7 @@ class LDAPInterface
|
||||
Module *owner;
|
||||
|
||||
LDAPInterface(Module *m) : owner(m) { }
|
||||
virtual ~LDAPInterface() { }
|
||||
virtual ~LDAPInterface() = default;
|
||||
|
||||
virtual void OnResult(const LDAPResult &r) = 0;
|
||||
virtual void OnError(const LDAPResult &err) = 0;
|
||||
|
||||
@@ -12,9 +12,9 @@
|
||||
struct NSCertList
|
||||
{
|
||||
protected:
|
||||
NSCertList() { }
|
||||
NSCertList() = default;
|
||||
public:
|
||||
virtual ~NSCertList() { }
|
||||
virtual ~NSCertList() = default;
|
||||
|
||||
/** Add an entry to the nick's certificate list
|
||||
*
|
||||
|
||||
@@ -27,7 +27,7 @@ struct ForbidData
|
||||
time_t expires = 0;
|
||||
ForbidType type;
|
||||
|
||||
virtual ~ForbidData() { }
|
||||
virtual ~ForbidData() = default;
|
||||
protected:
|
||||
ForbidData() = default;
|
||||
};
|
||||
|
||||
@@ -16,7 +16,7 @@ struct IgnoreData
|
||||
Anope::string reason;
|
||||
time_t time = 0; /* When do we stop ignoring them? */
|
||||
|
||||
virtual ~IgnoreData() { }
|
||||
virtual ~IgnoreData() = default;
|
||||
protected:
|
||||
IgnoreData() = default;
|
||||
};
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace Redis
|
||||
Module *owner;
|
||||
|
||||
Interface(Module *m) : owner(m) { }
|
||||
virtual ~Interface() { }
|
||||
virtual ~Interface() = default;
|
||||
|
||||
virtual void OnResult(const Reply &r) = 0;
|
||||
virtual void OnError(const Anope::string &error) { Log(owner) << error; }
|
||||
|
||||
@@ -12,6 +12,7 @@ struct MiscData
|
||||
Anope::string name;
|
||||
Anope::string data;
|
||||
|
||||
MiscData() { }
|
||||
virtual ~MiscData() { }
|
||||
virtual ~MiscData() = default;
|
||||
protected:
|
||||
MiscData() = default;
|
||||
};
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace SQL
|
||||
public:
|
||||
Exception(const Anope::string &reason) : ModuleException(reason) { }
|
||||
|
||||
virtual ~Exception() throw() { }
|
||||
virtual ~Exception() throw() = default;
|
||||
};
|
||||
|
||||
/** A SQL query
|
||||
@@ -187,7 +187,7 @@ namespace SQL
|
||||
Module *owner;
|
||||
|
||||
Interface(Module *m) : owner(m) { }
|
||||
virtual ~Interface() { }
|
||||
virtual ~Interface() = default;
|
||||
|
||||
virtual void OnResult(const Result &r) = 0;
|
||||
virtual void OnError(const Result &r) = 0;
|
||||
|
||||
@@ -14,6 +14,6 @@ struct SuspendInfo
|
||||
Anope::string what, by, reason;
|
||||
time_t when, expires;
|
||||
|
||||
SuspendInfo() { }
|
||||
virtual ~SuspendInfo() { }
|
||||
SuspendInfo() = default;
|
||||
virtual ~SuspendInfo() = default;
|
||||
};
|
||||
|
||||
@@ -28,7 +28,7 @@ class XMLRPCServiceInterface;
|
||||
class XMLRPCEvent
|
||||
{
|
||||
public:
|
||||
virtual ~XMLRPCEvent() { }
|
||||
virtual ~XMLRPCEvent() = default;
|
||||
virtual bool Run(XMLRPCServiceInterface *iface, HTTPClient *client, XMLRPCRequest &request) = 0;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user