Skip to content

Commit

Permalink
clang-tidy: use equals default
Browse files Browse the repository at this point in the history
Found with modernize-use-equals-default

Signed-off-by: Rosen Penev <[email protected]>
  • Loading branch information
neheb committed Jan 9, 2024
1 parent 369b105 commit abb11ca
Show file tree
Hide file tree
Showing 41 changed files with 69 additions and 130 deletions.
4 changes: 1 addition & 3 deletions modules/bindbackend/bindbackend2.hh
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,7 @@ template <typename T>
class LookButDontTouch
{
public:
LookButDontTouch()
{
}
LookButDontTouch() = default;
LookButDontTouch(shared_ptr<T>&& records) :
d_records(std::move(records))
{
Expand Down
2 changes: 1 addition & 1 deletion modules/geoipbackend/geoipinterface-dat.cc
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ class GeoIPInterfaceDAT : public GeoIPInterface
return false;
}

~GeoIPInterfaceDAT() {}
~GeoIPInterfaceDAT() = default;

private:
unsigned int d_db_type;
Expand Down
2 changes: 1 addition & 1 deletion modules/geoipbackend/geoipinterface.hh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public:
boost::optional<int>& alt, boost::optional<int>& prec)
= 0;

virtual ~GeoIPInterface() {}
virtual ~GeoIPInterface() = default;

static unique_ptr<GeoIPInterface> makeInterface(const string& dbStr);

