From: Rosen Penev Date: Fri, 22 May 2020 23:51:16 +0000 (-0700) Subject: [clang-tidy] use auto X-Git-Tag: release-1.6.0~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0462cd13995add39fe7954a9029592142dd44720;p=libmatroska [clang-tidy] use auto Found with modernize-use-auto Signed-off-by: Rosen Penev --- diff --git a/src/KaxBlock.cpp b/src/KaxBlock.cpp index 9e59a0b..1825781 100644 --- a/src/KaxBlock.cpp +++ b/src/KaxBlock.cpp @@ -48,11 +48,11 @@ START_LIBMATROSKA_NAMESPACE DataBuffer * DataBuffer::Clone() { - binary *ClonedData = (binary *)malloc(mySize * sizeof(binary)); + auto ClonedData = (binary *)malloc(mySize * sizeof(binary)); assert(ClonedData != nullptr); memcpy(ClonedData, myBuffer ,mySize ); - SimpleDataBuffer * result = new SimpleDataBuffer(ClonedData, mySize, 0); + auto result = new SimpleDataBuffer(ClonedData, mySize, 0); result->bValidValue = bValidValue; return result; } @@ -85,8 +85,8 @@ KaxInternalBlock::KaxInternalBlock(const KaxInternalBlock & ElementToClone) ,ParentCluster(ElementToClone.ParentCluster) ///< \todo not exactly { // add a clone of the list - std::vector::const_iterator Itr = ElementToClone.myBuffers.begin(); - std::vector::iterator myItr = myBuffers.begin(); + auto Itr = ElementToClone.myBuffers.begin(); + auto myItr = myBuffers.begin(); while (Itr != ElementToClone.myBuffers.end()) { *myItr = (*Itr)->Clone(); ++Itr; ++myItr; @@ -492,7 +492,7 @@ filepos_t KaxInternalBlock::ReadData(IOCallback & input, ScopeMode ReadFully) // put all Frames in the list if (mLacing == LACING_NONE) { FirstFrameLocation += Mem.GetPosition(); - DataBuffer * soloFrame = new DataBuffer(BufferStart + Mem.GetPosition(), GetSize() - BlockHeadSize); + auto soloFrame = new DataBuffer(BufferStart + Mem.GetPosition(), GetSize() - BlockHeadSize); myBuffers.push_back(soloFrame); SizeList.resize(1); SizeList[0] = GetSize() - BlockHeadSize; @@ -559,7 +559,7 @@ filepos_t KaxInternalBlock::ReadData(IOCallback & input, ScopeMode ReadFully) FirstFrameLocation += Mem.GetPosition(); for (Index=0; Index<=FrameNum; Index++) { - DataBuffer * lacedFrame = new DataBuffer(BufferStart + Mem.GetPosition(), SizeList[Index]); + auto lacedFrame = new DataBuffer(BufferStart + Mem.GetPosition(), SizeList[Index]); myBuffers.push_back(lacedFrame); Mem.Skip(SizeList[Index]); } @@ -724,7 +724,7 @@ filepos_t KaxInternalBlock::ReadData(IOCallback & input, ScopeMode ReadFully) bool KaxBlockGroup::AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, LacingType lacing) { - KaxBlock & theBlock = GetChild(*this); + auto & theBlock = GetChild(*this); assert(ParentCluster != nullptr); theBlock.SetParent(*ParentCluster); ParentTrack = &track; @@ -735,13 +735,13 @@ bool KaxBlockGroup::AddFrame(const KaxTrackEntry & track, uint64 timecode, DataB { // assert(past_timecode < 0); - KaxBlock & theBlock = GetChild(*this); + auto & theBlock = GetChild(*this); assert(ParentCluster != nullptr); theBlock.SetParent(*ParentCluster); ParentTrack = &track; bool bRes = theBlock.AddFrame(track, timecode, buffer, lacing); - KaxReferenceBlock & thePastRef = GetChild(*this); + auto & thePastRef = GetChild(*this); thePastRef.SetReferencedBlock(PastBlock); thePastRef.SetParentBlock(*this); @@ -754,17 +754,17 @@ bool KaxBlockGroup::AddFrame(const KaxTrackEntry & track, uint64 timecode, DataB // assert(forw_timecode > 0); - KaxBlock & theBlock = GetChild(*this); + auto & theBlock = GetChild(*this); assert(ParentCluster != nullptr); theBlock.SetParent(*ParentCluster); ParentTrack = &track; bool bRes = theBlock.AddFrame(track, timecode, buffer, lacing); - KaxReferenceBlock & thePastRef = GetChild(*this); + auto & thePastRef = GetChild(*this); thePastRef.SetReferencedBlock(PastBlock); thePastRef.SetParentBlock(*this); - KaxReferenceBlock & theFutureRef = AddNewChild(*this); + auto & theFutureRef = AddNewChild(*this); theFutureRef.SetReferencedBlock(ForwBlock); theFutureRef.SetParentBlock(*this); @@ -773,20 +773,20 @@ bool KaxBlockGroup::AddFrame(const KaxTrackEntry & track, uint64 timecode, DataB bool KaxBlockGroup::AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, const KaxBlockBlob * PastBlock, const KaxBlockBlob * ForwBlock, LacingType lacing) { - KaxBlock & theBlock = GetChild(*this); + auto & theBlock = GetChild(*this); assert(ParentCluster != nullptr); theBlock.SetParent(*ParentCluster); ParentTrack = &track; bool bRes = theBlock.AddFrame(track, timecode, buffer, lacing); if (PastBlock != nullptr) { - KaxReferenceBlock & thePastRef = GetChild(*this); + auto & thePastRef = GetChild(*this); thePastRef.SetReferencedBlock(PastBlock); thePastRef.SetParentBlock(*this); } if (ForwBlock != nullptr) { - KaxReferenceBlock & theFutureRef = AddNewChild(*this); + auto & theFutureRef = AddNewChild(*this); theFutureRef.SetReferencedBlock(ForwBlock); theFutureRef.SetParentBlock(*this); } @@ -826,7 +826,7 @@ uint64 KaxInternalBlock::ClusterPosition() const unsigned int KaxBlockGroup::ReferenceCount() const { unsigned int Result = 0; - KaxReferenceBlock * MyBlockAdds = static_cast(FindFirstElt(EBML_INFO(KaxReferenceBlock))); + auto MyBlockAdds = static_cast(FindFirstElt(EBML_INFO(KaxReferenceBlock))); if (MyBlockAdds != nullptr) { Result++; while ((MyBlockAdds = static_cast(FindNextElt(*MyBlockAdds))) != nullptr) { @@ -838,7 +838,7 @@ unsigned int KaxBlockGroup::ReferenceCount() const const KaxReferenceBlock & KaxBlockGroup::Reference(unsigned int Index) const { - KaxReferenceBlock * MyBlockAdds = static_cast(FindFirstElt(EBML_INFO(KaxReferenceBlock))); + auto MyBlockAdds = static_cast(FindFirstElt(EBML_INFO(KaxReferenceBlock))); assert(MyBlockAdds != nullptr); // call of a non existing reference while (Index != 0) { @@ -878,7 +878,7 @@ void KaxBlockGroup::SetBlockDuration(uint64 TimeLength) bool KaxBlockGroup::GetBlockDuration(uint64 &TheTimecode) const { - KaxBlockDuration * myDuration = static_cast(FindElt(EBML_INFO(KaxBlockDuration))); + auto myDuration = static_cast(FindElt(EBML_INFO(KaxBlockDuration))); if (myDuration == nullptr) { return false; } @@ -889,13 +889,13 @@ bool KaxBlockGroup::GetBlockDuration(uint64 &TheTimecode) const } KaxBlockGroup::operator KaxInternalBlock &() { - KaxBlock & theBlock = GetChild(*this); + auto & theBlock = GetChild(*this); return theBlock; } void KaxBlockGroup::SetParent(KaxCluster & aParentCluster) { ParentCluster = &aParentCluster; - KaxBlock & theBlock = GetChild(*this); + auto & theBlock = GetChild(*this); theBlock.SetParent( aParentCluster ); } diff --git a/src/KaxBlockData.cpp b/src/KaxBlockData.cpp index cdaee0d..f17ed00 100644 --- a/src/KaxBlockData.cpp +++ b/src/KaxBlockData.cpp @@ -104,7 +104,7 @@ void KaxReferenceBlock::SetReferencedBlock(const KaxBlockBlob * aRefdBlock) void KaxReferenceBlock::SetReferencedBlock(const KaxBlockGroup & aRefdBlock) { FreeBlob(); - KaxBlockBlob *block_blob = new KaxBlockBlob(BLOCK_BLOB_NO_SIMPLE); + auto block_blob = new KaxBlockBlob(BLOCK_BLOB_NO_SIMPLE); block_blob->SetBlockGroup(*const_cast(&aRefdBlock)); RefdBlock = block_blob; bOurBlob = true; diff --git a/src/KaxCluster.cpp b/src/KaxCluster.cpp index d934954..b371ca2 100644 --- a/src/KaxCluster.cpp +++ b/src/KaxCluster.cpp @@ -54,7 +54,7 @@ KaxCluster::KaxCluster(const KaxCluster & ElementToClone) ,bSilentTracksUsed(ElementToClone.bSilentTracksUsed) { // update the parent of each children - EBML_MASTER_ITERATOR Itr = begin(); + auto Itr = begin(); while (Itr != end()) { if (EbmlId(**Itr) == EBML_ID(KaxBlockGroup)) { static_cast(*Itr)->SetParent(*this); @@ -152,7 +152,7 @@ filepos_t KaxCluster::Render(IOCallback & output, KaxCues & CueToUpdate, bool bS EBML_MASTER_ITERATOR TrkItr, Itr; // update the Timecode of the Cluster before writing - KaxClusterTimecode * Timecode = static_cast(this->FindElt(EBML_INFO(KaxClusterTimecode))); + auto Timecode = static_cast(this->FindElt(EBML_INFO(KaxClusterTimecode))); *static_cast(Timecode) = GlobalTimecode() / GlobalTimecodeScale(); if (Blobs.empty()) { @@ -175,9 +175,9 @@ filepos_t KaxCluster::Render(IOCallback & output, KaxCues & CueToUpdate, bool bS } // the track wasn't found in this cluster if (Itr == end()) { - KaxClusterSilentTracks * SilentTracks = static_cast(this->FindFirstElt(EBML_INFO(KaxClusterSilentTracks))); + auto SilentTracks = static_cast(this->FindFirstElt(EBML_INFO(KaxClusterSilentTracks))); assert(SilentTracks != nullptr); // the flag bSilentTracksUsed should be set when creating the Cluster - KaxClusterSilentTrackNumber * trackelt = static_cast(SilentTracks->AddNewElt(EBML_INFO(KaxClusterSilentTrackNumber))); + auto trackelt = static_cast(SilentTracks->AddNewElt(EBML_INFO(KaxClusterSilentTrackNumber))); *static_cast(trackelt) = tracknum; } } @@ -215,9 +215,9 @@ filepos_t KaxCluster::Render(IOCallback & output, KaxCues & CueToUpdate, bool bS } // the track wasn't found in this cluster if (Index == ListSize()) { - KaxClusterSilentTracks * SilentTracks = static_cast(this->FindFirstElt(EBML_INFO(KaxClusterSilentTracks))); + auto SilentTracks = static_cast(this->FindFirstElt(EBML_INFO(KaxClusterSilentTracks))); assert(SilentTracks != nullptr); // the flag bSilentTracksUsed should be set when creating the Cluster - KaxClusterSilentTrackNumber * trackelt = static_cast(SilentTracks->AddNewElt(EBML_INFO(KaxClusterSilentTrackNumber))); + auto trackelt = static_cast(SilentTracks->AddNewElt(EBML_INFO(KaxClusterSilentTrackNumber))); *static_cast(trackelt) = tracknum; } } @@ -265,7 +265,7 @@ int16 KaxCluster::GetBlockLocalTimecode(uint64 aGlobalTimecode) const uint64 KaxCluster::GetBlockGlobalTimecode(int16 LocalTimecode) { if (!bFirstFrameInside) { - KaxClusterTimecode * Timecode = static_cast(this->FindElt(EBML_INFO(KaxClusterTimecode))); + auto Timecode = static_cast(this->FindElt(EBML_INFO(KaxClusterTimecode))); assert (bFirstFrameInside); // use the InitTimecode() hack for now MinTimecode = MaxTimecode = PreviousTimecode = *static_cast(Timecode); bFirstFrameInside = true; @@ -276,7 +276,7 @@ uint64 KaxCluster::GetBlockGlobalTimecode(int16 LocalTimecode) KaxBlockGroup & KaxCluster::GetNewBlock() { - KaxBlockGroup & MyBlock = AddNewChild(*this); + auto & MyBlock = AddNewChild(*this); MyBlock.SetParent(*this); return MyBlock; } diff --git a/src/KaxCues.cpp b/src/KaxCues.cpp index f9f00b5..0fd1e54 100644 --- a/src/KaxCues.cpp +++ b/src/KaxCues.cpp @@ -85,7 +85,7 @@ void KaxCues::PositionSet(const KaxBlockBlob & BlockReference) for (ListIdx = myTempReferences.begin(); ListIdx != myTempReferences.end(); ++ListIdx) { if (*ListIdx == &BlockReference) { // found, now add the element to the entry list - KaxCuePoint & NewPoint = AddNewChild(*this); + auto & NewPoint = AddNewChild(*this); NewPoint.PositionSet(BlockReference, GlobalTimecodeScale()); myTempReferences.erase(ListIdx); break; @@ -103,7 +103,7 @@ void KaxCues::PositionSet(const KaxBlockGroup & BlockRef) if (refTmp.GlobalTimecode() == BlockRef.GlobalTimecode() && refTmp.TrackNum() == BlockRef.TrackNumber()) { // found, now add the element to the entry list - KaxCuePoint & NewPoint = AddNewChild(*this); + auto & NewPoint = AddNewChild(*this); NewPoint.PositionSet(**ListIdx, GlobalTimecodeScale()); myTempReferences.erase(ListIdx); break; @@ -124,11 +124,11 @@ const KaxCuePoint * KaxCues::GetTimecodePoint(uint64 aTimecode) const EBML_MASTER_CONST_ITERATOR Itr; for (Itr = begin(); Itr != end(); ++Itr) { if (EbmlId(*(*Itr)) == EBML_ID(KaxCuePoint)) { - const KaxCuePoint *tmp = static_cast(*Itr); + auto tmp = static_cast(*Itr); // check the tile - const KaxCueTime *aTime = static_cast(tmp->FindFirstElt(EBML_INFO(KaxCueTime))); + auto aTime = static_cast(tmp->FindFirstElt(EBML_INFO(KaxCueTime))); if (aTime != nullptr) { - uint64 _Time = uint64(*aTime); + auto _Time = uint64(*aTime); if (_Time > aPrevTime && _Time < TimecodeToLocate) { aPrevTime = _Time; aPointPrev = tmp; diff --git a/src/KaxCuesData.cpp b/src/KaxCuesData.cpp index 400d08c..adcc0dd 100644 --- a/src/KaxCuesData.cpp +++ b/src/KaxCuesData.cpp @@ -50,28 +50,28 @@ START_LIBMATROSKA_NAMESPACE void KaxCuePoint::PositionSet(const KaxBlockGroup & BlockReference, uint64 GlobalTimecodeScale) { // fill me - KaxCueTime & NewTime = GetChild(*this); + auto & NewTime = GetChild(*this); *static_cast(&NewTime) = BlockReference.GlobalTimecode() / GlobalTimecodeScale; - KaxCueTrackPositions & NewPositions = AddNewChild(*this); - KaxCueTrack & TheTrack = GetChild(NewPositions); + auto & NewPositions = AddNewChild(*this); + auto & TheTrack = GetChild(NewPositions); *static_cast(&TheTrack) = BlockReference.TrackNumber(); - KaxCueClusterPosition & TheClustPos = GetChild(NewPositions); + auto & TheClustPos = GetChild(NewPositions); *static_cast(&TheClustPos) = BlockReference.ClusterPosition(); // handle reference use if (BlockReference.ReferenceCount() != 0) { unsigned int i; for (i=0; i(NewPositions); + auto & NewRefs = AddNewChild(NewPositions); NewRefs.AddReference(BlockReference.Reference(i).RefBlock(), GlobalTimecodeScale); } } - KaxCodecState *CodecState = static_cast(BlockReference.FindFirstElt(EBML_INFO(KaxCodecState))); + auto CodecState = static_cast(BlockReference.FindFirstElt(EBML_INFO(KaxCodecState))); if (CodecState != nullptr) { - KaxCueCodecState &CueCodecState = AddNewChild(NewPositions); + auto &CueCodecState = AddNewChild(NewPositions); *static_cast(&CueCodecState) = BlockReference.GetParentCluster()->GetParentSegment()->GetRelativePosition(CodecState->GetElementPosition()); } @@ -83,14 +83,14 @@ void KaxCuePoint::PositionSet(const KaxBlockBlob & BlobReference, uint64 GlobalT const KaxInternalBlock &BlockReference = BlobReference; // fill me - KaxCueTime & NewTime = GetChild(*this); + auto & NewTime = GetChild(*this); *static_cast(&NewTime) = BlockReference.GlobalTimecode() / GlobalTimecodeScale; - KaxCueTrackPositions & NewPositions = AddNewChild(*this); - KaxCueTrack & TheTrack = GetChild(NewPositions); + auto & NewPositions = AddNewChild(*this); + auto & TheTrack = GetChild(NewPositions); *static_cast(&TheTrack) = BlockReference.TrackNum(); - KaxCueClusterPosition & TheClustPos = GetChild(NewPositions); + auto & TheClustPos = GetChild(NewPositions); *static_cast(&TheClustPos) = BlockReference.ClusterPosition(); #if 0 // MATROSKA_VERSION >= 2 @@ -108,7 +108,7 @@ void KaxCuePoint::PositionSet(const KaxBlockBlob & BlobReference, uint64 GlobalT const KaxBlockGroup &BlockGroup = BlobReference; const KaxCodecState *CodecState = static_cast(BlockGroup.FindFirstElt(EBML_INFO(KaxCodecState))); if (CodecState != nullptr) { - KaxCueCodecState &CueCodecState = AddNewChild(NewPositions); + auto &CueCodecState = AddNewChild(NewPositions); *static_cast(&CueCodecState) = BlockGroup.GetParentCluster()->GetParentSegment()->GetRelativePosition(CodecState->GetElementPosition()); } } @@ -122,10 +122,10 @@ void KaxCuePoint::PositionSet(const KaxBlockBlob & BlobReference, uint64 GlobalT void KaxCueReference::AddReference(const KaxBlockBlob & BlockReference, uint64 GlobalTimecodeScale) { const KaxInternalBlock & theBlock = BlockReference; - KaxCueRefTime & NewTime = GetChild(*this); + auto & NewTime = GetChild(*this); *static_cast(&NewTime) = theBlock.GlobalTimecode() / GlobalTimecodeScale; - KaxCueRefCluster & TheClustPos = GetChild(*this); + auto & TheClustPos = GetChild(*this); *static_cast(&TheClustPos) = theBlock.ClusterPosition(); #ifdef OLD @@ -147,11 +147,11 @@ bool KaxCuePoint::IsSmallerThan(const EbmlElement * Cmp) const const KaxCuePoint & theCmp = *static_cast(Cmp); // compare timecode - const KaxCueTime * TimeCodeA = static_cast(FindElt(EBML_INFO(KaxCueTime))); + auto TimeCodeA = static_cast(FindElt(EBML_INFO(KaxCueTime))); if (TimeCodeA == nullptr) return false; - const KaxCueTime * TimeCodeB = static_cast(theCmp.FindElt(EBML_INFO(KaxCueTime))); + auto TimeCodeB = static_cast(theCmp.FindElt(EBML_INFO(KaxCueTime))); if (TimeCodeB == nullptr) return false; @@ -162,11 +162,11 @@ bool KaxCuePoint::IsSmallerThan(const EbmlElement * Cmp) const return false; // compare tracks (timecodes are equal) - const KaxCueTrack * TrackA = static_cast(FindElt(EBML_INFO(KaxCueTrack))); + auto TrackA = static_cast(FindElt(EBML_INFO(KaxCueTrack))); if (TrackA == nullptr) return false; - const KaxCueTrack * TrackB = static_cast(theCmp.FindElt(EBML_INFO(KaxCueTrack))); + auto TrackB = static_cast(theCmp.FindElt(EBML_INFO(KaxCueTrack))); if (TrackB == nullptr) return false; @@ -181,7 +181,7 @@ bool KaxCuePoint::IsSmallerThan(const EbmlElement * Cmp) const bool KaxCuePoint::Timecode(uint64 & aTimecode, uint64 GlobalTimecodeScale) const { - const KaxCueTime *aTime = static_cast(FindFirstElt(EBML_INFO(KaxCueTime))); + auto aTime = static_cast(FindFirstElt(EBML_INFO(KaxCueTime))); if (aTime == nullptr) return false; aTimecode = uint64(*aTime) * GlobalTimecodeScale; @@ -196,9 +196,9 @@ const KaxCueTrackPositions * KaxCuePoint::GetSeekPosition() const const KaxCueTrackPositions * result = nullptr; uint64 aPosition = EBML_PRETTYLONGINT(0xFFFFFFFFFFFFFFF); // find the position of the "earlier" Cluster - const KaxCueTrackPositions *aPoss = static_cast(FindFirstElt(EBML_INFO(KaxCueTrackPositions))); + auto aPoss = static_cast(FindFirstElt(EBML_INFO(KaxCueTrackPositions))); while (aPoss != nullptr) { - const KaxCueClusterPosition *aPos = static_cast(aPoss->FindFirstElt(EBML_INFO(KaxCueClusterPosition))); + auto aPos = static_cast(aPoss->FindFirstElt(EBML_INFO(KaxCueClusterPosition))); if (aPos != nullptr && uint64(*aPos) < aPosition) { aPosition = uint64(*aPos); result = aPoss; @@ -211,7 +211,7 @@ const KaxCueTrackPositions * KaxCuePoint::GetSeekPosition() const uint64 KaxCueTrackPositions::ClusterPosition() const { - const KaxCueClusterPosition *aPos = static_cast(FindFirstElt(EBML_INFO(KaxCueClusterPosition))); + auto aPos = static_cast(FindFirstElt(EBML_INFO(KaxCueClusterPosition))); if (aPos == nullptr) return 0; @@ -220,7 +220,7 @@ uint64 KaxCueTrackPositions::ClusterPosition() const uint16 KaxCueTrackPositions::TrackNumber() const { - const KaxCueTrack *aTrack = static_cast(FindFirstElt(EBML_INFO(KaxCueTrack))); + auto aTrack = static_cast(FindFirstElt(EBML_INFO(KaxCueTrack))); if (aTrack == nullptr) return 0; diff --git a/src/KaxSeekHead.cpp b/src/KaxSeekHead.cpp index 4cf9b37..f1ed42d 100644 --- a/src/KaxSeekHead.cpp +++ b/src/KaxSeekHead.cpp @@ -49,13 +49,13 @@ START_LIBMATROSKA_NAMESPACE void KaxSeekHead::IndexThis(const EbmlElement & aElt, const KaxSegment & ParentSegment) { // create a new point - KaxSeek & aNewPoint = AddNewChild(*this); + auto & aNewPoint = AddNewChild(*this); // add the informations to this element - KaxSeekPosition & aNewPos = GetChild(aNewPoint); + auto & aNewPos = GetChild(aNewPoint); *static_cast(&aNewPos) = ParentSegment.GetRelativePosition(aElt); - KaxSeekID & aNewID = GetChild(aNewPoint); + auto & aNewID = GetChild(aNewPoint); binary ID[4]; ((const EbmlId&)aElt).Fill(ID); aNewID.CopyBuffer(ID, EBML_ID_LENGTH((const EbmlId&)aElt)); @@ -64,7 +64,7 @@ void KaxSeekHead::IndexThis(const EbmlElement & aElt, const KaxSegment & ParentS KaxSeek * KaxSeekHead::FindFirstOf(const EbmlCallbacks & Callbacks) const { // parse all the Entries and find the first to match the type - KaxSeek * aElt = static_cast(FindFirstElt(EBML_INFO(KaxSeek))); + auto aElt = static_cast(FindFirstElt(EBML_INFO(KaxSeek))); while (aElt != nullptr) { KaxSeekID * aId = nullptr; EBML_MASTER_ITERATOR Itr; @@ -111,7 +111,7 @@ KaxSeek * KaxSeekHead::FindNextOf(const KaxSeek &aPrev) const int64 KaxSeek::Location() const { - KaxSeekPosition *aPos = static_cast(FindFirstElt(EBML_INFO(KaxSeekPosition))); + auto aPos = static_cast(FindFirstElt(EBML_INFO(KaxSeekPosition))); if (aPos == nullptr) return 0; return uint64(*aPos); @@ -119,7 +119,7 @@ int64 KaxSeek::Location() const bool KaxSeek::IsEbmlId(const EbmlId & aId) const { - KaxSeekID *_Id = static_cast(FindFirstElt(EBML_INFO(KaxSeekID))); + auto _Id = static_cast(FindFirstElt(EBML_INFO(KaxSeekID))); if (_Id == nullptr) return false; EbmlId aEbmlId(_Id->GetBuffer(), _Id->GetSize()); @@ -128,10 +128,10 @@ bool KaxSeek::IsEbmlId(const EbmlId & aId) const bool KaxSeek::IsEbmlId(const KaxSeek & aPoint) const { - KaxSeekID *_IdA = static_cast(FindFirstElt(EBML_INFO(KaxSeekID))); + auto _IdA = static_cast(FindFirstElt(EBML_INFO(KaxSeekID))); if (_IdA == nullptr) return false; - KaxSeekID *_IdB = static_cast(aPoint.FindFirstElt(EBML_INFO(KaxSeekID))); + auto _IdB = static_cast(aPoint.FindFirstElt(EBML_INFO(KaxSeekID))); if (_IdB == nullptr) return false; EbmlId aEbmlIdA(_IdA->GetBuffer(), _IdA->GetSize()); diff --git a/src/KaxSegment.cpp b/src/KaxSegment.cpp index d364c57..ce960ac 100644 --- a/src/KaxSegment.cpp +++ b/src/KaxSegment.cpp @@ -56,7 +56,7 @@ KaxSegment::KaxSegment(const KaxSegment & ElementToClone) :EbmlMaster(ElementToClone) { // update the parent of each children - EBML_MASTER_ITERATOR Itr = begin(); + auto Itr = begin(); while (Itr != end()) { if (EbmlId(**Itr) == EBML_ID(KaxCluster)) { static_cast(*Itr)->SetParent(*this); diff --git a/src/KaxTracks.cpp b/src/KaxTracks.cpp index d56a824..85a1baa 100644 --- a/src/KaxTracks.cpp +++ b/src/KaxTracks.cpp @@ -47,7 +47,7 @@ KaxTrackEntry::KaxTrackEntry(EBML_EXTRA_DEF) void KaxTrackEntry::EnableLacing(bool bEnable) { - KaxTrackFlagLacing & myLacing = GetChild(*this); + auto & myLacing = GetChild(*this); *(static_cast(&myLacing)) = bEnable ? 1 : 0; }