Change 0 to nullptr

This commit is contained in:
Jonas Kvinge
2019-04-21 21:39:11 +02:00
parent d1108c533f
commit 247a11146c
12 changed files with 23 additions and 23 deletions

View File

@@ -74,7 +74,7 @@ namespace
return file; return file;
} }
return 0; return nullptr;
} }
// Detect the file type based on the file extension. // Detect the file type based on the file extension.
@@ -98,7 +98,7 @@ namespace
// that a default file type resolver is created. // that a default file type resolver is created.
if(ext.isEmpty()) if(ext.isEmpty())
return 0; return nullptr;
// .oga can be any audio in the Ogg container. So leave it to content-based detection. // .oga can be any audio in the Ogg container. So leave it to content-based detection.
@@ -142,7 +142,7 @@ namespace
if(ext == "DSF") if(ext == "DSF")
return new DSF::File(stream, readAudioProperties, audioPropertiesStyle); return new DSF::File(stream, readAudioProperties, audioPropertiesStyle);
return 0; return nullptr;
} }
// Detect the file type based on the actual content of the stream. // Detect the file type based on the actual content of the stream.
@@ -194,7 +194,7 @@ namespace
delete file; delete file;
} }
return 0; return nullptr;
} }
// Internal function that supports FileRef::create(). // Internal function that supports FileRef::create().
@@ -220,7 +220,7 @@ namespace
ext = s.substr(pos + 1).upper(); ext = s.substr(pos + 1).upper();
if(ext.isEmpty()) if(ext.isEmpty())
return 0; return nullptr;
if(ext == "MP3") if(ext == "MP3")
return new MPEG::File(fileName, ID3v2::FrameFactory::instance(), readAudioProperties, audioPropertiesStyle); return new MPEG::File(fileName, ID3v2::FrameFactory::instance(), readAudioProperties, audioPropertiesStyle);
@@ -270,7 +270,7 @@ namespace
if(ext == "DSF") if(ext == "DSF")
return new DSF::File(fileName, readAudioProperties, audioPropertiesStyle); return new DSF::File(fileName, readAudioProperties, audioPropertiesStyle);
return 0; return nullptr;
} }
} }
@@ -335,7 +335,7 @@ Tag *FileRef::tag() const
{ {
if(isNull()) { if(isNull()) {
debug("FileRef::tag() - Called without a valid file."); debug("FileRef::tag() - Called without a valid file.");
return 0; return nullptr;
} }
return d->file->tag(); return d->file->tag();
} }
@@ -344,7 +344,7 @@ AudioProperties *FileRef::audioProperties() const
{ {
if(isNull()) { if(isNull()) {
debug("FileRef::audioProperties() - Called without a valid file."); debug("FileRef::audioProperties() - Called without a valid file.");
return 0; return nullptr;
} }
return d->file->audioProperties(); return d->file->audioProperties();
} }

View File

@@ -118,7 +118,7 @@ MP4::Atom::find(const char *name1, const char *name2, const char *name3, const c
return (*it)->find(name2, name3, name4); return (*it)->find(name2, name3, name4);
} }
} }
return 0; return nullptr;
} }
MP4::AtomList MP4::AtomList
@@ -178,7 +178,7 @@ MP4::Atoms::find(const char *name1, const char *name2, const char *name3, const
return (*it)->find(name2, name3, name4); return (*it)->find(name2, name3, name4);
} }
} }
return 0; return nullptr;
} }
MP4::AtomList MP4::AtomList

View File

@@ -236,7 +236,7 @@ ChapterFrame *ChapterFrame::findByElementID(const ID3v2::Tag *tag, const ByteVec
return frame; return frame;
} }
return 0; return nullptr;
} }
void ChapterFrame::parseFields(const ByteVector &data) void ChapterFrame::parseFields(const ByteVector &data)

View File

@@ -136,7 +136,7 @@ CommentsFrame *CommentsFrame::findByDescription(const ID3v2::Tag *tag, const Str
return frame; return frame;
} }
return 0; return nullptr;
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////

View File

