]> granicus.if.org Git - libmatroska/commitdiff
[clang-tidy] use nullptr
authorRosen Penev <rosenp@gmail.com>
Fri, 22 May 2020 23:45:31 +0000 (16:45 -0700)
committerMoritz Bunkus <moritz@bunkus.org>
Mon, 22 Jun 2020 08:47:59 +0000 (10:47 +0200)
Found with modernize-use-nullptr

Signed-off-by: Rosen Penev <rosenp@gmail.com>
src/KaxBlock.cpp
src/KaxBlockData.cpp
src/KaxCluster.cpp
src/KaxCues.cpp
src/KaxCuesData.cpp
src/KaxSeekHead.cpp

index 981ea10cc5902f7555a040b6e71ed8b2eae915cf..9e59a0b017dd0dff568430037292818a2fa78bfb 100644 (file)
@@ -49,7 +49,7 @@ START_LIBMATROSKA_NAMESPACE
 DataBuffer * DataBuffer::Clone()
 {
   binary *ClonedData = (binary *)malloc(mySize * sizeof(binary));
-  assert(ClonedData != NULL);
+  assert(ClonedData != nullptr);
   memcpy(ClonedData, myBuffer ,mySize );
 
   SimpleDataBuffer * result = new SimpleDataBuffer(ClonedData, mySize, 0);
@@ -60,7 +60,7 @@ DataBuffer * DataBuffer::Clone()
 SimpleDataBuffer::SimpleDataBuffer(const SimpleDataBuffer & ToClone)
   :DataBuffer((binary *)malloc(ToClone.mySize * sizeof(binary)), ToClone.mySize, myFreeBuffer)
 {
-  assert(myBuffer != NULL);
+  assert(myBuffer != nullptr);
   memcpy(myBuffer, ToClone.myBuffer ,mySize );
   bValidValue = ToClone.bValidValue;
 }
@@ -101,8 +101,8 @@ KaxBlockGroup::~KaxBlockGroup()
 
 KaxBlockGroup::KaxBlockGroup(EBML_EXTRA_DEF)
   :EbmlMaster(EBML_CLASS_SEMCONTEXT(KaxBlockGroup) EBML_DEF_SEP EBML_EXTRA_CALL)
-  ,ParentCluster(NULL)
-  ,ParentTrack(NULL)
+  ,ParentCluster(nullptr)
+  ,ParentTrack(nullptr)
 {}
 
 /*!
@@ -166,7 +166,7 @@ LacingType KaxInternalBlock::GetBestLacingType() const {
 filepos_t KaxInternalBlock::UpdateSize(bool /* bSaveDefault */, bool /* bForceRender */)
 {
   LacingType LacingHere;
-  assert(EbmlBinary::GetBuffer() == NULL); // Data is not used for KaxInternalBlock
+  assert(EbmlBinary::GetBuffer() == nullptr); // Data is not used for KaxInternalBlock
   assert(TrackNumber < 0x4000); // no more allowed for the moment
   unsigned int i;
 
@@ -227,7 +227,7 @@ KaxBlockVirtual::KaxBlockVirtual(const KaxBlockVirtual & ElementToClone)
 }
 
 KaxBlockVirtual::KaxBlockVirtual(EBML_EXTRA_DEF)
