diff --git a/client/ovpncli.hpp b/client/ovpncli.hpp index e73e62c5..c531e384 100644 --- a/client/ovpncli.hpp +++ b/client/ovpncli.hpp @@ -452,9 +452,7 @@ struct LogInfo struct LogReceiver { virtual void log(const LogInfo &) = 0; - virtual ~LogReceiver() - { - } + virtual ~LogReceiver() = default; }; // used to pass stats for an interface diff --git a/openvpn/apple/cf/error.hpp b/openvpn/apple/cf/error.hpp index 07f62fe3..267f53af 100644 --- a/openvpn/apple/cf/error.hpp +++ b/openvpn/apple/cf/error.hpp @@ -55,9 +55,7 @@ class CFException : public std::exception return errtxt; } - virtual ~CFException() noexcept - { - } + virtual ~CFException() noexcept = default; private: void set_errtxt(const std::string &text, const OSStatus status) diff --git a/openvpn/apple/reach.hpp b/openvpn/apple/reach.hpp index 70089e99..a54665bd 100644 --- a/openvpn/apple/reach.hpp +++ b/openvpn/apple/reach.hpp @@ -38,9 +38,7 @@ struct ReachabilityInterface virtual Status reachable() const = 0; virtual bool reachableVia(const std::string &net_type) const = 0; virtual std::string to_string() const = 0; - virtual ~ReachabilityInterface() - { - } + virtual ~ReachabilityInterface() = default; }; } // namespace openvpn #endif diff --git a/openvpn/apple/reachable.hpp b/openvpn/apple/reachable.hpp index c499a50f..82a54931 100644 --- a/openvpn/apple/reachable.hpp +++ b/openvpn/apple/reachable.hpp @@ -205,9 +205,7 @@ class ReachabilityBase virtual Type vtype() const = 0; virtual Status vstatus(const SCNetworkReachabilityFlags flags) const = 0; - virtual ~ReachabilityBase() - { - } + virtual ~ReachabilityBase() = default; CF::NetworkReachability reach; }; diff --git a/openvpn/aws/awsrest.hpp b/openvpn/aws/awsrest.hpp index 04714ceb..d7e4b6df 100644 --- a/openvpn/aws/awsrest.hpp +++ b/openvpn/aws/awsrest.hpp @@ -242,9 +242,7 @@ class REST return date.substr(0, 8) + '/' + region + '/' + service + "/aws4_request"; } - virtual ~QueryBuilder() - { - } + virtual ~QueryBuilder() = default; }; }; } // namespace openvpn::AWS diff --git a/openvpn/common/action.hpp b/openvpn/common/action.hpp index 8e280774..fa81f0ca 100644 --- a/openvpn/common/action.hpp +++ b/openvpn/common/action.hpp @@ -48,9 +48,7 @@ struct Action : public RC throw Exception("Action::to_json() virtual method not implemented"); } #endif - virtual ~Action() - { - } + virtual ~Action() = default; }; class ActionList : public std::vector, public DestructorBase diff --git a/openvpn/common/destruct.hpp b/openvpn/common/destruct.hpp index f452bbe3..26759867 100644 --- a/openvpn/common/destruct.hpp +++ b/openvpn/common/destruct.hpp @@ -32,9 +32,7 @@ struct DestructorBase : public RC { typedef RCPtr Ptr; virtual void destroy(std::ostream &os) = 0; - virtual ~DestructorBase() - { - } + virtual ~DestructorBase() = default; }; } // namespace openvpn diff --git a/openvpn/common/rc.hpp b/openvpn/common/rc.hpp index fc4b01ac..1757a0bc 100644 --- a/openvpn/common/rc.hpp +++ b/openvpn/common/rc.hpp @@ -989,8 +989,8 @@ template class RCCopyable { public: - virtual ~RCCopyable(){}; - RCCopyable() noexcept {}; + virtual ~RCCopyable() = default; + RCCopyable() noexcept = default; RCCopyable(const RCCopyable &) noexcept; RCCopyable(RCCopyable &&) noexcept; RCCopyable &operator=(const RCCopyable &) noexcept; @@ -1318,13 +1318,9 @@ template class RCWeak::NotifyBase { public: - NotifyBase() noexcept - { - } + NotifyBase() noexcept = default; virtual void call() noexcept = 0; - virtual ~NotifyBase() - { - } + virtual ~NotifyBase() = default; NotifyBase *next = nullptr; private: diff --git a/openvpn/common/redir.hpp b/openvpn/common/redir.hpp index 2470b921..bcce8e92 100644 --- a/openvpn/common/redir.hpp +++ b/openvpn/common/redir.hpp @@ -49,9 +49,7 @@ struct RedirectBase OPENVPN_EXCEPTION(redirect_std_err); virtual void redirect() = 0; virtual void close() = 0; - virtual ~RedirectBase() - { - } + virtual ~RedirectBase() = default; }; struct RedirectStdFD : public RedirectBase diff --git a/openvpn/common/usergroup.hpp b/openvpn/common/usergroup.hpp index 66277787..92a3a441 100644 --- a/openvpn/common/usergroup.hpp +++ b/openvpn/common/usergroup.hpp @@ -76,9 +76,7 @@ class SetUserGroup } } - virtual ~SetUserGroup() - { - } + virtual ~SetUserGroup() = default; const std::string &user() const { diff --git a/openvpn/error/excode.hpp b/openvpn/error/excode.hpp index d21d4260..a62b751d 100644 --- a/openvpn/error/excode.hpp +++ b/openvpn/error/excode.hpp @@ -75,9 +75,7 @@ class ExceptionCode : public std::exception return code_ != 0; } - virtual ~ExceptionCode() noexcept - { - } + virtual ~ExceptionCode() noexcept = default; private: static unsigned int mkcode(const Error::Type code, const bool fatal) @@ -104,9 +102,7 @@ class ErrorCode : public ExceptionCode return err_.c_str(); } - virtual ~ErrorCode() noexcept - { - } + virtual ~ErrorCode() noexcept = default; private: std::string err_; diff --git a/openvpn/ovpnagent/mac/ovpnagent.cpp b/openvpn/ovpnagent/mac/ovpnagent.cpp index c52b3657..f79427bb 100644 --- a/openvpn/ovpnagent/mac/ovpnagent.cpp +++ b/openvpn/ovpnagent/mac/ovpnagent.cpp @@ -343,13 +343,9 @@ class MyClientInstance : public WS::Server::Listener::Client MyClientInstance(WS::Server::Listener::Client::Initializer &ci) : WS::Server::Listener::Client(ci) { - // OPENVPN_LOG("INSTANCE START"); } - virtual ~MyClientInstance() - { - // OPENVPN_LOG("INSTANCE DESTRUCT"); - } + virtual ~MyClientInstance() = default; private: void generate_reply(const Json::Value &jout) diff --git a/openvpn/ovpnagent/win/ovpnagent.cpp b/openvpn/ovpnagent/win/ovpnagent.cpp index 0a351f30..5a835265 100644 --- a/openvpn/ovpnagent/win/ovpnagent.cpp +++ b/openvpn/ovpnagent/win/ovpnagent.cpp @@ -549,13 +549,9 @@ class MyClientInstance : public WS::Server::Listener::Client MyClientInstance(WS::Server::Listener::Client::Initializer &ci) : WS::Server::Listener::Client(ci) { - // OPENVPN_LOG("INSTANCE START"); } - virtual ~MyClientInstance() - { - // OPENVPN_LOG("INSTANCE DESTRUCT"); - } + virtual ~MyClientInstance() = default; private: void generate_reply(const Json::Value &jout) diff --git a/openvpn/pki/epkibase.hpp b/openvpn/pki/epkibase.hpp index f30ca7a6..d7939497 100644 --- a/openvpn/pki/epkibase.hpp +++ b/openvpn/pki/epkibase.hpp @@ -35,9 +35,7 @@ class ExternalPKIBase // Return true on success or false on error. virtual bool sign(const std::string &alias, const std::string &data, std::string &sig, const std::string &algorithm, const std::string &hashalg, const std::string &saltlen) = 0; - virtual ~ExternalPKIBase() - { - } + virtual ~ExternalPKIBase() = default; }; class ExternalPKIImpl diff --git a/openvpn/ssl/proto.hpp b/openvpn/ssl/proto.hpp index 82b05cfa..6b331ae4 100644 --- a/openvpn/ssl/proto.hpp +++ b/openvpn/ssl/proto.hpp @@ -3949,9 +3949,7 @@ class ProtoContext : public logging::LoggingMixin { virtual void call() = 0; virtual const Time &fire_time() = 0; - virtual ~EventBase() - { - } + virtual ~EventBase() = default; }; template diff --git a/openvpn/tun/builder/base.hpp b/openvpn/tun/builder/base.hpp index 1e59a79b..1b6f976b 100644 --- a/openvpn/tun/builder/base.hpp +++ b/openvpn/tun/builder/base.hpp @@ -284,9 +284,7 @@ class TunBuilderBase { } - virtual ~TunBuilderBase() - { - } + virtual ~TunBuilderBase() = default; #ifdef ENABLE_OVPNDCO /** diff --git a/openvpn/tun/builder/setup.hpp b/openvpn/tun/builder/setup.hpp index f09f8535..fea93a82 100644 --- a/openvpn/tun/builder/setup.hpp +++ b/openvpn/tun/builder/setup.hpp @@ -36,9 +36,7 @@ struct Config virtual Json::Value to_json() = 0; virtual void from_json(const Json::Value &root, const std::string &title) = 0; #endif - virtual ~Config() - { - } + virtual ~Config() = default; }; struct Base : public DestructorBase diff --git a/openvpn/tun/extern/fw.hpp b/openvpn/tun/extern/fw.hpp index 8ca2acc3..d89e40fc 100644 --- a/openvpn/tun/extern/fw.hpp +++ b/openvpn/tun/extern/fw.hpp @@ -34,9 +34,7 @@ struct Config; // defined in config.hpp struct Factory { virtual TunClientFactory *new_tun_factory(const Config &conf, const OptionList &opt) = 0; - virtual ~Factory() - { - } + virtual ~Factory() = default; }; } // namespace ExternalTun