@@ -258,7 +258,7 @@ TableOfContentsFrame *TableOfContentsFrame::findByElementID(const ID3v2::Tag *ta
return frame; return frame;
} }
return 0; return nullptr;
} }
TableOfContentsFrame *TableOfContentsFrame::findTopLevel(const ID3v2::Tag *tag) // static TableOfContentsFrame *TableOfContentsFrame::findTopLevel(const ID3v2::Tag *tag) // static
@@ -274,7 +274,7 @@ TableOfContentsFrame *TableOfContentsFrame::findTopLevel(const ID3v2::Tag *tag)
return frame; return frame;
} }
return 0; return nullptr;
} }
void TableOfContentsFrame::parseFields(const ByteVector &data) void TableOfContentsFrame::parseFields(const ByteVector &data)

View File

@@ -410,7 +410,7 @@ UserTextIdentificationFrame *UserTextIdentificationFrame::find(
if(f && f->description() == description) if(f && f->description() == description)
return f; return f;
} }
return 0; return nullptr;
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////

View File

@@ -114,7 +114,7 @@ UniqueFileIdentifierFrame *UniqueFileIdentifierFrame::findByOwner(const ID3v2::T
return frame; return frame;
} }
return 0; return nullptr;
} }
void UniqueFileIdentifierFrame::parseFields(const ByteVector &data) void UniqueFileIdentifierFrame::parseFields(const ByteVector &data)

View File

@@ -134,7 +134,7 @@ UnsynchronizedLyricsFrame *UnsynchronizedLyricsFrame::findByDescription(const ID
if(frame && frame->description() == d) if(frame && frame->description() == d)
return frame; return frame;
} }
return 0; return nullptr;
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// protected members // protected members

View File

@@ -185,7 +185,7 @@ UserUrlLinkFrame *UserUrlLinkFrame::find(ID3v2::Tag *tag, const String &descript
if(f && f->description() == description) if(f && f->description() == description)
return f; return f;
} }
return 0; return nullptr;
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////

View File

@@ -140,7 +140,7 @@ Frame *FrameFactory::createFrame(const ByteVector &origData, Header *tagHeader)
header->frameSize() > data.size()) header->frameSize() > data.size())
{ {
delete header; delete header;
return 0; return nullptr;
} }
#ifndef NO_ITUNES_HACKS #ifndef NO_ITUNES_HACKS
@@ -157,7 +157,7 @@ Frame *FrameFactory::createFrame(const ByteVector &origData, Header *tagHeader)
for(ByteVector::ConstIterator it = frameID.begin(); it != frameID.end(); it++) { for(ByteVector::ConstIterator it = frameID.begin(); it != frameID.end(); it++) {
if( (*it < 'A' || *it > 'Z') && (*it < '0' || *it > '9') ) { if( (*it < 'A' || *it > 'Z') && (*it < '0' || *it > '9') ) {
delete header; delete header;
return 0; return nullptr;
} }
} }

View File

@@ -89,8 +89,8 @@ namespace
public: public:
explicit AdapterFile(IOStream *stream) : File(stream) {} explicit AdapterFile(IOStream *stream) : File(stream) {}
Tag *tag() const { return 0; } Tag *tag() const { return nullptr; }
AudioProperties *audioProperties() const { return 0; } AudioProperties *audioProperties() const { return nullptr; }
bool save() { return false; } bool save() { return false; }
}; };
} }

View File

@@ -272,7 +272,7 @@ List<Ogg::Page *> Ogg::Page::paginate(const ByteVectorList &packets,
Ogg::Page* Ogg::Page::getCopyWithNewPageSequenceNumber(int /*sequenceNumber*/) Ogg::Page* Ogg::Page::getCopyWithNewPageSequenceNumber(int /*sequenceNumber*/)
{ {
debug("Ogg::Page::getCopyWithNewPageSequenceNumber() -- This function is obsolete. Returning null."); debug("Ogg::Page::getCopyWithNewPageSequenceNumber() -- This function is obsolete. Returning null.");
return 0; return nullptr;
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////