Use nullptr for std::shared_ptr and unique_ptr default parameter

pull/119/head
Tatsuhiro Tsujikawa 2013-08-19 23:50:58 +09:00
parent 5ba7150333
commit b6d84c0160
6 changed files with 8 additions and 10 deletions

View File

@ -238,9 +238,8 @@ public:
(cuid_t cuid, const std::shared_ptr<Request>& req,
const std::shared_ptr<FileEntry>& fileEntry,
RequestGroup* requestGroup, DownloadEngine* e,
const std::shared_ptr<SocketCore>& s = std::shared_ptr<SocketCore>(),
const std::shared_ptr<SocketRecvBuffer>& socketRecvBuffer
= std::shared_ptr<SocketRecvBuffer>(),
const std::shared_ptr<SocketCore>& s = nullptr,
const std::shared_ptr<SocketRecvBuffer>& socketRecvBuffer = nullptr,
bool incNumConnection = true);
virtual ~AbstractCommand();

View File

@ -47,7 +47,7 @@ private:
size_t bytesProcessed_;
public:
ChunkedDecodingStreamFilter
(std::unique_ptr<StreamFilter> delegate = std::unique_ptr<StreamFilter>{});
(std::unique_ptr<StreamFilter> delegate = nullptr);
virtual ~ChunkedDecodingStreamFilter();

View File

@ -52,7 +52,7 @@ private:
static const size_t OUTBUF_LENGTH = 16*1024;
public:
GZipDecodingStreamFilter
(std::unique_ptr<StreamFilter> delegate = std::unique_ptr<StreamFilter>{});
(std::unique_ptr<StreamFilter> delegate = nullptr);
virtual ~GZipDecodingStreamFilter();

View File

@ -86,7 +86,7 @@ namespace aria2 {
namespace {
std::unique_ptr<StreamFilter> getTransferEncodingStreamFilter
(HttpResponse* httpResponse,
std::unique_ptr<StreamFilter> delegate = std::unique_ptr<StreamFilter>{})
std::unique_ptr<StreamFilter> delegate = nullptr)
{
if(httpResponse->isTransferEncodingSpecified()) {
auto filter = httpResponse->getTransferEncodingStreamFilter();
@ -106,7 +106,7 @@ std::unique_ptr<StreamFilter> getTransferEncodingStreamFilter
namespace {
std::unique_ptr<StreamFilter> getContentEncodingStreamFilter
(HttpResponse* httpResponse,
std::unique_ptr<StreamFilter> delegate = std::unique_ptr<StreamFilter>{})
std::unique_ptr<StreamFilter> delegate = nullptr)
{
if(httpResponse->isContentEncodingSpecified()) {
auto filter = httpResponse->getContentEncodingStreamFilter();

View File

@ -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>& piece = std::shared_ptr<Piece>())
const std::shared_ptr<Piece>& piece = nullptr)
: dispatchedTime_(global::wallclock()),
index_(index), begin_(begin), length_(length), blockIndex_(blockIndex),
piece_(piece)

View File

@ -50,8 +50,7 @@ class StreamFilter {
private:
std::unique_ptr<StreamFilter> delegate_;
public:
StreamFilter
(std::unique_ptr<StreamFilter> delegate = std::unique_ptr<StreamFilter>{});
StreamFilter(std::unique_ptr<StreamFilter> delegate = nullptr);
virtual ~StreamFilter();