summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2017-01-18 13:13:36 +0100
committerMax Kellermann <max@musicpd.org>2017-01-18 13:13:36 +0100
commit97ae594375b3e0b1e03aa6e4d224cb8cdf8b6f84 (patch)
treed2890202cfe97c68acbe72218a3453ec48fc97b5
parent3f321ae9a05a88b6b036b6bd845d5b60b586ceb3 (diff)
DetachedSong: use C++11 initializers
-rw-r--r--src/DetachedSong.hxx22
1 files changed, 7 insertions, 15 deletions
diff --git a/src/DetachedSong.hxx b/src/DetachedSong.hxx
index c33112443..083cad610 100644
--- a/src/DetachedSong.hxx
+++ b/src/DetachedSong.hxx
@@ -63,18 +63,18 @@ class DetachedSong {
Tag tag;
- time_t mtime;
+ time_t mtime = 0;
/**
* Start of this sub-song within the file.
*/
- SongTime start_time;
+ SongTime start_time = SongTime::zero();
/**
* End of this sub-song within the file.
* Unused if zero.
*/
- SongTime end_time;
+ SongTime end_time = SongTime::zero();
explicit DetachedSong(const LightSong &other);
@@ -82,26 +82,18 @@ public:
explicit DetachedSong(const DetachedSong &) = default;
explicit DetachedSong(const char *_uri)
- :uri(_uri),
- mtime(0),
- start_time(SongTime::zero()), end_time(SongTime::zero()) {}
+ :uri(_uri) {}
explicit DetachedSong(const std::string &_uri)
- :uri(_uri),
- mtime(0),
- start_time(SongTime::zero()), end_time(SongTime::zero()) {}
+ :uri(_uri) {}
explicit DetachedSong(std::string &&_uri)
- :uri(std::move(_uri)),
- mtime(0),
- start_time(SongTime::zero()), end_time(SongTime::zero()) {}
+ :uri(std::move(_uri)) {}
template<typename U>
DetachedSong(U &&_uri, Tag &&_tag)
:uri(std::forward<U>(_uri)),
- tag(std::move(_tag)),
- mtime(0),
- start_time(SongTime::zero()), end_time(SongTime::zero()) {}
+ tag(std::move(_tag)) {}
DetachedSong(DetachedSong &&) = default;