]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
clang-tidy: use override
authorRosen Penev <rosenp@gmail.com>
Tue, 5 Dec 2023 01:34:57 +0000 (17:34 -0800)
committerRosen Penev <rosenp@gmail.com>
Tue, 9 Jan 2024 00:09:26 +0000 (16:09 -0800)
Found with modernize-use-override

Signed-off-by: Rosen Penev <rosenp@gmail.com>
21 files changed:
modules/bindbackend/bindbackend2.hh
modules/geoipbackend/geoipbackend.hh
modules/geoipbackend/geoipinterface-dat.cc
modules/geoipbackend/geoipinterface-mmdb.cc
modules/gmysqlbackend/smysql.cc
modules/gmysqlbackend/smysql.hh
modules/godbcbackend/sodbc.cc
modules/godbcbackend/sodbc.hh
modules/gpgsqlbackend/spgsql.cc
modules/gpgsqlbackend/spgsql.hh
modules/ldapbackend/ldapauthenticator_p.hh
modules/ldapbackend/ldapbackend.hh
modules/lmdbbackend/lmdbbackend.hh
modules/lua2backend/lua2api2.hh
modules/pipebackend/coprocess.hh
modules/pipebackend/pipebackend.hh
pdns/backends/gsql/gsqlbackend.hh
pdns/epollmplexer.cc
pdns/lua-auth4.hh
pdns/pkcs11signers.hh
pdns/tcpiohandler.cc

index 2e88b8f696da629f66cca55a9b5c4e5196ba9591..118151d66986c4b4a14be437d30fe5f5420f4433 100644 (file)
@@ -180,7 +180,7 @@ class Bind2Backend : public DNSBackend
 {
 public:
   Bind2Backend(const string& suffix = "", bool loadZones = true);
-  ~Bind2Backend();
+  ~Bind2Backend() override;
   void getUnfreshSecondaryInfos(vector<DomainInfo>* unfreshDomains) override;
   void getUpdatedPrimaries(vector<DomainInfo>& changedDomains, std::unordered_set<DNSName>& catalogs, CatalogHashMap& catalogHashes) override;
   bool getDomainInfo(const DNSName& domain, DomainInfo& di, bool getSerial = true) override;
index 6185b2d9bd80bfacf9b2a9346e4d17a57a4c318e..4fe284d3a1cf7cffb6bd3117144aa70c45ecd9d6 100644 (file)
@@ -53,7 +53,7 @@ class GeoIPBackend : public DNSBackend
 {
 public:
   GeoIPBackend(const std::string& suffix = "");
-  ~GeoIPBackend();
+  ~GeoIPBackend() override;
 
   void lookup(const QType& qtype, const DNSName& qdomain, int zoneId, DNSPacket* pkt_p = nullptr) override;
   bool list(const DNSName& /* target */, int /* domain_id */, bool /* include_disabled */ = false) override { return false; } // not supported
index 83cdebc72570b6b252d4792107322ce03ab7fbc8..61c98a6bb249684fb444b954c5eca85803ad309c 100644 (file)
@@ -463,7 +463,7 @@ public:
     return false;
   }
 
-  ~GeoIPInterfaceDAT() = default;
+  ~GeoIPInterfaceDAT() override = default;
 
 private:
   unsigned int d_db_type;
index 5866ae1a641db0f87a4772f989db5da0602dc189..b3f08fb1cc985cb177f9fdefa67599cb0ce1e119 100644 (file)
@@ -246,7 +246,7 @@ public:
     return true;
   }
 
-  ~GeoIPInterfaceMMDB() { MMDB_close(&d_s); };
+  ~GeoIPInterfaceMMDB() override { MMDB_close(&d_s); };
 
 private:
   MMDB_s d_s;
index c8a3d880b5379db25a68fe2f4c254523bdd2c02a..efcbffd18e451a34fa035be683f1c5c0d38cd110 100644 (file)
@@ -88,7 +88,7 @@ public:
     }
   }
 
