Skip to content

Commit

Permalink
Fix modernize-use-equals-default clang-tidy lints (#3338)
Browse files Browse the repository at this point in the history
  • Loading branch information
bernardnormier authored Jan 13, 2025
1 parent 61765e4 commit 1f01e58
Show file tree
Hide file tree
Showing 98 changed files with 150 additions and 241 deletions.
2 changes: 1 addition & 1 deletion cpp/include/DataStorm/InternalT.h
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ namespace DataStormI
class FilterFactoryT final : public FilterFactory, public AbstractFactoryT<C, FilterT<C, V>>
{
public:
FilterFactoryT() {}
FilterFactoryT() = default;

[[nodiscard]] std::shared_ptr<Filter> get(std::int64_t id) const final
{
Expand Down
14 changes: 7 additions & 7 deletions cpp/include/Ice/MetricsObserverI.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace IceInternal
class StopWatch
{
public:
StopWatch() {}
StopWatch() = default;

void start() { _start = std::chrono::steady_clock::now(); }

Expand Down Expand Up @@ -52,7 +52,7 @@ namespace IceMX
template<typename T> class MetricsHelperT
{
public:
virtual ~MetricsHelperT() {}
virtual ~MetricsHelperT() = default;

virtual std::string operator()(const std::string&) const = 0;

Expand All @@ -69,7 +69,7 @@ namespace IceMX
public:
Resolver(std::string name) : _name(std::move(name)) {}

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

virtual std::string operator()(const Helper* h) const = 0;

Expand All @@ -78,7 +78,7 @@ namespace IceMX
};

public:
AttributeResolverT() : _default(nullptr) {}
AttributeResolverT() = default;

~AttributeResolverT()
{
Expand Down Expand Up @@ -289,7 +289,7 @@ namespace IceMX
static std::string toString(bool v) { return v ? "true" : "false"; }

std::map<std::string, Resolver*> _attributes;
std::string (Helper::*_default)(const std::string&) const;
std::string (Helper::*_default)(const std::string&) const = nullptr;
};
};

Expand Down Expand Up @@ -331,7 +331,7 @@ namespace IceMX
using EntryPtrType = typename IceInternal::MetricsMapT<MetricsType>::EntryTPtr;
using EntrySeqType = std::vector<EntryPtrType>;

ObserverT() : _previousDelay(0) {}
ObserverT() = default;

void attach() override
{
Expand Down Expand Up @@ -430,7 +430,7 @@ namespace IceMX
private:
EntrySeqType _objects;
IceInternal::StopWatch _watch;
std::chrono::microseconds _previousDelay;
std::chrono::microseconds _previousDelay{0};
};

template<typename ObserverImplType> class ObserverFactoryT : public Updater
Expand Down
2 changes: 1 addition & 1 deletion cpp/include/Ice/StringConverter.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ namespace Ice
virtual void
fromUTF8(const std::byte* sourceStart, const std::byte* sourceEnd, std::basic_string<charT>& target) const = 0;

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

#if defined(__clang__)
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/Glacier2/Glacier2Router.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ namespace

};

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

bool
RouterService::start(int argc, char* argv[], int& status)
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/Glacier2/ProxyVerifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ namespace Glacier2
class AddressMatcher
{
public:
virtual ~AddressMatcher() {}
virtual ~AddressMatcher() = default;

virtual bool match(const string&, string::size_type& pos) = 0;
[[nodiscard]] virtual const char* toString() const = 0;
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/Glacier2/ProxyVerifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace Glacier2
class ProxyRule
{
public:
virtual ~ProxyRule() {}
virtual ~ProxyRule() = default;

//
// Checks to see if the proxy passes.
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/Ice/CollocatedRequestHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ CollocatedRequestHandler::CollocatedRequestHandler(const ReferencePtr& ref, cons
{
}

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

AsyncStatus
CollocatedRequestHandler::sendAsyncRequest(const ProxyOutgoingAsyncBasePtr& outAsync)
Expand Down
5 changes: 1 addition & 4 deletions cpp/src/Ice/CommunicatorFlushBatchAsync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ using namespace std;
using namespace Ice;
using namespace IceInternal;

CommunicatorFlushBatchAsync::~CommunicatorFlushBatchAsync()
{
// Out of line to avoid weak vtable
}
CommunicatorFlushBatchAsync::~CommunicatorFlushBatchAsync() = default; // Out of line to avoid weak vtable

CommunicatorFlushBatchAsync::CommunicatorFlushBatchAsync(const InstancePtr& instance) : OutgoingAsyncBase(instance)
{
Expand Down
12 changes: 6 additions & 6 deletions cpp/src/Ice/Connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ using namespace Ice;
using namespace std;

// Implement virtual destructors out of line to avoid weak vtables.
Ice::ConnectionInfo::~ConnectionInfo() {}
Ice::TCPConnectionInfo::~TCPConnectionInfo() {}
Ice::UDPConnectionInfo::~UDPConnectionInfo() {}
Ice::WSConnectionInfo::~WSConnectionInfo() {}
Ice::IAPConnectionInfo::~IAPConnectionInfo() {}
Ice::ConnectionInfo::~ConnectionInfo() = default;
Ice::TCPConnectionInfo::~TCPConnectionInfo() = default;
Ice::UDPConnectionInfo::~UDPConnectionInfo() = default;
Ice::WSConnectionInfo::~WSConnectionInfo() = default;
Ice::IAPConnectionInfo::~IAPConnectionInfo() = default;

Ice::Connection::~Connection() {}
Ice::Connection::~Connection() = default;

void
Ice::Connection::flushBatchRequests(CompressBatch compress)
Expand Down
21 changes: 3 additions & 18 deletions cpp/src/Ice/DynamicLibrary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,9 @@ using namespace std;

IceInternal::DynamicLibrary::DynamicLibrary() : _hnd(nullptr) {}

IceInternal::DynamicLibrary::~DynamicLibrary()
{
/*
* Closing the library here can cause a crash at program exit if
* the application holds references to library resources in global
* or static variables. Instead, we let the process discard the
* library.
*
if(_hnd != 0)
{
#ifdef _WIN32
FreeLibrary(_hnd);
#else
dlclose(_hnd);
#endif
}
*/
}
// Closing the library here can cause a crash at program exit if the application holds references to library resources
// in global or static variables. Instead, we let the process discard the library.
IceInternal::DynamicLibrary::~DynamicLibrary() = default;

IceInternal::DynamicLibrary::symbol_type
IceInternal::DynamicLibrary::loadEntryPoint(const string& entryPoint, bool useIceVersion)
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/Ice/EndpointFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ using namespace std;
using namespace Ice;
using namespace IceInternal;

IceInternal::EndpointFactory::EndpointFactory() {}
IceInternal::EndpointFactory::EndpointFactory() = default;

IceInternal::EndpointFactory::~EndpointFactory() {}
IceInternal::EndpointFactory::~EndpointFactory() = default;

void
IceInternal::EndpointFactory::initialize()
Expand Down
20 changes: 7 additions & 13 deletions cpp/src/Ice/EndpointI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,9 @@

using namespace std;

Ice::Endpoint::~Endpoint()
{
// out of line to avoid weak vtable
}
Ice::Endpoint::~Endpoint() = default; // Out of line to avoid weak vtable

Ice::EndpointInfo::~EndpointInfo()
{
// out of line to avoid weak vtable
}
Ice::EndpointInfo::~EndpointInfo() = default; // Out of line to avoid weak vtable

int16_t
Ice::EndpointInfo::type() const noexcept
Expand All @@ -37,15 +31,15 @@ Ice::EndpointInfo::secure() const noexcept
return underlying ? underlying->secure() : false;
}

Ice::TCPEndpointInfo::~TCPEndpointInfo() {}
Ice::TCPEndpointInfo::~TCPEndpointInfo() = default;

Ice::UDPEndpointInfo::~UDPEndpointInfo() {}
Ice::UDPEndpointInfo::~UDPEndpointInfo() = default;

Ice::WSEndpointInfo::~WSEndpointInfo() {}
Ice::WSEndpointInfo::~WSEndpointInfo() = default;

Ice::IAPEndpointInfo::~IAPEndpointInfo() {}
Ice::IAPEndpointInfo::~IAPEndpointInfo() = default;

Ice::OpaqueEndpointInfo::~OpaqueEndpointInfo() {}
Ice::OpaqueEndpointInfo::~OpaqueEndpointInfo() = default;

void
IceInternal::EndpointI::streamWrite(Ice::OutputStream* s) const
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/Ice/EventHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ IceInternal::EventHandler::EventHandler()
{
}

IceInternal::EventHandler::~EventHandler() {}
IceInternal::EventHandler::~EventHandler() = default;
2 changes: 1 addition & 1 deletion cpp/src/Ice/Initialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ Ice::registerPluginFactory(std::string name, PluginFactory factory, bool loadOnI
// CommunicatorHolder
//

Ice::CommunicatorHolder::CommunicatorHolder() {}
Ice::CommunicatorHolder::CommunicatorHolder() = default;

Ice::CommunicatorHolder::CommunicatorHolder(CommunicatorPtr communicator) : _communicator(std::move(communicator)) {}

Expand Down
2 changes: 1 addition & 1 deletion cpp/src/Ice/LocatorInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ IceInternal::LocatorManager::get(const LocatorPrx& loc)
return _tableHint->second;
}

IceInternal::LocatorTable::LocatorTable() {}
IceInternal::LocatorTable::LocatorTable() = default;

void
IceInternal::LocatorTable::clear()
Expand Down
12 changes: 3 additions & 9 deletions cpp/src/Ice/MetricsAdminI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,7 @@ MetricsMapI::RegExp::match(const string& value)
return regex_match(value, _regex);
}

MetricsMapI::~MetricsMapI()
{
// Out of line to avoid weak vtable
}
MetricsMapI::~MetricsMapI() = default; // Out of line to avoid weak vtable

MetricsMapI::MetricsMapI(const std::string& mapPrefix, const PropertiesPtr& properties)
: _properties(properties->getPropertiesForPrefix(mapPrefix)),
Expand Down Expand Up @@ -169,10 +166,7 @@ MetricsMapI::getProperties() const
return _properties;
}

MetricsMapFactory::~MetricsMapFactory()
{
// Out of line to avoid weak vtable
}
MetricsMapFactory::~MetricsMapFactory() = default; // Out of line to avoid weak vtable

MetricsMapFactory::MetricsMapFactory(Updater* updater) : _updater(updater) {}

Expand Down Expand Up @@ -343,7 +337,7 @@ MetricsAdminI::MetricsAdminI(PropertiesPtr properties, LoggerPtr logger)
updateViews();
}

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

void
MetricsAdminI::destroy()
Expand Down
10 changes: 2 additions & 8 deletions cpp/src/Ice/Network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -690,15 +690,9 @@ namespace
}
}

