clang-tidy: init members by default (#1110)

Found with modernize-use-default-member-init

Signed-off-by: Rosen Penev <[email protected]>
This commit is contained in:
Rosen Penev
2023-08-30 16:26:14 +02:00
committed by GitHub
parent 4a86489186
commit cdc87aec10
70 changed files with 360 additions and 759 deletions
+8 -16
View File
@@ -47,15 +47,7 @@ namespace
class MPC::File::FilePrivate
{
public:
FilePrivate() :
APELocation(-1),
APESize(0),
ID3v1Location(-1),
ID3v2Header(nullptr),
ID3v2Location(-1),
ID3v2Size(0),
properties(nullptr) {}
FilePrivate() = default;
~FilePrivate()
{
delete ID3v2Header;
@@ -65,18 +57,18 @@ public:
FilePrivate(const FilePrivate &) = delete;
FilePrivate &operator=(const FilePrivate &) = delete;
offset_t APELocation;
long APESize;
offset_t APELocation { -1 };
long APESize { 0 };
offset_t ID3v1Location;
offset_t ID3v1Location { -1 };
ID3v2::Header *ID3v2Header;
offset_t ID3v2Location;
long ID3v2Size;
ID3v2::Header *ID3v2Header { nullptr };
offset_t ID3v2Location { -1 };
long ID3v2Size { 0 };
TagUnion tag;
Properties *properties;
Properties *properties { nullptr };
};
////////////////////////////////////////////////////////////////////////////////
+11 -24
View File
@@ -38,30 +38,17 @@ using namespace TagLib;
class MPC::Properties::PropertiesPrivate
{
public:
PropertiesPrivate() :
version(0),
length(0),
bitrate(0),
sampleRate(0),
channels(0),
totalFrames(0),
sampleFrames(0),
trackGain(0),
trackPeak(0),
albumGain(0),
albumPeak(0) {}
int version;
int length;
int bitrate;
int sampleRate;
int channels;
unsigned int totalFrames;
unsigned int sampleFrames;
int trackGain;
int trackPeak;
int albumGain;
int albumPeak;
int version { 0 };
int length { 0 };
int bitrate { 0 };
int sampleRate { 0 };
int channels { 0 };
unsigned int totalFrames { 0 };
unsigned int sampleFrames { 0 };
int trackGain { 0 };
int trackPeak { 0 };
int albumGain { 0 };
int albumPeak { 0 };
};
////////////////////////////////////////////////////////////////////////////////