-  :EBML_DEF_BINARY(KaxBlockVirtual)EBML_DEF_SEP ParentCluster(NULL)
+  :EBML_DEF_BINARY(KaxBlockVirtual)EBML_DEF_SEP ParentCluster(nullptr)
 {
   SetBuffer(DataBlock,sizeof(DataBlock));
   SetValueIsSet(false);
@@ -236,7 +236,7 @@ KaxBlockVirtual::KaxBlockVirtual(EBML_EXTRA_DEF)
 KaxBlockVirtual::~KaxBlockVirtual()
 {
   if(GetBuffer() == DataBlock)
-    SetBuffer( NULL, 0 );
+    SetBuffer( nullptr, 0 );
 }
 
 filepos_t KaxBlockVirtual::UpdateSize(bool /* bSaveDefault */, bool /* bForceRender */)
@@ -253,7 +253,7 @@ filepos_t KaxBlockVirtual::UpdateSize(bool /* bSaveDefault */, bool /* bForceRen
     *cursor++ = TrackNumber & 0xFF;
   }
 
-  assert(ParentCluster != NULL);
+  assert(ParentCluster != nullptr);
   int16 ActualTimecode = ParentCluster->GetBlockLocalTimecode(Timecode);
   big_int16 b16(ActualTimecode);
   b16.Fill(cursor);
@@ -296,7 +296,7 @@ filepos_t KaxInternalBlock::RenderData(IOCallback & output, bool /* bForceRender
       *cursor++ = TrackNumber & 0xFF;
     }
 
-    assert(ParentCluster != NULL);
+    assert(ParentCluster != nullptr);
     int16 ActualTimecode = ParentCluster->GetBlockLocalTimecode(Timecode);
     big_int16 b16(ActualTimecode);
     b16.Fill(cursor);
@@ -433,7 +433,7 @@ uint64 KaxInternalBlock::ReadInternalHead(IOCallback & input)
 
   big_int16 b16;
   b16.Eval(cursor);
-  assert(ParentCluster != NULL);
+  assert(ParentCluster != nullptr);
   Timecode = ParentCluster->GetBlockGlobalTimecode(int16(b16));
   bLocalTimecodeUsed = false;
   cursor += 2;
@@ -725,7 +725,7 @@ filepos_t KaxInternalBlock::ReadData(IOCallback & input, ScopeMode ReadFully)
 bool KaxBlockGroup::AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, LacingType lacing)
 {
   KaxBlock & theBlock = GetChild<KaxBlock>(*this);
-  assert(ParentCluster != NULL);
+  assert(ParentCluster != nullptr);
   theBlock.SetParent(*ParentCluster);
   ParentTrack = &track;
   return theBlock.AddFrame(track, timecode, buffer, lacing);
@@ -736,7 +736,7 @@ bool KaxBlockGroup::AddFrame(const KaxTrackEntry & track, uint64 timecode, DataB
   //  assert(past_timecode < 0);
 
   KaxBlock & theBlock = GetChild<KaxBlock>(*this);
-  assert(ParentCluster != NULL);
+  assert(ParentCluster != nullptr);
   theBlock.SetParent(*ParentCluster);
   ParentTrack = &track;
   bool bRes = theBlock.AddFrame(track, timecode, buffer, lacing);
@@ -755,7 +755,7 @@ bool KaxBlockGroup::AddFrame(const KaxTrackEntry & track, uint64 timecode, DataB
   //  assert(forw_timecode > 0);
 
   KaxBlock & theBlock = GetChild<KaxBlock>(*this);
-  assert(ParentCluster != NULL);
+  assert(ParentCluster != nullptr);
   theBlock.SetParent(*ParentCluster);
   ParentTrack = &track;
   bool bRes = theBlock.AddFrame(track, timecode, buffer, lacing);
@@ -774,18 +774,18 @@ 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<KaxBlock>(*this);
-  assert(ParentCluster != NULL);
+  assert(ParentCluster != nullptr);
   theBlock.SetParent(*ParentCluster);
   ParentTrack = &track;
   bool bRes = theBlock.AddFrame(track, timecode, buffer, lacing);
 
-  if (PastBlock != NULL) {
+  if (PastBlock != nullptr) {
     KaxReferenceBlock & thePastRef = GetChild<KaxReferenceBlock>(*this);
     thePastRef.SetReferencedBlock(PastBlock);
     thePastRef.SetParentBlock(*this);
   }
 
-  if (ForwBlock != NULL) {
+  if (ForwBlock != nullptr) {
     KaxReferenceBlock & theFutureRef = AddNewChild<KaxReferenceBlock>(*this);
     theFutureRef.SetReferencedBlock(ForwBlock);
     theFutureRef.SetParentBlock(*this);
@@ -799,7 +799,7 @@ bool KaxBlockGroup::AddFrame(const KaxTrackEntry & track, uint64 timecode, DataB
 */
 uint64 KaxBlockGroup::GlobalTimecode() const
 {
-  assert(ParentCluster != NULL); // impossible otherwise
+  assert(ParentCluster != nullptr); // impossible otherwise
   KaxInternalBlock & MyBlock = *static_cast<KaxBlock *>(this->FindElt(EBML_INFO(KaxBlock)));
   return MyBlock.GlobalTimecode();
 
@@ -813,13 +813,13 @@ uint16 KaxBlockGroup::TrackNumber() const
 
 uint64 KaxBlockGroup::ClusterPosition() const
 {
-  assert(ParentCluster != NULL); // impossible otherwise
+  assert(ParentCluster != nullptr); // impossible otherwise
   return ParentCluster->GetPosition();
 }
 
 uint64 KaxInternalBlock::ClusterPosition() const
 {
-  assert(ParentCluster != NULL); // impossible otherwise
+  assert(ParentCluster != nullptr); // impossible otherwise
   return ParentCluster->GetPosition();
 }
 
@@ -827,9 +827,9 @@ unsigned int KaxBlockGroup::ReferenceCount() const
 {
   unsigned int Result = 0;
   KaxReferenceBlock * MyBlockAdds = static_cast<KaxReferenceBlock *>(FindFirstElt(EBML_INFO(KaxReferenceBlock)));
-  if (MyBlockAdds != NULL) {
+  if (MyBlockAdds != nullptr) {
     Result++;
-    while ((MyBlockAdds = static_cast<KaxReferenceBlock *>(FindNextElt(*MyBlockAdds))) != NULL) {
+    while ((MyBlockAdds = static_cast<KaxReferenceBlock *>(FindNextElt(*MyBlockAdds))) != nullptr) {
       Result++;
     }
   }
@@ -839,11 +839,11 @@ unsigned int KaxBlockGroup::ReferenceCount() const
 const KaxReferenceBlock & KaxBlockGroup::Reference(unsigned int Index) const
 {
   KaxReferenceBlock * MyBlockAdds = static_cast<KaxReferenceBlock *>(FindFirstElt(EBML_INFO(KaxReferenceBlock)));
-  assert(MyBlockAdds != NULL); // call of a non existing reference
+  assert(MyBlockAdds != nullptr); // call of a non existing reference
 
   while (Index != 0) {
     MyBlockAdds = static_cast<KaxReferenceBlock *>(FindNextElt(*MyBlockAdds));
-    assert(MyBlockAdds != NULL);
+    assert(MyBlockAdds != nullptr);
     Index--;
   }
   return *MyBlockAdds;
@@ -860,17 +860,17 @@ void KaxInternalBlock::ReleaseFrames()
   // free the allocated Frames
   int i;
   for (i=myBuffers.size()-1; i>=0; i--) {
-    if (myBuffers[i] != NULL) {
+    if (myBuffers[i] != nullptr) {
       myBuffers[i]->FreeBuffer(*myBuffers[i]);
       delete myBuffers[i];
-      myBuffers[i] = NULL;
+      myBuffers[i] = nullptr;
     }
   }
 }
 
 void KaxBlockGroup::SetBlockDuration(uint64 TimeLength)
 {
-  assert(ParentTrack != NULL);
+  assert(ParentTrack != nullptr);
   int64 scale = ParentTrack->GlobalTimecodeScale();
   KaxBlockDuration & myDuration = *static_cast<KaxBlockDuration *>(FindFirstElt(EBML_INFO(KaxBlockDuration), true));
   *(static_cast<EbmlUInteger *>(&myDuration)) = TimeLength / uint64(scale);
@@ -879,11 +879,11 @@ void KaxBlockGroup::SetBlockDuration(uint64 TimeLength)
 bool KaxBlockGroup::GetBlockDuration(uint64 &TheTimecode) const
 {
   KaxBlockDuration * myDuration = static_cast<KaxBlockDuration *>(FindElt(EBML_INFO(KaxBlockDuration)));
-  if (myDuration == NULL) {
+  if (myDuration == nullptr) {
     return false;
   }
 
-  assert(ParentTrack != NULL);
+  assert(ParentTrack != nullptr);
   TheTimecode = uint64(*myDuration) * ParentTrack->GlobalTimecodeScale();
   return true;
 }
@@ -979,21 +979,21 @@ KaxBlockBlob::operator KaxSimpleBlock &()
 bool KaxBlockBlob::AddFrameAuto(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, LacingType lacing, const KaxBlockBlob * PastBlock, const KaxBlockBlob * ForwBlock)
 {
   bool bResult = false;
-  if ((SimpleBlockMode == BLOCK_BLOB_ALWAYS_SIMPLE) || (SimpleBlockMode == BLOCK_BLOB_SIMPLE_AUTO && PastBlock == NULL && ForwBlock == NULL)) {
+  if ((SimpleBlockMode == BLOCK_BLOB_ALWAYS_SIMPLE) || (SimpleBlockMode == BLOCK_BLOB_SIMPLE_AUTO && PastBlock == nullptr && ForwBlock == nullptr)) {
     assert(bUseSimpleBlock == true);
-    if (Block.simpleblock == NULL) {
+    if (Block.simpleblock == nullptr) {
       Block.simpleblock = new KaxSimpleBlock();
       Block.simpleblock->SetParent(*ParentCluster);
     }
 
     bResult = Block.simpleblock->AddFrame(track, timecode, buffer, lacing);
-    if (PastBlock == NULL && ForwBlock == NULL) {
+    if (PastBlock == nullptr && ForwBlock == nullptr) {
       Block.simpleblock->SetKeyframe(true);
       Block.simpleblock->SetDiscardable(false);
     } else {
       Block.simpleblock->SetKeyframe(false);
-      if ((ForwBlock == NULL || ((const KaxInternalBlock &)*ForwBlock).GlobalTimecode() <= timecode) &&
-          (PastBlock == NULL || ((const KaxInternalBlock &)*PastBlock).GlobalTimecode() <= timecode))
+      if ((ForwBlock == nullptr || ((const KaxInternalBlock &)*ForwBlock).GlobalTimecode() <= timecode) &&
+          (PastBlock == nullptr || ((const KaxInternalBlock &)*PastBlock).GlobalTimecode() <= timecode))
         Block.simpleblock->SetDiscardable(false);
       else
         Block.simpleblock->SetDiscardable(true);
@@ -1023,13 +1023,13 @@ bool KaxBlockBlob::ReplaceSimpleByGroup()
     return false;
 
   if (!bUseSimpleBlock) {
-    if (Block.group == NULL) {
+    if (Block.group == nullptr) {
       Block.group = new KaxBlockGroup();
     }
   }
   else {
 
-    if (Block.simpleblock != NULL) {
+    if (Block.simpleblock != nullptr) {
       KaxSimpleBlock *old_simpleblock = Block.simpleblock;
       Block.group = new KaxBlockGroup();
       // _TODO_ : move all the data to the blockgroup
@@ -1040,7 +1040,7 @@ bool KaxBlockBlob::ReplaceSimpleByGroup()
       Block.group = new KaxBlockGroup();
     }
   }
-  if (ParentCluster != NULL)
+  if (ParentCluster != nullptr)
     Block.group->SetParent(*ParentCluster);
 
   bUseSimpleBlock = false;
index 9589713928db399208d8773cbda7fa6029a85cb3..cdaee0d9428f6846ad37dd5c4c8d03b8c01fdd10 100644 (file)
@@ -44,14 +44,14 @@ START_LIBMATROSKA_NAMESPACE
 
 const KaxBlockBlob & KaxReferenceBlock::RefBlock() const
 {
-  assert(RefdBlock != NULL);
+  assert(RefdBlock != nullptr);
   return *RefdBlock;
 }
 
 KaxReferenceBlock::KaxReferenceBlock(EBML_EXTRA_DEF)
   :EBML_DEF_SINTEGER(KaxReferenceBlock)EBML_DEF_SEP
-  RefdBlock(NULL)
-  ,ParentBlock(NULL)
+  RefdBlock(nullptr)
+  ,ParentBlock(nullptr)
   ,bTimecodeSet(false)
   ,bOurBlob(false)
 {
@@ -60,8 +60,8 @@ KaxReferenceBlock::KaxReferenceBlock(EBML_EXTRA_DEF)
 
 KaxReferenceBlock::KaxReferenceBlock(const KaxReferenceBlock & ElementToClone)
   :EbmlSInteger(ElementToClone)
-  ,RefdBlock(NULL)
-  ,ParentBlock(NULL)
+  ,RefdBlock(nullptr)
+  ,ParentBlock(nullptr)
   ,bTimecodeSet(ElementToClone.bTimecodeSet)
   ,bOurBlob(false)
 {
@@ -74,16 +74,16 @@ KaxReferenceBlock::~KaxReferenceBlock()
 
 void KaxReferenceBlock::FreeBlob()
 {
-  if (bOurBlob && RefdBlock!=NULL)
+  if (bOurBlob && RefdBlock!=nullptr)
     delete RefdBlock;
-  RefdBlock = NULL;
+  RefdBlock = nullptr;
 }
 
 filepos_t KaxReferenceBlock::UpdateSize(bool bSaveDefault, bool bForceRender)
 {
   if (!bTimecodeSet) {
-    assert(RefdBlock != NULL);
-    assert(ParentBlock != NULL);
+    assert(RefdBlock != nullptr);
+    assert(ParentBlock != nullptr);
 
     const KaxInternalBlock &block = *RefdBlock;
     *static_cast<EbmlSInteger*>(this) = (int64(block.GlobalTimecode()) - int64(ParentBlock->GlobalTimecode())) / int64(ParentBlock->GlobalTimecodeScale());
@@ -93,8 +93,8 @@ filepos_t KaxReferenceBlock::UpdateSize(bool bSaveDefault, bool bForceRender)
 
 void KaxReferenceBlock::SetReferencedBlock(const KaxBlockBlob * aRefdBlock)
 {
-  assert(RefdBlock == NULL);
-  assert(aRefdBlock != NULL);
+  assert(RefdBlock == nullptr);
+  assert(aRefdBlock != nullptr);
   FreeBlob();
   RefdBlock = aRefdBlock;
   bOurBlob = true;
index 36fd05d79bf91ce3bfdfb99913f53fb076671274..d934954975b14ac19e015ca675f8d99f076b0ead 100644 (file)
@@ -41,8 +41,8 @@ START_LIBMATROSKA_NAMESPACE
 
 KaxCluster::KaxCluster(EBML_EXTRA_DEF)
   :EbmlMaster(EBML_CLASS_SEMCONTEXT(KaxCluster) EBML_DEF_SEP EBML_EXTRA_CALL)
-  ,currentNewBlock(NULL)
-  ,ParentSegment(NULL)
+  ,currentNewBlock(nullptr)
+  ,ParentSegment(nullptr)
   ,bFirstFrameInside(false)
   ,bPreviousTimecodeIsSet(false)
   ,bTimecodeScaleIsSet(false)
@@ -85,33 +85,33 @@ bool KaxCluster::AddFrameInternal(const KaxTrackEntry & track, uint64 timecode,
       MaxTimecode = timecode;
   }
 
-  MyNewBlock = NULL;
+  MyNewBlock = nullptr;
 
   if (lacing == LACING_NONE || !track.LacingEnabled()) {
-    currentNewBlock = NULL;
+    currentNewBlock = nullptr;
   }
 
   // force creation of a new block
-  if (currentNewBlock == NULL || uint32(track.TrackNumber()) != uint32(currentNewBlock->TrackNumber()) || PastBlock != NULL || ForwBlock != NULL) {
+  if (currentNewBlock == nullptr || uint32(track.TrackNumber()) != uint32(currentNewBlock->TrackNumber()) || PastBlock != nullptr || ForwBlock != nullptr) {
     KaxBlockGroup & aNewBlock = GetNewBlock();
     MyNewBlock = currentNewBlock = &aNewBlock;
   }
 
-  if (PastBlock != NULL) {
-    if (ForwBlock != NULL) {
+  if (PastBlock != nullptr) {
+    if (ForwBlock != nullptr) {
       if (currentNewBlock->AddFrame(track, timecode, buffer, *PastBlock, *ForwBlock, lacing)) {
         // more data are allowed in this Block
         return true;
       }
 
-      currentNewBlock = NULL;
+      currentNewBlock = nullptr;
       return false;
     }
     if (currentNewBlock->AddFrame(track, timecode, buffer, *PastBlock, lacing)) {
         // more data are allowed in this Block
         return true;
       }
-    currentNewBlock = NULL;
+    currentNewBlock = nullptr;
     return false;
   }
 
@@ -120,20 +120,20 @@ bool KaxCluster::AddFrameInternal(const KaxTrackEntry & track, uint64 timecode,
     return true;
   }
 
-  currentNewBlock = NULL;
+  currentNewBlock = nullptr;
   return false;
 }
 
 bool KaxCluster::AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, KaxBlockGroup * & MyNewBlock, LacingType lacing)
 {
   assert(Blobs.empty()); // mutually exclusive for the moment
-  return AddFrameInternal(track, timecode, buffer, MyNewBlock, NULL, NULL, lacing);
+  return AddFrameInternal(track, timecode, buffer, MyNewBlock, nullptr, nullptr, lacing);
 }
 
 bool KaxCluster::AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, KaxBlockGroup * & MyNewBlock, const KaxBlockGroup & PastBlock, LacingType lacing)
 {
   assert(Blobs.empty()); // mutually exclusive for the moment
-  return AddFrameInternal(track, timecode, buffer, MyNewBlock, &PastBlock, NULL, lacing);
+  return AddFrameInternal(track, timecode, buffer, MyNewBlock, &PastBlock, nullptr, lacing);
 }
 
 bool KaxCluster::AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, KaxBlockGroup * & MyNewBlock, const KaxBlockGroup & PastBlock, const KaxBlockGroup & ForwBlock, LacingType lacing)
@@ -176,7 +176,7 @@ 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<KaxClusterSilentTracks *>(this->FindFirstElt(EBML_INFO(KaxClusterSilentTracks)));
-            assert(SilentTracks != NULL); // the flag bSilentTracksUsed should be set when creating the Cluster
+            assert(SilentTracks != nullptr); // the flag bSilentTracksUsed should be set when creating the Cluster
             KaxClusterSilentTrackNumber * trackelt = static_cast<KaxClusterSilentTrackNumber *>(SilentTracks->AddNewElt(EBML_INFO(KaxClusterSilentTrackNumber)));
             *static_cast<EbmlUInteger *>(trackelt) = tracknum;
           }
@@ -216,7 +216,7 @@ 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<KaxClusterSilentTracks *>(this->FindFirstElt(EBML_INFO(KaxClusterSilentTracks)));
-            assert(SilentTracks != NULL); // the flag bSilentTracksUsed should be set when creating the Cluster
+            assert(SilentTracks != nullptr); // the flag bSilentTracksUsed should be set when creating the Cluster
             KaxClusterSilentTrackNumber * trackelt = static_cast<KaxClusterSilentTrackNumber *>(SilentTracks->AddNewElt(EBML_INFO(KaxClusterSilentTrackNumber)));
             *static_cast<EbmlUInteger *>(trackelt) = tracknum;
           }
@@ -293,7 +293,7 @@ void KaxCluster::ReleaseFrames()
 
 uint64 KaxCluster::GetPosition() const
 {
-  assert(ParentSegment != NULL);
+  assert(ParentSegment != nullptr);
   return ParentSegment->GetRelativePosition(*this);
 }
 
index a6c1d16d0c2e31ef1dd8ff9fba276cab70546fcf..f9f00b5dbd082d3fa570eabd6c677631f7c3c037 100644 (file)
@@ -117,7 +117,7 @@ void KaxCues::PositionSet(const KaxBlockGroup & BlockRef)
 const KaxCuePoint * KaxCues::GetTimecodePoint(uint64 aTimecode) const
 {
   uint64 TimecodeToLocate = aTimecode / GlobalTimecodeScale();
-  const KaxCuePoint * aPointPrev = NULL;
+  const KaxCuePoint * aPointPrev = nullptr;
   uint64 aPrevTime = 0;
   uint64 aNextTime = EBML_PRETTYLONGINT(0xFFFFFFFFFFFF);
 
@@ -127,7 +127,7 @@ const KaxCuePoint * KaxCues::GetTimecodePoint(uint64 aTimecode) const
       const KaxCuePoint *tmp = static_cast<const KaxCuePoint *>(*Itr);
       // check the tile
       const KaxCueTime *aTime = static_cast<const KaxCueTime *>(tmp->FindFirstElt(EBML_INFO(KaxCueTime)));
-      if (aTime != NULL) {
+      if (aTime != nullptr) {
         uint64 _Time = uint64(*aTime);
         if (_Time > aPrevTime && _Time < TimecodeToLocate) {
           aPrevTime = _Time;
@@ -146,11 +146,11 @@ const KaxCuePoint * KaxCues::GetTimecodePoint(uint64 aTimecode) const
 uint64 KaxCues::GetTimecodePosition(uint64 aTimecode) const
 {
   const KaxCuePoint * aPoint = GetTimecodePoint(aTimecode);
-  if (aPoint == NULL)
+  if (aPoint == nullptr)
     return 0;
 
   const KaxCueTrackPositions * aTrack = aPoint->GetSeekPosition();
-  if (aTrack == NULL)
+  if (aTrack == nullptr)
     return 0;
 
   return aTrack->ClusterPosition();
index b2a15fcec38a48af790f52824acc5f9c0a49c96d..400d08c464b39fa5eb8e7f99ec7a7cafe9e273bf 100644 (file)
@@ -70,7 +70,7 @@ void KaxCuePoint::PositionSet(const KaxBlockGroup & BlockReference, uint64 Globa
   }
 
   KaxCodecState *CodecState = static_cast<KaxCodecState *>(BlockReference.FindFirstElt(EBML_INFO(KaxCodecState)));
-  if (CodecState != NULL) {
+  if (CodecState != nullptr) {
     KaxCueCodecState &CueCodecState = AddNewChild<KaxCueCodecState>(NewPositions);
     *static_cast<EbmlUInteger*>(&CueCodecState) = BlockReference.GetParentCluster()->GetParentSegment()->GetRelativePosition(CodecState->GetElementPosition());
   }
@@ -107,7 +107,7 @@ void KaxCuePoint::PositionSet(const KaxBlockBlob & BlobReference, uint64 GlobalT
   if (!BlobReference.IsSimpleBlock()) {
     const KaxBlockGroup &BlockGroup = BlobReference;
     const KaxCodecState *CodecState = static_cast<KaxCodecState *>(BlockGroup.FindFirstElt(EBML_INFO(KaxCodecState)));
-    if (CodecState != NULL) {
+    if (CodecState != nullptr) {
       KaxCueCodecState &CueCodecState = AddNewChild<KaxCueCodecState>(NewPositions);
       *static_cast<EbmlUInteger*>(&CueCodecState) = BlockGroup.GetParentCluster()->GetParentSegment()->GetRelativePosition(CodecState->GetElementPosition());
     }
@@ -148,11 +148,11 @@ bool KaxCuePoint::IsSmallerThan(const EbmlElement * Cmp) const
 
   // compare timecode
   const KaxCueTime * TimeCodeA = static_cast<const KaxCueTime *>(FindElt(EBML_INFO(KaxCueTime)));
-  if (TimeCodeA == NULL)
+  if (TimeCodeA == nullptr)
     return false;
 
   const KaxCueTime * TimeCodeB = static_cast<const KaxCueTime *>(theCmp.FindElt(EBML_INFO(KaxCueTime)));
-  if (TimeCodeB == NULL)
+  if (TimeCodeB == nullptr)
     return false;
 
   if (TimeCodeA->IsSmallerThan(TimeCodeB))
@@ -163,11 +163,11 @@ bool KaxCuePoint::IsSmallerThan(const EbmlElement * Cmp) const
 
   // compare tracks (timecodes are equal)
   const KaxCueTrack * TrackA = static_cast<const KaxCueTrack *>(FindElt(EBML_INFO(KaxCueTrack)));
-  if (TrackA == NULL)
+  if (TrackA == nullptr)
     return false;
 
   const KaxCueTrack * TrackB = static_cast<const KaxCueTrack *>(theCmp.FindElt(EBML_INFO(KaxCueTrack)));
-  if (TrackB == NULL)
+  if (TrackB == nullptr)
     return false;
 
   if (TrackA->IsSmallerThan(TrackB))
@@ -182,7 +182,7 @@ bool KaxCuePoint::IsSmallerThan(const EbmlElement * Cmp) const
 bool KaxCuePoint::Timecode(uint64 & aTimecode, uint64 GlobalTimecodeScale) const
 {
   const KaxCueTime *aTime = static_cast<const KaxCueTime *>(FindFirstElt(EBML_INFO(KaxCueTime)));
-  if (aTime == NULL)
+  if (aTime == nullptr)
     return false;
   aTimecode = uint64(*aTime) * GlobalTimecodeScale;
   return true;
@@ -193,13 +193,13 @@ bool KaxCuePoint::Timecode(uint64 & aTimecode, uint64 GlobalTimecodeScale) const
 */
 const KaxCueTrackPositions * KaxCuePoint::GetSeekPosition() const
 {
-  const KaxCueTrackPositions * result = NULL;
+  const KaxCueTrackPositions * result = nullptr;
   uint64 aPosition = EBML_PRETTYLONGINT(0xFFFFFFFFFFFFFFF);
   // find the position of the "earlier" Cluster
   const KaxCueTrackPositions *aPoss = static_cast<const KaxCueTrackPositions *>(FindFirstElt(EBML_INFO(KaxCueTrackPositions)));
-  while (aPoss != NULL) {
+  while (aPoss != nullptr) {
     const KaxCueClusterPosition *aPos = static_cast<const KaxCueClusterPosition *>(aPoss->FindFirstElt(EBML_INFO(KaxCueClusterPosition)));
-    if (aPos != NULL && uint64(*aPos) < aPosition) {
+    if (aPos != nullptr && uint64(*aPos) < aPosition) {
       aPosition = uint64(*aPos);
       result = aPoss;
     }
@@ -212,7 +212,7 @@ const KaxCueTrackPositions * KaxCuePoint::GetSeekPosition() const
 uint64 KaxCueTrackPositions::ClusterPosition() const
 {
   const KaxCueClusterPosition *aPos = static_cast<const KaxCueClusterPosition *>(FindFirstElt(EBML_INFO(KaxCueClusterPosition)));
-  if (aPos == NULL)
+  if (aPos == nullptr)
     return 0;
 
   return uint64(*aPos);
@@ -221,7 +221,7 @@ uint64 KaxCueTrackPositions::ClusterPosition() const
 uint16 KaxCueTrackPositions::TrackNumber() const
 {
   const KaxCueTrack *aTrack = static_cast<const KaxCueTrack *>(FindFirstElt(EBML_INFO(KaxCueTrack)));
-  if (aTrack == NULL)
+  if (aTrack == nullptr)
     return 0;
 
   return uint16(*aTrack);
index 5cc131c5e731cb09b3dbcc63136d2830ece2c58f..4cf9b37bf95be1e3f64ebd264c29a51199020e1b 100644 (file)
@@ -65,8 +65,8 @@ KaxSeek * KaxSeekHead::FindFirstOf(const EbmlCallbacks & Callbacks) const
 {
   // parse all the Entries and find the first to match the type
   KaxSeek * aElt = static_cast<KaxSeek *>(FindFirstElt(EBML_INFO(KaxSeek)));
-  while (aElt != NULL) {
-    KaxSeekID * aId = NULL;
+  while (aElt != nullptr) {
+    KaxSeekID * aId = nullptr;
     EBML_MASTER_ITERATOR Itr;
     for (Itr = aElt->begin(); Itr != aElt->end(); ++Itr) {
       if (EbmlId(*(*Itr)) == EBML_ID(KaxSeekID)) {
@@ -81,7 +81,7 @@ KaxSeek * KaxSeekHead::FindFirstOf(const EbmlCallbacks & Callbacks) const
     aElt = static_cast<KaxSeek *>(FindNextElt(*aElt));
   }
 
-  return NULL;
+  return nullptr;
 }
 
 KaxSeek * KaxSeekHead::FindNextOf(const KaxSeek &aPrev) const
@@ -106,13 +106,13 @@ KaxSeek * KaxSeekHead::FindNextOf(const KaxSeek &aPrev) const
     }
   }
 
-  return NULL;
+  return nullptr;
 }
 
 int64 KaxSeek::Location() const
 {
   KaxSeekPosition *aPos = static_cast<KaxSeekPosition*>(FindFirstElt(EBML_INFO(KaxSeekPosition)));
-  if (aPos == NULL)
+  if (aPos == nullptr)
     return 0;
   return uint64(*aPos);
 }
@@ -120,7 +120,7 @@ int64 KaxSeek::Location() const
 bool KaxSeek::IsEbmlId(const EbmlId & aId) const
 {
   KaxSeekID *_Id = static_cast<KaxSeekID*>(FindFirstElt(EBML_INFO(KaxSeekID)));
-  if (_Id == NULL)
+  if (_Id == nullptr)
     return false;
   EbmlId aEbmlId(_Id->GetBuffer(), _Id->GetSize());
   return (aId == aEbmlId);
@@ -129,10 +129,10 @@ bool KaxSeek::IsEbmlId(const EbmlId & aId) const
 bool KaxSeek::IsEbmlId(const KaxSeek & aPoint) const
 {
   KaxSeekID *_IdA = static_cast<KaxSeekID*>(FindFirstElt(EBML_INFO(KaxSeekID)));
-  if (_IdA == NULL)
+  if (_IdA == nullptr)
     return false;
   KaxSeekID *_IdB = static_cast<KaxSeekID*>(aPoint.FindFirstElt(EBML_INFO(KaxSeekID)));
-  if (_IdB == NULL)
+  if (_IdB == nullptr)
     return false;
   EbmlId aEbmlIdA(_IdA->GetBuffer(), _IdA->GetSize());
   EbmlId aEbmlIdB(_IdB->GetBuffer(), _IdB->GetSize());