diff --git a/src/AbstractAuthResolver.cc b/src/AbstractAuthResolver.cc index 6a4e28b2..2e641275 100644 --- a/src/AbstractAuthResolver.cc +++ b/src/AbstractAuthResolver.cc @@ -40,7 +40,7 @@ namespace aria2 { AbstractAuthResolver::AbstractAuthResolver() {} -AbstractAuthResolver::~AbstractAuthResolver() {} +AbstractAuthResolver::~AbstractAuthResolver() = default; void AbstractAuthResolver::setUserDefinedCred(std::string user, std::string password) diff --git a/src/AbstractBtMessage.cc b/src/AbstractBtMessage.cc index 3bb90967..77bcdb20 100644 --- a/src/AbstractBtMessage.cc +++ b/src/AbstractBtMessage.cc @@ -54,7 +54,7 @@ AbstractBtMessage::AbstractBtMessage(uint8_t id, const char* name) { } -AbstractBtMessage::~AbstractBtMessage() {} +AbstractBtMessage::~AbstractBtMessage() = default; void AbstractBtMessage::setPeer(const std::shared_ptr& peer) { diff --git a/src/AbstractOptionHandler.cc b/src/AbstractOptionHandler.cc index 51fdf4ff..303a4a35 100644 --- a/src/AbstractOptionHandler.cc +++ b/src/AbstractOptionHandler.cc @@ -58,7 +58,7 @@ AbstractOptionHandler::AbstractOptionHandler(PrefPtr pref, { } -AbstractOptionHandler::~AbstractOptionHandler() {} +AbstractOptionHandler::~AbstractOptionHandler() = default; void AbstractOptionHandler::parse(Option& option, const std::string& arg) const { diff --git a/src/AbstractProxyRequestCommand.cc b/src/AbstractProxyRequestCommand.cc index 74d23142..bd2bcb37 100644 --- a/src/AbstractProxyRequestCommand.cc +++ b/src/AbstractProxyRequestCommand.cc @@ -64,7 +64,7 @@ AbstractProxyRequestCommand::AbstractProxyRequestCommand( setWriteCheckSocket(getSocket()); } -AbstractProxyRequestCommand::~AbstractProxyRequestCommand() {} +AbstractProxyRequestCommand::~AbstractProxyRequestCommand() = default; bool AbstractProxyRequestCommand::executeInternal() { diff --git a/src/AbstractProxyResponseCommand.cc b/src/AbstractProxyResponseCommand.cc index 90a11244..0f73c373 100644 --- a/src/AbstractProxyResponseCommand.cc +++ b/src/AbstractProxyResponseCommand.cc @@ -60,7 +60,7 @@ AbstractProxyResponseCommand::AbstractProxyResponseCommand( { } -AbstractProxyResponseCommand::~AbstractProxyResponseCommand() {} +AbstractProxyResponseCommand::~AbstractProxyResponseCommand() = default; bool AbstractProxyResponseCommand::executeInternal() { diff --git a/src/AbstractSingleDiskAdaptor.cc b/src/AbstractSingleDiskAdaptor.cc index 57881755..57de796a 100644 --- a/src/AbstractSingleDiskAdaptor.cc +++ b/src/AbstractSingleDiskAdaptor.cc @@ -51,7 +51,7 @@ AbstractSingleDiskAdaptor::AbstractSingleDiskAdaptor() { } -AbstractSingleDiskAdaptor::~AbstractSingleDiskAdaptor() {} +AbstractSingleDiskAdaptor::~AbstractSingleDiskAdaptor() = default; void AbstractSingleDiskAdaptor::initAndOpenFile() { diff --git a/src/AdaptiveFileAllocationIterator.cc b/src/AdaptiveFileAllocationIterator.cc index 05093b68..c24f3b5b 100644 --- a/src/AdaptiveFileAllocationIterator.cc +++ b/src/AdaptiveFileAllocationIterator.cc @@ -51,7 +51,7 @@ AdaptiveFileAllocationIterator::AdaptiveFileAllocationIterator( { } -AdaptiveFileAllocationIterator::~AdaptiveFileAllocationIterator() {} +AdaptiveFileAllocationIterator::~AdaptiveFileAllocationIterator() = default; void AdaptiveFileAllocationIterator::allocateChunk() { diff --git a/src/AdaptiveURISelector.cc b/src/AdaptiveURISelector.cc index 4a9f9b6b..3bfbf263 100644 --- a/src/AdaptiveURISelector.cc +++ b/src/AdaptiveURISelector.cc @@ -72,7 +72,7 @@ AdaptiveURISelector::AdaptiveURISelector( resetCounters(); } -AdaptiveURISelector::~AdaptiveURISelector() {} +AdaptiveURISelector::~AdaptiveURISelector() = default; std::string AdaptiveURISelector::select( FileEntry* fileEntry, diff --git a/src/AnnounceList.cc b/src/AnnounceList.cc index 234a33c8..c60dcda6 100644 --- a/src/AnnounceList.cc +++ b/src/AnnounceList.cc @@ -58,7 +58,7 @@ AnnounceList::AnnounceList( resetIterator(); } -AnnounceList::~AnnounceList() {} +AnnounceList::~AnnounceList() = default; void AnnounceList::reconfigure( const std::vector>& announceList) diff --git a/src/AnnounceTier.cc b/src/AnnounceTier.cc index 7472b36e..d220cd21 100644 --- a/src/AnnounceTier.cc +++ b/src/AnnounceTier.cc @@ -41,7 +41,7 @@ AnnounceTier::AnnounceTier(std::deque urls) { } -AnnounceTier::~AnnounceTier() {} +AnnounceTier::~AnnounceTier() = default; void AnnounceTier::nextEvent() { diff --git a/src/AnonDiskWriterFactory.h b/src/AnonDiskWriterFactory.h index 25d2dc26..aa7bd0ca 100644 --- a/src/AnonDiskWriterFactory.h +++ b/src/AnonDiskWriterFactory.h @@ -45,8 +45,8 @@ namespace aria2 { template class AnonDiskWriterFactory : public DiskWriterFactory { public: - AnonDiskWriterFactory() {} - virtual ~AnonDiskWriterFactory() {} + AnonDiskWriterFactory() = default; + virtual ~AnonDiskWriterFactory() = default; virtual std::unique_ptr newDiskWriter(const std::string& filename) CXX11_OVERRIDE diff --git a/src/ApiCallbackDownloadEventListener.cc b/src/ApiCallbackDownloadEventListener.cc index 9145dd92..5e31e29e 100644 --- a/src/ApiCallbackDownloadEventListener.cc +++ b/src/ApiCallbackDownloadEventListener.cc @@ -43,7 +43,7 @@ ApiCallbackDownloadEventListener::ApiCallbackDownloadEventListener( { } -ApiCallbackDownloadEventListener::~ApiCallbackDownloadEventListener() {} +ApiCallbackDownloadEventListener::~ApiCallbackDownloadEventListener() = default; void ApiCallbackDownloadEventListener::onEvent(DownloadEvent event, const RequestGroup* group) diff --git a/src/AppleMessageDigestImpl.cc b/src/AppleMessageDigestImpl.cc index 4204cc5f..34660cc5 100644 --- a/src/AppleMessageDigestImpl.cc +++ b/src/AppleMessageDigestImpl.cc @@ -48,7 +48,7 @@ template AuthConfigFactory::createAuthConfig(const std::shared_ptr& request, diff --git a/src/AuthResolver.h b/src/AuthResolver.h index 86438f9f..ebf822a9 100644 --- a/src/AuthResolver.h +++ b/src/AuthResolver.h @@ -46,7 +46,7 @@ class AuthConfig; class AuthResolver { public: - virtual ~AuthResolver() {} + virtual ~AuthResolver() = default; virtual std::unique_ptr resolveAuthConfig(const std::string& hostname) = 0; diff --git a/src/AutoSaveCommand.cc b/src/AutoSaveCommand.cc index b0471f0d..5e03a49a 100644 --- a/src/AutoSaveCommand.cc +++ b/src/AutoSaveCommand.cc @@ -44,7 +44,7 @@ AutoSaveCommand::AutoSaveCommand(cuid_t cuid, DownloadEngine* e, { } -AutoSaveCommand::~AutoSaveCommand() {} +AutoSaveCommand::~AutoSaveCommand() = default; void AutoSaveCommand::preProcess() { diff --git a/src/BencodeParser.cc b/src/BencodeParser.cc index 08d36b21..d8168597 100644 --- a/src/BencodeParser.cc +++ b/src/BencodeParser.cc @@ -72,7 +72,7 @@ BencodeParser::BencodeParser(StructParserStateMachine* psm) stateStack_.push(BENCODE_FINISH); } -BencodeParser::~BencodeParser() {} +BencodeParser::~BencodeParser() = default; ssize_t BencodeParser::parseUpdate(const char* data, size_t size) { diff --git a/src/BinaryStream.h b/src/BinaryStream.h index c5a23a62..8b442475 100644 --- a/src/BinaryStream.h +++ b/src/BinaryStream.h @@ -43,7 +43,7 @@ namespace aria2 { class BinaryStream { public: - virtual ~BinaryStream() {} + virtual ~BinaryStream() = default; virtual void writeData(const unsigned char* data, size_t len, int64_t offset) = 0; diff --git a/src/BtAbortOutstandingRequestEvent.cc b/src/BtAbortOutstandingRequestEvent.cc index 673c3f17..9ec2aa66 100644 --- a/src/BtAbortOutstandingRequestEvent.cc +++ b/src/BtAbortOutstandingRequestEvent.cc @@ -43,6 +43,6 @@ BtAbortOutstandingRequestEvent::BtAbortOutstandingRequestEvent( { } -BtAbortOutstandingRequestEvent::~BtAbortOutstandingRequestEvent() {} +BtAbortOutstandingRequestEvent::~BtAbortOutstandingRequestEvent() = default; } // namespace aria2 diff --git a/src/BtAnnounce.h b/src/BtAnnounce.h index 61b3c722..87878141 100644 --- a/src/BtAnnounce.h +++ b/src/BtAnnounce.h @@ -49,7 +49,7 @@ struct UDPTrackerRequest; class BtAnnounce { public: - virtual ~BtAnnounce() {} + virtual ~BtAnnounce() = default; /** * Returns true if announce is required. diff --git a/src/BtBitfieldMessage.cc b/src/BtBitfieldMessage.cc index eaeb610e..239239af 100644 --- a/src/BtBitfieldMessage.cc +++ b/src/BtBitfieldMessage.cc @@ -56,7 +56,7 @@ BtBitfieldMessage::BtBitfieldMessage(const unsigned char* bitfield, { } -BtBitfieldMessage::~BtBitfieldMessage() {} +BtBitfieldMessage::~BtBitfieldMessage() = default; void BtBitfieldMessage::setBitfield(const unsigned char* bitfield, size_t bitfieldLength) diff --git a/src/BtBitfieldMessageValidator.cc b/src/BtBitfieldMessageValidator.cc index 00bf12f8..680b0990 100644 --- a/src/BtBitfieldMessageValidator.cc +++ b/src/BtBitfieldMessageValidator.cc @@ -44,7 +44,7 @@ BtBitfieldMessageValidator::BtBitfieldMessageValidator( { } -BtBitfieldMessageValidator::~BtBitfieldMessageValidator() {} +BtBitfieldMessageValidator::~BtBitfieldMessageValidator() = default; void BtBitfieldMessageValidator::validate() { diff --git a/src/BtCheckIntegrityEntry.cc b/src/BtCheckIntegrityEntry.cc index 2bd8b7ec..f33649df 100644 --- a/src/BtCheckIntegrityEntry.cc +++ b/src/BtCheckIntegrityEntry.cc @@ -51,7 +51,7 @@ BtCheckIntegrityEntry::BtCheckIntegrityEntry(RequestGroup* requestGroup) { } -BtCheckIntegrityEntry::~BtCheckIntegrityEntry() {} +BtCheckIntegrityEntry::~BtCheckIntegrityEntry() = default; void BtCheckIntegrityEntry::onDownloadIncomplete( std::vector>& commands, DownloadEngine* e) diff --git a/src/BtDependency.cc b/src/BtDependency.cc index d29e72c2..311e6091 100644 --- a/src/BtDependency.cc +++ b/src/BtDependency.cc @@ -59,7 +59,7 @@ BtDependency::BtDependency(RequestGroup* dependant, { } -BtDependency::~BtDependency() {} +BtDependency::~BtDependency() = default; namespace { void copyValues(const std::shared_ptr& d, diff --git a/src/BtFileAllocationEntry.cc b/src/BtFileAllocationEntry.cc index dc9cc04f..3cb1daa7 100644 --- a/src/BtFileAllocationEntry.cc +++ b/src/BtFileAllocationEntry.cc @@ -55,7 +55,7 @@ BtFileAllocationEntry::BtFileAllocationEntry(RequestGroup* requestGroup) { } -BtFileAllocationEntry::~BtFileAllocationEntry() {} +BtFileAllocationEntry::~BtFileAllocationEntry() = default; void BtFileAllocationEntry::prepareForNextAction( std::vector>& commands, DownloadEngine* e) diff --git a/src/BtHandshakeMessage.cc b/src/BtHandshakeMessage.cc index ce6023e7..7f5102d8 100644 --- a/src/BtHandshakeMessage.cc +++ b/src/BtHandshakeMessage.cc @@ -55,7 +55,7 @@ BtHandshakeMessage::BtHandshakeMessage(const unsigned char* infoHash, std::copy_n(peerId, peerId_.size(), std::begin(peerId_)); } -BtHandshakeMessage::~BtHandshakeMessage() {} +BtHandshakeMessage::~BtHandshakeMessage() = default; void BtHandshakeMessage::init() { diff --git a/src/BtHandshakeMessageValidator.cc b/src/BtHandshakeMessageValidator.cc index e0e16ca4..b50b70a9 100644 --- a/src/BtHandshakeMessageValidator.cc +++ b/src/BtHandshakeMessageValidator.cc @@ -50,7 +50,7 @@ BtHandshakeMessageValidator::BtHandshakeMessageValidator( memcpy(infoHash_, infoHash, sizeof(infoHash_)); } -BtHandshakeMessageValidator::~BtHandshakeMessageValidator() {} +BtHandshakeMessageValidator::~BtHandshakeMessageValidator() = default; void BtHandshakeMessageValidator::validate() { diff --git a/src/BtInteractive.h b/src/BtInteractive.h index 33f55586..76eeb8ec 100644 --- a/src/BtInteractive.h +++ b/src/BtInteractive.h @@ -45,7 +45,7 @@ class BtHandshakeMessage; class BtInteractive { public: - virtual ~BtInteractive() {} + virtual ~BtInteractive() = default; virtual void initiateHandshake() = 0; diff --git a/src/BtInterestedMessage.cc b/src/BtInterestedMessage.cc index 0b919251..8e63781e 100644 --- a/src/BtInterestedMessage.cc +++ b/src/BtInterestedMessage.cc @@ -46,7 +46,7 @@ BtInterestedMessage::BtInterestedMessage() { } -BtInterestedMessage::~BtInterestedMessage() {} +BtInterestedMessage::~BtInterestedMessage() = default; std::unique_ptr BtInterestedMessage::create(const unsigned char* data, size_t dataLength) diff --git a/src/BtLeecherStateChoke.cc b/src/BtLeecherStateChoke.cc index 3e57df53..cd48b321 100644 --- a/src/BtLeecherStateChoke.cc +++ b/src/BtLeecherStateChoke.cc @@ -50,7 +50,7 @@ BtLeecherStateChoke::BtLeecherStateChoke() { } -BtLeecherStateChoke::~BtLeecherStateChoke() {} +BtLeecherStateChoke::~BtLeecherStateChoke() = default; BtLeecherStateChoke::PeerEntry::PeerEntry(const std::shared_ptr& peer) : peer_(peer), @@ -63,11 +63,7 @@ BtLeecherStateChoke::PeerEntry::PeerEntry(const std::shared_ptr& peer) } BtLeecherStateChoke::PeerEntry::PeerEntry(const PeerEntry& c) - : peer_(c.peer_), - downloadSpeed_(c.downloadSpeed_), - regularUnchoker_(c.regularUnchoker_) -{ -} + = default; void BtLeecherStateChoke::PeerEntry::swap(PeerEntry& c) { @@ -88,7 +84,7 @@ operator=(const PeerEntry& c) return *this; } -BtLeecherStateChoke::PeerEntry::~PeerEntry() {} +BtLeecherStateChoke::PeerEntry::~PeerEntry() = default; const std::shared_ptr& BtLeecherStateChoke::PeerEntry::getPeer() const { diff --git a/src/BtMessage.h b/src/BtMessage.h index 7b60a5a3..77e6588d 100644 --- a/src/BtMessage.h +++ b/src/BtMessage.h @@ -54,7 +54,7 @@ private: public: BtMessage(uint8_t id) : id_(id) {} - virtual ~BtMessage() {} + virtual ~BtMessage() = default; virtual bool isInvalidate() = 0; diff --git a/src/BtMessageDispatcher.h b/src/BtMessageDispatcher.h index 7f4b986a..850e42bc 100644 --- a/src/BtMessageDispatcher.h +++ b/src/BtMessageDispatcher.h @@ -49,7 +49,7 @@ class BtMessage; class BtMessageDispatcher { public: - virtual ~BtMessageDispatcher() {} + virtual ~BtMessageDispatcher() = default; virtual void addMessageToQueue(std::unique_ptr btMessage) = 0; diff --git a/src/BtMessageFactory.h b/src/BtMessageFactory.h index 42940be7..439ff550 100644 --- a/src/BtMessageFactory.h +++ b/src/BtMessageFactory.h @@ -64,7 +64,7 @@ class Piece; class BtMessageFactory { public: - virtual ~BtMessageFactory() {} + virtual ~BtMessageFactory() = default; virtual std::unique_ptr createBtMessage(const unsigned char* msg, size_t msgLength) = 0; diff --git a/src/BtMessageReceiver.h b/src/BtMessageReceiver.h index ea72dc7c..495af102 100644 --- a/src/BtMessageReceiver.h +++ b/src/BtMessageReceiver.h @@ -46,7 +46,7 @@ class BtHandshakeMessage; class BtMessageReceiver { public: - virtual ~BtMessageReceiver() {} + virtual ~BtMessageReceiver() = default; virtual std::unique_ptr receiveHandshake(bool quickReply = false) = 0; diff --git a/src/BtMessageValidator.h b/src/BtMessageValidator.h index d2896409..96c00492 100644 --- a/src/BtMessageValidator.h +++ b/src/BtMessageValidator.h @@ -43,7 +43,7 @@ namespace aria2 { class BtMessageValidator { public: - virtual ~BtMessageValidator() {} + virtual ~BtMessageValidator() = default; // Throws RecoverableException on error. virtual void validate() = 0; diff --git a/src/BtNotInterestedMessage.cc b/src/BtNotInterestedMessage.cc index 530826c5..b2c9666a 100644 --- a/src/BtNotInterestedMessage.cc +++ b/src/BtNotInterestedMessage.cc @@ -46,7 +46,7 @@ BtNotInterestedMessage::BtNotInterestedMessage() { } -BtNotInterestedMessage::~BtNotInterestedMessage() {} +BtNotInterestedMessage::~BtNotInterestedMessage() = default; std::unique_ptr BtNotInterestedMessage::create(const unsigned char* data, size_t dataLength) diff --git a/src/BtPieceMessage.cc b/src/BtPieceMessage.cc index cb0c2eb5..54c676ba 100644 --- a/src/BtPieceMessage.cc +++ b/src/BtPieceMessage.cc @@ -78,7 +78,7 @@ BtPieceMessage::BtPieceMessage(size_t index, int32_t begin, int32_t blockLength) setUploading(true); } -BtPieceMessage::~BtPieceMessage() {} +BtPieceMessage::~BtPieceMessage() = default; void BtPieceMessage::setMsgPayload(const unsigned char* data) { data_ = data; } diff --git a/src/BtPieceMessageValidator.cc b/src/BtPieceMessageValidator.cc index f8bb736d..04f7c568 100644 --- a/src/BtPieceMessageValidator.cc +++ b/src/BtPieceMessageValidator.cc @@ -45,7 +45,7 @@ BtPieceMessageValidator::BtPieceMessageValidator(const BtPieceMessage* message, { } -BtPieceMessageValidator::~BtPieceMessageValidator() {} +BtPieceMessageValidator::~BtPieceMessageValidator() = default; void BtPieceMessageValidator::validate() { diff --git a/src/BtProgressInfoFile.h b/src/BtProgressInfoFile.h index ce60b6a2..37edd9c5 100644 --- a/src/BtProgressInfoFile.h +++ b/src/BtProgressInfoFile.h @@ -43,7 +43,7 @@ namespace aria2 { class BtProgressInfoFile { public: - virtual ~BtProgressInfoFile() {} + virtual ~BtProgressInfoFile() = default; virtual std::string getFilename() = 0; diff --git a/src/BtRequestFactory.h b/src/BtRequestFactory.h index 224db62d..2299cb20 100644 --- a/src/BtRequestFactory.h +++ b/src/BtRequestFactory.h @@ -47,7 +47,7 @@ class BtRequestMessage; class BtRequestFactory { public: - virtual ~BtRequestFactory() {} + virtual ~BtRequestFactory() = default; virtual void addTargetPiece(const std::shared_ptr& piece) = 0; diff --git a/src/BtRuntime.cc b/src/BtRuntime.cc index 1031151a..769e07dc 100644 --- a/src/BtRuntime.cc +++ b/src/BtRuntime.cc @@ -47,7 +47,7 @@ BtRuntime::BtRuntime() { } -BtRuntime::~BtRuntime() {} +BtRuntime::~BtRuntime() = default; void BtRuntime::setMaxPeers(int maxPeers) { diff --git a/src/BtSeederStateChoke.cc b/src/BtSeederStateChoke.cc index 4b44eac0..6e1b719d 100644 --- a/src/BtSeederStateChoke.cc +++ b/src/BtSeederStateChoke.cc @@ -49,7 +49,7 @@ BtSeederStateChoke::BtSeederStateChoke() : round_(0), lastRound_(Timer::zero()) { } -BtSeederStateChoke::~BtSeederStateChoke() {} +BtSeederStateChoke::~BtSeederStateChoke() = default; namespace { constexpr auto TIME_FRAME = 20_s; @@ -66,15 +66,9 @@ BtSeederStateChoke::PeerEntry::PeerEntry(const std::shared_ptr& peer) } BtSeederStateChoke::PeerEntry::PeerEntry(const PeerEntry& c) - : peer_(c.peer_), - outstandingUpload_(c.outstandingUpload_), - lastAmUnchoking_(c.lastAmUnchoking_), - recentUnchoking_(c.recentUnchoking_), - uploadSpeed_(c.uploadSpeed_) -{ -} + = default; -BtSeederStateChoke::PeerEntry::~PeerEntry() {} +BtSeederStateChoke::PeerEntry::~PeerEntry() = default; void BtSeederStateChoke::PeerEntry::swap(PeerEntry& c) { diff --git a/src/BtSetup.cc b/src/BtSetup.cc index 63f20569..6732e657 100644 --- a/src/BtSetup.cc +++ b/src/BtSetup.cc @@ -88,7 +88,7 @@ namespace aria2 { -BtSetup::BtSetup() {} +BtSetup::BtSetup() = default; void BtSetup::setup(std::vector>& commands, RequestGroup* requestGroup, DownloadEngine* e, diff --git a/src/ByteArrayDiskWriter.cc b/src/ByteArrayDiskWriter.cc index 0ad91ac6..1636dc94 100644 --- a/src/ByteArrayDiskWriter.cc +++ b/src/ByteArrayDiskWriter.cc @@ -44,7 +44,7 @@ ByteArrayDiskWriter::ByteArrayDiskWriter(size_t maxLength) { } -ByteArrayDiskWriter::~ByteArrayDiskWriter() {} +ByteArrayDiskWriter::~ByteArrayDiskWriter() = default; void ByteArrayDiskWriter::clear() { buf_.str(A2STR::NIL); } diff --git a/src/CUIDCounter.cc b/src/CUIDCounter.cc index 5fbba205..2900cea8 100644 --- a/src/CUIDCounter.cc +++ b/src/CUIDCounter.cc @@ -38,7 +38,7 @@ namespace aria2 { CUIDCounter::CUIDCounter() : count_(0) {} -CUIDCounter::~CUIDCounter() {} +CUIDCounter::~CUIDCounter() = default; cuid_t CUIDCounter::newID() { diff --git a/src/CheckIntegrityEntry.cc b/src/CheckIntegrityEntry.cc index 9a634050..9989b10f 100644 --- a/src/CheckIntegrityEntry.cc +++ b/src/CheckIntegrityEntry.cc @@ -50,7 +50,7 @@ CheckIntegrityEntry::CheckIntegrityEntry(RequestGroup* requestGroup, { } -CheckIntegrityEntry::~CheckIntegrityEntry() {} +CheckIntegrityEntry::~CheckIntegrityEntry() = default; void CheckIntegrityEntry::validateChunk() { validator_->validateChunk(); } diff --git a/src/Checksum.cc b/src/Checksum.cc index 035146df..2383261b 100644 --- a/src/Checksum.cc +++ b/src/Checksum.cc @@ -44,7 +44,7 @@ Checksum::Checksum(std::string hashType, std::string digest) Checksum::Checksum() : hashType_("sha-1") {} -Checksum::~Checksum() {} +Checksum::~Checksum() = default; bool Checksum::isEmpty() const { return digest_.empty(); } diff --git a/src/ChecksumCheckIntegrityEntry.cc b/src/ChecksumCheckIntegrityEntry.cc index 9e138155..dc225b8b 100644 --- a/src/ChecksumCheckIntegrityEntry.cc +++ b/src/ChecksumCheckIntegrityEntry.cc @@ -51,7 +51,7 @@ ChecksumCheckIntegrityEntry::ChecksumCheckIntegrityEntry( { } -ChecksumCheckIntegrityEntry::~ChecksumCheckIntegrityEntry() {} +ChecksumCheckIntegrityEntry::~ChecksumCheckIntegrityEntry() = default; bool ChecksumCheckIntegrityEntry::isValidationReady() { diff --git a/src/ChunkedDecodingStreamFilter.cc b/src/ChunkedDecodingStreamFilter.cc index 9101ceab..4e3a0e59 100644 --- a/src/ChunkedDecodingStreamFilter.cc +++ b/src/ChunkedDecodingStreamFilter.cc @@ -74,7 +74,7 @@ ChunkedDecodingStreamFilter::ChunkedDecodingStreamFilter( { } -ChunkedDecodingStreamFilter::~ChunkedDecodingStreamFilter() {} +ChunkedDecodingStreamFilter::~ChunkedDecodingStreamFilter() = default; void ChunkedDecodingStreamFilter::init() {} diff --git a/src/Command.h b/src/Command.h index a50cb811..fb420dda 100644 --- a/src/Command.h +++ b/src/Command.h @@ -73,7 +73,7 @@ protected: public: Command(cuid_t cuid); - virtual ~Command() {} + virtual ~Command() = default; virtual bool execute() = 0; diff --git a/src/ConsoleStatCalc.h b/src/ConsoleStatCalc.h index f25e6c60..3940ef0e 100644 --- a/src/ConsoleStatCalc.h +++ b/src/ConsoleStatCalc.h @@ -50,7 +50,7 @@ protected: virtual std::string format(int64_t size) const = 0; public: - virtual ~SizeFormatter() {} + virtual ~SizeFormatter() = default; std::string operator()(int64_t size) const; }; @@ -73,7 +73,7 @@ public: ConsoleStatCalc(std::chrono::seconds summaryInterval, bool colorOutput = true, bool humanReadable = true); - virtual ~ConsoleStatCalc() {} + virtual ~ConsoleStatCalc() = default; virtual void calculateStat(const DownloadEngine* e) CXX11_OVERRIDE; diff --git a/src/ContentTypeRequestGroupCriteria.cc b/src/ContentTypeRequestGroupCriteria.cc index 40e311e2..03aa833e 100644 --- a/src/ContentTypeRequestGroupCriteria.cc +++ b/src/ContentTypeRequestGroupCriteria.cc @@ -47,7 +47,7 @@ ContentTypeRequestGroupCriteria::ContentTypeRequestGroupCriteria( { } -ContentTypeRequestGroupCriteria::~ContentTypeRequestGroupCriteria() {} +ContentTypeRequestGroupCriteria::~ContentTypeRequestGroupCriteria() = default; bool ContentTypeRequestGroupCriteria::match( const RequestGroup* requestGroup) const diff --git a/src/Context.cc b/src/Context.cc index d8f7e703..6d74455e 100644 --- a/src/Context.cc +++ b/src/Context.cc @@ -314,6 +314,6 @@ Context::Context(bool standalone, int argc, char** argv, const KeyVals& options) } } -Context::~Context() {} +Context::~Context() = default; } // namespace aria2 diff --git a/src/ContextAttribute.h b/src/ContextAttribute.h index 10b9f129..37caddf7 100644 --- a/src/ContextAttribute.h +++ b/src/ContextAttribute.h @@ -40,7 +40,7 @@ namespace aria2 { struct ContextAttribute { - virtual ~ContextAttribute() {} + virtual ~ContextAttribute() = default; }; enum ContextAttributeType { diff --git a/src/DHTAnnouncePeerReplyMessage.cc b/src/DHTAnnouncePeerReplyMessage.cc index 78c0bb6f..130ae5a2 100644 --- a/src/DHTAnnouncePeerReplyMessage.cc +++ b/src/DHTAnnouncePeerReplyMessage.cc @@ -48,7 +48,7 @@ DHTAnnouncePeerReplyMessage::DHTAnnouncePeerReplyMessage( { } -DHTAnnouncePeerReplyMessage::~DHTAnnouncePeerReplyMessage() {} +DHTAnnouncePeerReplyMessage::~DHTAnnouncePeerReplyMessage() = default; void DHTAnnouncePeerReplyMessage::doReceivedAction() {} diff --git a/src/DHTAutoSaveCommand.cc b/src/DHTAutoSaveCommand.cc index 8aa18910..8b8d5bf9 100644 --- a/src/DHTAutoSaveCommand.cc +++ b/src/DHTAutoSaveCommand.cc @@ -65,7 +65,7 @@ DHTAutoSaveCommand::DHTAutoSaveCommand(cuid_t cuid, DownloadEngine* e, { } -DHTAutoSaveCommand::~DHTAutoSaveCommand() {} +DHTAutoSaveCommand::~DHTAutoSaveCommand() = default; void DHTAutoSaveCommand::preProcess() { diff --git a/src/DHTBucket.cc b/src/DHTBucket.cc index 9650dcf3..52494970 100644 --- a/src/DHTBucket.cc +++ b/src/DHTBucket.cc @@ -69,7 +69,7 @@ DHTBucket::DHTBucket(const std::shared_ptr& localNode) memset(min_, 0, DHT_ID_LENGTH); } -DHTBucket::~DHTBucket() {} +DHTBucket::~DHTBucket() = default; void DHTBucket::getRandomNodeID(unsigned char* nodeID) const { diff --git a/src/DHTBucketRefreshCommand.cc b/src/DHTBucketRefreshCommand.cc index 42230469..00ed9c16 100644 --- a/src/DHTBucketRefreshCommand.cc +++ b/src/DHTBucketRefreshCommand.cc @@ -51,7 +51,7 @@ DHTBucketRefreshCommand::DHTBucketRefreshCommand(cuid_t cuid, DownloadEngine* e, { } -DHTBucketRefreshCommand::~DHTBucketRefreshCommand() {} +DHTBucketRefreshCommand::~DHTBucketRefreshCommand() = default; void DHTBucketRefreshCommand::preProcess() { diff --git a/src/DHTBucketRefreshTask.cc b/src/DHTBucketRefreshTask.cc index a977cb1e..ee1b165b 100644 --- a/src/DHTBucketRefreshTask.cc +++ b/src/DHTBucketRefreshTask.cc @@ -49,7 +49,7 @@ namespace aria2 { DHTBucketRefreshTask::DHTBucketRefreshTask() : forceRefresh_(false) {} -DHTBucketRefreshTask::~DHTBucketRefreshTask() {} +DHTBucketRefreshTask::~DHTBucketRefreshTask() = default; void DHTBucketRefreshTask::startup() { diff --git a/src/DHTBucketTree.cc b/src/DHTBucketTree.cc index cadfe6ef..02b45b56 100644 --- a/src/DHTBucketTree.cc +++ b/src/DHTBucketTree.cc @@ -57,7 +57,7 @@ DHTBucketTreeNode::DHTBucketTreeNode(std::shared_ptr bucket) memcpy(maxId_, bucket_->getMaxID(), DHT_ID_LENGTH); } -DHTBucketTreeNode::~DHTBucketTreeNode() {} +DHTBucketTreeNode::~DHTBucketTreeNode() = default; void DHTBucketTreeNode::resetRelation() { diff --git a/src/DHTConnection.h b/src/DHTConnection.h index cd718a74..44d4234c 100644 --- a/src/DHTConnection.h +++ b/src/DHTConnection.h @@ -43,7 +43,7 @@ namespace aria2 { class DHTConnection { public: - virtual ~DHTConnection() {} + virtual ~DHTConnection() = default; virtual ssize_t receiveMessage(unsigned char* data, size_t len, std::string& host, uint16_t& port) = 0; diff --git a/src/DHTConnectionImpl.cc b/src/DHTConnectionImpl.cc index 5bae0ccf..2ca7ec42 100644 --- a/src/DHTConnectionImpl.cc +++ b/src/DHTConnectionImpl.cc @@ -52,7 +52,7 @@ DHTConnectionImpl::DHTConnectionImpl(int family) { } -DHTConnectionImpl::~DHTConnectionImpl() {} +DHTConnectionImpl::~DHTConnectionImpl() = default; bool DHTConnectionImpl::bind(uint16_t& port, const std::string& addr, SegList& sgl) diff --git a/src/DHTMessage.cc b/src/DHTMessage.cc index 220274ed..bed841fe 100644 --- a/src/DHTMessage.cc +++ b/src/DHTMessage.cc @@ -58,7 +58,7 @@ DHTMessage::DHTMessage(const std::shared_ptr& localNode, } } -DHTMessage::~DHTMessage() {} +DHTMessage::~DHTMessage() = default; void DHTMessage::generateTransactionID() { diff --git a/src/DHTMessageCallback.h b/src/DHTMessageCallback.h index da7620fe..202bb814 100644 --- a/src/DHTMessageCallback.h +++ b/src/DHTMessageCallback.h @@ -51,7 +51,7 @@ class DHTPingReplyMessage; class DHTMessageCallback { public: - virtual ~DHTMessageCallback() {} + virtual ~DHTMessageCallback() = default; void onReceived(DHTResponseMessage* message) { message->accept(this); } diff --git a/src/DHTMessageDispatcher.h b/src/DHTMessageDispatcher.h index cab1b45f..9acd6fb8 100644 --- a/src/DHTMessageDispatcher.h +++ b/src/DHTMessageDispatcher.h @@ -48,7 +48,7 @@ class DHTMessage; class DHTMessageDispatcher { public: - virtual ~DHTMessageDispatcher() {} + virtual ~DHTMessageDispatcher() = default; virtual void addMessageToQueue(std::unique_ptr message, diff --git a/src/DHTMessageFactory.h b/src/DHTMessageFactory.h index 490db620..2c4b3065 100644 --- a/src/DHTMessageFactory.h +++ b/src/DHTMessageFactory.h @@ -63,7 +63,7 @@ class Peer; class DHTMessageFactory { public: - virtual ~DHTMessageFactory() {} + virtual ~DHTMessageFactory() = default; virtual std::unique_ptr createQueryMessage(const Dict* dict, const std::string& ipaddr, diff --git a/src/DHTNode.cc b/src/DHTNode.cc index 2509700d..85a5c426 100644 --- a/src/DHTNode.cc +++ b/src/DHTNode.cc @@ -55,7 +55,7 @@ DHTNode::DHTNode(const unsigned char* id) memcpy(id_, id, DHT_ID_LENGTH); } -DHTNode::~DHTNode() {} +DHTNode::~DHTNode() = default; void DHTNode::generateID() { util::generateRandomKey(id_); } diff --git a/src/DHTPeerAnnounceCommand.cc b/src/DHTPeerAnnounceCommand.cc index b4ce33eb..e6aee7d6 100644 --- a/src/DHTPeerAnnounceCommand.cc +++ b/src/DHTPeerAnnounceCommand.cc @@ -50,7 +50,7 @@ DHTPeerAnnounceCommand::DHTPeerAnnounceCommand(cuid_t cuid, DownloadEngine* e, { } -DHTPeerAnnounceCommand::~DHTPeerAnnounceCommand() {} +DHTPeerAnnounceCommand::~DHTPeerAnnounceCommand() = default; void DHTPeerAnnounceCommand::preProcess() { diff --git a/src/DHTPeerAnnounceEntry.cc b/src/DHTPeerAnnounceEntry.cc index 976410ff..dd14d3b4 100644 --- a/src/DHTPeerAnnounceEntry.cc +++ b/src/DHTPeerAnnounceEntry.cc @@ -47,7 +47,7 @@ DHTPeerAnnounceEntry::DHTPeerAnnounceEntry(const unsigned char* infoHash) memcpy(infoHash_, infoHash, DHT_ID_LENGTH); } -DHTPeerAnnounceEntry::~DHTPeerAnnounceEntry() {} +DHTPeerAnnounceEntry::~DHTPeerAnnounceEntry() = default; void DHTPeerAnnounceEntry::addPeerAddrEntry(const PeerAddrEntry& entry) { diff --git a/src/DHTPingTask.cc b/src/DHTPingTask.cc index 6daf096e..d7a03f61 100644 --- a/src/DHTPingTask.cc +++ b/src/DHTPingTask.cc @@ -54,7 +54,7 @@ DHTPingTask::DHTPingTask(const std::shared_ptr& remoteNode, { } -DHTPingTask::~DHTPingTask() {} +DHTPingTask::~DHTPingTask() = default; void DHTPingTask::addMessage() { diff --git a/src/DHTQueryMessage.cc b/src/DHTQueryMessage.cc index 1d984be9..9908a7fe 100644 --- a/src/DHTQueryMessage.cc +++ b/src/DHTQueryMessage.cc @@ -50,7 +50,7 @@ DHTQueryMessage::DHTQueryMessage(const std::shared_ptr& localNode, { } -DHTQueryMessage::~DHTQueryMessage() {} +DHTQueryMessage::~DHTQueryMessage() = default; const std::string& DHTQueryMessage::getType() const { return Q; } diff --git a/src/DHTReplaceNodeTask.cc b/src/DHTReplaceNodeTask.cc index 6638ae80..86342b3b 100644 --- a/src/DHTReplaceNodeTask.cc +++ b/src/DHTReplaceNodeTask.cc @@ -56,7 +56,7 @@ DHTReplaceNodeTask::DHTReplaceNodeTask(const std::shared_ptr& bucket, { } -DHTReplaceNodeTask::~DHTReplaceNodeTask() {} +DHTReplaceNodeTask::~DHTReplaceNodeTask() = default; void DHTReplaceNodeTask::startup() { sendMessage(); } diff --git a/src/DHTResponseMessage.cc b/src/DHTResponseMessage.cc index 78652ea9..c6313ea1 100644 --- a/src/DHTResponseMessage.cc +++ b/src/DHTResponseMessage.cc @@ -49,7 +49,7 @@ DHTResponseMessage::DHTResponseMessage( { } -DHTResponseMessage::~DHTResponseMessage() {} +DHTResponseMessage::~DHTResponseMessage() = default; const std::string& DHTResponseMessage::getType() const { return R; } diff --git a/src/DHTRoutingTable.cc b/src/DHTRoutingTable.cc index 72bd9fca..5f1e6af8 100644 --- a/src/DHTRoutingTable.cc +++ b/src/DHTRoutingTable.cc @@ -59,7 +59,7 @@ DHTRoutingTable::DHTRoutingTable(const std::shared_ptr& localNode) { } -DHTRoutingTable::~DHTRoutingTable() {} +DHTRoutingTable::~DHTRoutingTable() = default; bool DHTRoutingTable::addNode(const std::shared_ptr& node) { diff --git a/src/DHTRoutingTableDeserializer.cc b/src/DHTRoutingTableDeserializer.cc index bc01e545..87b757a6 100644 --- a/src/DHTRoutingTableDeserializer.cc +++ b/src/DHTRoutingTableDeserializer.cc @@ -58,7 +58,7 @@ DHTRoutingTableDeserializer::DHTRoutingTableDeserializer(int family) { } -DHTRoutingTableDeserializer::~DHTRoutingTableDeserializer() {} +DHTRoutingTableDeserializer::~DHTRoutingTableDeserializer() = default; #define READ_CHECK(fp, ptr, count) \ if (fp.read((ptr), (count)) != (count)) { \ diff --git a/src/DHTRoutingTableSerializer.cc b/src/DHTRoutingTableSerializer.cc index 29c59c5e..d26f64c4 100644 --- a/src/DHTRoutingTableSerializer.cc +++ b/src/DHTRoutingTableSerializer.cc @@ -57,7 +57,7 @@ DHTRoutingTableSerializer::DHTRoutingTableSerializer(int family) { } -DHTRoutingTableSerializer::~DHTRoutingTableSerializer() {} +DHTRoutingTableSerializer::~DHTRoutingTableSerializer() = default; void DHTRoutingTableSerializer::setLocalNode( const std::shared_ptr& localNode) diff --git a/src/DHTSetup.cc b/src/DHTSetup.cc index 7ac7fc91..0cc99aee 100644 --- a/src/DHTSetup.cc +++ b/src/DHTSetup.cc @@ -76,9 +76,9 @@ namespace aria2 { -DHTSetup::DHTSetup() {} +DHTSetup::DHTSetup() = default; -DHTSetup::~DHTSetup() {} +DHTSetup::~DHTSetup() = default; std::pair>, std::vector>> diff --git a/src/DHTTask.h b/src/DHTTask.h index e45269a8..15e22ee8 100644 --- a/src/DHTTask.h +++ b/src/DHTTask.h @@ -41,7 +41,7 @@ namespace aria2 { class DHTTask { public: - virtual ~DHTTask() {} + virtual ~DHTTask() = default; virtual void startup() = 0; diff --git a/src/DHTTaskExecutor.cc b/src/DHTTaskExecutor.cc index ed398a5b..edb51db7 100644 --- a/src/DHTTaskExecutor.cc +++ b/src/DHTTaskExecutor.cc @@ -49,7 +49,7 @@ DHTTaskExecutor::DHTTaskExecutor(int numConcurrent) { } -DHTTaskExecutor::~DHTTaskExecutor() {} +DHTTaskExecutor::~DHTTaskExecutor() = default; void DHTTaskExecutor::update() { diff --git a/src/DHTTaskFactory.h b/src/DHTTaskFactory.h index 7d329d92..5914a0f6 100644 --- a/src/DHTTaskFactory.h +++ b/src/DHTTaskFactory.h @@ -49,7 +49,7 @@ class DHTBucket; class DHTTaskFactory { public: - virtual ~DHTTaskFactory() {} + virtual ~DHTTaskFactory() = default; virtual std::shared_ptr createPingTask(const std::shared_ptr& remoteNode, diff --git a/src/DHTTaskFactoryImpl.cc b/src/DHTTaskFactoryImpl.cc index 23ad5d77..ce4d46d6 100644 --- a/src/DHTTaskFactoryImpl.cc +++ b/src/DHTTaskFactoryImpl.cc @@ -59,7 +59,7 @@ DHTTaskFactoryImpl::DHTTaskFactoryImpl() { } -DHTTaskFactoryImpl::~DHTTaskFactoryImpl() {} +DHTTaskFactoryImpl::~DHTTaskFactoryImpl() = default; std::shared_ptr DHTTaskFactoryImpl::createPingTask(const std::shared_ptr& remoteNode, diff --git a/src/DHTTaskQueue.h b/src/DHTTaskQueue.h index dad5e99f..992ba6ce 100644 --- a/src/DHTTaskQueue.h +++ b/src/DHTTaskQueue.h @@ -45,7 +45,7 @@ class DHTTask; class DHTTaskQueue { public: - virtual ~DHTTaskQueue() {} + virtual ~DHTTaskQueue() = default; virtual void executeTask() = 0; diff --git a/src/DHTTaskQueueImpl.cc b/src/DHTTaskQueueImpl.cc index a5f96c29..3a2e30cd 100644 --- a/src/DHTTaskQueueImpl.cc +++ b/src/DHTTaskQueueImpl.cc @@ -50,7 +50,7 @@ DHTTaskQueueImpl::DHTTaskQueueImpl() { } -DHTTaskQueueImpl::~DHTTaskQueueImpl() {} +DHTTaskQueueImpl::~DHTTaskQueueImpl() = default; void DHTTaskQueueImpl::executeTask() { diff --git a/src/DHTTokenTracker.cc b/src/DHTTokenTracker.cc index 33a9f836..05afcef5 100644 --- a/src/DHTTokenTracker.cc +++ b/src/DHTTokenTracker.cc @@ -58,7 +58,7 @@ DHTTokenTracker::DHTTokenTracker(const unsigned char* initialSecret) memcpy(secret_[1], initialSecret, SECRET_SIZE); } -DHTTokenTracker::~DHTTokenTracker() {} +DHTTokenTracker::~DHTTokenTracker() = default; std::string DHTTokenTracker::generateToken(const unsigned char* infoHash, const std::string& ipaddr, diff --git a/src/DHTTokenUpdateCommand.cc b/src/DHTTokenUpdateCommand.cc index 27db7982..65b0ee22 100644 --- a/src/DHTTokenUpdateCommand.cc +++ b/src/DHTTokenUpdateCommand.cc @@ -49,7 +49,7 @@ DHTTokenUpdateCommand::DHTTokenUpdateCommand(cuid_t cuid, DownloadEngine* e, { } -DHTTokenUpdateCommand::~DHTTokenUpdateCommand() {} +DHTTokenUpdateCommand::~DHTTokenUpdateCommand() = default; void DHTTokenUpdateCommand::preProcess() { diff --git a/src/DNSCache.cc b/src/DNSCache.cc index 7cf4aeb1..4ca4a609 100644 --- a/src/DNSCache.cc +++ b/src/DNSCache.cc @@ -43,11 +43,9 @@ DNSCache::AddrEntry::AddrEntry(const std::string& addr) } DNSCache::AddrEntry::AddrEntry(const AddrEntry& c) - : addr_(c.addr_), good_(c.good_) -{ -} + = default; -DNSCache::AddrEntry::~AddrEntry() {} +DNSCache::AddrEntry::~AddrEntry() = default; DNSCache::AddrEntry& DNSCache::AddrEntry::operator=(const AddrEntry& c) { @@ -64,11 +62,9 @@ DNSCache::CacheEntry::CacheEntry(const std::string& hostname, uint16_t port) } DNSCache::CacheEntry::CacheEntry(const CacheEntry& c) - : hostname_(c.hostname_), port_(c.port_), addrEntries_(c.addrEntries_) -{ -} + = default; -DNSCache::CacheEntry::~CacheEntry() {} +DNSCache::CacheEntry::~CacheEntry() = default; DNSCache::CacheEntry& DNSCache::CacheEntry::operator=(const CacheEntry& c) { @@ -154,9 +150,9 @@ bool DNSCache::CacheEntry::operator==(const CacheEntry& e) const DNSCache::DNSCache() {} -DNSCache::DNSCache(const DNSCache& c) : entries_(c.entries_) {} +DNSCache::DNSCache(const DNSCache& c) = default; -DNSCache::~DNSCache() {} +DNSCache::~DNSCache() = default; DNSCache& DNSCache::operator=(const DNSCache& c) { diff --git a/src/DefaultBtAnnounce.cc b/src/DefaultBtAnnounce.cc index 44e4d545..c60bc56a 100644 --- a/src/DefaultBtAnnounce.cc +++ b/src/DefaultBtAnnounce.cc @@ -74,7 +74,7 @@ DefaultBtAnnounce::DefaultBtAnnounce(DownloadContext* downloadContext, { } -DefaultBtAnnounce::~DefaultBtAnnounce() {} +DefaultBtAnnounce::~DefaultBtAnnounce() = default; bool DefaultBtAnnounce::isDefaultAnnounceReady() { diff --git a/src/DefaultBtInteractive.cc b/src/DefaultBtInteractive.cc index 6c125e12..72343565 100644 --- a/src/DefaultBtInteractive.cc +++ b/src/DefaultBtInteractive.cc @@ -109,7 +109,7 @@ DefaultBtInteractive::DefaultBtInteractive( { } -DefaultBtInteractive::~DefaultBtInteractive() {} +DefaultBtInteractive::~DefaultBtInteractive() = default; void DefaultBtInteractive::initiateHandshake() { diff --git a/src/DefaultBtProgressInfoFile.cc b/src/DefaultBtProgressInfoFile.cc index 2787b664..d76285c5 100644 --- a/src/DefaultBtProgressInfoFile.cc +++ b/src/DefaultBtProgressInfoFile.cc @@ -84,7 +84,7 @@ DefaultBtProgressInfoFile::DefaultBtProgressInfoFile( { } -DefaultBtProgressInfoFile::~DefaultBtProgressInfoFile() {} +DefaultBtProgressInfoFile::~DefaultBtProgressInfoFile() = default; void DefaultBtProgressInfoFile::updateFilename() { diff --git a/src/DefaultBtRequestFactory.cc b/src/DefaultBtRequestFactory.cc index 29b12b99..988bfdf3 100644 --- a/src/DefaultBtRequestFactory.cc +++ b/src/DefaultBtRequestFactory.cc @@ -60,7 +60,7 @@ DefaultBtRequestFactory::DefaultBtRequestFactory() { } -DefaultBtRequestFactory::~DefaultBtRequestFactory() {} +DefaultBtRequestFactory::~DefaultBtRequestFactory() = default; void DefaultBtRequestFactory::addTargetPiece( const std::shared_ptr& piece) diff --git a/src/DefaultDiskWriter.cc b/src/DefaultDiskWriter.cc index 2940be02..0c92e668 100644 --- a/src/DefaultDiskWriter.cc +++ b/src/DefaultDiskWriter.cc @@ -41,7 +41,7 @@ DefaultDiskWriter::DefaultDiskWriter(const std::string& filename) { } -DefaultDiskWriter::~DefaultDiskWriter() {} +DefaultDiskWriter::~DefaultDiskWriter() = default; void DefaultDiskWriter::initAndOpenFile(int64_t totalLength) { createFile(); } diff --git a/src/DefaultPieceStorage.cc b/src/DefaultPieceStorage.cc index 91b9aef5..7e94ebc6 100644 --- a/src/DefaultPieceStorage.cc +++ b/src/DefaultPieceStorage.cc @@ -114,7 +114,7 @@ DefaultPieceStorage::DefaultPieceStorage( } } -DefaultPieceStorage::~DefaultPieceStorage() {} +DefaultPieceStorage::~DefaultPieceStorage() = default; std::shared_ptr DefaultPieceStorage::checkOutPiece(size_t index, cuid_t cuid) diff --git a/src/DefaultStreamPieceSelector.cc b/src/DefaultStreamPieceSelector.cc index bc7f7bc6..100cd070 100644 --- a/src/DefaultStreamPieceSelector.cc +++ b/src/DefaultStreamPieceSelector.cc @@ -42,7 +42,7 @@ DefaultStreamPieceSelector::DefaultStreamPieceSelector(BitfieldMan* bitfieldMan) { } -DefaultStreamPieceSelector::~DefaultStreamPieceSelector() {} +DefaultStreamPieceSelector::~DefaultStreamPieceSelector() = default; bool DefaultStreamPieceSelector::select(size_t& index, size_t minSplitSize, const unsigned char* ignoreBitfield, diff --git a/src/Dependency.h b/src/Dependency.h index 514b9249..665f700a 100644 --- a/src/Dependency.h +++ b/src/Dependency.h @@ -41,7 +41,7 @@ namespace aria2 { class Dependency { public: - virtual ~Dependency() {} + virtual ~Dependency() = default; virtual bool resolve() = 0; // throw() }; diff --git a/src/DiskAdaptor.cc b/src/DiskAdaptor.cc index b162a971..9e5815ef 100644 --- a/src/DiskAdaptor.cc +++ b/src/DiskAdaptor.cc @@ -40,6 +40,6 @@ namespace aria2 { DiskAdaptor::DiskAdaptor() : fileAllocationMethod_(FILE_ALLOC_ADAPTIVE) {} -DiskAdaptor::~DiskAdaptor() {} +DiskAdaptor::~DiskAdaptor() = default; } // namespace aria2 diff --git a/src/DiskWriter.h b/src/DiskWriter.h index 558e71a3..960e346c 100644 --- a/src/DiskWriter.h +++ b/src/DiskWriter.h @@ -47,7 +47,7 @@ class DiskWriter : public BinaryStream { public: DiskWriter() {} - virtual ~DiskWriter() {} + virtual ~DiskWriter() = default; /** * Opens file. If the file exists, then it is truncated to 0 length. */ diff --git a/src/DiskWriterFactory.h b/src/DiskWriterFactory.h index 52b969b7..ae9da051 100644 --- a/src/DiskWriterFactory.h +++ b/src/DiskWriterFactory.h @@ -46,7 +46,7 @@ class DiskWriter; class DiskWriterFactory { public: - virtual ~DiskWriterFactory() {} + virtual ~DiskWriterFactory() = default; virtual std::unique_ptr newDiskWriter(const std::string& filename) = 0; diff --git a/src/DownloadContext.cc b/src/DownloadContext.cc index b7d21ed3..80edf2d9 100644 --- a/src/DownloadContext.cc +++ b/src/DownloadContext.cc @@ -72,7 +72,7 @@ DownloadContext::DownloadContext(int32_t pieceLength, int64_t totalLength, std::make_shared(std::move(path), totalLength, 0)); } -DownloadContext::~DownloadContext() {} +DownloadContext::~DownloadContext() = default; void DownloadContext::resetDownloadStartTime() { diff --git a/src/DownloadEngine.cc b/src/DownloadEngine.cc index 72e617c2..2dfe08b8 100644 --- a/src/DownloadEngine.cc +++ b/src/DownloadEngine.cc @@ -150,7 +150,7 @@ void executeCommand(std::deque>& commands, namespace { class GlobalHaltRequestedFinalizer { public: - GlobalHaltRequestedFinalizer() {} + GlobalHaltRequestedFinalizer() = default; ~GlobalHaltRequestedFinalizer() { global::globalHaltRequested = 5; } }; } // namespace @@ -519,7 +519,7 @@ DownloadEngine::SocketPoolEntry::SocketPoolEntry( { } -DownloadEngine::SocketPoolEntry::~SocketPoolEntry() {} +DownloadEngine::SocketPoolEntry::~SocketPoolEntry() = default; bool DownloadEngine::SocketPoolEntry::isTimeout() const { diff --git a/src/DownloadEngineFactory.cc b/src/DownloadEngineFactory.cc index 1913a5d4..3c5bfe58 100644 --- a/src/DownloadEngineFactory.cc +++ b/src/DownloadEngineFactory.cc @@ -81,7 +81,7 @@ namespace aria2 { -DownloadEngineFactory::DownloadEngineFactory() {} +DownloadEngineFactory::DownloadEngineFactory() = default; namespace { std::unique_ptr createEventPoll(Option* op) diff --git a/src/DownloadResult.cc b/src/DownloadResult.cc index 9d5e2230..3f504c47 100644 --- a/src/DownloadResult.cc +++ b/src/DownloadResult.cc @@ -54,6 +54,6 @@ DownloadResult::DownloadResult() { } -DownloadResult::~DownloadResult() {} +DownloadResult::~DownloadResult() = default; } // namespace aria2 diff --git a/src/Event.h b/src/Event.h index 1cce3b98..39037912 100644 --- a/src/Event.h +++ b/src/Event.h @@ -52,7 +52,7 @@ namespace aria2 { template class Event { public: - virtual ~Event() {} + virtual ~Event() = default; virtual void processEvents(int events) = 0; diff --git a/src/EventPoll.h b/src/EventPoll.h index 2d8298b6..35bee1ba 100644 --- a/src/EventPoll.h +++ b/src/EventPoll.h @@ -58,7 +58,7 @@ public: EVENT_HUP = 1 << 3, }; - virtual ~EventPoll() {} + virtual ~EventPoll() = default; virtual void poll(const struct timeval& tv) = 0; diff --git a/src/EvictSocketPoolCommand.cc b/src/EvictSocketPoolCommand.cc index 5c765a8e..b35cea6d 100644 --- a/src/EvictSocketPoolCommand.cc +++ b/src/EvictSocketPoolCommand.cc @@ -44,7 +44,7 @@ EvictSocketPoolCommand::EvictSocketPoolCommand(cuid_t cuid, DownloadEngine* e, { } -EvictSocketPoolCommand::~EvictSocketPoolCommand() {} +EvictSocketPoolCommand::~EvictSocketPoolCommand() = default; void EvictSocketPoolCommand::preProcess() { diff --git a/src/Exception.cc b/src/Exception.cc index bedaed05..1e7abd94 100644 --- a/src/Exception.cc +++ b/src/Exception.cc @@ -95,7 +95,7 @@ Exception::Exception(const char* file, int line, int errNum, { } -Exception::~Exception() throw() {} +Exception::~Exception() throw() = default; std::string Exception::stackTrace() const { diff --git a/src/ExtensionMessage.h b/src/ExtensionMessage.h index 67d8256d..0a18b351 100644 --- a/src/ExtensionMessage.h +++ b/src/ExtensionMessage.h @@ -42,7 +42,7 @@ namespace aria2 { class ExtensionMessage { public: - virtual ~ExtensionMessage() {} + virtual ~ExtensionMessage() = default; virtual std::string getPayload() = 0; diff --git a/src/ExtensionMessageFactory.h b/src/ExtensionMessageFactory.h index 557ef4bd..f42d4ec6 100644 --- a/src/ExtensionMessageFactory.h +++ b/src/ExtensionMessageFactory.h @@ -45,7 +45,7 @@ class ExtensionMessage; class ExtensionMessageFactory { public: - virtual ~ExtensionMessageFactory() {} + virtual ~ExtensionMessageFactory() = default; virtual std::unique_ptr createMessage(const unsigned char* data, size_t length) = 0; diff --git a/src/ExtensionMessageRegistry.cc b/src/ExtensionMessageRegistry.cc index 1e9fa84a..85543309 100644 --- a/src/ExtensionMessageRegistry.cc +++ b/src/ExtensionMessageRegistry.cc @@ -44,7 +44,7 @@ ExtensionMessageRegistry::ExtensionMessageRegistry() { } -ExtensionMessageRegistry::~ExtensionMessageRegistry() {} +ExtensionMessageRegistry::~ExtensionMessageRegistry() = default; namespace { const char* EXTENSION_NAMES[] = {"ut_metadata", "ut_pex", nullptr}; diff --git a/src/FeedbackURISelector.cc b/src/FeedbackURISelector.cc index 37519df0..0a353069 100644 --- a/src/FeedbackURISelector.cc +++ b/src/FeedbackURISelector.cc @@ -55,7 +55,7 @@ FeedbackURISelector::FeedbackURISelector( { } -FeedbackURISelector::~FeedbackURISelector() {} +FeedbackURISelector::~FeedbackURISelector() = default; std::string FeedbackURISelector::select( FileEntry* fileEntry, diff --git a/src/File.cc b/src/File.cc index 758ce501..3ee6c47a 100644 --- a/src/File.cc +++ b/src/File.cc @@ -56,9 +56,9 @@ namespace aria2 { File::File(const std::string& name) : name_(name) {} -File::File(const File& c) : name_(c.name_) {} +File::File(const File& c) = default; -File::~File() {} +File::~File() = default; File& File::operator=(const File& c) { diff --git a/src/FileAllocationEntry.cc b/src/FileAllocationEntry.cc index d2a5c6e8..57174d93 100644 --- a/src/FileAllocationEntry.cc +++ b/src/FileAllocationEntry.cc @@ -50,7 +50,7 @@ FileAllocationEntry::FileAllocationEntry(RequestGroup* requestGroup, { } -FileAllocationEntry::~FileAllocationEntry() {} +FileAllocationEntry::~FileAllocationEntry() = default; int64_t FileAllocationEntry::getCurrentLength() { diff --git a/src/FileAllocationIterator.h b/src/FileAllocationIterator.h index c3f237cd..d4aeb1a7 100644 --- a/src/FileAllocationIterator.h +++ b/src/FileAllocationIterator.h @@ -43,7 +43,7 @@ namespace aria2 { class FileAllocationIterator { public: - virtual ~FileAllocationIterator() {} + virtual ~FileAllocationIterator() = default; virtual void allocateChunk() = 0; diff --git a/src/FileEntry.cc b/src/FileEntry.cc index 453c6816..a2353435 100644 --- a/src/FileEntry.cc +++ b/src/FileEntry.cc @@ -88,7 +88,7 @@ FileEntry::FileEntry() { } -FileEntry::~FileEntry() {} +FileEntry::~FileEntry() = default; FileEntry& FileEntry::operator=(const FileEntry& entry) { diff --git a/src/FillRequestGroupCommand.cc b/src/FillRequestGroupCommand.cc index 421360eb..9c84d01a 100644 --- a/src/FillRequestGroupCommand.cc +++ b/src/FillRequestGroupCommand.cc @@ -52,7 +52,7 @@ FillRequestGroupCommand::FillRequestGroupCommand(cuid_t cuid, DownloadEngine* e) setStatusRealtime(); } -FillRequestGroupCommand::~FillRequestGroupCommand() {} +FillRequestGroupCommand::~FillRequestGroupCommand() = default; bool FillRequestGroupCommand::execute() { diff --git a/src/FtpConnection.cc b/src/FtpConnection.cc index 5a52b869..415b8ebd 100644 --- a/src/FtpConnection.cc +++ b/src/FtpConnection.cc @@ -76,7 +76,7 @@ FtpConnection::FtpConnection(cuid_t cuid, { } -FtpConnection::~FtpConnection() {} +FtpConnection::~FtpConnection() = default; bool FtpConnection::sendUser() { diff --git a/src/FtpDownloadCommand.cc b/src/FtpDownloadCommand.cc index 47f84281..85a217c3 100644 --- a/src/FtpDownloadCommand.cc +++ b/src/FtpDownloadCommand.cc @@ -61,7 +61,7 @@ FtpDownloadCommand::FtpDownloadCommand( { } -FtpDownloadCommand::~FtpDownloadCommand() {} +FtpDownloadCommand::~FtpDownloadCommand() = default; bool FtpDownloadCommand::prepareForNextSegment() { diff --git a/src/FtpFinishDownloadCommand.cc b/src/FtpFinishDownloadCommand.cc index 4f1de617..1cf28162 100644 --- a/src/FtpFinishDownloadCommand.cc +++ b/src/FtpFinishDownloadCommand.cc @@ -64,7 +64,7 @@ FtpFinishDownloadCommand::FtpFinishDownloadCommand( { } -FtpFinishDownloadCommand::~FtpFinishDownloadCommand() {} +FtpFinishDownloadCommand::~FtpFinishDownloadCommand() = default; // overrides AbstractCommand::execute(). // AbstractCommand::_segments is empty. diff --git a/src/FtpInitiateConnectionCommand.cc b/src/FtpInitiateConnectionCommand.cc index 772bf3fd..604c9c0f 100644 --- a/src/FtpInitiateConnectionCommand.cc +++ b/src/FtpInitiateConnectionCommand.cc @@ -75,7 +75,7 @@ FtpInitiateConnectionCommand::FtpInitiateConnectionCommand( { } -FtpInitiateConnectionCommand::~FtpInitiateConnectionCommand() {} +FtpInitiateConnectionCommand::~FtpInitiateConnectionCommand() = default; std::unique_ptr FtpInitiateConnectionCommand::createNextCommandProxied( const std::string& hostname, const std::string& addr, uint16_t port, diff --git a/src/FtpNegotiationCommand.cc b/src/FtpNegotiationCommand.cc index b2e877c5..b2c797b6 100644 --- a/src/FtpNegotiationCommand.cc +++ b/src/FtpNegotiationCommand.cc @@ -100,7 +100,7 @@ FtpNegotiationCommand::FtpNegotiationCommand( setWriteCheckSocket(getSocket()); } -FtpNegotiationCommand::~FtpNegotiationCommand() {} +FtpNegotiationCommand::~FtpNegotiationCommand() = default; bool FtpNegotiationCommand::executeInternal() { diff --git a/src/FtpTunnelRequestCommand.cc b/src/FtpTunnelRequestCommand.cc index 6bb6c608..25c5d422 100644 --- a/src/FtpTunnelRequestCommand.cc +++ b/src/FtpTunnelRequestCommand.cc @@ -52,7 +52,7 @@ FtpTunnelRequestCommand::FtpTunnelRequestCommand( { } -FtpTunnelRequestCommand::~FtpTunnelRequestCommand() {} +FtpTunnelRequestCommand::~FtpTunnelRequestCommand() = default; std::unique_ptr FtpTunnelRequestCommand::getNextCommand() { diff --git a/src/FtpTunnelResponseCommand.cc b/src/FtpTunnelResponseCommand.cc index 0d296eaf..b9c34896 100644 --- a/src/FtpTunnelResponseCommand.cc +++ b/src/FtpTunnelResponseCommand.cc @@ -56,7 +56,7 @@ FtpTunnelResponseCommand::FtpTunnelResponseCommand( { } -FtpTunnelResponseCommand::~FtpTunnelResponseCommand() {} +FtpTunnelResponseCommand::~FtpTunnelResponseCommand() = default; std::unique_ptr FtpTunnelResponseCommand::getNextCommand() { diff --git a/src/GenericParser.h b/src/GenericParser.h index f3048654..09e42146 100644 --- a/src/GenericParser.h +++ b/src/GenericParser.h @@ -46,7 +46,7 @@ template class GenericParser { public: GenericParser() : parser_{&psm_} {} - ~GenericParser() {} + ~GenericParser() = default; typedef typename ParserStateMachine::ResultType ResultType; typedef ParserStateMachine ParserStateMachineType; diff --git a/src/GeomStreamPieceSelector.cc b/src/GeomStreamPieceSelector.cc index d91a6b12..c6668c7f 100644 --- a/src/GeomStreamPieceSelector.cc +++ b/src/GeomStreamPieceSelector.cc @@ -43,7 +43,7 @@ GeomStreamPieceSelector::GeomStreamPieceSelector(BitfieldMan* bitfieldMan, { } -GeomStreamPieceSelector::~GeomStreamPieceSelector() {} +GeomStreamPieceSelector::~GeomStreamPieceSelector() = default; bool GeomStreamPieceSelector::select(size_t& index, size_t minSplitSize, const unsigned char* ignoreBitfield, diff --git a/src/GrowSegment.cc b/src/GrowSegment.cc index 21876075..462bbb40 100644 --- a/src/GrowSegment.cc +++ b/src/GrowSegment.cc @@ -43,7 +43,7 @@ GrowSegment::GrowSegment(const std::shared_ptr& piece) { } -GrowSegment::~GrowSegment() {} +GrowSegment::~GrowSegment() = default; void GrowSegment::updateWrittenLength(int64_t bytes) { diff --git a/src/HaveEraseCommand.cc b/src/HaveEraseCommand.cc index 9c2b0bc0..94d7fa46 100644 --- a/src/HaveEraseCommand.cc +++ b/src/HaveEraseCommand.cc @@ -47,7 +47,7 @@ HaveEraseCommand::HaveEraseCommand(cuid_t cuid, DownloadEngine* e, { } -HaveEraseCommand::~HaveEraseCommand() {} +HaveEraseCommand::~HaveEraseCommand() = default; void HaveEraseCommand::preProcess() { diff --git a/src/HttpConnection.cc b/src/HttpConnection.cc index 788f4ca2..d29f4a30 100644 --- a/src/HttpConnection.cc +++ b/src/HttpConnection.cc @@ -89,7 +89,7 @@ HttpConnection::HttpConnection( { } -HttpConnection::~HttpConnection() {} +HttpConnection::~HttpConnection() = default; std::string HttpConnection::eraseConfidentialInfo(const std::string& request) { diff --git a/src/HttpDownloadCommand.cc b/src/HttpDownloadCommand.cc index a3663847..0011a443 100644 --- a/src/HttpDownloadCommand.cc +++ b/src/HttpDownloadCommand.cc @@ -69,7 +69,7 @@ HttpDownloadCommand::HttpDownloadCommand( { } -HttpDownloadCommand::~HttpDownloadCommand() {} +HttpDownloadCommand::~HttpDownloadCommand() = default; bool HttpDownloadCommand::prepareForNextSegment() { diff --git a/src/HttpHeader.cc b/src/HttpHeader.cc index f253e87f..2b554bf2 100644 --- a/src/HttpHeader.cc +++ b/src/HttpHeader.cc @@ -43,7 +43,7 @@ namespace aria2 { HttpHeader::HttpHeader() : statusCode_(0) {} -HttpHeader::~HttpHeader() {} +HttpHeader::~HttpHeader() = default; void HttpHeader::put(int hdKey, const std::string& value) { diff --git a/src/HttpHeaderProcessor.cc b/src/HttpHeaderProcessor.cc index c3b501a8..9b40b2e7 100644 --- a/src/HttpHeaderProcessor.cc +++ b/src/HttpHeaderProcessor.cc @@ -83,7 +83,7 @@ HttpHeaderProcessor::HttpHeaderProcessor(ParserMode mode) { } -HttpHeaderProcessor::~HttpHeaderProcessor() {} +HttpHeaderProcessor::~HttpHeaderProcessor() = default; namespace { size_t getToken(std::string& buf, const unsigned char* data, size_t length, diff --git a/src/HttpInitiateConnectionCommand.cc b/src/HttpInitiateConnectionCommand.cc index a54148f3..74c74b7a 100644 --- a/src/HttpInitiateConnectionCommand.cc +++ b/src/HttpInitiateConnectionCommand.cc @@ -66,7 +66,7 @@ HttpInitiateConnectionCommand::HttpInitiateConnectionCommand( { } -HttpInitiateConnectionCommand::~HttpInitiateConnectionCommand() {} +HttpInitiateConnectionCommand::~HttpInitiateConnectionCommand() = default; std::unique_ptr HttpInitiateConnectionCommand::createNextCommand( const std::string& hostname, const std::string& addr, uint16_t port, diff --git a/src/HttpProxyRequestCommand.cc b/src/HttpProxyRequestCommand.cc index b0e568a2..8251f535 100644 --- a/src/HttpProxyRequestCommand.cc +++ b/src/HttpProxyRequestCommand.cc @@ -51,7 +51,7 @@ HttpProxyRequestCommand::HttpProxyRequestCommand( { } -HttpProxyRequestCommand::~HttpProxyRequestCommand() {} +HttpProxyRequestCommand::~HttpProxyRequestCommand() = default; std::unique_ptr HttpProxyRequestCommand::getNextCommand() { diff --git a/src/HttpProxyResponseCommand.cc b/src/HttpProxyResponseCommand.cc index ba456220..105382ef 100644 --- a/src/HttpProxyResponseCommand.cc +++ b/src/HttpProxyResponseCommand.cc @@ -53,7 +53,7 @@ HttpProxyResponseCommand::HttpProxyResponseCommand( { } -HttpProxyResponseCommand::~HttpProxyResponseCommand() {} +HttpProxyResponseCommand::~HttpProxyResponseCommand() = default; std::unique_ptr HttpProxyResponseCommand::getNextCommand() { diff --git a/src/HttpRequest.cc b/src/HttpRequest.cc index 42359c88..b5fb4f86 100644 --- a/src/HttpRequest.cc +++ b/src/HttpRequest.cc @@ -72,7 +72,7 @@ HttpRequest::HttpRequest() { } -HttpRequest::~HttpRequest() {} +HttpRequest::~HttpRequest() = default; void HttpRequest::setSegment(std::shared_ptr segment) { diff --git a/src/HttpRequestCommand.cc b/src/HttpRequestCommand.cc index 4288214e..a2b8e7ef 100644 --- a/src/HttpRequestCommand.cc +++ b/src/HttpRequestCommand.cc @@ -76,7 +76,7 @@ HttpRequestCommand::HttpRequestCommand( setWriteCheckSocket(getSocket()); } -HttpRequestCommand::~HttpRequestCommand() {} +HttpRequestCommand::~HttpRequestCommand() = default; namespace { std::unique_ptr diff --git a/src/HttpResponseCommand.cc b/src/HttpResponseCommand.cc index 7d942524..4765f647 100644 --- a/src/HttpResponseCommand.cc +++ b/src/HttpResponseCommand.cc @@ -139,7 +139,7 @@ HttpResponseCommand::HttpResponseCommand( checkSocketRecvBuffer(); } -HttpResponseCommand::~HttpResponseCommand() {} +HttpResponseCommand::~HttpResponseCommand() = default; bool HttpResponseCommand::executeInternal() { diff --git a/src/HttpServer.cc b/src/HttpServer.cc index 0a102ec3..bd3a7a33 100644 --- a/src/HttpServer.cc +++ b/src/HttpServer.cc @@ -76,7 +76,7 @@ HttpServer::HttpServer(const std::shared_ptr& socket) { } -HttpServer::~HttpServer() {} +HttpServer::~HttpServer() = default; namespace { const char* getStatusString(int status) diff --git a/src/HttpServerResponseCommand.cc b/src/HttpServerResponseCommand.cc index 4f55012b..543d83f0 100644 --- a/src/HttpServerResponseCommand.cc +++ b/src/HttpServerResponseCommand.cc @@ -51,7 +51,7 @@ HttpServerResponseCommand::HttpServerResponseCommand( { } -HttpServerResponseCommand::~HttpServerResponseCommand() {} +HttpServerResponseCommand::~HttpServerResponseCommand() = default; void HttpServerResponseCommand::afterSend( const std::shared_ptr& httpServer, DownloadEngine* e) diff --git a/src/HttpSkipResponseCommand.cc b/src/HttpSkipResponseCommand.cc index 2c4556d1..14bd37d4 100644 --- a/src/HttpSkipResponseCommand.cc +++ b/src/HttpSkipResponseCommand.cc @@ -81,7 +81,7 @@ HttpSkipResponseCommand::HttpSkipResponseCommand( checkSocketRecvBuffer(); } -HttpSkipResponseCommand::~HttpSkipResponseCommand() {} +HttpSkipResponseCommand::~HttpSkipResponseCommand() = default; void HttpSkipResponseCommand::installStreamFilter( std::unique_ptr streamFilter) diff --git a/src/IOFile.h b/src/IOFile.h index 8d3fa39b..26fabf79 100644 --- a/src/IOFile.h +++ b/src/IOFile.h @@ -51,7 +51,7 @@ private: public: IOFile() {} - virtual ~IOFile() {} + virtual ~IOFile() = default; // Returns true if file is opened and ferror returns 0. Otherwise // returns false. operator unspecified_bool_type() const; diff --git a/src/IndexBtMessageValidator.cc b/src/IndexBtMessageValidator.cc index 5c9df07a..988a6ea9 100644 --- a/src/IndexBtMessageValidator.cc +++ b/src/IndexBtMessageValidator.cc @@ -44,7 +44,7 @@ IndexBtMessageValidator::IndexBtMessageValidator(const IndexBtMessage* message, { } -IndexBtMessageValidator::~IndexBtMessageValidator() {} +IndexBtMessageValidator::~IndexBtMessageValidator() = default; void IndexBtMessageValidator::validate() { diff --git a/src/IndexedList.h b/src/IndexedList.h index fae8d5e0..2fb64f96 100644 --- a/src/IndexedList.h +++ b/src/IndexedList.h @@ -63,7 +63,7 @@ struct IndexedListIterator { typedef typename SeqType::difference_type difference_type; typedef IndexedListIterator SelfType; - IndexedListIterator() {} + IndexedListIterator() = default; IndexedListIterator(const iterator& other) : p(other.p) {} IndexedListIterator(const SeqIteratorType& p) : p(p) {} @@ -305,8 +305,8 @@ operator-(const IndexedListIterator class IndexedList { public: - IndexedList() {} - ~IndexedList() {} + IndexedList() = default; + ~IndexedList() = default; typedef KeyType key_type; typedef ValuePtrType value_type; diff --git a/src/InitiateConnectionCommand.cc b/src/InitiateConnectionCommand.cc index 7f32e2a3..b23413e8 100644 --- a/src/InitiateConnectionCommand.cc +++ b/src/InitiateConnectionCommand.cc @@ -69,7 +69,7 @@ InitiateConnectionCommand::InitiateConnectionCommand( disableWriteCheckSocket(); } -InitiateConnectionCommand::~InitiateConnectionCommand() {} +InitiateConnectionCommand::~InitiateConnectionCommand() = default; bool InitiateConnectionCommand::executeInternal() { diff --git a/src/InorderStreamPieceSelector.cc b/src/InorderStreamPieceSelector.cc index 3f89d225..995838e8 100644 --- a/src/InorderStreamPieceSelector.cc +++ b/src/InorderStreamPieceSelector.cc @@ -42,7 +42,7 @@ InorderStreamPieceSelector::InorderStreamPieceSelector(BitfieldMan* bitfieldMan) { } -InorderStreamPieceSelector::~InorderStreamPieceSelector() {} +InorderStreamPieceSelector::~InorderStreamPieceSelector() = default; bool InorderStreamPieceSelector::select(size_t& index, size_t minSplitSize, const unsigned char* ignoreBitfield, diff --git a/src/InorderURISelector.cc b/src/InorderURISelector.cc index 8ed5ce91..2c4c33e1 100644 --- a/src/InorderURISelector.cc +++ b/src/InorderURISelector.cc @@ -40,7 +40,7 @@ namespace aria2 { InorderURISelector::InorderURISelector() {} -InorderURISelector::~InorderURISelector() {} +InorderURISelector::~InorderURISelector() = default; std::string InorderURISelector::select( FileEntry* fileEntry, diff --git a/src/InternalMessageDigestImpl.cc b/src/InternalMessageDigestImpl.cc index e5220a5c..7cc33930 100644 --- a/src/InternalMessageDigestImpl.cc +++ b/src/InternalMessageDigestImpl.cc @@ -47,7 +47,7 @@ template class MessageDigestBase : public MessageDigestImpl { public: MessageDigestBase() : ctx_{hash::create(algo)} {} - virtual ~MessageDigestBase() {} + virtual ~MessageDigestBase() = default; static size_t length() { diff --git a/src/IteratableChecksumValidator.cc b/src/IteratableChecksumValidator.cc index c95e446f..2b2db4d9 100644 --- a/src/IteratableChecksumValidator.cc +++ b/src/IteratableChecksumValidator.cc @@ -57,7 +57,7 @@ IteratableChecksumValidator::IteratableChecksumValidator( { } -IteratableChecksumValidator::~IteratableChecksumValidator() {} +IteratableChecksumValidator::~IteratableChecksumValidator() = default; void IteratableChecksumValidator::validateChunk() { diff --git a/src/IteratableChunkChecksumValidator.cc b/src/IteratableChunkChecksumValidator.cc index 8d1ad8fe..043d2113 100644 --- a/src/IteratableChunkChecksumValidator.cc +++ b/src/IteratableChunkChecksumValidator.cc @@ -65,7 +65,7 @@ IteratableChunkChecksumValidator::IteratableChunkChecksumValidator( { } -IteratableChunkChecksumValidator::~IteratableChunkChecksumValidator() {} +IteratableChunkChecksumValidator::~IteratableChunkChecksumValidator() = default; void IteratableChunkChecksumValidator::validateChunk() { diff --git a/src/IteratableValidator.h b/src/IteratableValidator.h index 9eac5268..dcd52b8d 100644 --- a/src/IteratableValidator.h +++ b/src/IteratableValidator.h @@ -51,7 +51,7 @@ namespace aria2 { */ class IteratableValidator { public: - virtual ~IteratableValidator() {} + virtual ~IteratableValidator() = default; virtual void init() = 0; diff --git a/src/JsonParser.cc b/src/JsonParser.cc index 2b404a93..af5b40e1 100644 --- a/src/JsonParser.cc +++ b/src/JsonParser.cc @@ -91,7 +91,7 @@ JsonParser::JsonParser(StructParserStateMachine* psm) stateStack_.push(JSON_FINISH); } -JsonParser::~JsonParser() {} +JsonParser::~JsonParser() = default; namespace { bool isSpace(char c) { return util::isLws(c) || util::isCRLF(c); } diff --git a/src/KeepRunningCommand.cc b/src/KeepRunningCommand.cc index 3ee243fb..3eae3c39 100644 --- a/src/KeepRunningCommand.cc +++ b/src/KeepRunningCommand.cc @@ -44,7 +44,7 @@ KeepRunningCommand::KeepRunningCommand(cuid_t cuid, DownloadEngine* e) setStatusRealtime(); } -KeepRunningCommand::~KeepRunningCommand() {} +KeepRunningCommand::~KeepRunningCommand() = default; bool KeepRunningCommand::execute() { diff --git a/src/LibgcryptMessageDigestImpl.cc b/src/LibgcryptMessageDigestImpl.cc index 6edc985a..7efbaac1 100644 --- a/src/LibgcryptMessageDigestImpl.cc +++ b/src/LibgcryptMessageDigestImpl.cc @@ -62,7 +62,7 @@ public: reset(); } - virtual ~MessageDigestBase() {} + virtual ~MessageDigestBase() = default; static size_t length() { return ::gcry_md_get_algo_dlen(hash); } diff --git a/src/LibnettleARC4Encryptor.cc b/src/LibnettleARC4Encryptor.cc index 99a8fca9..2a257602 100644 --- a/src/LibnettleARC4Encryptor.cc +++ b/src/LibnettleARC4Encryptor.cc @@ -38,7 +38,7 @@ namespace aria2 { ARC4Encryptor::ARC4Encryptor() {} -ARC4Encryptor::~ARC4Encryptor() {} +ARC4Encryptor::~ARC4Encryptor() = default; void ARC4Encryptor::init(const unsigned char* key, size_t keyLength) { diff --git a/src/LibnettleMessageDigestImpl.cc b/src/LibnettleMessageDigestImpl.cc index aedf4e1a..c6c2d7ce 100644 --- a/src/LibnettleMessageDigestImpl.cc +++ b/src/LibnettleMessageDigestImpl.cc @@ -49,7 +49,7 @@ public: { reset(); } - virtual ~MessageDigestBase() {} + virtual ~MessageDigestBase() = default; static size_t length() { return hash->digest_size; } virtual size_t getDigestLength() const CXX11_OVERRIDE diff --git a/src/LibsslARC4Encryptor.cc b/src/LibsslARC4Encryptor.cc index efcd167b..e1a46aae 100644 --- a/src/LibsslARC4Encryptor.cc +++ b/src/LibsslARC4Encryptor.cc @@ -38,7 +38,7 @@ namespace aria2 { ARC4Encryptor::ARC4Encryptor() {} -ARC4Encryptor::~ARC4Encryptor() {} +ARC4Encryptor::~ARC4Encryptor() = default; void ARC4Encryptor::init(const unsigned char* key, size_t keyLength) { diff --git a/src/Logger.cc b/src/Logger.cc index ed998a92..87168e16 100644 --- a/src/Logger.cc +++ b/src/Logger.cc @@ -58,7 +58,7 @@ Logger::Logger() { } -Logger::~Logger() {} +Logger::~Logger() = default; void Logger::openFile(const std::string& filename) { diff --git a/src/LpdDispatchMessageCommand.cc b/src/LpdDispatchMessageCommand.cc index 79abf57b..20adc159 100644 --- a/src/LpdDispatchMessageCommand.cc +++ b/src/LpdDispatchMessageCommand.cc @@ -52,7 +52,7 @@ LpdDispatchMessageCommand::LpdDispatchMessageCommand( { } -LpdDispatchMessageCommand::~LpdDispatchMessageCommand() {} +LpdDispatchMessageCommand::~LpdDispatchMessageCommand() = default; bool LpdDispatchMessageCommand::execute() { diff --git a/src/LpdMessage.cc b/src/LpdMessage.cc index 22e0be8b..ec5bf915 100644 --- a/src/LpdMessage.cc +++ b/src/LpdMessage.cc @@ -46,6 +46,6 @@ LpdMessage::LpdMessage(const std::shared_ptr& peer, { } -LpdMessage::~LpdMessage() {} +LpdMessage::~LpdMessage() = default; } // namespace aria2 diff --git a/src/LpdMessageDispatcher.cc b/src/LpdMessageDispatcher.cc index 02bc6d10..888bc80e 100644 --- a/src/LpdMessageDispatcher.cc +++ b/src/LpdMessageDispatcher.cc @@ -62,7 +62,7 @@ LpdMessageDispatcher::LpdMessageDispatcher(const std::string& infoHash, { } -LpdMessageDispatcher::~LpdMessageDispatcher() {} +LpdMessageDispatcher::~LpdMessageDispatcher() = default; bool LpdMessageDispatcher::init(const std::string& localAddr, unsigned char ttl, unsigned char loop) diff --git a/src/LpdMessageReceiver.cc b/src/LpdMessageReceiver.cc index 8f1b3d58..a74b33b7 100644 --- a/src/LpdMessageReceiver.cc +++ b/src/LpdMessageReceiver.cc @@ -53,7 +53,7 @@ LpdMessageReceiver::LpdMessageReceiver(const std::string& multicastAddress, { } -LpdMessageReceiver::~LpdMessageReceiver() {} +LpdMessageReceiver::~LpdMessageReceiver() = default; bool LpdMessageReceiver::init(const std::string& localAddr) { diff --git a/src/MSEHandshake.cc b/src/MSEHandshake.cc index cd33faac..31bd1575 100644 --- a/src/MSEHandshake.cc +++ b/src/MSEHandshake.cc @@ -92,7 +92,7 @@ MSEHandshake::MSEHandshake(cuid_t cuid, { } -MSEHandshake::~MSEHandshake() {} +MSEHandshake::~MSEHandshake() = default; MSEHandshake::HANDSHAKE_TYPE MSEHandshake::identifyHandshakeType() { diff --git a/src/MessageDigest.cc b/src/MessageDigest.cc index 0c8a5ece..610d306e 100644 --- a/src/MessageDigest.cc +++ b/src/MessageDigest.cc @@ -68,7 +68,7 @@ MessageDigest::MessageDigest(std::unique_ptr impl) { } -MessageDigest::~MessageDigest() {} +MessageDigest::~MessageDigest() = default; std::unique_ptr MessageDigest::sha1() { diff --git a/src/MessageDigestImpl.h b/src/MessageDigestImpl.h index d4869102..41702d80 100644 --- a/src/MessageDigestImpl.h +++ b/src/MessageDigestImpl.h @@ -66,7 +66,7 @@ private: MessageDigestImpl& operator=(const MessageDigestImpl&) = delete; public: - virtual ~MessageDigestImpl() {} + virtual ~MessageDigestImpl() = default; static std::unique_ptr sha1(); inline static std::unique_ptr @@ -101,7 +101,7 @@ public: virtual void digest(unsigned char* md) = 0; protected: - MessageDigestImpl() {} + MessageDigestImpl() = default; }; } // namespace aria2 diff --git a/src/MetadataInfo.cc b/src/MetadataInfo.cc index 2a6a8ac1..774a4b12 100644 --- a/src/MetadataInfo.cc +++ b/src/MetadataInfo.cc @@ -46,7 +46,7 @@ MetadataInfo::MetadataInfo(const std::shared_ptr& gid, MetadataInfo::MetadataInfo() {} -MetadataInfo::~MetadataInfo() {} +MetadataInfo::~MetadataInfo() = default; a2_gid_t MetadataInfo::getGID() const { diff --git a/src/Metalink2RequestGroup.cc b/src/Metalink2RequestGroup.cc index a160c116..26fa7575 100644 --- a/src/Metalink2RequestGroup.cc +++ b/src/Metalink2RequestGroup.cc @@ -69,7 +69,7 @@ namespace aria2 { -Metalink2RequestGroup::Metalink2RequestGroup() {} +Metalink2RequestGroup::Metalink2RequestGroup() = default; namespace { class AccumulateNonP2PUri { @@ -97,7 +97,7 @@ public: namespace { class FindBitTorrentUri { public: - FindBitTorrentUri() {} + FindBitTorrentUri() = default; bool operator()(const std::shared_ptr& resource) { diff --git a/src/MetalinkEntry.cc b/src/MetalinkEntry.cc index 5ea2e317..3567f06d 100644 --- a/src/MetalinkEntry.cc +++ b/src/MetalinkEntry.cc @@ -50,7 +50,7 @@ namespace aria2 { MetalinkEntry::MetalinkEntry() : sizeKnown(false), maxConnections(-1) {} -MetalinkEntry::~MetalinkEntry() {} +MetalinkEntry::~MetalinkEntry() = default; const std::string& MetalinkEntry::getPath() const { return file->getPath(); } diff --git a/src/MetalinkHttpEntry.cc b/src/MetalinkHttpEntry.cc index c2494e96..f5ea8fd0 100644 --- a/src/MetalinkHttpEntry.cc +++ b/src/MetalinkHttpEntry.cc @@ -38,7 +38,7 @@ namespace aria2 { MetalinkHttpEntry::MetalinkHttpEntry() : pri(999999), pref(false) {} -MetalinkHttpEntry::~MetalinkHttpEntry() {} +MetalinkHttpEntry::~MetalinkHttpEntry() = default; void MetalinkHttpEntry::swap(MetalinkHttpEntry& other) { diff --git a/src/MetalinkMetaurl.cc b/src/MetalinkMetaurl.cc index b567a509..ddb2e7cd 100644 --- a/src/MetalinkMetaurl.cc +++ b/src/MetalinkMetaurl.cc @@ -51,6 +51,6 @@ MetalinkMetaurl::MetalinkMetaurl(const std::string& url, { } -MetalinkMetaurl::~MetalinkMetaurl() {} +MetalinkMetaurl::~MetalinkMetaurl() = default; } // namespace aria2 diff --git a/src/MetalinkParserController.cc b/src/MetalinkParserController.cc index 62e9d787..6dd2e9ad 100644 --- a/src/MetalinkParserController.cc +++ b/src/MetalinkParserController.cc @@ -60,7 +60,7 @@ MetalinkParserController::MetalinkParserController() { } -MetalinkParserController::~MetalinkParserController() {} +MetalinkParserController::~MetalinkParserController() = default; void MetalinkParserController::reset() { diff --git a/src/MetalinkParserState.h b/src/MetalinkParserState.h index 430e5572..46840130 100644 --- a/src/MetalinkParserState.h +++ b/src/MetalinkParserState.h @@ -47,7 +47,7 @@ struct XmlAttr; class MetalinkParserState { public: - virtual ~MetalinkParserState() {} + virtual ~MetalinkParserState() = default; virtual void beginElement(MetalinkParserStateMachine* stm, const char* localname, const char* prefix, diff --git a/src/MetalinkParserStateMachine.cc b/src/MetalinkParserStateMachine.cc index 4e709755..d8d000a3 100644 --- a/src/MetalinkParserStateMachine.cc +++ b/src/MetalinkParserStateMachine.cc @@ -111,7 +111,7 @@ MetalinkParserStateMachine::MetalinkParserStateMachine() stateStack_.push(initialState_); } -MetalinkParserStateMachine::~MetalinkParserStateMachine() {} +MetalinkParserStateMachine::~MetalinkParserStateMachine() = default; void MetalinkParserStateMachine::reset() { diff --git a/src/MetalinkResource.cc b/src/MetalinkResource.cc index 1ade2be8..143441c8 100644 --- a/src/MetalinkResource.cc +++ b/src/MetalinkResource.cc @@ -44,6 +44,6 @@ MetalinkResource::MetalinkResource() { } -MetalinkResource::~MetalinkResource() {} +MetalinkResource::~MetalinkResource() = default; } // namespace aria2 diff --git a/src/Metalinker.cc b/src/Metalinker.cc index 9f676c0b..ebe65a7d 100644 --- a/src/Metalinker.cc +++ b/src/Metalinker.cc @@ -41,7 +41,7 @@ namespace aria2 { Metalinker::Metalinker() {} -Metalinker::~Metalinker() {} +Metalinker::~Metalinker() = default; std::vector> Metalinker::queryEntry(const std::string& version, const std::string& language, diff --git a/src/MultiUrlRequestInfo.cc b/src/MultiUrlRequestInfo.cc index 66461d8d..240f1d23 100644 --- a/src/MultiUrlRequestInfo.cc +++ b/src/MultiUrlRequestInfo.cc @@ -161,7 +161,7 @@ MultiUrlRequestInfo::MultiUrlRequestInfo( #endif // !HAVE_SIGACTION } -MultiUrlRequestInfo::~MultiUrlRequestInfo() {} +MultiUrlRequestInfo::~MultiUrlRequestInfo() = default; void MultiUrlRequestInfo::printMessageForContinue() { diff --git a/src/NetStat.cc b/src/NetStat.cc index 98ef1b0d..3edb238e 100644 --- a/src/NetStat.cc +++ b/src/NetStat.cc @@ -46,7 +46,7 @@ NetStat::NetStat() { } -NetStat::~NetStat() {} +NetStat::~NetStat() = default; /** * Returns current download speed in byte per sec. diff --git a/src/Netrc.cc b/src/Netrc.cc index a1cf3778..005f3162 100644 --- a/src/Netrc.cc +++ b/src/Netrc.cc @@ -58,7 +58,7 @@ Authenticator::Authenticator(std::string machine, std::string login, { } -Authenticator::~Authenticator() {} +Authenticator::~Authenticator() = default; bool Authenticator::match(const std::string& hostname) const { @@ -92,7 +92,7 @@ DefaultAuthenticator::DefaultAuthenticator(std::string login, { } -DefaultAuthenticator::~DefaultAuthenticator() {} +DefaultAuthenticator::~DefaultAuthenticator() = default; bool DefaultAuthenticator::match(const std::string& hostname) const { @@ -101,7 +101,7 @@ bool DefaultAuthenticator::match(const std::string& hostname) const Netrc::Netrc() {} -Netrc::~Netrc() {} +Netrc::~Netrc() = default; void Netrc::addAuthenticator(std::unique_ptr authenticator) { diff --git a/src/Netrc.h b/src/Netrc.h index 023ea863..060238c3 100644 --- a/src/Netrc.h +++ b/src/Netrc.h @@ -45,7 +45,7 @@ namespace aria2 { class Authenticatable { public: - virtual ~Authenticatable() {} + virtual ~Authenticatable() = default; virtual bool match(const std::string& hostname) const = 0; }; diff --git a/src/Notifier.cc b/src/Notifier.cc index a1ca8274..d4becd23 100644 --- a/src/Notifier.cc +++ b/src/Notifier.cc @@ -40,7 +40,7 @@ namespace aria2 { Notifier::Notifier() {} -Notifier::~Notifier() {} +Notifier::~Notifier() = default; void Notifier::addDownloadEventListener(DownloadEventListener* listener) { diff --git a/src/Notifier.h b/src/Notifier.h index aec3548b..b3065209 100644 --- a/src/Notifier.h +++ b/src/Notifier.h @@ -47,7 +47,7 @@ namespace aria2 { class RequestGroup; struct DownloadEventListener { - virtual ~DownloadEventListener() {} + virtual ~DownloadEventListener() = default; virtual void onEvent(DownloadEvent event, const RequestGroup* group) = 0; }; diff --git a/src/NsCookieParser.cc b/src/NsCookieParser.cc index 77ca25ab..1812daa6 100644 --- a/src/NsCookieParser.cc +++ b/src/NsCookieParser.cc @@ -49,9 +49,9 @@ namespace aria2 { -NsCookieParser::NsCookieParser() {} +NsCookieParser::NsCookieParser() = default; -NsCookieParser::~NsCookieParser() {} +NsCookieParser::~NsCookieParser() = default; namespace { std::unique_ptr parseNsCookie(const std::string& cookieStr, diff --git a/src/NullOutputFile.h b/src/NullOutputFile.h index 739caa69..7a865cc5 100644 --- a/src/NullOutputFile.h +++ b/src/NullOutputFile.h @@ -41,7 +41,7 @@ namespace aria2 { class NullOutputFile : public OutputFile { public: - virtual ~NullOutputFile() {} + virtual ~NullOutputFile() = default; virtual size_t write(const char* str) CXX11_OVERRIDE { return 0; } virtual int flush() CXX11_OVERRIDE { return 0; } virtual int vprintf(const char* format, va_list va) CXX11_OVERRIDE diff --git a/src/NullProgressInfoFile.h b/src/NullProgressInfoFile.h index 2c209821..790be6e2 100644 --- a/src/NullProgressInfoFile.h +++ b/src/NullProgressInfoFile.h @@ -42,7 +42,7 @@ namespace aria2 { class NullProgressInfoFile : public BtProgressInfoFile { public: - virtual ~NullProgressInfoFile() {} + virtual ~NullProgressInfoFile() = default; virtual std::string getFilename() CXX11_OVERRIDE { return A2STR::NIL; } diff --git a/src/NullStatCalc.h b/src/NullStatCalc.h index aeb4ccf8..a1a45a9f 100644 --- a/src/NullStatCalc.h +++ b/src/NullStatCalc.h @@ -41,7 +41,7 @@ namespace aria2 { class NullStatCalc : public StatCalc { public: - virtual ~NullStatCalc() {} + virtual ~NullStatCalc() = default; virtual void calculateStat(const DownloadEngine* e) CXX11_OVERRIDE {} }; diff --git a/src/NullWebSocketSessionMan.h b/src/NullWebSocketSessionMan.h index db007be8..4f760d12 100644 --- a/src/NullWebSocketSessionMan.h +++ b/src/NullWebSocketSessionMan.h @@ -53,8 +53,8 @@ class WebSocketSession { class WebSocketSessionMan { public: - WebSocketSessionMan() {} - ~WebSocketSessionMan() {} + WebSocketSessionMan() = default; + ~WebSocketSessionMan() = default; void addSession(const std::shared_ptr& wsSession) {} void removeSession(const std::shared_ptr& wsSession) {} void addNotification(const std::string& method, const RequestGroup* group) {} diff --git a/src/Option.cc b/src/Option.cc index e2af7017..dc5ce58f 100644 --- a/src/Option.cc +++ b/src/Option.cc @@ -46,12 +46,10 @@ Option::Option() { } -Option::~Option() {} +Option::~Option() = default; Option::Option(const Option& option) - : table_(option.table_), use_(option.use_), parent_(option.parent_) -{ -} + = default; Option& Option::operator=(const Option& option) { diff --git a/src/OptionHandler.h b/src/OptionHandler.h index becf5dba..8ea71e4a 100644 --- a/src/OptionHandler.h +++ b/src/OptionHandler.h @@ -60,7 +60,7 @@ class Option; class OptionHandler { public: - virtual ~OptionHandler() {} + virtual ~OptionHandler() = default; virtual void parse(Option& option, const std::string& arg) const = 0; diff --git a/src/OptionHandlerException.cc b/src/OptionHandlerException.cc index 301c44a9..738181fe 100644 --- a/src/OptionHandlerException.cc +++ b/src/OptionHandlerException.cc @@ -59,7 +59,7 @@ OptionHandlerException::OptionHandlerException(const char* file, int line, { } -OptionHandlerException::~OptionHandlerException() throw() {} +OptionHandlerException::~OptionHandlerException() throw() = default; std::shared_ptr OptionHandlerException::copy() const { diff --git a/src/OptionHandlerImpl.cc b/src/OptionHandlerImpl.cc index 12412993..23e03876 100644 --- a/src/OptionHandlerImpl.cc +++ b/src/OptionHandlerImpl.cc @@ -75,7 +75,7 @@ BooleanOptionHandler::BooleanOptionHandler(PrefPtr pref, { } -BooleanOptionHandler::~BooleanOptionHandler() {} +BooleanOptionHandler::~BooleanOptionHandler() = default; void BooleanOptionHandler::parseArg(Option& option, const std::string& optarg) const @@ -111,7 +111,7 @@ IntegerRangeOptionHandler::IntegerRangeOptionHandler( { } -IntegerRangeOptionHandler::~IntegerRangeOptionHandler() {} +IntegerRangeOptionHandler::~IntegerRangeOptionHandler() = default; void IntegerRangeOptionHandler::parseArg(Option& option, const std::string& optarg) const @@ -146,7 +146,7 @@ NumberOptionHandler::NumberOptionHandler(PrefPtr pref, const char* description, { } -NumberOptionHandler::~NumberOptionHandler() {} +NumberOptionHandler::~NumberOptionHandler() = default; void NumberOptionHandler::parseArg(Option& option, const std::string& optarg) const @@ -210,7 +210,7 @@ UnitNumberOptionHandler::UnitNumberOptionHandler( { } -UnitNumberOptionHandler::~UnitNumberOptionHandler() {} +UnitNumberOptionHandler::~UnitNumberOptionHandler() = default; void UnitNumberOptionHandler::parseArg(Option& option, const std::string& optarg) const @@ -229,7 +229,7 @@ FloatNumberOptionHandler::FloatNumberOptionHandler( { } -FloatNumberOptionHandler::~FloatNumberOptionHandler() {} +FloatNumberOptionHandler::~FloatNumberOptionHandler() = default; void FloatNumberOptionHandler::parseArg(Option& option, const std::string& optarg) const @@ -287,7 +287,7 @@ DefaultOptionHandler::DefaultOptionHandler( { } -DefaultOptionHandler::~DefaultOptionHandler() {} +DefaultOptionHandler::~DefaultOptionHandler() = default; void DefaultOptionHandler::parseArg(Option& option, const std::string& optarg) const @@ -316,7 +316,7 @@ CumulativeOptionHandler::CumulativeOptionHandler( { } -CumulativeOptionHandler::~CumulativeOptionHandler() {} +CumulativeOptionHandler::~CumulativeOptionHandler() = default; void CumulativeOptionHandler::parseArg(Option& option, const std::string& optarg) const @@ -340,7 +340,7 @@ IndexOutOptionHandler::IndexOutOptionHandler(PrefPtr pref, { } -IndexOutOptionHandler::~IndexOutOptionHandler() {} +IndexOutOptionHandler::~IndexOutOptionHandler() = default; void IndexOutOptionHandler::parseArg(Option& option, const std::string& optarg) const @@ -375,7 +375,7 @@ ChecksumOptionHandler::ChecksumOptionHandler( { } -ChecksumOptionHandler::~ChecksumOptionHandler() {} +ChecksumOptionHandler::~ChecksumOptionHandler() = default; void ChecksumOptionHandler::parseArg(Option& option, const std::string& optarg) const @@ -411,7 +411,7 @@ ParameterOptionHandler::ParameterOptionHandler( { } -ParameterOptionHandler::~ParameterOptionHandler() {} +ParameterOptionHandler::~ParameterOptionHandler() = default; void ParameterOptionHandler::parseArg(Option& option, const std::string& optarg) const @@ -457,7 +457,7 @@ HostPortOptionHandler::HostPortOptionHandler( { } -HostPortOptionHandler::~HostPortOptionHandler() {} +HostPortOptionHandler::~HostPortOptionHandler() = default; void HostPortOptionHandler::parseArg(Option& option, const std::string& optarg) const @@ -496,7 +496,7 @@ HttpProxyOptionHandler::HttpProxyOptionHandler(PrefPtr pref, { } -HttpProxyOptionHandler::~HttpProxyOptionHandler() {} +HttpProxyOptionHandler::~HttpProxyOptionHandler() = default; void HttpProxyOptionHandler::parseArg(Option& option, const std::string& optarg) const diff --git a/src/OutputFile.h b/src/OutputFile.h index cc25c398..427306ce 100644 --- a/src/OutputFile.h +++ b/src/OutputFile.h @@ -47,7 +47,7 @@ namespace aria2 { class OutputFile { public: - virtual ~OutputFile() {} + virtual ~OutputFile() = default; virtual size_t write(const char* str) = 0; virtual int flush() = 0; virtual int vprintf(const char* format, va_list va) = 0; diff --git a/src/ParserStateMachine.h b/src/ParserStateMachine.h index 8b50ec9b..e07b539e 100644 --- a/src/ParserStateMachine.h +++ b/src/ParserStateMachine.h @@ -46,7 +46,7 @@ struct XmlAttr; class ParserStateMachine { public: - virtual ~ParserStateMachine() {} + virtual ~ParserStateMachine() = default; virtual bool needsCharactersBuffering() const = 0; diff --git a/src/PeerAddrEntry.cc b/src/PeerAddrEntry.cc index 29493bd9..5591879e 100644 --- a/src/PeerAddrEntry.cc +++ b/src/PeerAddrEntry.cc @@ -44,11 +44,9 @@ PeerAddrEntry::PeerAddrEntry(const std::string& ipaddr, uint16_t port, } PeerAddrEntry::PeerAddrEntry(const PeerAddrEntry& c) - : ipaddr_(c.ipaddr_), port_(c.port_), lastUpdated_(c.lastUpdated_) -{ -} + = default; -PeerAddrEntry::~PeerAddrEntry() {} +PeerAddrEntry::~PeerAddrEntry() = default; PeerAddrEntry& PeerAddrEntry::operator=(const PeerAddrEntry& c) { diff --git a/src/PeerChokeCommand.cc b/src/PeerChokeCommand.cc index 7d920bcc..397a9029 100644 --- a/src/PeerChokeCommand.cc +++ b/src/PeerChokeCommand.cc @@ -44,7 +44,7 @@ PeerChokeCommand::PeerChokeCommand(cuid_t cuid, DownloadEngine* e) { } -PeerChokeCommand::~PeerChokeCommand() {} +PeerChokeCommand::~PeerChokeCommand() = default; bool PeerChokeCommand::execute() { diff --git a/src/PeerConnection.cc b/src/PeerConnection.cc index b6f1beaa..51f08a6f 100644 --- a/src/PeerConnection.cc +++ b/src/PeerConnection.cc @@ -81,7 +81,7 @@ PeerConnection::PeerConnection(cuid_t cuid, const std::shared_ptr& peer, { } -PeerConnection::~PeerConnection() {} +PeerConnection::~PeerConnection() = default; void PeerConnection::pushBytes(std::vector data, std::unique_ptr progressUpdate) diff --git a/src/PeerListenCommand.cc b/src/PeerListenCommand.cc index 96fc5069..79e6d83e 100644 --- a/src/PeerListenCommand.cc +++ b/src/PeerListenCommand.cc @@ -57,7 +57,7 @@ PeerListenCommand::PeerListenCommand(cuid_t cuid, DownloadEngine* e, int family) { } -PeerListenCommand::~PeerListenCommand() {} +PeerListenCommand::~PeerListenCommand() = default; bool PeerListenCommand::bindPort(uint16_t& port, SegList& sgl) { diff --git a/src/PeerReceiveHandshakeCommand.cc b/src/PeerReceiveHandshakeCommand.cc index e1f8f332..1b1e6be6 100644 --- a/src/PeerReceiveHandshakeCommand.cc +++ b/src/PeerReceiveHandshakeCommand.cc @@ -79,7 +79,7 @@ PeerReceiveHandshakeCommand::PeerReceiveHandshakeCommand( } } -PeerReceiveHandshakeCommand::~PeerReceiveHandshakeCommand() {} +PeerReceiveHandshakeCommand::~PeerReceiveHandshakeCommand() = default; bool PeerReceiveHandshakeCommand::exitBeforeExecute() { diff --git a/src/PeerSessionResource.cc b/src/PeerSessionResource.cc index c58d9acc..d1e68222 100644 --- a/src/PeerSessionResource.cc +++ b/src/PeerSessionResource.cc @@ -64,7 +64,7 @@ PeerSessionResource::PeerSessionResource(int32_t pieceLength, { } -PeerSessionResource::~PeerSessionResource() {} +PeerSessionResource::~PeerSessionResource() = default; void PeerSessionResource::amChoking(bool b) { diff --git a/src/PeerStat.cc b/src/PeerStat.cc index d25bea28..60a166ff 100644 --- a/src/PeerStat.cc +++ b/src/PeerStat.cc @@ -45,7 +45,7 @@ PeerStat::PeerStat(cuid_t cuid, const std::string& hostname, PeerStat::PeerStat(cuid_t cuid) : cuid_(cuid) {} -PeerStat::~PeerStat() {} +PeerStat::~PeerStat() = default; /** * Returns current download speed in byte per sec. diff --git a/src/PeerStorage.h b/src/PeerStorage.h index 78a0944f..cc77c515 100644 --- a/src/PeerStorage.h +++ b/src/PeerStorage.h @@ -54,7 +54,7 @@ typedef std::set, RefLess> PeerSet; class PeerStorage { public: - virtual ~PeerStorage() {} + virtual ~PeerStorage() = default; /** * Adds new peer to the internal peer list. diff --git a/src/Piece.cc b/src/Piece.cc index 9ab04935..ccbb0f44 100644 --- a/src/Piece.cc +++ b/src/Piece.cc @@ -62,7 +62,7 @@ Piece::Piece(size_t index, int64_t length, int32_t blockLength) { } -Piece::~Piece() {} +Piece::~Piece() = default; void Piece::completeBlock(size_t blockIndex) { diff --git a/src/PieceHashCheckIntegrityEntry.cc b/src/PieceHashCheckIntegrityEntry.cc index 76f22c56..7545dec7 100644 --- a/src/PieceHashCheckIntegrityEntry.cc +++ b/src/PieceHashCheckIntegrityEntry.cc @@ -47,7 +47,7 @@ PieceHashCheckIntegrityEntry::PieceHashCheckIntegrityEntry( { } -PieceHashCheckIntegrityEntry::~PieceHashCheckIntegrityEntry() {} +PieceHashCheckIntegrityEntry::~PieceHashCheckIntegrityEntry() = default; bool PieceHashCheckIntegrityEntry::isValidationReady() { diff --git a/src/PieceSelector.h b/src/PieceSelector.h index b4308474..16e47da7 100644 --- a/src/PieceSelector.h +++ b/src/PieceSelector.h @@ -43,7 +43,7 @@ namespace aria2 { class PieceSelector { public: - virtual ~PieceSelector() {} + virtual ~PieceSelector() = default; virtual bool select(size_t& index, const unsigned char* bitfield, size_t nbits) const = 0; diff --git a/src/PieceStatMan.cc b/src/PieceStatMan.cc index a984619e..5d2efe76 100644 --- a/src/PieceStatMan.cc +++ b/src/PieceStatMan.cc @@ -55,7 +55,7 @@ PieceStatMan::PieceStatMan(size_t pieceNum, bool randomShuffle) } } -PieceStatMan::~PieceStatMan() {} +PieceStatMan::~PieceStatMan() = default; namespace { void inc(int& x) diff --git a/src/PieceStorage.h b/src/PieceStorage.h index 6e7066de..981c8547 100644 --- a/src/PieceStorage.h +++ b/src/PieceStorage.h @@ -55,7 +55,7 @@ class WrDiskCache; class PieceStorage { public: - virtual ~PieceStorage() {} + virtual ~PieceStorage() = default; #ifdef ENABLE_BITTORRENT /** diff --git a/src/PiecedSegment.cc b/src/PiecedSegment.cc index 7b50964f..6e13fbc3 100644 --- a/src/PiecedSegment.cc +++ b/src/PiecedSegment.cc @@ -48,7 +48,7 @@ PiecedSegment::PiecedSegment(int32_t pieceLength, writtenLength_ = index * piece_->getBlockLength(); } -PiecedSegment::~PiecedSegment() {} +PiecedSegment::~PiecedSegment() = default; bool PiecedSegment::complete() const { return piece_->pieceComplete(); } diff --git a/src/PollEventPoll.cc b/src/PollEventPoll.cc index 93790cf3..3b85f528 100644 --- a/src/PollEventPoll.cc +++ b/src/PollEventPoll.cc @@ -82,7 +82,7 @@ PollEventPoll::PollEventPoll() { } -PollEventPoll::~PollEventPoll() {} +PollEventPoll::~PollEventPoll() = default; void PollEventPoll::poll(const struct timeval& tv) { diff --git a/src/ProgressAwareEntry.h b/src/ProgressAwareEntry.h index f9e1f2db..c804069f 100644 --- a/src/ProgressAwareEntry.h +++ b/src/ProgressAwareEntry.h @@ -44,7 +44,7 @@ namespace aria2 { class ProgressAwareEntry { public: - virtual ~ProgressAwareEntry() {} + virtual ~ProgressAwareEntry() = default; virtual int64_t getCurrentLength() = 0; diff --git a/src/ProtocolDetector.cc b/src/ProtocolDetector.cc index 7f36bac3..81078f84 100644 --- a/src/ProtocolDetector.cc +++ b/src/ProtocolDetector.cc @@ -49,9 +49,9 @@ namespace aria2 { -ProtocolDetector::ProtocolDetector() {} +ProtocolDetector::ProtocolDetector() = default; -ProtocolDetector::~ProtocolDetector() {} +ProtocolDetector::~ProtocolDetector() = default; bool ProtocolDetector::isStreamProtocol(const std::string& uri) const { diff --git a/src/RandomStreamPieceSelector.cc b/src/RandomStreamPieceSelector.cc index e91e256c..e630598c 100644 --- a/src/RandomStreamPieceSelector.cc +++ b/src/RandomStreamPieceSelector.cc @@ -43,7 +43,7 @@ RandomStreamPieceSelector::RandomStreamPieceSelector(BitfieldMan* bitfieldMan) { } -RandomStreamPieceSelector::~RandomStreamPieceSelector() {} +RandomStreamPieceSelector::~RandomStreamPieceSelector() = default; bool RandomStreamPieceSelector::select(size_t& index, size_t minSplitSize, const unsigned char* ignoreBitfield, diff --git a/src/Randomizer.h b/src/Randomizer.h index 80234ad8..10aeb943 100644 --- a/src/Randomizer.h +++ b/src/Randomizer.h @@ -41,7 +41,7 @@ namespace aria2 { class Randomizer { public: - virtual ~Randomizer() {} + virtual ~Randomizer() = default; /** * Returns random number in [0, to). diff --git a/src/Range.cc b/src/Range.cc index 3ec20d4d..3bc03fab 100644 --- a/src/Range.cc +++ b/src/Range.cc @@ -44,11 +44,9 @@ Range::Range(int64_t startByte, int64_t endByte, int64_t entityLength) } Range::Range(const Range& c) - : startByte(c.startByte), endByte(c.endByte), entityLength(c.entityLength) -{ -} + = default; -Range::~Range() {} +Range::~Range() = default; Range& Range::operator=(const Range& c) { diff --git a/src/RangeBtMessageValidator.cc b/src/RangeBtMessageValidator.cc index ff15515a..9d43c960 100644 --- a/src/RangeBtMessageValidator.cc +++ b/src/RangeBtMessageValidator.cc @@ -45,7 +45,7 @@ RangeBtMessageValidator::RangeBtMessageValidator(const RangeBtMessage* message, { } -RangeBtMessageValidator::~RangeBtMessageValidator() {} +RangeBtMessageValidator::~RangeBtMessageValidator() = default; void RangeBtMessageValidator::validate() { diff --git a/src/ReceiverMSEHandshakeCommand.cc b/src/ReceiverMSEHandshakeCommand.cc index 46b76447..90ba5585 100644 --- a/src/ReceiverMSEHandshakeCommand.cc +++ b/src/ReceiverMSEHandshakeCommand.cc @@ -67,7 +67,7 @@ ReceiverMSEHandshakeCommand::ReceiverMSEHandshakeCommand( mseHandshake_->setWantRead(true); } -ReceiverMSEHandshakeCommand::~ReceiverMSEHandshakeCommand() {} +ReceiverMSEHandshakeCommand::~ReceiverMSEHandshakeCommand() = default; bool ReceiverMSEHandshakeCommand::exitBeforeExecute() { diff --git a/src/Request.cc b/src/Request.cc index d7bfec7c..9fea2224 100644 --- a/src/Request.cc +++ b/src/Request.cc @@ -66,7 +66,7 @@ Request::Request() { } -Request::~Request() {} +Request::~Request() = default; namespace { std::string removeFragment(const std::string& uri) diff --git a/src/RequestGroup.cc b/src/RequestGroup.cc index 8fb16194..f41f00d5 100644 --- a/src/RequestGroup.cc +++ b/src/RequestGroup.cc @@ -161,7 +161,7 @@ RequestGroup::RequestGroup(const std::shared_ptr& gid, } } -RequestGroup::~RequestGroup() {} +RequestGroup::~RequestGroup() = default; bool RequestGroup::isCheckIntegrityReady() { diff --git a/src/RequestGroupCriteria.h b/src/RequestGroupCriteria.h index 7c1be6e1..f7e4b870 100644 --- a/src/RequestGroupCriteria.h +++ b/src/RequestGroupCriteria.h @@ -43,7 +43,7 @@ class RequestGroup; class RequestGroupCriteria { public: - virtual ~RequestGroupCriteria() {} + virtual ~RequestGroupCriteria() = default; virtual bool match(const RequestGroup* requestGroup) const = 0; }; diff --git a/src/RpcMethod.cc b/src/RpcMethod.cc index eaf1c4b1..4e9c4a38 100644 --- a/src/RpcMethod.cc +++ b/src/RpcMethod.cc @@ -56,7 +56,7 @@ namespace rpc { RpcMethod::RpcMethod() : optionParser_(OptionParser::getInstance()) {} -RpcMethod::~RpcMethod() {} +RpcMethod::~RpcMethod() = default; std::unique_ptr RpcMethod::createErrorResponse(const Exception& e, const RpcRequest& req) diff --git a/src/RpcResponse.cc b/src/RpcResponse.cc index 9df13592..fd3b2f10 100644 --- a/src/RpcResponse.cc +++ b/src/RpcResponse.cc @@ -58,7 +58,7 @@ void encodeValue(const ValueBase* value, OutputStream& o) public: XmlValueBaseVisitor(OutputStream& o) : o_(o) {} - virtual ~XmlValueBaseVisitor() {} + virtual ~XmlValueBaseVisitor() = default; virtual void visit(const String& v) CXX11_OVERRIDE { diff --git a/src/SaveSessionCommand.cc b/src/SaveSessionCommand.cc index adf00bb9..3725ce39 100644 --- a/src/SaveSessionCommand.cc +++ b/src/SaveSessionCommand.cc @@ -49,7 +49,7 @@ SaveSessionCommand::SaveSessionCommand(cuid_t cuid, DownloadEngine* e, { } -SaveSessionCommand::~SaveSessionCommand() {} +SaveSessionCommand::~SaveSessionCommand() = default; void SaveSessionCommand::preProcess() { diff --git a/src/SeedCriteria.h b/src/SeedCriteria.h index 6c182b59..77c98826 100644 --- a/src/SeedCriteria.h +++ b/src/SeedCriteria.h @@ -41,7 +41,7 @@ namespace aria2 { class SeedCriteria { public: - virtual ~SeedCriteria() {} + virtual ~SeedCriteria() = default; /** * Returns true if criteria is met. diff --git a/src/Segment.h b/src/Segment.h index d4f9381f..f32e5622 100644 --- a/src/Segment.h +++ b/src/Segment.h @@ -48,7 +48,7 @@ class WrDiskCache; class Segment { public: - virtual ~Segment() {} + virtual ~Segment() = default; virtual bool complete() const = 0; diff --git a/src/SegmentMan.cc b/src/SegmentMan.cc index 65748e1c..1e7acf93 100644 --- a/src/SegmentMan.cc +++ b/src/SegmentMan.cc @@ -63,7 +63,7 @@ SegmentEntry::SegmentEntry(cuid_t cuid, const std::shared_ptr& segment) { } -SegmentEntry::~SegmentEntry() {} +SegmentEntry::~SegmentEntry() = default; SegmentMan::SegmentMan(const std::shared_ptr& downloadContext, const std::shared_ptr& pieceStorage) @@ -75,7 +75,7 @@ SegmentMan::SegmentMan(const std::shared_ptr& downloadContext, ignoreBitfield_.enableFilter(); } -SegmentMan::~SegmentMan() {} +SegmentMan::~SegmentMan() = default; bool SegmentMan::downloadFinished() const { diff --git a/src/ServerStat.cc b/src/ServerStat.cc index 34503e6f..d35407dc 100644 --- a/src/ServerStat.cc +++ b/src/ServerStat.cc @@ -61,7 +61,7 @@ ServerStat::ServerStat(const std::string& hostname, const std::string& protocol) { } -ServerStat::~ServerStat() {} +ServerStat::~ServerStat() = default; void ServerStat::setLastUpdated(const Time& time) { lastUpdated_ = time; } diff --git a/src/ServerStatMan.cc b/src/ServerStatMan.cc index 4ce42740..1f551d9e 100644 --- a/src/ServerStatMan.cc +++ b/src/ServerStatMan.cc @@ -54,7 +54,7 @@ namespace aria2 { ServerStatMan::ServerStatMan() {} -ServerStatMan::~ServerStatMan() {} +ServerStatMan::~ServerStatMan() = default; std::shared_ptr ServerStatMan::find(const std::string& hostname, diff --git a/src/SftpDownloadCommand.cc b/src/SftpDownloadCommand.cc index a32c9d8e..0da4314c 100644 --- a/src/SftpDownloadCommand.cc +++ b/src/SftpDownloadCommand.cc @@ -58,7 +58,7 @@ SftpDownloadCommand::SftpDownloadCommand( setWriteCheckSocket(getSocket()); } -SftpDownloadCommand::~SftpDownloadCommand() {} +SftpDownloadCommand::~SftpDownloadCommand() = default; bool SftpDownloadCommand::prepareForNextSegment() { diff --git a/src/SftpFinishDownloadCommand.cc b/src/SftpFinishDownloadCommand.cc index b21b3d94..f658cc13 100644 --- a/src/SftpFinishDownloadCommand.cc +++ b/src/SftpFinishDownloadCommand.cc @@ -61,7 +61,7 @@ SftpFinishDownloadCommand::SftpFinishDownloadCommand( setWriteCheckSocket(getSocket()); } -SftpFinishDownloadCommand::~SftpFinishDownloadCommand() {} +SftpFinishDownloadCommand::~SftpFinishDownloadCommand() = default; // overrides AbstractCommand::execute(). // AbstractCommand::_segments is empty. diff --git a/src/SftpNegotiationCommand.cc b/src/SftpNegotiationCommand.cc index 70d50a0c..66c2fb0e 100644 --- a/src/SftpNegotiationCommand.cc +++ b/src/SftpNegotiationCommand.cc @@ -88,7 +88,7 @@ SftpNegotiationCommand::SftpNegotiationCommand( } } -SftpNegotiationCommand::~SftpNegotiationCommand() {} +SftpNegotiationCommand::~SftpNegotiationCommand() = default; bool SftpNegotiationCommand::executeInternal() { diff --git a/src/ShareRatioSeedCriteria.cc b/src/ShareRatioSeedCriteria.cc index c834039b..118f8422 100644 --- a/src/ShareRatioSeedCriteria.cc +++ b/src/ShareRatioSeedCriteria.cc @@ -45,7 +45,7 @@ ShareRatioSeedCriteria::ShareRatioSeedCriteria( { } -ShareRatioSeedCriteria::~ShareRatioSeedCriteria() {} +ShareRatioSeedCriteria::~ShareRatioSeedCriteria() = default; void ShareRatioSeedCriteria::reset() {} diff --git a/src/Signature.cc b/src/Signature.cc index eaf43501..d361a278 100644 --- a/src/Signature.cc +++ b/src/Signature.cc @@ -40,7 +40,7 @@ namespace aria2 { Signature::Signature() {} -Signature::~Signature() {} +Signature::~Signature() = default; void Signature::setType(std::string type) { type_ = std::move(type); } diff --git a/src/SingletonHolder.h b/src/SingletonHolder.h index 2c46eecf..425e20cf 100644 --- a/src/SingletonHolder.h +++ b/src/SingletonHolder.h @@ -45,10 +45,10 @@ template class SingletonHolder { private: static std::unique_ptr instance_; - SingletonHolder() {} + SingletonHolder() = default; public: - ~SingletonHolder() {} + ~SingletonHolder() = default; static std::unique_ptr& instance() { return instance_; } diff --git a/src/SocketBuffer.cc b/src/SocketBuffer.cc index 95a0244a..62862fff 100644 --- a/src/SocketBuffer.cc +++ b/src/SocketBuffer.cc @@ -53,7 +53,7 @@ SocketBuffer::ByteArrayBufEntry::ByteArrayBufEntry( { } -SocketBuffer::ByteArrayBufEntry::~ByteArrayBufEntry() {} +SocketBuffer::ByteArrayBufEntry::~ByteArrayBufEntry() = default; ssize_t SocketBuffer::ByteArrayBufEntry::send(const std::shared_ptr& socket, @@ -107,7 +107,7 @@ SocketBuffer::SocketBuffer(std::shared_ptr socket) { } -SocketBuffer::~SocketBuffer() {} +SocketBuffer::~SocketBuffer() = default; void SocketBuffer::pushBytes(std::vector bytes, std::unique_ptr progressUpdate) diff --git a/src/SocketBuffer.h b/src/SocketBuffer.h index 5858078f..d1887f43 100644 --- a/src/SocketBuffer.h +++ b/src/SocketBuffer.h @@ -47,7 +47,7 @@ namespace aria2 { class SocketCore; struct ProgressUpdate { - virtual ~ProgressUpdate() {} + virtual ~ProgressUpdate() = default; virtual void update(size_t length, bool complete) = 0; }; @@ -59,7 +59,7 @@ private: : progressUpdate_(std::move(progressUpdate)) { } - virtual ~BufEntry() {} + virtual ~BufEntry() = default; virtual ssize_t send(const std::shared_ptr& socket, size_t offset) = 0; virtual bool final(size_t offset) const = 0; diff --git a/src/SocketRecvBuffer.cc b/src/SocketRecvBuffer.cc index 74477b80..8b2352a6 100644 --- a/src/SocketRecvBuffer.cc +++ b/src/SocketRecvBuffer.cc @@ -47,7 +47,7 @@ SocketRecvBuffer::SocketRecvBuffer(std::shared_ptr socket) { } -SocketRecvBuffer::~SocketRecvBuffer() {} +SocketRecvBuffer::~SocketRecvBuffer() = default; ssize_t SocketRecvBuffer::recv() { diff --git a/src/Sqlite3CookieParserImpl.cc b/src/Sqlite3CookieParserImpl.cc index 751ead1c..51afd886 100644 --- a/src/Sqlite3CookieParserImpl.cc +++ b/src/Sqlite3CookieParserImpl.cc @@ -41,7 +41,7 @@ Sqlite3MozCookieParser::Sqlite3MozCookieParser(const std::string& filename) { } -Sqlite3MozCookieParser::~Sqlite3MozCookieParser() {} +Sqlite3MozCookieParser::~Sqlite3MozCookieParser() = default; const char* Sqlite3MozCookieParser::getQuery() const { @@ -55,7 +55,7 @@ Sqlite3ChromiumCookieParser::Sqlite3ChromiumCookieParser( { } -Sqlite3ChromiumCookieParser::~Sqlite3ChromiumCookieParser() {} +Sqlite3ChromiumCookieParser::~Sqlite3ChromiumCookieParser() = default; const char* Sqlite3ChromiumCookieParser::getQuery() const { diff --git a/src/StatCalc.h b/src/StatCalc.h index 6c0ed47a..e9266674 100644 --- a/src/StatCalc.h +++ b/src/StatCalc.h @@ -43,7 +43,7 @@ class DownloadEngine; class StatCalc { public: - virtual ~StatCalc() {} + virtual ~StatCalc() = default; virtual void calculateStat(const DownloadEngine* e) = 0; }; diff --git a/src/StreamCheckIntegrityEntry.cc b/src/StreamCheckIntegrityEntry.cc index 2f5500a0..17f26521 100644 --- a/src/StreamCheckIntegrityEntry.cc +++ b/src/StreamCheckIntegrityEntry.cc @@ -48,7 +48,7 @@ StreamCheckIntegrityEntry::StreamCheckIntegrityEntry( { } -StreamCheckIntegrityEntry::~StreamCheckIntegrityEntry() {} +StreamCheckIntegrityEntry::~StreamCheckIntegrityEntry() = default; void StreamCheckIntegrityEntry::onDownloadIncomplete( std::vector>& commands, DownloadEngine* e) diff --git a/src/StreamFileAllocationEntry.cc b/src/StreamFileAllocationEntry.cc index e02bbc48..b455f280 100644 --- a/src/StreamFileAllocationEntry.cc +++ b/src/StreamFileAllocationEntry.cc @@ -55,7 +55,7 @@ StreamFileAllocationEntry::StreamFileAllocationEntry( { } -StreamFileAllocationEntry::~StreamFileAllocationEntry() {} +StreamFileAllocationEntry::~StreamFileAllocationEntry() = default; void StreamFileAllocationEntry::prepareForNextAction( std::vector>& commands, DownloadEngine* e) diff --git a/src/StreamFilter.cc b/src/StreamFilter.cc index cfb44ec4..81b06d73 100644 --- a/src/StreamFilter.cc +++ b/src/StreamFilter.cc @@ -41,7 +41,7 @@ StreamFilter::StreamFilter(std::unique_ptr delegate) { } -StreamFilter::~StreamFilter() {} +StreamFilter::~StreamFilter() = default; bool StreamFilter::installDelegate(std::unique_ptr filter) { diff --git a/src/StreamPieceSelector.h b/src/StreamPieceSelector.h index 8e570110..ccb49bed 100644 --- a/src/StreamPieceSelector.h +++ b/src/StreamPieceSelector.h @@ -45,7 +45,7 @@ namespace aria2 { // PieceSelector interface. class StreamPieceSelector { public: - virtual ~StreamPieceSelector() {} + virtual ~StreamPieceSelector() = default; // Selected piece index will be stored in index. To ignore some // piece indexes from selection, use ignoreBitfield and set // corresponding bit. length is the number of byte of diff --git a/src/StructParserStateMachine.h b/src/StructParserStateMachine.h index a30cc4d7..57592b4a 100644 --- a/src/StructParserStateMachine.h +++ b/src/StructParserStateMachine.h @@ -55,7 +55,7 @@ enum StructElementType { // JSON, Bencode). class StructParserStateMachine { public: - virtual ~StructParserStateMachine() {} + virtual ~StructParserStateMachine() = default; virtual void beginElement(int elementType) = 0; virtual void endElement(int elementType) = 0; diff --git a/src/TLSContext.h b/src/TLSContext.h index ffbfce39..2897c774 100644 --- a/src/TLSContext.h +++ b/src/TLSContext.h @@ -54,7 +54,7 @@ enum TLSVersion { class TLSContext { public: static TLSContext* make(TLSSessionSide side, TLSVersion minVer); - virtual ~TLSContext() {} + virtual ~TLSContext() = default; // private key `keyfile' must be decrypted. virtual bool addCredentialFile(const std::string& certfile, diff --git a/src/TLSSession.h b/src/TLSSession.h index 4b430d13..6e8988f2 100644 --- a/src/TLSSession.h +++ b/src/TLSSession.h @@ -56,7 +56,7 @@ public: static TLSSession* make(TLSContext* ctx); // MUST deallocate all resources - virtual ~TLSSession() {} + virtual ~TLSSession() = default; // Initializes SSL/TLS session. The |sockfd| is the underlying // transport socket. This function returns TLS_ERR_OK if it @@ -112,7 +112,7 @@ public: virtual size_t getRecvBufferedLength() = 0; protected: - TLSSession() {} + TLSSession() = default; private: TLSSession(const TLSSession&); diff --git a/src/TimeBasedCommand.cc b/src/TimeBasedCommand.cc index d6592c7c..c2464e5a 100644 --- a/src/TimeBasedCommand.cc +++ b/src/TimeBasedCommand.cc @@ -50,7 +50,7 @@ TimeBasedCommand::TimeBasedCommand(cuid_t cuid, DownloadEngine* e, { } -TimeBasedCommand::~TimeBasedCommand() {} +TimeBasedCommand::~TimeBasedCommand() = default; bool TimeBasedCommand::execute() { diff --git a/src/TimeSeedCriteria.cc b/src/TimeSeedCriteria.cc index f6c0c145..448359be 100644 --- a/src/TimeSeedCriteria.cc +++ b/src/TimeSeedCriteria.cc @@ -42,7 +42,7 @@ TimeSeedCriteria::TimeSeedCriteria(std::chrono::seconds duration) { } -TimeSeedCriteria::~TimeSeedCriteria() {} +TimeSeedCriteria::~TimeSeedCriteria() = default; void TimeSeedCriteria::reset() { watch_ = global::wallclock(); } diff --git a/src/TimedHaltCommand.cc b/src/TimedHaltCommand.cc index 4939fd7a..3ac079b0 100644 --- a/src/TimedHaltCommand.cc +++ b/src/TimedHaltCommand.cc @@ -50,7 +50,7 @@ TimedHaltCommand::TimedHaltCommand(cuid_t cuid, DownloadEngine* e, { } -TimedHaltCommand::~TimedHaltCommand() {} +TimedHaltCommand::~TimedHaltCommand() = default; void TimedHaltCommand::preProcess() { diff --git a/src/TorrentAttribute.cc b/src/TorrentAttribute.cc index daf46bf9..91251298 100644 --- a/src/TorrentAttribute.cc +++ b/src/TorrentAttribute.cc @@ -44,6 +44,6 @@ TorrentAttribute::TorrentAttribute() { } -TorrentAttribute::~TorrentAttribute() {} +TorrentAttribute::~TorrentAttribute() = default; } // namespace aria2 diff --git a/src/TrackerWatcherCommand.cc b/src/TrackerWatcherCommand.cc index 2e6f4f31..6352d9e8 100644 --- a/src/TrackerWatcherCommand.cc +++ b/src/TrackerWatcherCommand.cc @@ -75,7 +75,7 @@ HTTPAnnRequest::HTTPAnnRequest(std::unique_ptr rg) { } -HTTPAnnRequest::~HTTPAnnRequest() {} +HTTPAnnRequest::~HTTPAnnRequest() = default; bool HTTPAnnRequest::stopped() const { return rg_->getNumCommand() == 0; } @@ -139,7 +139,7 @@ UDPAnnRequest::UDPAnnRequest(const std::shared_ptr& req) { } -UDPAnnRequest::~UDPAnnRequest() {} +UDPAnnRequest::~UDPAnnRequest() = default; bool UDPAnnRequest::stopped() const { diff --git a/src/TrackerWatcherCommand.h b/src/TrackerWatcherCommand.h index 288ccd54..bd877417 100644 --- a/src/TrackerWatcherCommand.h +++ b/src/TrackerWatcherCommand.h @@ -54,7 +54,7 @@ class UDPTrackerClient; class AnnRequest { public: - virtual ~AnnRequest() {} + virtual ~AnnRequest() = default; // Returns true if tracker request is finished, regardless of the // outcome. virtual bool stopped() const = 0; diff --git a/src/URIResult.cc b/src/URIResult.cc index 76f57eb4..77540470 100644 --- a/src/URIResult.cc +++ b/src/URIResult.cc @@ -41,6 +41,6 @@ URIResult::URIResult(const std::string& uri, error_code::Value result) { } -URIResult::~URIResult() {} +URIResult::~URIResult() = default; } // namespace aria2 diff --git a/src/URISelector.h b/src/URISelector.h index a0b4c8a7..e01cdbf0 100644 --- a/src/URISelector.h +++ b/src/URISelector.h @@ -47,7 +47,7 @@ class FileEntry; class URISelector { public: - virtual ~URISelector() {} + virtual ~URISelector() = default; virtual std::string select(FileEntry* fileEntry, diff --git a/src/UnionSeedCriteria.cc b/src/UnionSeedCriteria.cc index 2bcdc7a5..f556f04d 100644 --- a/src/UnionSeedCriteria.cc +++ b/src/UnionSeedCriteria.cc @@ -39,7 +39,7 @@ namespace aria2 { UnionSeedCriteria::UnionSeedCriteria() {} -UnionSeedCriteria::~UnionSeedCriteria() {} +UnionSeedCriteria::~UnionSeedCriteria() = default; void UnionSeedCriteria::reset() { diff --git a/src/UnknownLengthPieceStorage.cc b/src/UnknownLengthPieceStorage.cc index 6bb565bf..b7e1ce84 100644 --- a/src/UnknownLengthPieceStorage.cc +++ b/src/UnknownLengthPieceStorage.cc @@ -56,7 +56,7 @@ UnknownLengthPieceStorage::UnknownLengthPieceStorage( { } -UnknownLengthPieceStorage::~UnknownLengthPieceStorage() {} +UnknownLengthPieceStorage::~UnknownLengthPieceStorage() = default; void UnknownLengthPieceStorage::initStorage() { diff --git a/src/UnknownOptionException.cc b/src/UnknownOptionException.cc index f2f776f2..1cf4f208 100644 --- a/src/UnknownOptionException.cc +++ b/src/UnknownOptionException.cc @@ -58,7 +58,7 @@ UnknownOptionException::UnknownOptionException(const char* file, int line, { } -UnknownOptionException::~UnknownOptionException() throw() {} +UnknownOptionException::~UnknownOptionException() throw() = default; std::shared_ptr UnknownOptionException::copy() const { diff --git a/src/UriListParser.cc b/src/UriListParser.cc index ce7cab64..9ef0051c 100644 --- a/src/UriListParser.cc +++ b/src/UriListParser.cc @@ -60,7 +60,7 @@ UriListParser::UriListParser(const std::string& filename) { } -UriListParser::~UriListParser() {} +UriListParser::~UriListParser() = default; void UriListParser::parseNext(std::vector& uris, Option& op) { diff --git a/src/ValueBase.h b/src/ValueBase.h index b7a3889e..7bd4b24b 100644 --- a/src/ValueBase.h +++ b/src/ValueBase.h @@ -50,7 +50,7 @@ class ValueBaseVisitor; class ValueBase { public: - virtual ~ValueBase() {} + virtual ~ValueBase() = default; virtual void accept(ValueBaseVisitor& visitor) const = 0; }; @@ -64,7 +64,7 @@ class Dict; class ValueBaseVisitor { public: - virtual ~ValueBaseVisitor() {} + virtual ~ValueBaseVisitor() = default; virtual void visit(const String& string) = 0; virtual void visit(const Integer& integer) = 0; virtual void visit(const Bool& boolValue) = 0; diff --git a/src/ValueBaseDiskWriter.h b/src/ValueBaseDiskWriter.h index 8f381699..538c04f5 100644 --- a/src/ValueBaseDiskWriter.h +++ b/src/ValueBaseDiskWriter.h @@ -48,7 +48,7 @@ template class ValueBaseDiskWriter : public DiskWriter { public: ValueBaseDiskWriter() : parser_(&psm_) {} - virtual ~ValueBaseDiskWriter() {} + virtual ~ValueBaseDiskWriter() = default; virtual void initAndOpenFile(int64_t totalLength = 0) CXX11_OVERRIDE { diff --git a/src/ValueBaseStructParserState.h b/src/ValueBaseStructParserState.h index 9f00050e..1d0ced30 100644 --- a/src/ValueBaseStructParserState.h +++ b/src/ValueBaseStructParserState.h @@ -43,7 +43,7 @@ class ValueBaseStructParserStateMachine; class ValueBaseStructParserState { public: - virtual ~ValueBaseStructParserState() {} + virtual ~ValueBaseStructParserState() = default; virtual void beginElement(ValueBaseStructParserStateMachine* psm, int elementType) = 0; diff --git a/src/ValueBaseStructParserStateImpl.h b/src/ValueBaseStructParserStateImpl.h index cde1bc2f..2c020204 100644 --- a/src/ValueBaseStructParserStateImpl.h +++ b/src/ValueBaseStructParserStateImpl.h @@ -41,7 +41,7 @@ namespace aria2 { class ValueValueBaseStructParserState : public ValueBaseStructParserState { public: - virtual ~ValueValueBaseStructParserState() {} + virtual ~ValueValueBaseStructParserState() = default; virtual void beginElement(ValueBaseStructParserStateMachine* psm, int elementType) CXX11_OVERRIDE; @@ -54,7 +54,7 @@ public: class DictValueBaseStructParserState : public ValueBaseStructParserState { public: - virtual ~DictValueBaseStructParserState() {} + virtual ~DictValueBaseStructParserState() = default; virtual void beginElement(ValueBaseStructParserStateMachine* psm, int elementType) CXX11_OVERRIDE; @@ -67,7 +67,7 @@ public: class DictKeyValueBaseStructParserState : public ValueBaseStructParserState { public: - virtual ~DictKeyValueBaseStructParserState() {} + virtual ~DictKeyValueBaseStructParserState() = default; virtual void beginElement(ValueBaseStructParserStateMachine* psm, int elementType) CXX11_OVERRIDE @@ -81,7 +81,7 @@ public: class DictDataValueBaseStructParserState : public ValueValueBaseStructParserState { public: - virtual ~DictDataValueBaseStructParserState() {} + virtual ~DictDataValueBaseStructParserState() = default; virtual void endElement(ValueBaseStructParserStateMachine* psm, int elementType) CXX11_OVERRIDE; @@ -89,7 +89,7 @@ public: class ArrayValueBaseStructParserState : public ValueBaseStructParserState { public: - virtual ~ArrayValueBaseStructParserState() {} + virtual ~ArrayValueBaseStructParserState() = default; virtual void beginElement(ValueBaseStructParserStateMachine* psm, int elementType) CXX11_OVERRIDE; @@ -103,7 +103,7 @@ public: class ArrayDataValueBaseStructParserState : public ValueValueBaseStructParserState { public: - virtual ~ArrayDataValueBaseStructParserState() {} + virtual ~ArrayDataValueBaseStructParserState() = default; virtual void endElement(ValueBaseStructParserStateMachine* psm, int elementType) CXX11_OVERRIDE; @@ -111,7 +111,7 @@ public: class StringValueBaseStructParserState : public ValueBaseStructParserState { public: - virtual ~StringValueBaseStructParserState() {} + virtual ~StringValueBaseStructParserState() = default; virtual void beginElement(ValueBaseStructParserStateMachine* psm, int elementType) CXX11_OVERRIDE @@ -124,7 +124,7 @@ public: class NumberValueBaseStructParserState : public ValueBaseStructParserState { public: - virtual ~NumberValueBaseStructParserState() {} + virtual ~NumberValueBaseStructParserState() = default; virtual void beginElement(ValueBaseStructParserStateMachine* psm, int elementType) CXX11_OVERRIDE @@ -137,7 +137,7 @@ public: class BoolValueBaseStructParserState : public ValueBaseStructParserState { public: - virtual ~BoolValueBaseStructParserState() {} + virtual ~BoolValueBaseStructParserState() = default; virtual void beginElement(ValueBaseStructParserStateMachine* psm, int elementType) CXX11_OVERRIDE @@ -150,7 +150,7 @@ public: class NullValueBaseStructParserState : public ValueBaseStructParserState { public: - virtual ~NullValueBaseStructParserState() {} + virtual ~NullValueBaseStructParserState() = default; virtual void beginElement(ValueBaseStructParserStateMachine* psm, int elementType) CXX11_OVERRIDE diff --git a/src/ValueBaseStructParserStateMachine.cc b/src/ValueBaseStructParserStateMachine.cc index 37593b27..e560bfbf 100644 --- a/src/ValueBaseStructParserStateMachine.cc +++ b/src/ValueBaseStructParserStateMachine.cc @@ -66,7 +66,7 @@ ValueBaseStructParserStateMachine::ValueBaseStructParserStateMachine() stateStack_.push(valueState); } -ValueBaseStructParserStateMachine::~ValueBaseStructParserStateMachine() {} +ValueBaseStructParserStateMachine::~ValueBaseStructParserStateMachine() = default; void ValueBaseStructParserStateMachine::reset() { diff --git a/src/WebSocketResponseCommand.cc b/src/WebSocketResponseCommand.cc index d1ca31f5..a06c9a01 100644 --- a/src/WebSocketResponseCommand.cc +++ b/src/WebSocketResponseCommand.cc @@ -50,7 +50,7 @@ WebSocketResponseCommand::WebSocketResponseCommand( { } -WebSocketResponseCommand::~WebSocketResponseCommand() {} +WebSocketResponseCommand::~WebSocketResponseCommand() = default; void WebSocketResponseCommand::afterSend( const std::shared_ptr& httpServer, DownloadEngine* e) diff --git a/src/WebSocketSessionMan.cc b/src/WebSocketSessionMan.cc index 75542e67..5e4e3384 100644 --- a/src/WebSocketSessionMan.cc +++ b/src/WebSocketSessionMan.cc @@ -49,7 +49,7 @@ namespace rpc { WebSocketSessionMan::WebSocketSessionMan() {} -WebSocketSessionMan::~WebSocketSessionMan() {} +WebSocketSessionMan::~WebSocketSessionMan() = default; void WebSocketSessionMan::addSession( const std::shared_ptr& wsSession) diff --git a/src/XmlRpcDiskWriter.cc b/src/XmlRpcDiskWriter.cc index 5fc712c9..4eeae7ec 100644 --- a/src/XmlRpcDiskWriter.cc +++ b/src/XmlRpcDiskWriter.cc @@ -43,7 +43,7 @@ namespace rpc { XmlRpcDiskWriter::XmlRpcDiskWriter() : parser_(&psm_) {} -XmlRpcDiskWriter::~XmlRpcDiskWriter() {} +XmlRpcDiskWriter::~XmlRpcDiskWriter() = default; void XmlRpcDiskWriter::initAndOpenFile(int64_t totalLength) { parser_.reset(); } diff --git a/src/XmlRpcRequestParserState.h b/src/XmlRpcRequestParserState.h index 837ecac3..697f7633 100644 --- a/src/XmlRpcRequestParserState.h +++ b/src/XmlRpcRequestParserState.h @@ -50,7 +50,7 @@ class XmlRpcRequestParserStateMachine; class XmlRpcRequestParserState { public: - virtual ~XmlRpcRequestParserState() {} + virtual ~XmlRpcRequestParserState() = default; virtual void beginElement(XmlRpcRequestParserStateMachine* psm, const char* name, diff --git a/src/aria2api.cc b/src/aria2api.cc index b3403a2c..7546254e 100644 --- a/src/aria2api.cc +++ b/src/aria2api.cc @@ -73,7 +73,7 @@ Session::Session(const KeyVals& options) { } -Session::~Session() {} +Session::~Session() = default; SessionConfig::SessionConfig() : keepRunning(false), @@ -660,7 +660,7 @@ struct RequestGroupDH : public DownloadHandle { : group(group), ts(group->calculateStat()) { } - virtual ~RequestGroupDH() {} + virtual ~RequestGroupDH() = default; virtual DownloadStatus getStatus() CXX11_OVERRIDE { if (group->getState() == RequestGroup::STATE_ACTIVE) { @@ -796,7 +796,7 @@ struct RequestGroupDH : public DownloadHandle { namespace { struct DownloadResultDH : public DownloadHandle { DownloadResultDH(std::shared_ptr dr) : dr(std::move(dr)) {} - virtual ~DownloadResultDH() {} + virtual ~DownloadResultDH() = default; virtual DownloadStatus getStatus() CXX11_OVERRIDE { switch (dr->result) { diff --git a/src/array_fun.h b/src/array_fun.h index 6a934b3f..100ceb00 100644 --- a/src/array_fun.h +++ b/src/array_fun.h @@ -52,7 +52,7 @@ private: T array_[N]; public: - array_wrapper() {} + array_wrapper() = default; operator T*() { return array_; } diff --git a/src/bignum.h b/src/bignum.h index 29ac558d..da02ccfd 100644 --- a/src/bignum.h +++ b/src/bignum.h @@ -49,7 +49,7 @@ public: memcpy(buf_.get(), data, size); } - virtual ~ulong() {} + virtual ~ulong() = default; ulong& operator=(const ulong& rhs) { diff --git a/src/bittorrent_helper.h b/src/bittorrent_helper.h index 5dc5ac54..795dc639 100644 --- a/src/bittorrent_helper.h +++ b/src/bittorrent_helper.h @@ -275,7 +275,7 @@ void extractPeer(const ValueBase* peerData, int family, OutputIterator dest) { } - virtual ~PeerListValueBaseVisitor() {} + virtual ~PeerListValueBaseVisitor() = default; virtual void visit(const String& peerData) CXX11_OVERRIDE { diff --git a/src/crypto_hash.cc b/src/crypto_hash.cc index e988bc6d..8448269e 100644 --- a/src/crypto_hash.cc +++ b/src/crypto_hash.cc @@ -98,7 +98,7 @@ protected: } public: - AlgorithmImpl() {} + AlgorithmImpl() = default; virtual void update(const void* data, uint64_t len) { diff --git a/src/crypto_hash.h b/src/crypto_hash.h index ab6299da..7b8b9da5 100644 --- a/src/crypto_hash.h +++ b/src/crypto_hash.h @@ -27,9 +27,9 @@ enum Algorithms { class Algorithm { public: - Algorithm() {} + Algorithm() = default; - virtual ~Algorithm() {} + virtual ~Algorithm() = default; virtual void update(const void* data, uint64_t len) = 0; diff --git a/src/includes/aria2/aria2.h b/src/includes/aria2/aria2.h index e13f0bac..c704a64c 100644 --- a/src/includes/aria2/aria2.h +++ b/src/includes/aria2/aria2.h @@ -741,7 +741,7 @@ enum DownloadStatus { */ class DownloadHandle { public: - virtual ~DownloadHandle() {} + virtual ~DownloadHandle() = default; /** * Returns status of this download. */ diff --git a/src/uri.cc b/src/uri.cc index e200c5bf..77ade701 100644 --- a/src/uri.cc +++ b/src/uri.cc @@ -46,20 +46,9 @@ UriStruct::UriStruct() : port(0), hasPassword(false), ipv6LiteralAddress(false) } UriStruct::UriStruct(const UriStruct& c) - : protocol(c.protocol), - host(c.host), - dir(c.dir), - file(c.file), - query(c.query), - username(c.username), - password(c.password), - port(c.port), - hasPassword(c.hasPassword), - ipv6LiteralAddress(c.ipv6LiteralAddress) -{ -} + = default; -UriStruct::~UriStruct() {} +UriStruct::~UriStruct() = default; UriStruct& UriStruct::operator=(const UriStruct& c) { diff --git a/src/util_security.h b/src/util_security.h index 120e4d96..2f37756b 100644 --- a/src/util_security.h +++ b/src/util_security.h @@ -90,16 +90,9 @@ public: { } - HMACResult(const HMACResult& other) : result_(other.result_), len_(other.len_) - { - } + HMACResult(const HMACResult& other) = default; - HMACResult& operator=(const HMACResult& other) - { - result_ = other.result_; - len_ = other.len_; - return *this; - } + HMACResult& operator=(const HMACResult& other) = default; bool operator==(const HMACResult& other) const { diff --git a/test.cc b/test.cc new file mode 100644 index 00000000..d39babdd --- /dev/null +++ b/test.cc @@ -0,0 +1,16 @@ +#include +#include + +int main() { + std::string filepath = "/ahue/hue/hue/kuk.jpg"; + auto fn = filepath; + std::string ext; + auto idx = fn.find_last_of("."); + auto slash = fn.find_last_of("\\/"); + if (idx != std::string::npos && (slash == std::string::npos || slash < idx)) { + ext = fn.substr(idx); + fn = fn.substr(0, idx); + } + std::cout << "fn:" << fn << " ext:" << ext; + return 0; +}