mirror of
https://github.com/taglib/taglib.git
synced 2025-07-18 21:14:23 -04:00
clang-tidy: Use nullptr instead of 0
run-clang-tidy -header-filter='.*' -checks='-*,modernize-use-nullptr' -fix
This commit is contained in:
@ -34,8 +34,8 @@ using namespace TagLib;
|
||||
class PlainFile : public File {
|
||||
public:
|
||||
explicit PlainFile(FileName name) : File(name) { }
|
||||
Tag *tag() const override { return NULL; }
|
||||
AudioProperties *audioProperties() const override { return NULL; }
|
||||
Tag *tag() const override { return nullptr; }
|
||||
AudioProperties *audioProperties() const override { return nullptr; }
|
||||
bool save() override { return false; }
|
||||
void truncate(long length) { File::truncate(length); }
|
||||
|
||||
|
@ -66,7 +66,7 @@ namespace
|
||||
public:
|
||||
File *createFile(FileName, bool, AudioProperties::ReadStyle) const override
|
||||
{
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
File *createFileFromStream(IOStream *s, bool, AudioProperties::ReadStyle) const override
|
||||
@ -391,7 +391,7 @@ public:
|
||||
{
|
||||
{
|
||||
FileRef f(TEST_FILE_PATH_C("xing.mp3"));
|
||||
CPPUNIT_ASSERT(dynamic_cast<MPEG::File *>(f.file()) != NULL);
|
||||
CPPUNIT_ASSERT(dynamic_cast<MPEG::File *>(f.file()) != nullptr);
|
||||
}
|
||||
|
||||
DummyResolver resolver;
|
||||
@ -399,7 +399,7 @@ public:
|
||||
|
||||
{
|
||||
FileRef f(TEST_FILE_PATH_C("xing.mp3"));
|
||||
CPPUNIT_ASSERT(dynamic_cast<Ogg::Vorbis::File *>(f.file()) != NULL);
|
||||
CPPUNIT_ASSERT(dynamic_cast<Ogg::Vorbis::File *>(f.file()) != nullptr);
|
||||
}
|
||||
|
||||
DummyStreamResolver streamResolver;
|
||||
@ -408,7 +408,7 @@ public:
|
||||
{
|
||||
FileStream s(TEST_FILE_PATH_C("xing.mp3"));
|
||||
FileRef f(&s);
|
||||
CPPUNIT_ASSERT(dynamic_cast<MP4::File *>(f.file()) != NULL);
|
||||
CPPUNIT_ASSERT(dynamic_cast<MP4::File *>(f.file()) != nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,7 @@ class PublicFrame : public ID3v2::Frame
|
||||
public:
|
||||
PublicFrame() : ID3v2::Frame(ByteVector("XXXX\0\0\0\0\0\0", 10)) {}
|
||||
String readStringField(const ByteVector &data, String::Type encoding,
|
||||
int *position = 0)
|
||||
int *position = nullptr)
|
||||
{ return ID3v2::Frame::readStringField(data, encoding, position); }
|
||||
String toString() const override { return String(); }
|
||||
void parseFields(const ByteVector &) override {}
|
||||
@ -1242,7 +1242,7 @@ public:
|
||||
tag.removeUnsupportedProperties(properties.unsupportedData());
|
||||
CPPUNIT_ASSERT(tag.frameList("APIC").isEmpty());
|
||||
CPPUNIT_ASSERT(tag.frameList("TIPL").isEmpty());
|
||||
CPPUNIT_ASSERT_EQUAL((ID3v2::UniqueFileIdentifierFrame *)0, ID3v2::UniqueFileIdentifierFrame::findByOwner(&tag, "http://example.com"));
|
||||
CPPUNIT_ASSERT_EQUAL((ID3v2::UniqueFileIdentifierFrame *)nullptr, ID3v2::UniqueFileIdentifierFrame::findByOwner(&tag, "http://example.com"));
|
||||
CPPUNIT_ASSERT_EQUAL(frame6, ID3v2::UniqueFileIdentifierFrame::findByOwner(&tag, "http://musicbrainz.org"));
|
||||
}
|
||||
|
||||
|
@ -85,7 +85,7 @@ public:
|
||||
ScopedFileCopy copy("test", ".it");
|
||||
{
|
||||
IT::File file(copy.fileName().c_str());
|
||||
CPPUNIT_ASSERT(file.tag() != 0);
|
||||
CPPUNIT_ASSERT(file.tag() != nullptr);
|
||||
file.tag()->setTitle(titleAfter);
|
||||
file.tag()->setComment(newComment);
|
||||
file.tag()->setTrackerName("won't be saved");
|
||||
@ -104,8 +104,8 @@ private:
|
||||
IT::Properties *p = file.audioProperties();
|
||||
Mod::Tag *t = file.tag();
|
||||
|
||||
CPPUNIT_ASSERT(0 != p);
|
||||
CPPUNIT_ASSERT(0 != t);
|
||||
CPPUNIT_ASSERT(nullptr != p);
|
||||
CPPUNIT_ASSERT(nullptr != t);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL( 0, p->length());
|
||||
CPPUNIT_ASSERT_EQUAL( 0, p->bitrate());
|
||||
|
@ -70,7 +70,7 @@ public:
|
||||
ScopedFileCopy copy("test", ".mod");
|
||||
{
|
||||
Mod::File file(copy.fileName().c_str());
|
||||
CPPUNIT_ASSERT(file.tag() != 0);
|
||||
CPPUNIT_ASSERT(file.tag() != nullptr);
|
||||
file.tag()->setTitle(titleAfter);
|
||||
file.tag()->setComment(newComment);
|
||||
CPPUNIT_ASSERT(file.save());
|
||||
@ -110,8 +110,8 @@ private:
|
||||
Mod::Properties *p = file.audioProperties();
|
||||
Mod::Tag *t = file.tag();
|
||||
|
||||
CPPUNIT_ASSERT(0 != p);
|
||||
CPPUNIT_ASSERT(0 != t);
|
||||
CPPUNIT_ASSERT(nullptr != p);
|
||||
CPPUNIT_ASSERT(nullptr != t);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, p->length());
|
||||
CPPUNIT_ASSERT_EQUAL(0, p->bitrate());
|
||||
|
@ -51,8 +51,8 @@ public:
|
||||
void setChunkData(const ByteVector &name, const ByteVector &data) {
|
||||
RIFF::File::setChunkData(name, data);
|
||||
};
|
||||
TagLib::Tag* tag() const override { return 0; };
|
||||
TagLib::AudioProperties* audioProperties() const override { return 0;};
|
||||
TagLib::Tag* tag() const override { return nullptr; };
|
||||
TagLib::AudioProperties* audioProperties() const override { return nullptr;};
|
||||
bool save() override { return false; };
|
||||
void removeChunk(unsigned int i) { RIFF::File::removeChunk(i); }
|
||||
void removeChunk(const ByteVector &name) { RIFF::File::removeChunk(name); }
|
||||
|
@ -73,7 +73,7 @@ public:
|
||||
ScopedFileCopy copy("test", ".s3m");
|
||||
{
|
||||
S3M::File file(copy.fileName().c_str());
|
||||
CPPUNIT_ASSERT(file.tag() != 0);
|
||||
CPPUNIT_ASSERT(file.tag() != nullptr);
|
||||
file.tag()->setTitle(titleAfter);
|
||||
file.tag()->setComment(newComment);
|
||||
file.tag()->setTrackerName("won't be saved");
|
||||
@ -95,8 +95,8 @@ private:
|
||||
S3M::Properties *p = file.audioProperties();
|
||||
Mod::Tag *t = file.tag();
|
||||
|
||||
CPPUNIT_ASSERT(0 != p);
|
||||
CPPUNIT_ASSERT(0 != t);
|
||||
CPPUNIT_ASSERT(nullptr != p);
|
||||
CPPUNIT_ASSERT(nullptr != t);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL( 0, p->length());
|
||||
CPPUNIT_ASSERT_EQUAL( 0, p->bitrate());
|
||||
|
@ -127,8 +127,8 @@ public:
|
||||
XM::Properties *p = file.audioProperties();
|
||||
Mod::Tag *t = file.tag();
|
||||
|
||||
CPPUNIT_ASSERT(0 != p);
|
||||
CPPUNIT_ASSERT(0 != t);
|
||||
CPPUNIT_ASSERT(nullptr != p);
|
||||
CPPUNIT_ASSERT(nullptr != t);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, p->length());
|
||||
CPPUNIT_ASSERT_EQUAL(0, p->bitrate());
|
||||
@ -173,8 +173,8 @@ private:
|
||||
XM::Properties *p = file.audioProperties();
|
||||
Mod::Tag *t = file.tag();
|
||||
|
||||
CPPUNIT_ASSERT(0 != p);
|
||||
CPPUNIT_ASSERT(0 != t);
|
||||
CPPUNIT_ASSERT(nullptr != p);
|
||||
CPPUNIT_ASSERT(nullptr != t);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(0, p->length());
|
||||
CPPUNIT_ASSERT_EQUAL(0, p->bitrate());
|
||||
@ -203,7 +203,7 @@ private:
|
||||
ScopedFileCopy copy("test", ".xm");
|
||||
{
|
||||
XM::File file(copy.fileName().c_str());
|
||||
CPPUNIT_ASSERT(file.tag() != 0);
|
||||
CPPUNIT_ASSERT(file.tag() != nullptr);
|
||||
file.tag()->setTitle(titleAfter);
|
||||
file.tag()->setComment(comment);
|
||||
file.tag()->setTrackerName(trackerNameAfter);
|
||||
|
Reference in New Issue
Block a user