From b6d84c0160d2db509a2b7fe1644f693ade14122b Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 19 Aug 2013 23:50:58 +0900 Subject: [PATCH] Use nullptr for std::shared_ptr and unique_ptr default parameter --- src/AbstractCommand.h | 5 ++--- src/ChunkedDecodingStreamFilter.h | 2 +- src/GZipDecodingStreamFilter.h | 2 +- src/HttpResponseCommand.cc | 4 ++-- src/RequestSlot.h | 2 +- src/StreamFilter.h | 3 +-- 6 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/AbstractCommand.h b/src/AbstractCommand.h index fd85980d..23fb4950 100644 --- a/src/AbstractCommand.h +++ b/src/AbstractCommand.h @@ -238,9 +238,8 @@ public: (cuid_t cuid, const std::shared_ptr& req, const std::shared_ptr& fileEntry, RequestGroup* requestGroup, DownloadEngine* e, - const std::shared_ptr& s = std::shared_ptr(), - const std::shared_ptr& socketRecvBuffer - = std::shared_ptr(), + const std::shared_ptr& s = nullptr, + const std::shared_ptr& socketRecvBuffer = nullptr, bool incNumConnection = true); virtual ~AbstractCommand(); diff --git a/src/ChunkedDecodingStreamFilter.h b/src/ChunkedDecodingStreamFilter.h index 7a40f584..10c4abfa 100644 --- a/src/ChunkedDecodingStreamFilter.h +++ b/src/ChunkedDecodingStreamFilter.h @@ -47,7 +47,7 @@ private: size_t bytesProcessed_; public: ChunkedDecodingStreamFilter - (std::unique_ptr delegate = std::unique_ptr{}); + (std::unique_ptr delegate = nullptr); virtual ~ChunkedDecodingStreamFilter(); diff --git a/src/GZipDecodingStreamFilter.h b/src/GZipDecodingStreamFilter.h index fca170ea..259379e4 100644 --- a/src/GZipDecodingStreamFilter.h +++ b/src/GZipDecodingStreamFilter.h @@ -52,7 +52,7 @@ private: static const size_t OUTBUF_LENGTH = 16*1024; public: GZipDecodingStreamFilter - (std::unique_ptr delegate = std::unique_ptr{}); + (std::unique_ptr delegate = nullptr); virtual ~GZipDecodingStreamFilter(); diff --git a/src/HttpResponseCommand.cc b/src/HttpResponseCommand.cc index 4b232d42..bf62f014 100644 --- a/src/HttpResponseCommand.cc +++ b/src/HttpResponseCommand.cc @@ -86,7 +86,7 @@ namespace aria2 { namespace { std::unique_ptr getTransferEncodingStreamFilter (HttpResponse* httpResponse, - std::unique_ptr delegate = std::unique_ptr{}) + std::unique_ptr delegate = nullptr) { if(httpResponse->isTransferEncodingSpecified()) { auto filter = httpResponse->getTransferEncodingStreamFilter(); @@ -106,7 +106,7 @@ std::unique_ptr getTransferEncodingStreamFilter namespace { std::unique_ptr getContentEncodingStreamFilter (HttpResponse* httpResponse, - std::unique_ptr delegate = std::unique_ptr{}) + std::unique_ptr delegate = nullptr) { if(httpResponse->isContentEncodingSpecified()) { auto filter = httpResponse->getContentEncodingStreamFilter(); diff --git a/src/RequestSlot.h b/src/RequestSlot.h index 3a2f901f..2208d26f 100644 --- a/src/RequestSlot.h +++ b/src/RequestSlot.h @@ -45,7 +45,7 @@ namespace aria2 { class RequestSlot { public: RequestSlot(size_t index, int32_t begin, int32_t length, size_t blockIndex, - const std::shared_ptr& piece = std::shared_ptr()) + const std::shared_ptr& piece = nullptr) : dispatchedTime_(global::wallclock()), index_(index), begin_(begin), length_(length), blockIndex_(blockIndex), piece_(piece) diff --git a/src/StreamFilter.h b/src/StreamFilter.h index 32b0498b..62a93c23 100644 --- a/src/StreamFilter.h +++ b/src/StreamFilter.h @@ -50,8 +50,7 @@ class StreamFilter { private: std::unique_ptr delegate_; public: - StreamFilter - (std::unique_ptr delegate = std::unique_ptr{}); + StreamFilter(std::unique_ptr delegate = nullptr); virtual ~StreamFilter();