Expand Down
2 changes: 1 addition & 1 deletion modules/ldapbackend/ldapauthenticator.hh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
class LdapAuthenticator
{
public:
virtual ~LdapAuthenticator() {}
virtual ~LdapAuthenticator() = default;
virtual bool authenticate(LDAP* connection) = 0;
virtual std::string getError() const = 0;
};
2 changes: 1 addition & 1 deletion modules/lmdbbackend/lmdbbackend.hh
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public:
class LMDBResourceRecord : public DNSResourceRecord
{
public:
LMDBResourceRecord() {}
LMDBResourceRecord() = default;
LMDBResourceRecord(const DNSResourceRecord& rr) :
DNSResourceRecord(rr), ordername(false) {}

Expand Down
2 changes: 1 addition & 1 deletion modules/pipebackend/coprocess.hh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
class CoRemote
{
public:
virtual ~CoRemote() {}
virtual ~CoRemote() = default;
virtual void sendReceive(const string& send, string& receive) = 0;
virtual void receive(string& rcv) = 0;
virtual void send(const string& send) = 0;
Expand Down
4 changes: 1 addition & 3 deletions modules/pipebackend/pipebackend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ CoWrapper::CoWrapper(const string& command, int timeout, int abiVersion)
// I think
}

CoWrapper::~CoWrapper()
{
}
CoWrapper::~CoWrapper() = default;

void CoWrapper::launch()
{
Expand Down
3 changes: 1 addition & 2 deletions pdns/anadns.hh
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@

struct QuestionIdentifier
{
QuestionIdentifier()
{}
QuestionIdentifier() = default;

bool operator<(const QuestionIdentifier& rhs) const
{
Expand Down
6 changes: 2 additions & 4 deletions pdns/auth-packetcache.hh
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,8 @@ private:

struct MapCombo
{
MapCombo() {
}
~MapCombo() {
}
MapCombo() = default;
~MapCombo() = default;
MapCombo(const MapCombo&) = delete;
MapCombo& operator=(const MapCombo&) = delete;

Expand Down
6 changes: 2 additions & 4 deletions pdns/auth-querycache.hh
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,8 @@ private:

struct MapCombo
{
MapCombo() {
}
~MapCombo() {
}
MapCombo() = default;
~MapCombo() = default;
MapCombo(const MapCombo &) = delete;
MapCombo & operator=(const MapCombo &) = delete;

Expand Down
4 changes: 0 additions & 4 deletions pdns/auth-secondarycommunicator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1042,10 +1042,6 @@ struct SecondarySenderReceiver

map<uint32_t, Answer> d_freshness;

SecondarySenderReceiver()
{
}

void deliverTimeout(const Identifier& /* i */)
{
}
Expand Down
4 changes: 2 additions & 2 deletions pdns/auth-zonecache.hh
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ private:

struct MapCombo
{
MapCombo() {}
~MapCombo() {}
MapCombo() = default;
~MapCombo() = default;
MapCombo(const MapCombo&) = delete;
MapCombo& operator=(const MapCombo&) = delete;

Expand Down
3 changes: 1 addition & 2 deletions pdns/backends/gsql/gsqlbackend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2327,6 +2327,5 @@ void GSQLBackend::extractComment(SSqlStatement::row_t& row, Comment& comment)
comment.content = std::move(row[5]);
}

SSqlStatement::~SSqlStatement() {
// make sure vtable won't break
}
SSqlStatement::~SSqlStatement() = default;
2 changes: 1 addition & 1 deletion pdns/comment.hh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Comment
{
public:
Comment() : modified_at(0), domain_id(0) {};
~Comment() {};
~Comment() = default;

// data
DNSName qname; //!< the name of the associated RRset, for example: www.powerdns.com
Expand Down
4 changes: 2 additions & 2 deletions pdns/dnsbackend.hh
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public:
*/
virtual bool list(const DNSName &target, int domain_id, bool include_disabled=false)=0;

virtual ~DNSBackend(){};
virtual ~DNSBackend() = default;

//! fills the soadata struct with the SOA details. Returns false if there is no SOA.
virtual bool getSOA(const DNSName &name, SOAData &soadata);
Expand Down Expand Up @@ -475,7 +475,7 @@ class BackendFactory
{
public:
BackendFactory(const string &name) : d_name(name) {}
virtual ~BackendFactory(){}
virtual ~BackendFactory() = default;
virtual DNSBackend *make(const string &suffix)=0;
virtual DNSBackend *makeMetadataOnly(const string &suffix)
{
Expand Down
5 changes: 2 additions & 3 deletions pdns/dnsname.hh
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class DNSName
public:
static const size_t s_maxDNSNameLength = 255;

DNSName() {} //!< Constructs an *empty* DNSName, NOT the root!
DNSName() = default; //!< Constructs an *empty* DNSName, NOT the root!
// Work around assertion in some boost versions that do not like self-assignment of boost::container::string
DNSName& operator=(const DNSName& rhs)
{
Expand Down Expand Up @@ -561,8 +561,7 @@ private:
struct SuffixMatchNode
{
public:
SuffixMatchNode()
{}
SuffixMatchNode() = default;
SuffixMatchTree<bool> d_tree;

void add(const DNSName& dnsname)
Expand Down
2 changes: 1 addition & 1 deletion pdns/dnsparser.hh
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public:
static string upgradeContent(const DNSName& qname, const QType& qtype, const string& content);

virtual std::string getZoneRepresentation(bool noDot=false) const = 0;
virtual ~DNSRecordContent() {}
virtual ~DNSRecordContent() = default;
virtual void toPacket(DNSPacketWriter& pw) const = 0;
// returns the wire format of the content, possibly including compressed pointers pointing to the owner name (unless canonic or lowerCase are set)
string serialize(const DNSName& qname, bool canonic=false, bool lowerCase=false) const
Expand Down
14 changes: 7 additions & 7 deletions pdns/dnsrecords.cc
Original file line number Diff line number Diff line change
Expand Up @@ -360,23 +360,23 @@ boilerplate_conv(SMIMEA,
conv.xfrHexBlob(d_cert, true);
)

DSRecordContent::DSRecordContent() {}
DSRecordContent::DSRecordContent() = default;
boilerplate_conv(DS,
conv.xfr16BitInt(d_tag);
conv.xfr8BitInt(d_algorithm);
conv.xfr8BitInt(d_digesttype);
conv.xfrHexBlob(d_digest, true); // keep reading across spaces
)

CDSRecordContent::CDSRecordContent() {}
CDSRecordContent::CDSRecordContent() = default;
boilerplate_conv(CDS,
conv.xfr16BitInt(d_tag);
conv.xfr8BitInt(d_algorithm);
conv.xfr8BitInt(d_digesttype);
conv.xfrHexBlob(d_digest, true); // keep reading across spaces
)

DLVRecordContent::DLVRecordContent() {}
DLVRecordContent::DLVRecordContent() = default;
boilerplate_conv(DLV,
conv.xfr16BitInt(d_tag);
conv.xfr8BitInt(d_algorithm);
Expand All @@ -403,31 +403,31 @@ boilerplate_conv(RRSIG,
conv.xfrBlob(d_signature);
)

RRSIGRecordContent::RRSIGRecordContent() {}
RRSIGRecordContent::RRSIGRecordContent() = default;

boilerplate_conv(DNSKEY,
conv.xfr16BitInt(d_flags);
conv.xfr8BitInt(d_protocol);
conv.xfr8BitInt(d_algorithm);
conv.xfrBlob(d_key);
)
DNSKEYRecordContent::DNSKEYRecordContent() {}
DNSKEYRecordContent::DNSKEYRecordContent() = default;

boilerplate_conv(CDNSKEY,
conv.xfr16BitInt(d_flags);
conv.xfr8BitInt(d_protocol);
conv.xfr8BitInt(d_algorithm);
conv.xfrBlob(d_key);
)
CDNSKEYRecordContent::CDNSKEYRecordContent() {}
CDNSKEYRecordContent::CDNSKEYRecordContent() = default;

boilerplate_conv(RKEY,
conv.xfr16BitInt(d_flags);
conv.xfr8BitInt(d_protocol);
conv.xfr8BitInt(d_algorithm);
conv.xfrBlob(d_key);
)
RKEYRecordContent::RKEYRecordContent() {}
RKEYRecordContent::RKEYRecordContent() = default;

boilerplate_conv(NID,
conv.xfr16BitInt(d_preference);
Expand Down
25 changes: 10 additions & 15 deletions pdns/dnsrecords.hh
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class TSIGRecordContent : public DNSRecordContent
{
public:
includeboilerplate(TSIG)
TSIGRecordContent() {}
TSIGRecordContent() = default;

uint16_t d_origID{0};
uint16_t d_fudge{0};
Expand Down Expand Up @@ -334,7 +334,7 @@ private:
class OPTRecordContent : public DNSRecordContent
{
public:
OPTRecordContent(){}
OPTRecordContent() = default;
includeboilerplate(OPT)
void getData(vector<pair<uint16_t, string> > &opts) const;
private:
Expand Down Expand Up @@ -701,8 +701,7 @@ class NSECRecordContent : public DNSRecordContent
{
public:
static void report(void);
NSECRecordContent()
{}
NSECRecordContent() = default;
NSECRecordContent(const string& content, const DNSName& zone=DNSName());

static std::shared_ptr<DNSRecordContent> make(const DNSRecord &dr, PacketReader& pr);
Expand Down Expand Up @@ -739,8 +738,7 @@ class NSEC3RecordContent : public DNSRecordContent
{
public:
static void report(void);
NSEC3RecordContent()
{}
NSEC3RecordContent() = default;
NSEC3RecordContent(const string& content, const DNSName& zone=DNSName());

static std::shared_ptr<DNSRecordContent> make(const DNSRecord &dr, PacketReader& pr);
Expand Down Expand Up @@ -786,8 +784,7 @@ class CSYNCRecordContent : public DNSRecordContent
{
public:
static void report(void);
CSYNCRecordContent()
{}
CSYNCRecordContent() = default;
CSYNCRecordContent(const string& content, const DNSName& zone=DNSName());

static std::shared_ptr<DNSRecordContent> make(const DNSRecord &dr, PacketReader& pr);
Expand Down Expand Up @@ -815,8 +812,7 @@ class NSEC3PARAMRecordContent : public DNSRecordContent
{
public:
static void report(void);
NSEC3PARAMRecordContent()
{}
NSEC3PARAMRecordContent() = default;
NSEC3PARAMRecordContent(const string& content, const DNSName& zone=DNSName());

static std::shared_ptr<DNSRecordContent> make(const DNSRecord &dr, PacketReader& pr);
Expand All @@ -840,8 +836,7 @@ class LOCRecordContent : public DNSRecordContent
{
public:
static void report(void);
LOCRecordContent()
{}
LOCRecordContent() = default;
LOCRecordContent(const string& content, const string& zone="");

static std::shared_ptr<DNSRecordContent> make(const DNSRecord &dr, PacketReader& pr);
Expand Down Expand Up @@ -903,7 +898,7 @@ private:
class EUI48RecordContent : public DNSRecordContent
{
public:
EUI48RecordContent() {};
EUI48RecordContent() = default;
static void report(void);
static std::shared_ptr<DNSRecordContent> make(const DNSRecord &dr, PacketReader& pr);
static std::shared_ptr<DNSRecordContent> make(const string& zone); // FIXME400: DNSName& zone?
Expand All @@ -918,7 +913,7 @@ private:
class EUI64RecordContent : public DNSRecordContent
{
public:
EUI64RecordContent() {};
EUI64RecordContent() = default;
static void report(void);
static std::shared_ptr<DNSRecordContent> make(const DNSRecord &dr, PacketReader& pr);
static std::shared_ptr<DNSRecordContent> make(const string& zone); // FIXME400: DNSName& zone?
Expand All @@ -945,7 +940,7 @@ typedef struct s_APLRDataElement {
class APLRecordContent : public DNSRecordContent
{
public:
APLRecordContent() {};
APLRecordContent() = default;
includeboilerplate(APL)
private:
std::vector<APLRDataElement> aplrdata;
Expand Down
2 changes: 1 addition & 1 deletion pdns/dnssecinfra.hh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class DNSCryptoKeyEngine
{
public:
explicit DNSCryptoKeyEngine(unsigned int algorithm) : d_algorithm(algorithm) {}
virtual ~DNSCryptoKeyEngine() {};
virtual ~DNSCryptoKeyEngine() = default;
[[nodiscard]] virtual string getName() const = 0;

using stormap_t = std::map<std::string, std::string>;
Expand Down
9 changes: 1 addition & 8 deletions pdns/dnswasher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ po::variables_map g_vm;
class IPObfuscator
{
public:
virtual ~IPObfuscator()
{
}
virtual ~IPObfuscator() = default;
virtual uint32_t obf4(uint32_t orig)=0;
virtual struct in6_addr obf6(const struct in6_addr& orig)=0;
};
Expand All @@ -71,9 +69,6 @@ class IPSeqObfuscator : public IPObfuscator
{
}

~IPSeqObfuscator()
{}

static std::unique_ptr<IPObfuscator> make()
{
return std::make_unique<IPSeqObfuscator>();
Expand Down Expand Up @@ -132,8 +127,6 @@ class IPCipherObfuscator : public IPObfuscator
}
}

~IPCipherObfuscator()
{}
static std::unique_ptr<IPObfuscator> make(std::string key, bool decrypt)
{
return std::make_unique<IPCipherObfuscator>(key, decrypt);
Expand Down
2 changes: 1 addition & 1 deletion pdns/ednscookies.hh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct EDNSCookiesOpt
static const size_t EDNSCookieSecretSize = 32;
static const size_t EDNSCookieOptSize = 24;

EDNSCookiesOpt(){};
EDNSCookiesOpt() = default;
EDNSCookiesOpt(const std::string& option);
EDNSCookiesOpt(const char* option, unsigned int len);

Expand Down
Loading

0 comments on commit abb11ca

Please sign in to comment.