Fix code style and errors
This commit is contained in:
2
3rdparty/taglib/asf/asffile.cpp
vendored
2
3rdparty/taglib/asf/asffile.cpp
vendored
@@ -113,7 +113,7 @@ class ASF::File::FilePrivate::UnknownObject : public ASF::File::FilePrivate::Bas
|
||||
{
|
||||
ByteVector myGuid;
|
||||
public:
|
||||
UnknownObject(const ByteVector &guid);
|
||||
explicit UnknownObject(const ByteVector &guid);
|
||||
ByteVector guid() const;
|
||||
};
|
||||
|
||||
|
||||
6
3rdparty/taglib/dsf/dsffile.cpp
vendored
6
3rdparty/taglib/dsf/dsffile.cpp
vendored
@@ -40,8 +40,10 @@ class DSF::File::FilePrivate
|
||||
{
|
||||
public:
|
||||
FilePrivate() :
|
||||
properties(0),
|
||||
tag(0)
|
||||
fileSize(0),
|
||||
metadataOffset(0),
|
||||
properties(nullptr),
|
||||
tag(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
2
3rdparty/taglib/flac/flacfile.cpp
vendored
2
3rdparty/taglib/flac/flacfile.cpp
vendored
@@ -60,7 +60,7 @@ namespace
|
||||
class FLAC::File::FilePrivate
|
||||
{
|
||||
public:
|
||||
FilePrivate(const ID3v2::FrameFactory *frameFactory = ID3v2::FrameFactory::instance()) :
|
||||
explicit FilePrivate(const ID3v2::FrameFactory *frameFactory = ID3v2::FrameFactory::instance()) :
|
||||
ID3v2FrameFactory(frameFactory),
|
||||
ID3v2Location(-1),
|
||||
ID3v2OriginalSize(0),
|
||||
|
||||
2
3rdparty/taglib/it/itfile.cpp
vendored
2
3rdparty/taglib/it/itfile.cpp
vendored
@@ -36,7 +36,7 @@ using namespace IT;
|
||||
class IT::File::FilePrivate
|
||||
{
|
||||
public:
|
||||
FilePrivate(AudioProperties::ReadStyle propertiesStyle)
|
||||
explicit FilePrivate(AudioProperties::ReadStyle propertiesStyle)
|
||||
: tag(), properties(propertiesStyle)
|
||||
{
|
||||
}
|
||||
|
||||
2
3rdparty/taglib/mod/modfile.cpp
vendored
2
3rdparty/taglib/mod/modfile.cpp
vendored
@@ -36,7 +36,7 @@ using namespace Mod;
|
||||
class Mod::File::FilePrivate
|
||||
{
|
||||
public:
|
||||
FilePrivate(AudioProperties::ReadStyle propertiesStyle)
|
||||
explicit FilePrivate(AudioProperties::ReadStyle propertiesStyle)
|
||||
: properties(propertiesStyle)
|
||||
{
|
||||
}
|
||||
|
||||
4
3rdparty/taglib/mpeg/mpegfile.cpp
vendored
4
3rdparty/taglib/mpeg/mpegfile.cpp
vendored
@@ -47,7 +47,7 @@ namespace
|
||||
class MPEG::File::FilePrivate
|
||||
{
|
||||
public:
|
||||
FilePrivate(const ID3v2::FrameFactory *frameFactory = ID3v2::FrameFactory::instance()) :
|
||||
explicit FilePrivate(const ID3v2::FrameFactory *frameFactory = ID3v2::FrameFactory::instance()) :
|
||||
ID3v2FrameFactory(frameFactory),
|
||||
ID3v2Location(-1),
|
||||
ID3v2OriginalSize(0),
|
||||
@@ -87,7 +87,7 @@ namespace
|
||||
class AdapterFile : public TagLib::File
|
||||
{
|
||||
public:
|
||||
AdapterFile(IOStream *stream) : File(stream) {}
|
||||
explicit AdapterFile(IOStream *stream) : File(stream) {}
|
||||
|
||||
Tag *tag() const { return 0; }
|
||||
AudioProperties *audioProperties() const { return 0; }
|
||||
|
||||
1
3rdparty/taglib/ogg/oggfile.cpp
vendored
1
3rdparty/taglib/ogg/oggfile.cpp
vendored
@@ -50,6 +50,7 @@ class Ogg::File::FilePrivate
|
||||
{
|
||||
public:
|
||||
FilePrivate() :
|
||||
streamSerialNumber(0),
|
||||
firstPageHeader(0),
|
||||
lastPageHeader(0)
|
||||
{
|
||||
|
||||
2
3rdparty/taglib/riff/rifffile.cpp
vendored
2
3rdparty/taglib/riff/rifffile.cpp
vendored
@@ -46,7 +46,7 @@ struct Chunk
|
||||
class RIFF::File::FilePrivate
|
||||
{
|
||||
public:
|
||||
FilePrivate(Endianness endianness) :
|
||||
explicit FilePrivate(Endianness endianness) :
|
||||
endianness(endianness),
|
||||
size(0),
|
||||
sizeOffset(0) {}
|
||||
|
||||
2
3rdparty/taglib/s3m/s3mfile.cpp
vendored
2
3rdparty/taglib/s3m/s3mfile.cpp
vendored
@@ -38,7 +38,7 @@ using namespace S3M;
|
||||
class S3M::File::FilePrivate
|
||||
{
|
||||
public:
|
||||
FilePrivate(AudioProperties::ReadStyle propertiesStyle)
|
||||
explicit FilePrivate(AudioProperties::ReadStyle propertiesStyle)
|
||||
: properties(propertiesStyle)
|
||||
{
|
||||
}
|
||||
|
||||
53
3rdparty/taglib/tag.cpp
vendored
53
3rdparty/taglib/tag.cpp
vendored
@@ -34,7 +34,8 @@ class Tag::TagPrivate
|
||||
|
||||
};
|
||||
|
||||
Tag::Tag()
|
||||
Tag::Tag() :
|
||||
d(nullptr)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -58,19 +59,19 @@ bool Tag::isEmpty() const
|
||||
PropertyMap Tag::properties() const
|
||||
{
|
||||
PropertyMap map;
|
||||
if(!(title().isEmpty()))
|
||||
if (!(title().isEmpty()))
|
||||
map["TITLE"].append(title());
|
||||
if(!(artist().isEmpty()))
|
||||
if (!(artist().isEmpty()))
|
||||
map["ARTIST"].append(artist());
|
||||
if(!(album().isEmpty()))
|
||||
if (!(album().isEmpty()))
|
||||
map["ALBUM"].append(album());
|
||||
if(!(comment().isEmpty()))
|
||||
if (!(comment().isEmpty()))
|
||||
map["COMMENT"].append(comment());
|
||||
if(!(genre().isEmpty()))
|
||||
if (!(genre().isEmpty()))
|
||||
map["GENRE"].append(genre());
|
||||
if(!(year() == 0))
|
||||
if (!(year() == 0))
|
||||
map["DATE"].append(String::number(year()));
|
||||
if(!(track() == 0))
|
||||
if (!(track() == 0))
|
||||
map["TRACKNUMBER"].append(String::number(track()));
|
||||
return map;
|
||||
}
|
||||
@@ -85,40 +86,40 @@ PropertyMap Tag::setProperties(const PropertyMap &origProps)
|
||||
properties.removeEmpty();
|
||||
StringList oneValueSet;
|
||||
// can this be simplified by using some preprocessor defines / function pointers?
|
||||
if(properties.contains("TITLE")) {
|
||||
if (properties.contains("TITLE")) {
|
||||
setTitle(properties["TITLE"].front());
|
||||
oneValueSet.append("TITLE");
|
||||
} else
|
||||
setTitle(String());
|
||||
|
||||
if(properties.contains("ARTIST")) {
|
||||
if (properties.contains("ARTIST")) {
|
||||
setArtist(properties["ARTIST"].front());
|
||||
oneValueSet.append("ARTIST");
|
||||
} else
|
||||
setArtist(String());
|
||||
|
||||
if(properties.contains("ALBUM")) {
|
||||
if (properties.contains("ALBUM")) {
|
||||
setAlbum(properties["ALBUM"].front());
|
||||
oneValueSet.append("ALBUM");
|
||||
} else
|
||||
setAlbum(String());
|
||||
|
||||
if(properties.contains("COMMENT")) {
|
||||
if (properties.contains("COMMENT")) {
|
||||
setComment(properties["COMMENT"].front());
|
||||
oneValueSet.append("COMMENT");
|
||||
} else
|
||||
setComment(String());
|
||||
|
||||
if(properties.contains("GENRE")) {
|
||||
if (properties.contains("GENRE")) {
|
||||
setGenre(properties["GENRE"].front());
|
||||
oneValueSet.append("GENRE");
|
||||
} else
|
||||
setGenre(String());
|
||||
|
||||
if(properties.contains("DATE")) {
|
||||
if (properties.contains("DATE")) {
|
||||
bool ok;
|
||||
int date = properties["DATE"].front().toInt(&ok);
|
||||
if(ok) {
|
||||
if (ok) {
|
||||
setYear(date);
|
||||
oneValueSet.append("DATE");
|
||||
} else
|
||||
@@ -127,10 +128,10 @@ PropertyMap Tag::setProperties(const PropertyMap &origProps)
|
||||
else
|
||||
setYear(0);
|
||||
|
||||
if(properties.contains("TRACKNUMBER")) {
|
||||
if (properties.contains("TRACKNUMBER")) {
|
||||
bool ok;
|
||||
int track = properties["TRACKNUMBER"].front().toInt(&ok);
|
||||
if(ok) {
|
||||
if (ok) {
|
||||
setTrack(track);
|
||||
oneValueSet.append("TRACKNUMBER");
|
||||
} else
|
||||
@@ -142,7 +143,7 @@ PropertyMap Tag::setProperties(const PropertyMap &origProps)
|
||||
// for each tag that has been set above, remove the first entry in the corresponding
|
||||
// value list. The others will be returned as unsupported by this format.
|
||||
for(StringList::ConstIterator it = oneValueSet.begin(); it != oneValueSet.end(); ++it) {
|
||||
if(properties[*it].size() == 1)
|
||||
if (properties[*it].size() == 1)
|
||||
properties.erase(*it);
|
||||
else
|
||||
properties[*it].erase( properties[*it].begin() );
|
||||
@@ -152,7 +153,7 @@ PropertyMap Tag::setProperties(const PropertyMap &origProps)
|
||||
|
||||
void Tag::duplicate(const Tag *source, Tag *target, bool overwrite) // static
|
||||
{
|
||||
if(overwrite) {
|
||||
if (overwrite) {
|
||||
target->setTitle(source->title());
|
||||
target->setArtist(source->artist());
|
||||
target->setAlbum(source->album());
|
||||
@@ -162,19 +163,19 @@ void Tag::duplicate(const Tag *source, Tag *target, bool overwrite) // static
|
||||
target->setTrack(source->track());
|
||||
}
|
||||
else {
|
||||
if(target->title().isEmpty())
|
||||
if (target->title().isEmpty())
|
||||
target->setTitle(source->title());
|
||||
if(target->artist().isEmpty())
|
||||
if (target->artist().isEmpty())
|
||||
target->setArtist(source->artist());
|
||||
if(target->album().isEmpty())
|
||||
if (target->album().isEmpty())
|
||||
target->setAlbum(source->album());
|
||||
if(target->comment().isEmpty())
|
||||
if (target->comment().isEmpty())
|
||||
target->setComment(source->comment());
|
||||
if(target->genre().isEmpty())
|
||||
if (target->genre().isEmpty())
|
||||
target->setGenre(source->genre());
|
||||
if(target->year() <= 0)
|
||||
if (target->year() == 0)
|
||||
target->setYear(source->year());
|
||||
if(target->track() <= 0)
|
||||
if (target->track() == 0)
|
||||
target->setTrack(source->track());
|
||||
}
|
||||
}
|
||||
|
||||
4
3rdparty/taglib/toolkit/tbytevectorlist.cpp
vendored
4
3rdparty/taglib/toolkit/tbytevectorlist.cpp
vendored
@@ -70,7 +70,9 @@ ByteVectorList ByteVectorList::split(const ByteVector &v, const ByteVector &patt
|
||||
// public members
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
ByteVectorList::ByteVectorList() : List<ByteVector>()
|
||||
ByteVectorList::ByteVectorList() :
|
||||
List<ByteVector>(),
|
||||
d(nullptr)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ using namespace TagLib;
|
||||
class ByteVectorStream::ByteVectorStreamPrivate
|
||||
{
|
||||
public:
|
||||
ByteVectorStreamPrivate(const ByteVector &data);
|
||||
explicit ByteVectorStreamPrivate(const ByteVector &data);
|
||||
|
||||
ByteVector data;
|
||||
long position;
|
||||
|
||||
2
3rdparty/taglib/toolkit/tfile.cpp
vendored
2
3rdparty/taglib/toolkit/tfile.cpp
vendored
@@ -91,7 +91,7 @@ public:
|
||||
// public members
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
File::File(FileName fileName) :
|
||||
File::File(const FileName fileName) :
|
||||
d(new FilePrivate(new FileStream(fileName), true))
|
||||
{
|
||||
}
|
||||
|
||||
4
3rdparty/taglib/toolkit/tfilestream.cpp
vendored
4
3rdparty/taglib/toolkit/tfilestream.cpp
vendored
@@ -90,7 +90,7 @@ namespace
|
||||
|
||||
struct FileNameHandle : public std::string
|
||||
{
|
||||
FileNameHandle(FileName name) : std::string(name) {}
|
||||
explicit FileNameHandle(FileName name) : std::string(name) {}
|
||||
operator FileName () const { return c_str(); }
|
||||
};
|
||||
|
||||
@@ -129,7 +129,7 @@ namespace
|
||||
class FileStream::FileStreamPrivate
|
||||
{
|
||||
public:
|
||||
FileStreamPrivate(const FileName &fileName)
|
||||
explicit FileStreamPrivate(const FileName &fileName)
|
||||
: file(InvalidFileHandle)
|
||||
, name(fileName)
|
||||
, readOnly(true)
|
||||
|
||||
12
3rdparty/taglib/toolkit/tstringlist.cpp
vendored
12
3rdparty/taglib/toolkit/tstringlist.cpp
vendored
@@ -55,17 +55,23 @@ StringList StringList::split(const String &s, const String &pattern)
|
||||
// public members
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
StringList::StringList() : List<String>()
|
||||
StringList::StringList() :
|
||||
List<String>(),
|
||||
d(nullptr)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
StringList::StringList(const StringList &l) : List<String>(l)
|
||||
StringList::StringList(const StringList &l) :
|
||||
List<String>(l),
|
||||
d(nullptr)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
StringList::StringList(const String &s) : List<String>()
|
||||
StringList::StringList(const String &s) :
|
||||
List<String>(),
|
||||
d(nullptr)
|
||||
{
|
||||
append(s);
|
||||
}
|
||||
|
||||
2
3rdparty/taglib/trueaudio/trueaudiofile.cpp
vendored
2
3rdparty/taglib/trueaudio/trueaudiofile.cpp
vendored
@@ -50,7 +50,7 @@ namespace
|
||||
class TrueAudio::File::FilePrivate
|
||||
{
|
||||
public:
|
||||
FilePrivate(const ID3v2::FrameFactory *frameFactory = ID3v2::FrameFactory::instance()) :
|
||||
explicit FilePrivate(const ID3v2::FrameFactory *frameFactory = ID3v2::FrameFactory::instance()) :
|
||||
ID3v2FrameFactory(frameFactory),
|
||||
ID3v2Location(-1),
|
||||
ID3v2OriginalSize(0),
|
||||
|
||||
@@ -160,7 +160,6 @@ void TrueAudio::Properties::read(const ByteVector &data, long streamLength)
|
||||
pos += 4;
|
||||
|
||||
d->sampleFrames = data.toUInt(pos, false);
|
||||
pos += 4;
|
||||
|
||||
if(d->sampleFrames > 0 && d->sampleRate > 0) {
|
||||
const double length = d->sampleFrames * 1000.0 / d->sampleRate;
|
||||
|
||||
8
3rdparty/taglib/xm/xmfile.cpp
vendored
8
3rdparty/taglib/xm/xmfile.cpp
vendored
@@ -86,7 +86,7 @@ public:
|
||||
class SkipReader : public Reader
|
||||
{
|
||||
public:
|
||||
SkipReader(unsigned int size) : m_size(size)
|
||||
explicit SkipReader(unsigned int size) : m_size(size)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ template<typename T>
|
||||
class ValueReader : public Reader
|
||||
{
|
||||
public:
|
||||
ValueReader(T &value) : value(value)
|
||||
explicit ValueReader(T &value) : value(value)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ private:
|
||||
class ByteReader : public ValueReader<unsigned char>
|
||||
{
|
||||
public:
|
||||
ByteReader(unsigned char &byte) : ValueReader<unsigned char>(byte) {}
|
||||
explicit ByteReader(unsigned char &byte) : ValueReader<unsigned char>(byte) {}
|
||||
|
||||
unsigned int read(TagLib::File &file, unsigned int limit)
|
||||
{
|
||||
@@ -346,7 +346,7 @@ private:
|
||||
class XM::File::FilePrivate
|
||||
{
|
||||
public:
|
||||
FilePrivate(AudioProperties::ReadStyle propertiesStyle)
|
||||
explicit FilePrivate(AudioProperties::ReadStyle propertiesStyle)
|
||||
: tag(), properties(propertiesStyle)
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user