diff options
author | Max Kellermann <max@musicpd.org> | 2018-01-17 12:16:21 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2018-01-17 12:16:21 +0100 |
commit | c4f7740b800c49ad119e5d70335ea51a666e0114 (patch) | |
tree | 337e94b6cb8121b8aa48407c5cf981ae36708310 | |
parent | 6c239f7a006f265af0fc675d8026447757c45257 (diff) |
fs/Path: replace method Null() with nullptr_t constructor
-rw-r--r-- | src/decoder/DecoderThread.cxx | 2 | ||||
-rw-r--r-- | src/fs/Path.hxx | 16 | ||||
-rw-r--r-- | test/run_input.cxx | 2 |
3 files changed, 9 insertions, 11 deletions
diff --git a/src/decoder/DecoderThread.cxx b/src/decoder/DecoderThread.cxx index 39c6460a2..715db8e88 100644 --- a/src/decoder/DecoderThread.cxx +++ b/src/decoder/DecoderThread.cxx @@ -498,7 +498,7 @@ try { const char *const uri_utf8 = song.GetRealURI(); - Path path_fs = Path::Null(); + Path path_fs = nullptr; AllocatedPath path_buffer = AllocatedPath::Null(); if (PathTraitsUTF8::IsAbsolute(uri_utf8)) { path_buffer = AllocatedPath::FromUTF8Throw(uri_utf8); diff --git a/src/fs/Path.hxx b/src/fs/Path.hxx index 8e3eefb09..2e7393eab 100644 --- a/src/fs/Path.hxx +++ b/src/fs/Path.hxx @@ -43,19 +43,17 @@ class Path : public PathTraitsFS::Pointer { public: /** - * Copy a #Path object. - */ - constexpr Path(const Path &) = default; - - /** - * Return a "nulled" instance. Its IsNull() method will + * Construct a "nulled" instance. Its IsNull() method will * return true. Such an object must not be used. * * @see IsNull() */ - static constexpr Path Null() { - return Path(nullptr); - } + constexpr Path(std::nullptr_t):Base(nullptr) {} + + /** + * Copy a #Path object. + */ + constexpr Path(const Path &) = default; /** * Create a new instance pointing to the specified path diff --git a/test/run_input.cxx b/test/run_input.cxx index 3c4dadbf7..5fc8a8211 100644 --- a/test/run_input.cxx +++ b/test/run_input.cxx @@ -45,7 +45,7 @@ struct CommandLine { const char *uri = nullptr; - Path config_path = Path::Null(); + Path config_path = nullptr; }; enum Option { |