ReadyCallback::~ReadyCallback()
{
// Out of line to avoid weak vtable
}
ReadyCallback::~ReadyCallback() = default; // Out of line to avoid weak vtable

NativeInfo::~NativeInfo()
{
// Out of line to avoid weak vtable
}
NativeInfo::~NativeInfo() = default; // Out of line to avoid weak vtable

void
NativeInfo::setReadyCallback(const ReadyCallbackPtr& callback)
Expand Down
5 changes: 1 addition & 4 deletions cpp/src/Ice/NetworkProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@
using namespace std;
using namespace IceInternal;

NetworkProxy::~NetworkProxy()
{
// Out of line to avoid weak vtable
}
NetworkProxy::~NetworkProxy() = default; // Out of line to avoid weak vtable

namespace
{
Expand Down
7 changes: 2 additions & 5 deletions cpp/src/Ice/OutgoingAsync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@ using namespace IceInternal;
const unsigned char OutgoingAsyncBase::OK = 0x1;
const unsigned char OutgoingAsyncBase::Sent = 0x2;

OutgoingAsyncCompletionCallback::~OutgoingAsyncCompletionCallback()
{
// Out of line to avoid weak vtable
}
OutgoingAsyncCompletionCallback::~OutgoingAsyncCompletionCallback() = default; // Out of line to avoid weak vtable

bool
OutgoingAsyncBase::sent()
Expand Down Expand Up @@ -419,7 +416,7 @@ ProxyOutgoingAsyncBase::ProxyOutgoingAsyncBase(ObjectPrx proxy)
{
}

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

void
ProxyOutgoingAsyncBase::invokeImpl(bool userThread)
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/Ice/OutputUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ IceInternal::OutputBase::OutputBase(const string& s)
open(s);
}

