[clang-tidy] use default member init
Found with modernize-use-default-member-init Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
parent
d2115e908a
commit
7fe49cf24d
@ -31,11 +31,11 @@
|
||||
#include <map>
|
||||
|
||||
struct SearchStats {
|
||||
unsigned n_songs;
|
||||
unsigned n_songs{0};
|
||||
std::chrono::duration<std::uint64_t, SongTime::period> total_duration;
|
||||
|
||||
constexpr SearchStats()
|
||||
:n_songs(0), total_duration(0) {}
|
||||
: total_duration(0) {}
|
||||
};
|
||||
|
||||
class TagCountMap : public std::map<std::string, SearchStats> {
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
||||
};
|
||||
|
||||
|
@ -57,9 +57,9 @@ ParsePls(TextInputStream &is, std::forward_list<DetachedSong> &songs)
|
||||
|
||||
struct Entry {
|
||||
std::string file, title;
|
||||
int length;
|
||||
int length{-1};
|
||||
|
||||
Entry():length(-1) {}
|
||||
Entry() = default;
|
||||
};
|
||||
|
||||
static constexpr unsigned MAX_ENTRIES = 65536;
|
||||
|
@ -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
|
||||
|
@ -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];
|
||||
|
Loading…
Reference in New Issue
Block a user