Skip to content

Commit

Permalink
Use default where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
nmaier committed Aug 29, 2016
1 parent 08f4b5e commit 366e2e8
Show file tree
Hide file tree
Showing 272 changed files with 346 additions and 368 deletions.
2 changes: 1 addition & 1 deletion src/AbstractAuthResolver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace aria2 {

AbstractAuthResolver::AbstractAuthResolver() {}

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

void AbstractAuthResolver::setUserDefinedCred(std::string user,
std::string password)
Expand Down
2 changes: 1 addition & 1 deletion src/AbstractBtMessage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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>& peer)
{
Expand Down
2 changes: 1 addition & 1 deletion src/AbstractOptionHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ AbstractOptionHandler::AbstractOptionHandler(PrefPtr pref,
{
}

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

void AbstractOptionHandler::parse(Option& option, const std::string& arg) const
{
Expand Down
2 changes: 1 addition & 1 deletion src/AbstractProxyRequestCommand.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ AbstractProxyRequestCommand::AbstractProxyRequestCommand(
setWriteCheckSocket(getSocket());
}

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

bool AbstractProxyRequestCommand::executeInternal()
{
Expand Down
2 changes: 1 addition & 1 deletion src/AbstractProxyResponseCommand.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ AbstractProxyResponseCommand::AbstractProxyResponseCommand(
{
}

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

bool AbstractProxyResponseCommand::executeInternal()
{
Expand Down
2 changes: 1 addition & 1 deletion src/AbstractSingleDiskAdaptor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ AbstractSingleDiskAdaptor::AbstractSingleDiskAdaptor()
{
}

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

void AbstractSingleDiskAdaptor::initAndOpenFile()
{
Expand Down
2 changes: 1 addition & 1 deletion src/AdaptiveFileAllocationIterator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ AdaptiveFileAllocationIterator::AdaptiveFileAllocationIterator(
{
}

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

void AdaptiveFileAllocationIterator::allocateChunk()
{
Expand Down
2 changes: 1 addition & 1 deletion src/AdaptiveURISelector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ AdaptiveURISelector::AdaptiveURISelector(
resetCounters();
}

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

std::string AdaptiveURISelector::select(
FileEntry* fileEntry,
Expand Down
2 changes: 1 addition & 1 deletion src/AnnounceList.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ AnnounceList::AnnounceList(
resetIterator();
}

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

void AnnounceList::reconfigure(
const std::vector<std::vector<std::string>>& announceList)
Expand Down
2 changes: 1 addition & 1 deletion src/AnnounceTier.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ AnnounceTier::AnnounceTier(std::deque<std::string> urls)
{
}

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

void AnnounceTier::nextEvent()
{
Expand Down
4 changes: 2 additions & 2 deletions src/AnonDiskWriterFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ namespace aria2 {
template <class DiskWriterType>
class AnonDiskWriterFactory : public DiskWriterFactory {
public:
AnonDiskWriterFactory() {}
virtual ~AnonDiskWriterFactory() {}
AnonDiskWriterFactory() = default;
virtual ~AnonDiskWriterFactory() = default;

virtual std::unique_ptr<DiskWriter>
newDiskWriter(const std::string& filename) CXX11_OVERRIDE
Expand Down
2 changes: 1 addition & 1 deletion src/ApiCallbackDownloadEventListener.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ ApiCallbackDownloadEventListener::ApiCallbackDownloadEventListener(
{
}

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

void ApiCallbackDownloadEventListener::onEvent(DownloadEvent event,
const RequestGroup* group)
Expand Down
2 changes: 1 addition & 1 deletion src/AppleMessageDigestImpl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ template <size_t dlen, typename ctx_t, int (*init_fn)(ctx_t*),
class MessageDigestBase : public MessageDigestImpl {
public:
MessageDigestBase() { reset(); }
virtual ~MessageDigestBase() {}
virtual ~MessageDigestBase() = default;

static size_t length() { return dlen; }
virtual size_t getDigestLength() const CXX11_OVERRIDE { return dlen; }
Expand Down
2 changes: 1 addition & 1 deletion src/AuthConfig.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ AuthConfig::AuthConfig(std::string user, std::string password)
{
}

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

std::string AuthConfig::getAuthText() const
{
Expand Down
2 changes: 1 addition & 1 deletion src/AuthConfigFactory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const std::string AUTH_DEFAULT_PASSWD("ARIA2USER@");

AuthConfigFactory::AuthConfigFactory() {}

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

std::unique_ptr<AuthConfig>
AuthConfigFactory::createAuthConfig(const std::shared_ptr<Request>& request,
Expand Down
2 changes: 1 addition & 1 deletion src/AuthResolver.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class AuthConfig;

class AuthResolver {
public:
virtual ~AuthResolver() {}
virtual ~AuthResolver() = default;

virtual std::unique_ptr<AuthConfig>
resolveAuthConfig(const std::string& hostname) = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/AutoSaveCommand.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ AutoSaveCommand::AutoSaveCommand(cuid_t cuid, DownloadEngine* e,
{
}

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

void AutoSaveCommand::preProcess()
{
Expand Down
2 changes: 1 addition & 1 deletion src/BencodeParser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion src/BinaryStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/BtAbortOutstandingRequestEvent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ BtAbortOutstandingRequestEvent::BtAbortOutstandingRequestEvent(
{
}

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

} // namespace aria2
2 changes: 1 addition & 1 deletion src/BtAnnounce.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ struct UDPTrackerRequest;

class BtAnnounce {
public:
virtual ~BtAnnounce() {}
virtual ~BtAnnounce() = default;

/**
* Returns true if announce is required.
Expand Down
2 changes: 1 addition & 1 deletion src/BtBitfieldMessage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/BtBitfieldMessageValidator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ BtBitfieldMessageValidator::BtBitfieldMessageValidator(
{
}

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

void BtBitfieldMessageValidator::validate()
{
Expand Down
2 changes: 1 addition & 1 deletion src/BtCheckIntegrityEntry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ BtCheckIntegrityEntry::BtCheckIntegrityEntry(RequestGroup* requestGroup)
{
}

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

void BtCheckIntegrityEntry::onDownloadIncomplete(
std::vector<std::unique_ptr<Command>>& commands, DownloadEngine* e)
Expand Down
2 changes: 1 addition & 1 deletion src/BtDependency.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ BtDependency::BtDependency(RequestGroup* dependant,
{
}

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

namespace {
void copyValues(const std::shared_ptr<FileEntry>& d,
Expand Down
2 changes: 1 addition & 1 deletion src/BtFileAllocationEntry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ BtFileAllocationEntry::BtFileAllocationEntry(RequestGroup* requestGroup)
{
}

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

void BtFileAllocationEntry::prepareForNextAction(
std::vector<std::unique_ptr<Command>>& commands, DownloadEngine* e)
Expand Down
2 changes: 1 addition & 1 deletion src/BtHandshakeMessage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
2 changes: 1 addition & 1 deletion src/BtHandshakeMessageValidator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ BtHandshakeMessageValidator::BtHandshakeMessageValidator(
memcpy(infoHash_, infoHash, sizeof(infoHash_));
}

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

void BtHandshakeMessageValidator::validate()
{
Expand Down
2 changes: 1 addition & 1 deletion src/BtInteractive.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class BtHandshakeMessage;

class BtInteractive {
public:
virtual ~BtInteractive() {}
virtual ~BtInteractive() = default;

virtual void initiateHandshake() = 0;

Expand Down
2 changes: 1 addition & 1 deletion src/BtInterestedMessage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ BtInterestedMessage::BtInterestedMessage()
{
}

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

std::unique_ptr<BtInterestedMessage>
BtInterestedMessage::create(const unsigned char* data, size_t dataLength)
Expand Down
10 changes: 3 additions & 7 deletions src/BtLeecherStateChoke.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ BtLeecherStateChoke::BtLeecherStateChoke()
{
}

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

BtLeecherStateChoke::PeerEntry::PeerEntry(const std::shared_ptr<Peer>& peer)
: peer_(peer),
Expand All @@ -63,11 +63,7 @@ BtLeecherStateChoke::PeerEntry::PeerEntry(const std::shared_ptr<Peer>& peer)
}

BtLeecherStateChoke::PeerEntry::PeerEntry(const PeerEntry& c)
: peer_(c.peer_),
downloadSpeed_(c.downloadSpeed_),
regularUnchoker_(c.regularUnchoker_)
{
}
= default;

void BtLeecherStateChoke::PeerEntry::swap(PeerEntry& c)
{
Expand All @@ -88,7 +84,7 @@ operator=(const PeerEntry& c)
return *this;
}

BtLeecherStateChoke::PeerEntry::~PeerEntry() {}
BtLeecherStateChoke::PeerEntry::~PeerEntry() = default;

const std::shared_ptr<Peer>& BtLeecherStateChoke::PeerEntry::getPeer() const
{
Expand Down
2 changes: 1 addition & 1 deletion src/BtMessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class BtMessage {
public:
BtMessage(uint8_t id) : id_(id) {}

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

virtual bool isInvalidate() = 0;

Expand Down
2 changes: 1 addition & 1 deletion src/BtMessageDispatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class BtMessage;

class BtMessageDispatcher {
public:
virtual ~BtMessageDispatcher() {}
virtual ~BtMessageDispatcher() = default;

virtual void addMessageToQueue(std::unique_ptr<BtMessage> btMessage) = 0;

Expand Down
2 changes: 1 addition & 1 deletion src/BtMessageFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class Piece;

class BtMessageFactory {
public:
virtual ~BtMessageFactory() {}
virtual ~BtMessageFactory() = default;

virtual std::unique_ptr<BtMessage> createBtMessage(const unsigned char* msg,
size_t msgLength) = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/BtMessageReceiver.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class BtHandshakeMessage;

class BtMessageReceiver {
public:
virtual ~BtMessageReceiver() {}
virtual ~BtMessageReceiver() = default;

virtual std::unique_ptr<BtHandshakeMessage>
receiveHandshake(bool quickReply = false) = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/BtMessageValidator.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ namespace aria2 {

class BtMessageValidator {
public:
virtual ~BtMessageValidator() {}
virtual ~BtMessageValidator() = default;

// Throws RecoverableException on error.
virtual void validate() = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/BtNotInterestedMessage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ BtNotInterestedMessage::BtNotInterestedMessage()
{
}

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

std::unique_ptr<BtNotInterestedMessage>
BtNotInterestedMessage::create(const unsigned char* data, size_t dataLength)
Expand Down
2 changes: 1 addition & 1 deletion src/BtPieceMessage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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; }

Expand Down
2 changes: 1 addition & 1 deletion src/BtPieceMessageValidator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ BtPieceMessageValidator::BtPieceMessageValidator(const BtPieceMessage* message,
{
}

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

void BtPieceMessageValidator::validate()
{
Expand Down
2 changes: 1 addition & 1 deletion src/BtProgressInfoFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ namespace aria2 {

class BtProgressInfoFile {
public:
virtual ~BtProgressInfoFile() {}
virtual ~BtProgressInfoFile() = default;

virtual std::string getFilename() = 0;

Expand Down
2 changes: 1 addition & 1 deletion src/BtRequestFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class BtRequestMessage;

class BtRequestFactory {
public:
virtual ~BtRequestFactory() {}
virtual ~BtRequestFactory() = default;

virtual void addTargetPiece(const std::shared_ptr<Piece>& piece) = 0;

Expand Down
Loading

0 comments on commit 366e2e8

Please sign in to comment.