diff --git a/src/db/Count.cxx b/src/db/Count.cxx index 4a7779c7c..a2e7f3b55 100644 --- a/src/db/Count.cxx +++ b/src/db/Count.cxx @@ -31,11 +31,11 @@ #include struct SearchStats { - unsigned n_songs; + unsigned n_songs{0}; std::chrono::duration total_duration; constexpr SearchStats() - :n_songs(0), total_duration(0) {} + : total_duration(0) {} }; class TagCountMap : public std::map { diff --git a/src/db/plugins/simple/SimpleDatabasePlugin.cxx b/src/db/plugins/simple/SimpleDatabasePlugin.cxx index 4cd1ea892..634268954 100644 --- a/src/db/plugins/simple/SimpleDatabasePlugin.cxx +++ b/src/db/plugins/simple/SimpleDatabasePlugin.cxx @@ -79,8 +79,8 @@ inline SimpleDatabase::SimpleDatabase(AllocatedPath &&_path, #ifdef ENABLE_ZLIB compress(_compress), #endif - cache_path(nullptr), - prefixed_light_song(nullptr) { + cache_path(nullptr) +{ } DatabasePtr diff --git a/src/fs/StandardDirectory.cxx b/src/fs/StandardDirectory.cxx index 6a7cdfd9f..d5e51e2f7 100644 --- a/src/fs/StandardDirectory.cxx +++ b/src/fs/StandardDirectory.cxx @@ -56,9 +56,9 @@ class PasswdEntry passwd pw; #endif - passwd *result; + passwd *result{nullptr}; public: - PasswdEntry() : result(nullptr) { } + PasswdEntry() = default; bool ReadByName(const char *name) { #ifdef HAVE_GETPWNAM_R diff --git a/src/playlist/plugins/AsxPlaylistPlugin.cxx b/src/playlist/plugins/AsxPlaylistPlugin.cxx index b4eeba8df..55fb8e262 100644 --- a/src/playlist/plugins/AsxPlaylistPlugin.cxx +++ b/src/playlist/plugins/AsxPlaylistPlugin.cxx @@ -40,7 +40,7 @@ struct AsxParser { */ enum { ROOT, ENTRY, - } state; + } state{ROOT}; /** * The current tag within the "entry" element. This is only @@ -56,8 +56,7 @@ struct AsxParser { TagBuilder tag_builder; - AsxParser() - :state(ROOT) {} + AsxParser() = default; }; diff --git a/src/playlist/plugins/PlsPlaylistPlugin.cxx b/src/playlist/plugins/PlsPlaylistPlugin.cxx index 0fc272739..8c0e0295b 100644 --- a/src/playlist/plugins/PlsPlaylistPlugin.cxx +++ b/src/playlist/plugins/PlsPlaylistPlugin.cxx @@ -57,9 +57,9 @@ ParsePls(TextInputStream &is, std::forward_list &songs) struct Entry { std::string file, title; - int length; + int length{-1}; - Entry():length(-1) {} + Entry() = default; }; static constexpr unsigned MAX_ENTRIES = 65536; diff --git a/src/playlist/plugins/RssPlaylistPlugin.cxx b/src/playlist/plugins/RssPlaylistPlugin.cxx index 0c0f66e1b..8295b05b0 100644 --- a/src/playlist/plugins/RssPlaylistPlugin.cxx +++ b/src/playlist/plugins/RssPlaylistPlugin.cxx @@ -40,7 +40,7 @@ struct RssParser { */ enum { ROOT, ITEM, - } state; + } state{ROOT}; /** * The current tag within the "entry" element. This is only @@ -57,8 +57,7 @@ struct RssParser { TagBuilder tag_builder; - RssParser() - :state(ROOT) {} + RssParser() = default; }; static void XMLCALL diff --git a/src/tag/Tag.cxx b/src/tag/Tag.cxx index f3a580a11..bf0be78b9 100644 --- a/src/tag/Tag.cxx +++ b/src/tag/Tag.cxx @@ -42,8 +42,7 @@ Tag::Clear() noexcept Tag::Tag(const Tag &other) noexcept :duration(other.duration), has_playlist(other.has_playlist), - num_items(other.num_items), - items(nullptr) + num_items(other.num_items) { if (num_items > 0) { items = new TagItem *[num_items];