IceInternal::OutputBase::~OutputBase() {}
IceInternal::OutputBase::~OutputBase() = default;

void
IceInternal::OutputBase::open(const string& s)
Expand Down
5 changes: 1 addition & 4 deletions cpp/src/Ice/PropertiesAdminI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ namespace
const char* traceCategory = "Admin.Properties";
}

NativePropertiesAdmin::~NativePropertiesAdmin()
{
// Out of line to avoid weak vtable
}
NativePropertiesAdmin::~NativePropertiesAdmin() = default; // Out of line to avoid weak vtable

namespace IceInternal
{
Expand Down
6 changes: 2 additions & 4 deletions cpp/src/Ice/ProtocolInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ using namespace std;
using namespace Ice;
using namespace IceInternal;

IceInternal::ProtocolInstance::~ProtocolInstance()
{
// Out of line to avoid weak vtable
}
// Out of line to avoid weak vtable
IceInternal::ProtocolInstance::~ProtocolInstance() = default;

IceInternal::ProtocolInstance::ProtocolInstance(const CommunicatorPtr& com, int16_t type, string protocol, bool secure)
: _instance(getInstance(com)),
Expand Down
5 changes: 1 addition & 4 deletions cpp/src/Ice/ProtocolPluginFacade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ using namespace std;
using namespace Ice;
using namespace IceInternal;

IceInternal::ProtocolPluginFacade::~ProtocolPluginFacade()
{
// Out of line to avoid weak vtable
}
IceInternal::ProtocolPluginFacade::~ProtocolPluginFacade() = default; // Out of line to avoid weak vtable

ProtocolPluginFacadePtr
IceInternal::getProtocolPluginFacade(const CommunicatorPtr& communicator)
Expand Down
6 changes: 0 additions & 6 deletions cpp/src/Ice/Reference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -741,12 +741,6 @@ IceInternal::FixedReference::clone() const
return make_shared<FixedReference>(*this);
}

IceInternal::FixedReference::FixedReference(const FixedReference& r)
: Reference(r),
_fixedConnection(r._fixedConnection)
{
}

IceInternal::RoutableReference::RoutableReference(
InstancePtr instance,
CommunicatorPtr communicator,
Expand Down
Loading

0 comments on commit 1f01e58

Please sign in to comment.