From 54c6e9ae01a8aaf5c8ceea9ab8c8c773b70af248 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Wed, 18 May 2022 18:18:15 -0700 Subject: [PATCH] clang-tidy: default init variables Found with modernize-use-default-member-init Signed-off-by: Rosen Penev --- matroska/KaxBlock.h | 6 +++--- matroska/KaxBlockData.h | 8 ++++---- matroska/KaxCluster.h | 12 ++++++------ matroska/KaxTracks.h | 2 +- src/KaxBlock.cpp | 2 -- src/KaxBlockData.cpp | 6 ------ src/KaxCluster.cpp | 6 ------ src/KaxTracks.cpp | 1 - 8 files changed, 14 insertions(+), 29 deletions(-) diff --git a/matroska/KaxBlock.h b/matroska/KaxBlock.h index f87d0c6..bb2275a 100644 --- a/matroska/KaxBlock.h +++ b/matroska/KaxBlock.h @@ -201,8 +201,8 @@ DECLARE_MKX_MASTER(KaxBlockGroup) const KaxCluster *GetParentCluster() const { return ParentCluster; } protected: - KaxCluster * ParentCluster; - const KaxTrackEntry * ParentTrack; + KaxCluster * ParentCluster{nullptr}; + const KaxTrackEntry * ParentTrack{nullptr}; }; class MATROSKA_DLL_API KaxInternalBlock : public EbmlBinary { @@ -376,7 +376,7 @@ DECLARE_MKX_BINARY_CONS(KaxBlockVirtual) uint16 TrackNumber; binary DataBlock[5]; - const KaxCluster * ParentCluster; + const KaxCluster * ParentCluster{nullptr}; }; END_LIBMATROSKA_NAMESPACE diff --git a/matroska/KaxBlockData.h b/matroska/KaxBlockData.h index c8e86b3..eb977ce 100644 --- a/matroska/KaxBlockData.h +++ b/matroska/KaxBlockData.h @@ -62,10 +62,10 @@ DECLARE_MKX_SINTEGER_CONS(KaxReferenceBlock) void SetReferencedTimecode(int64 refTimecode) {*static_cast(this) = refTimecode; bTimecodeSet = true;}; protected: - const KaxBlockBlob * RefdBlock; - const KaxBlockGroup * ParentBlock; - bool bTimecodeSet; - bool bOurBlob; + const KaxBlockBlob * RefdBlock{nullptr}; + const KaxBlockGroup * ParentBlock{nullptr}; + bool bTimecodeSet{false}; + bool bOurBlob{false}; void FreeBlob(); }; diff --git a/matroska/KaxCluster.h b/matroska/KaxCluster.h index 274cd9e..7fa5047 100644 --- a/matroska/KaxCluster.h +++ b/matroska/KaxCluster.h @@ -137,16 +137,16 @@ DECLARE_MKX_MASTER_CONS(KaxCluster) protected: KaxBlockBlob * currentNewBlob; std::vector Blobs; - KaxBlockGroup * currentNewBlock; - const KaxSegment * ParentSegment; + KaxBlockGroup * currentNewBlock{nullptr}; + const KaxSegment * ParentSegment{nullptr}; uint64 MinTimecode, MaxTimecode, PreviousTimecode; int64 TimecodeScale; - bool bFirstFrameInside; // used to speed research - bool bPreviousTimecodeIsSet; - bool bTimecodeScaleIsSet; - bool bSilentTracksUsed; + bool bFirstFrameInside{false}; // used to speed research + bool bPreviousTimecodeIsSet{false}; + bool bTimecodeScaleIsSet{false}; + bool bSilentTracksUsed{false}; /*! \note method used internally diff --git a/matroska/KaxTracks.h b/matroska/KaxTracks.h index d820bce..cbe5db3 100644 --- a/matroska/KaxTracks.h +++ b/matroska/KaxTracks.h @@ -69,7 +69,7 @@ DECLARE_MKX_MASTER(KaxTrackEntry) } protected: - bool bGlobalTimecodeScaleIsSet; + bool bGlobalTimecodeScaleIsSet{false}; uint64 mGlobalTimecodeScale; }; diff --git a/src/KaxBlock.cpp b/src/KaxBlock.cpp index 44bdf30..ace92d4 100644 --- a/src/KaxBlock.cpp +++ b/src/KaxBlock.cpp @@ -101,8 +101,6 @@ KaxInternalBlock::KaxInternalBlock(const KaxInternalBlock & ElementToClone) KaxBlockGroup::KaxBlockGroup(EBML_EXTRA_DEF) :EbmlMaster(EBML_CLASS_SEMCONTEXT(KaxBlockGroup) EBML_DEF_SEP EBML_EXTRA_CALL) - ,ParentCluster(nullptr) - ,ParentTrack(nullptr) {} /*! diff --git a/src/KaxBlockData.cpp b/src/KaxBlockData.cpp index f17ed00..de9b93f 100644 --- a/src/KaxBlockData.cpp +++ b/src/KaxBlockData.cpp @@ -51,19 +51,13 @@ const KaxBlockBlob & KaxReferenceBlock::RefBlock() const KaxReferenceBlock::KaxReferenceBlock(EBML_EXTRA_DEF) :EBML_DEF_SINTEGER(KaxReferenceBlock)EBML_DEF_SEP RefdBlock(nullptr) - ,ParentBlock(nullptr) - ,bTimecodeSet(false) - ,bOurBlob(false) { bTimecodeSet = false; } KaxReferenceBlock::KaxReferenceBlock(const KaxReferenceBlock & ElementToClone) :EbmlSInteger(ElementToClone) - ,RefdBlock(nullptr) - ,ParentBlock(nullptr) ,bTimecodeSet(ElementToClone.bTimecodeSet) - ,bOurBlob(false) { } diff --git a/src/KaxCluster.cpp b/src/KaxCluster.cpp index e8b61a5..0a7a91e 100644 --- a/src/KaxCluster.cpp +++ b/src/KaxCluster.cpp @@ -41,12 +41,6 @@ START_LIBMATROSKA_NAMESPACE KaxCluster::KaxCluster(EBML_EXTRA_DEF) :EbmlMaster(EBML_CLASS_SEMCONTEXT(KaxCluster) EBML_DEF_SEP EBML_EXTRA_CALL) - ,currentNewBlock(nullptr) - ,ParentSegment(nullptr) - ,bFirstFrameInside(false) - ,bPreviousTimecodeIsSet(false) - ,bTimecodeScaleIsSet(false) - ,bSilentTracksUsed(false) {} KaxCluster::KaxCluster(const KaxCluster & ElementToClone) diff --git a/src/KaxTracks.cpp b/src/KaxTracks.cpp index 85a1baa..bc18eff 100644 --- a/src/KaxTracks.cpp +++ b/src/KaxTracks.cpp @@ -42,7 +42,6 @@ START_LIBMATROSKA_NAMESPACE KaxTrackEntry::KaxTrackEntry(EBML_EXTRA_DEF) :EbmlMaster(EBML_CLASS_SEMCONTEXT(KaxTrackEntry) EBML_DEF_SEP EBML_EXTRA_CALL) - ,bGlobalTimecodeScaleIsSet(false) {} void KaxTrackEntry::EnableLacing(bool bEnable) -- 2.40.0