-  SSqlStatement* bind(const string& /* name */, bool value)
+  SSqlStatement* bind(const string& /* name */, bool value) override
   {
     prepareStatement();
     if (d_paridx >= d_parnum) {
@@ -101,15 +101,15 @@ public:
     d_paridx++;
     return this;
   }
-  SSqlStatement* bind(const string& name, int value)
+  SSqlStatement* bind(const string& name, int value) override
   {
     return bind(name, (long)value);
   }
-  SSqlStatement* bind(const string& name, uint32_t value)
+  SSqlStatement* bind(const string& name, uint32_t value) override
   {
     return bind(name, (unsigned long)value);
   }
-  SSqlStatement* bind(const string& /* name */, long value)
+  SSqlStatement* bind(const string& /* name */, long value) override
   {
     prepareStatement();
     if (d_paridx >= d_parnum) {
@@ -122,7 +122,7 @@ public:
     d_paridx++;
     return this;
   }
-  SSqlStatement* bind(const string& /* name */, unsigned long value)
+  SSqlStatement* bind(const string& /* name */, unsigned long value) override
   {
     prepareStatement();
     if (d_paridx >= d_parnum) {
@@ -136,7 +136,7 @@ public:
     d_paridx++;
     return this;
   }
-  SSqlStatement* bind(const string& /* name */, long long value)
+  SSqlStatement* bind(const string& /* name */, long long value) override
   {
     prepareStatement();
     if (d_paridx >= d_parnum) {
@@ -149,7 +149,7 @@ public:
     d_paridx++;
     return this;
   }
-  SSqlStatement* bind(const string& /* name */, unsigned long long value)
+  SSqlStatement* bind(const string& /* name */, unsigned long long value) override
   {
     prepareStatement();
     if (d_paridx >= d_parnum) {
@@ -163,7 +163,7 @@ public:
     d_paridx++;
     return this;
   }
-  SSqlStatement* bind(const string& /* name */, const std::string& value)
+  SSqlStatement* bind(const string& /* name */, const std::string& value) override
   {
     prepareStatement();
     if (d_paridx >= d_parnum) {
@@ -180,7 +180,7 @@ public:
     d_paridx++;
     return this;
   }
-  SSqlStatement* bindNull(const string& /* name */)
+  SSqlStatement* bindNull(const string& /* name */) override
   {
     prepareStatement();
     if (d_paridx >= d_parnum) {
@@ -192,7 +192,7 @@ public:
     return this;
   }
 
-  SSqlStatement* execute()
+  SSqlStatement* execute() override
   {
     prepareStatement();
 
@@ -267,7 +267,7 @@ public:
     return this;
   }
 
-  bool hasNextRow()
+  bool hasNextRow() override
   {
     if (d_dolog && d_residx == d_resnum) {
       g_log << Logger::Warning << "Query " << ((long)(void*)this) << ": " << d_dtime.udiffNoReset() << " us total to last row" << endl;
@@ -275,7 +275,7 @@ public:
     return d_residx < d_resnum;
   }
 
-  SSqlStatement* nextRow(row_t& row)
+  SSqlStatement* nextRow(row_t& row) override
   {
     int err;
     row.clear();
@@ -338,7 +338,7 @@ public:
     return this;
   }
 
-  SSqlStatement* getResult(result_t& result)
+  SSqlStatement* getResult(result_t& result) override
   {
     result.clear();
     result.reserve(d_resnum);
@@ -352,7 +352,7 @@ public:
     return this;
   }
 
-  SSqlStatement* reset()
+  SSqlStatement* reset() override
   {
     if (!d_stmt)
       return this;
@@ -383,9 +383,9 @@ public:
     return this;
   }
 
-  const std::string& getQuery() { return d_query; }
+  const std::string& getQuery() override { return d_query; }
 
-  ~SMySQLStatement()
+  ~SMySQLStatement() override
   {
     releaseStatement();
   }
index 255649ca1ab040e66a0f9a3fe539021f7e4f05cc..f39e5b942750d5b79016cbbccb9d50b940fd7871 100644 (file)
@@ -35,7 +35,7 @@ public:
          bool setIsolation = false, unsigned int timeout = 10,
          bool threadCleanup = false, bool clientSSL = false);
 
-  ~SMySQL();
+  ~SMySQL() override;
 
   SSqlException sPerrorException(const string& reason) override;
   void setLog(bool state) override;
index 79797ae5cffa199400ff4365b9a1b10ce70cd0a3..c79ac2b26504bb4531be84cc0a5f6ee4de440fe8 100644 (file)
@@ -112,31 +112,31 @@ public:
     return this;
   }
 
-  SSqlStatement* bind(const string& name, bool value)
+  SSqlStatement* bind(const string& name, bool value) override
   {
     prepareStatement();
     return bind(name, (uint32_t)value);
   }
 
-  SSqlStatement* bind(const string& name, long value)
+  SSqlStatement* bind(const string& name, long value) override
   {
     prepareStatement();
     return bind(name, (unsigned long)value);
   }
 
-  SSqlStatement* bind(const string& name, int value)
+  SSqlStatement* bind(const string& name, int value) override
   {
     prepareStatement();
     return bind(name, (uint32_t)value);
   }
 
-  SSqlStatement* bind(const string& name, long long value)
+  SSqlStatement* bind(const string& name, long long value) override
   {
     prepareStatement();
     return bind(name, (unsigned long long)value);
   }
 
-  SSqlStatement* bind(const string& name, uint32_t value)
+  SSqlStatement* bind(const string& name, uint32_t value) override
   {
     prepareStatement();
     ODBCParam p;
@@ -147,7 +147,7 @@ public:
     return bind(name, p);
   }
 
-  SSqlStatement* bind(const string& name, unsigned long value)
+  SSqlStatement* bind(const string& name, unsigned long value) override
   {
     prepareStatement();
     ODBCParam p;
@@ -158,7 +158,7 @@ public:
     return bind(name, p);
   }
 
-  SSqlStatement* bind(const string& name, unsigned long long value)
+  SSqlStatement* bind(const string& name, unsigned long long value) override
   {
     prepareStatement();
     ODBCParam p;
@@ -169,7 +169,7 @@ public:
     return bind(name, p);
   }
 
-  SSqlStatement* bind(const string& name, const std::string& value)
+  SSqlStatement* bind(const string& name, const std::string& value) override
   {
 
     // cerr<<"asked to bind string "<<value<<endl;
@@ -190,7 +190,7 @@ public:
     return bind(name, p);
   }
 
-  SSqlStatement* bindNull(const string& name)
+  SSqlStatement* bindNull(const string& name) override
   {
     if (d_req_bind.size() > (d_parnum + 1))
       throw SSqlException("Trying to bind too many parameters.");
@@ -207,7 +207,7 @@ public:
     return bind(name, p);
   }
 
-  SSqlStatement* execute()
+  SSqlStatement* execute() override
   {
     prepareStatement();
     SQLRETURN result;
@@ -238,14 +238,14 @@ public:
     return this;
   }
 
-  bool hasNextRow()
+  bool hasNextRow() override
   {
     // cerr<<"hasNextRow d_result="<<d_result<<endl;
     return d_result != SQL_NO_DATA;
   }
-  SSqlStatement* nextRow(row_t& row);
+  SSqlStatement* nextRow(row_t& row) override;
 
-  SSqlStatement* getResult(result_t& result)
+  SSqlStatement* getResult(result_t& result) override
   {
     result.clear();
     // if (d_res == NULL) return this;
@@ -257,7 +257,7 @@ public:
     return this;
   }
 
-  SSqlStatement* reset()
+  SSqlStatement* reset() override
   {
     SQLCloseCursor(d_statement); // hack, this probably violates some state transitions
 
@@ -275,9 +275,9 @@ public:
     d_paridx = 0;
     return this;
   }
-  const std::string& getQuery() { return d_query; }
+  const std::string& getQuery() override { return d_query; }
 
-  ~SODBCStatement()
+  ~SODBCStatement() override
   {
     releaseStatement();
   }
index cc01f68395154ee8d206f8d4ddd70f71ff4e6006..7fea6309af06e3676263843c0ca0fe859cb75da2 100644 (file)
@@ -55,7 +55,7 @@ public:
     const std::string& password);
 
   //! Destructor.
-  virtual ~SODBC();
+  ~SODBC() override;
 
   //! Sets the logging state.
   void setLog(bool state) override;
index f373c8adf75ef533e5684b4230d44b9a60df73da..953f66f95aa3456bbf2b502055cea646d8eca437 100644 (file)
@@ -44,14 +44,14 @@ public:
     d_nstatement = nstatement;
   }
 
-  SSqlStatement* bind(const string& name, bool value) { return bind(name, string(value ? "t" : "f")); }
-  SSqlStatement* bind(const string& name, int value) { return bind(name, std::to_string(value)); }
-  SSqlStatement* bind(const string& name, uint32_t value) { return bind(name, std::to_string(value)); }
-  SSqlStatement* bind(const string& name, long value) { return bind(name, std::to_string(value)); }
-  SSqlStatement* bind(const string& name, unsigned long value) { return bind(name, std::to_string(value)); }
-  SSqlStatement* bind(const string& name, long long value) { return bind(name, std::to_string(value)); }
-  SSqlStatement* bind(const string& name, unsigned long long value) { return bind(name, std::to_string(value)); }
-  SSqlStatement* bind(const string& /* name */, const std::string& value)
+  SSqlStatement* bind(const string& name, bool value) override { return bind(name, string(value ? "t" : "f")); }
+  SSqlStatement* bind(const string& name, int value) override { return bind(name, std::to_string(value)); }
+  SSqlStatement* bind(const string& name, uint32_t value) override { return bind(name, std::to_string(value)); }
+  SSqlStatement* bind(const string& name, long value) override { return bind(name, std::to_string(value)); }
+  SSqlStatement* bind(const string& name, unsigned long value) override { return bind(name, std::to_string(value)); }
+  SSqlStatement* bind(const string& name, long long value) override { return bind(name, std::to_string(value)); }
+  SSqlStatement* bind(const string& name, unsigned long long value) override { return bind(name, std::to_string(value)); }
+  SSqlStatement* bind(const string& /* name */, const std::string& value) override
   {
     prepareStatement();
     allocate();
@@ -66,13 +66,13 @@ public:
     d_paridx++;
     return this;
   }
-  SSqlStatement* bindNull(const string& /* name */)
+  SSqlStatement* bindNull(const string& /* name */) override
   {
     prepareStatement();
     d_paridx++;
     return this;
   } // these are set null in allocate()
-  SSqlStatement* execute()
+  SSqlStatement* execute() override
   {
     prepareStatement();
     if (d_dolog) {
@@ -140,7 +140,7 @@ public:
     }
   }
 
-  bool hasNextRow()
+  bool hasNextRow() override
   {
     if (d_dolog && d_residx == d_resnum) {
       g_log << Logger::Warning << "Query " << ((long)(void*)this) << ": " << d_dtime.udiff() << " us total to last row" << endl;
@@ -149,7 +149,7 @@ public:
     return d_residx < d_resnum;
   }
 
-  SSqlStatement* nextRow(row_t& row)
+  SSqlStatement* nextRow(row_t& row) override
   {
     int i;
     row.clear();
@@ -177,7 +177,7 @@ public:
     return this;
   }
 
-  SSqlStatement* getResult(result_t& result)
+  SSqlStatement* getResult(result_t& result) override
   {
     result.clear();
     if (d_res == nullptr)
@@ -191,7 +191,7 @@ public:
     return this;
   }
 
-  SSqlStatement* reset()
+  SSqlStatement* reset() override
   {
     int i;
     if (d_res) {
@@ -217,9 +217,9 @@ public:
     return this;
   }
 
-  const std::string& getQuery() { return d_query; }
+  const std::string& getQuery() override { return d_query; }
 
-  ~SPgSQLStatement()
+  ~SPgSQLStatement() override
   {
     releaseStatement();
   }
index a1fd64f3d20c91f5728215eb70e4f4848656b444..4533ddad1d178e3721a1613c405363b51bde62c7 100644 (file)
@@ -31,7 +31,7 @@ public:
          const string& user = "", const string& password = "",
          const string& extra_connection_parameters = "", const bool use_prepared = true);
 
-  ~SPgSQL();
+  ~SPgSQL() override;
 
   SSqlException sPerrorException(const string& reason) override;
   void setLog(bool state) override;
index e17eb1f6035f81fe2db277fb355d50a108f7258e..1e557f83f2d8650e02437ce3643039d54dcd1bd7 100644 (file)
@@ -36,8 +36,8 @@ class LdapSimpleAuthenticator : public LdapAuthenticator
 
 public:
   LdapSimpleAuthenticator(const std::string& dn, const std::string& pw, int timeout);
-  virtual bool authenticate(LDAP* conn);
-  virtual std::string getError() const;
+  bool authenticate(LDAP* conn) override;
+  std::string getError() const override;
 };
 
 class LdapGssapiAuthenticator : public LdapAuthenticator
@@ -63,7 +63,7 @@ class LdapGssapiAuthenticator : public LdapAuthenticator
 
 public:
   LdapGssapiAuthenticator(const std::string& keytab, const std::string& credsCache, int timeout);
-  ~LdapGssapiAuthenticator();
-  virtual bool authenticate(LDAP* conn);
-  virtual std::string getError() const;
+  ~LdapGssapiAuthenticator() override;
+  bool authenticate(LDAP* conn) override;
+  std::string getError() const override;
 };
index f460ebd84935e618c39d14947c86756413813e67..830cae7c7e8610fae7cacebf56b4246b148a9680 100644 (file)
@@ -167,7 +167,7 @@ class LdapBackend : public DNSBackend
 
 public:
   LdapBackend(const string& suffix = "");
-  ~LdapBackend();
+  ~LdapBackend() override;
 
   // Native backend
   bool list(const DNSName& target, int domain_id, bool include_disabled = false) override;
index b4c0c157c2190f03973de9fa0636be58a63ae6fc..6bef1078347b35829c93b9cf96c47df912d8da06 100644 (file)
@@ -137,7 +137,7 @@ public:
 
   bool getBeforeAndAfterNamesAbsolute(uint32_t id, const DNSName& qname, DNSName& unhashed, DNSName& before, DNSName& after) override;
 
-  virtual bool getBeforeAndAfterNames(uint32_t id, const DNSName& zonename, const DNSName& qname, DNSName& before, DNSName& after) override;
+  bool getBeforeAndAfterNames(uint32_t id, const DNSName& zonename, const DNSName& qname, DNSName& before, DNSName& after) override;
 
   bool updateDNSSECOrderNameAndAuth(uint32_t domain_id, const DNSName& qname, const DNSName& ordername, bool auth, const uint16_t qtype = QType::ANY) override;
 
index 73b4baf678219c5466912061be2b78554224b3d2..8f5683e3b20fc3346dcf7b79d3ec5294477a00ab 100644 (file)
@@ -71,7 +71,7 @@ public:
     loadFile(getArg("filename"));
   }
 
-  ~Lua2BackendAPIv2();
+  ~Lua2BackendAPIv2() override;
 
 #define logCall(func, var)                                                                               \
   {                                                                                                      \
@@ -87,12 +87,12 @@ public:
     }                                                                 \
   }
 
-  virtual void postPrepareContext() override
+  void postPrepareContext() override
   {
     AuthLua4::postPrepareContext();
   }
 
-  virtual void postLoad() override
+  void postLoad() override
   {
     f_lookup = d_lw->readVariable<boost::optional<lookup_call_t>>("dns_lookup").get_value_or(0);
     f_list = d_lw->readVariable<boost::optional<list_call_t>>("dns_list").get_value_or(0);
index 0a0bbbf0929cb14a1b681675153f07371a82f1f1..c9185132abf4ba4e25c6a112887829a693d6dead 100644 (file)
@@ -39,7 +39,7 @@ class CoProcess : public CoRemote
 {
 public:
   CoProcess(const string& command, int timeout = 0, int infd = 0, int outfd = 1);
-  ~CoProcess();
+  ~CoProcess() override;
   void sendReceive(const string& send, string& receive) override;
   void receive(string& rcv) override;
   void send(const string& send) override;
index 91beedb46a88876fc2c313017626f80d7eb3a5e6..776533a5a2bc686468f3d16cabcbbea02ca9c3cd 100644 (file)
@@ -49,7 +49,7 @@ class PipeBackend : public DNSBackend
 {
 public:
   PipeBackend(const string& suffix = "");
-  ~PipeBackend();
+  ~PipeBackend() override;
   void lookup(const QType&, const DNSName& qdomain, int zoneId, DNSPacket* p = nullptr) override;
   bool list(const DNSName& target, int domain_id, bool include_disabled = false) override;
   bool get(DNSResourceRecord& r) override;
index 51f1da599e4ba8ce2ebc925c007c7cbbb0ac6573..8f92d5fb8c46fa77617541a5a9c7041b7570c416 100644 (file)
@@ -36,7 +36,7 @@ class GSQLBackend : public DNSBackend
 {
 public:
   GSQLBackend(const string &mode, const string &suffix); //!< Makes our connection to the database. Throws an exception if it fails.
-  virtual ~GSQLBackend()
+  ~GSQLBackend() override
   {
     freeStatements();
     d_db.reset();
@@ -277,7 +277,7 @@ protected:
     reconnect();
   }
   virtual void reconnect() { }
-  virtual bool inTransaction() override
+  bool inTransaction() override
   {
     return d_inTransaction;
   }
index 74de2c29607b2eba7a720769b987c0d451024924..4ccb0a016c3d0f04e55d03228fb333f88f210400 100644 (file)
@@ -37,7 +37,7 @@ class EpollFDMultiplexer : public FDMultiplexer
 {
 public:
   EpollFDMultiplexer(unsigned int maxEventsHint);
-  ~EpollFDMultiplexer()
+  ~EpollFDMultiplexer() override
   {
     if (d_epollfd >= 0) {
       close(d_epollfd);
index 06ad247b60c105438367107cf07647a2df539032..fea41d640b99918dfe9d42a66c33b076ab284de7 100644 (file)
@@ -19,10 +19,11 @@ public:
 
   std::unique_ptr<DNSPacket> prequery(const DNSPacket& p);
 
-  ~AuthLua4(); // this is so unique_ptr works with an incomplete type
+  ~AuthLua4() override; // this is so unique_ptr works with an incomplete type
 protected:
-  virtual void postPrepareContext() override;
-  virtual void postLoad() override;
+  void postPrepareContext() override;
+  void postLoad() override;
+
 private:
   struct UpdatePolicyQuery {
     DNSName qname;
index a54e83f3fabe6d7fba901d81ab154cb4dfb80e17..36cef9f54d09d878fb8d86590cdb151f4632d1f7 100644 (file)
@@ -32,7 +32,7 @@ class PKCS11DNSCryptoKeyEngine : public DNSCryptoKeyEngine
 
   public:
     PKCS11DNSCryptoKeyEngine(unsigned int algorithm);
-    ~PKCS11DNSCryptoKeyEngine();
+    ~PKCS11DNSCryptoKeyEngine() override;
 
     PKCS11DNSCryptoKeyEngine(const PKCS11DNSCryptoKeyEngine& orig);
 
index 55f18554bd6be08bb2f557fafcfd3993088bce6a..841d9e3217e314f487ca8312862b59b9c80f310e 100644 (file)
@@ -813,7 +813,7 @@ public:
     }
   }
 
-  void loadTicketsKeys(const std::string& keyFile) override final
+  void loadTicketsKeys(const std::string& keyFile) final
   {
     d_feContext->d_ticketKeys.loadTicketsKeys(keyFile);
 
@@ -1011,7 +1011,7 @@ public:
     sess.size = 0;
   }
 
-  virtual ~GnuTLSSession()
+  ~GnuTLSSession() override
   {
     if (d_sess.data != nullptr && d_sess.size > 0) {
       safe_memory_release(d_sess.data, d_sess.size);
@@ -1660,7 +1660,7 @@ public:
     }
   }
 
-  virtual ~GnuTLSIOCtx() override
+  ~GnuTLSIOCtx() override
   {
     d_creds.reset();
 
@@ -1744,7 +1744,7 @@ public:
     }
   }
 
-  void loadTicketsKeys(const std::string& file) override final
+  void loadTicketsKeys(const std::string& file) final
   {
     if (!d_enableTickets) {
       return;