From 7eab1bf6dff2ae01546bfa3b22c11880263226ef Mon Sep 17 00:00:00 2001 From: mathbunnyru Date: Sat, 10 Dec 2016 15:20:42 +0300 Subject: [PATCH] Add explicit keyword wherever easily possible --- taglib/ape/apefooter.h | 2 +- taglib/asf/asffile.cpp | 2 +- taglib/ebml/ebmlelement.h | 2 +- taglib/ebml/ebmlfile.cpp | 2 +- taglib/ebml/ebmlfile.h | 4 ++-- taglib/ebml/matroska/ebmlmatroskaaudio.h | 2 +- taglib/ebml/matroska/ebmlmatroskafile.cpp | 4 ++-- taglib/ebml/matroska/ebmlmatroskafile.h | 6 +++--- taglib/fileref.cpp | 2 +- taglib/flac/flacfile.cpp | 2 +- taglib/flac/flacpicture.h | 2 +- taglib/it/itfile.cpp | 2 +- taglib/it/itproperties.h | 2 +- taglib/mod/modfile.cpp | 2 +- taglib/mod/modfilebase.h | 4 ++-- taglib/mod/modproperties.h | 2 +- taglib/mp4/mp4atom.h | 4 ++-- taglib/mpeg/id3v2/frames/relativevolumeframe.h | 2 +- taglib/mpeg/id3v2/frames/uniquefileidentifierframe.h | 2 +- taglib/mpeg/id3v2/frames/unknownframe.h | 2 +- taglib/mpeg/id3v2/id3v2frame.h | 2 +- taglib/mpeg/id3v2/id3v2header.h | 2 +- taglib/mpeg/mpegfile.cpp | 2 +- taglib/mpeg/mpegheader.h | 2 +- taglib/mpeg/xingheader.h | 2 +- taglib/ogg/oggfile.h | 4 ++-- taglib/riff/rifffile.cpp | 2 +- taglib/riff/wav/infotag.h | 2 +- taglib/s3m/s3mfile.cpp | 2 +- taglib/s3m/s3mproperties.h | 2 +- taglib/toolkit/tbytevectorstream.cpp | 2 +- taglib/toolkit/tbytevectorstream.h | 2 +- taglib/toolkit/tfile.h | 4 ++-- taglib/toolkit/tfilestream.cpp | 4 ++-- taglib/toolkit/tiostream.cpp | 4 ++-- taglib/toolkit/tiostream.h | 4 ++-- taglib/toolkit/tsmartptr.h | 2 +- taglib/trueaudio/trueaudiofile.cpp | 2 +- taglib/xm/xmfile.cpp | 8 ++++---- taglib/xm/xmproperties.h | 2 +- tests/test_file.cpp | 2 +- tests/test_riff.cpp | 2 +- tests/test_smartptr.cpp | 4 ++-- 43 files changed, 58 insertions(+), 58 deletions(-) diff --git a/taglib/ape/apefooter.h b/taglib/ape/apefooter.h index 47741d0d..c6bb5791 100644 --- a/taglib/ape/apefooter.h +++ b/taglib/ape/apefooter.h @@ -54,7 +54,7 @@ namespace TagLib { * Constructs an APE footer based on \a data. parse() is called * immediately. */ - Footer(const ByteVector &data); + explicit Footer(const ByteVector &data); /*! * Destroys the footer. diff --git a/taglib/asf/asffile.cpp b/taglib/asf/asffile.cpp index 1861cce7..4b1d2004 100644 --- a/taglib/asf/asffile.cpp +++ b/taglib/asf/asffile.cpp @@ -112,7 +112,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; }; diff --git a/taglib/ebml/ebmlelement.h b/taglib/ebml/ebmlelement.h index 0f4c6e5c..95c38a52 100644 --- a/taglib/ebml/ebmlelement.h +++ b/taglib/ebml/ebmlelement.h @@ -61,7 +61,7 @@ namespace TagLib { /*! * Creates an root element using document. */ - Element(File *document); + explicit Element(File *document); /*! * Returns the first found child element with the given id. Returns a null diff --git a/taglib/ebml/ebmlfile.cpp b/taglib/ebml/ebmlfile.cpp index e9f4ce9f..8afb36d7 100644 --- a/taglib/ebml/ebmlfile.cpp +++ b/taglib/ebml/ebmlfile.cpp @@ -30,7 +30,7 @@ using namespace TagLib; class EBML::File::FilePrivate { public: - FilePrivate(File *document) : root(document) + explicit FilePrivate(File *document) : root(document) { } diff --git a/taglib/ebml/ebmlfile.h b/taglib/ebml/ebmlfile.h index fc1204e8..a24d2370 100644 --- a/taglib/ebml/ebmlfile.h +++ b/taglib/ebml/ebmlfile.h @@ -61,7 +61,7 @@ namespace TagLib { * This constructor is protected since an object should be created * through a specific subclass. */ - File(FileName file); + explicit File(FileName file); /*! * Constructs an instance of an EBML file from an IOStream. @@ -69,7 +69,7 @@ namespace TagLib { * This constructor is protected since an object should be created * through a specific subclass. */ - File(IOStream *stream); + explicit File(IOStream *stream); private: //! Non-copyable diff --git a/taglib/ebml/matroska/ebmlmatroskaaudio.h b/taglib/ebml/matroska/ebmlmatroskaaudio.h index f3cdedeb..b4593568 100644 --- a/taglib/ebml/matroska/ebmlmatroskaaudio.h +++ b/taglib/ebml/matroska/ebmlmatroskaaudio.h @@ -50,7 +50,7 @@ namespace TagLib { /*! * Constructs an instance from a file. */ - AudioProperties(File *document); + explicit AudioProperties(File *document); /*! * Returns the length of the file. diff --git a/taglib/ebml/matroska/ebmlmatroskafile.cpp b/taglib/ebml/matroska/ebmlmatroskafile.cpp index ec525ae6..21515d39 100644 --- a/taglib/ebml/matroska/ebmlmatroskafile.cpp +++ b/taglib/ebml/matroska/ebmlmatroskafile.cpp @@ -48,7 +48,7 @@ public: return true; } - FilePrivate(File *p_document) : tag(0), document(p_document) + explicit FilePrivate(File *p_document) : tag(0), document(p_document) { // Just get the first segment, because "Typically a Matroska file is // composed of 1 segment." @@ -286,7 +286,7 @@ class EBML::Matroska::File::Tag::TagPrivate { public: // Creates a TagPrivate instance - TagPrivate(File *p_document) : + explicit TagPrivate(File *p_document) : document(p_document), title(document->d->tags.end()), artist(document->d->tags.end()), diff --git a/taglib/ebml/matroska/ebmlmatroskafile.h b/taglib/ebml/matroska/ebmlmatroskafile.h index 27f070b7..57b93d91 100644 --- a/taglib/ebml/matroska/ebmlmatroskafile.h +++ b/taglib/ebml/matroska/ebmlmatroskafile.h @@ -49,12 +49,12 @@ namespace TagLib { /*! * Constructs a Matroska File from a file name. */ - File(FileName file); + explicit File(FileName file); /*! * Constructs a Matroska File from a stream. */ - File(IOStream *stream); + explicit File(IOStream *stream); /*! * Returns the pointer to a tag that allow access on common tags. @@ -101,7 +101,7 @@ namespace TagLib { * Creates a new Tag for Matroska files. The given properties are gained * by the Matroska::File. */ - Tag(File *document); + explicit Tag(File *document); /*! * Returns the track name; if no track name is present in the tag diff --git a/taglib/fileref.cpp b/taglib/fileref.cpp index 56f6ef28..676ec4f2 100644 --- a/taglib/fileref.cpp +++ b/taglib/fileref.cpp @@ -192,7 +192,7 @@ public: FileRefPrivate() : file() {} - FileRefPrivate(File *f) : + explicit FileRefPrivate(File *f) : file(f) {} SHARED_PTR file; diff --git a/taglib/flac/flacfile.cpp b/taglib/flac/flacfile.cpp index 30114667..42b55b81 100644 --- a/taglib/flac/flacfile.cpp +++ b/taglib/flac/flacfile.cpp @@ -60,7 +60,7 @@ namespace class FLAC::File::FilePrivate { public: - FilePrivate(const ID3v2::FrameFactory *frameFactory) : + explicit FilePrivate(const ID3v2::FrameFactory *frameFactory) : ID3v2FrameFactory(ID3v2::FrameFactory::instance()), ID3v2Location(-1), ID3v2OriginalSize(0), diff --git a/taglib/flac/flacpicture.h b/taglib/flac/flacpicture.h index 213284f0..87aad484 100644 --- a/taglib/flac/flacpicture.h +++ b/taglib/flac/flacpicture.h @@ -89,7 +89,7 @@ namespace TagLib { }; Picture(); - Picture(const ByteVector &data); + explicit Picture(const ByteVector &data); ~Picture(); /*! diff --git a/taglib/it/itfile.cpp b/taglib/it/itfile.cpp index 8ef72ac4..9503e93a 100644 --- a/taglib/it/itfile.cpp +++ b/taglib/it/itfile.cpp @@ -36,7 +36,7 @@ using namespace IT; class IT::File::FilePrivate { public: - FilePrivate(AudioProperties::ReadStyle propertiesStyle) + explicit FilePrivate(AudioProperties::ReadStyle propertiesStyle) : tag(), properties(propertiesStyle) { } diff --git a/taglib/it/itproperties.h b/taglib/it/itproperties.h index 38edc7c3..cb80593a 100644 --- a/taglib/it/itproperties.h +++ b/taglib/it/itproperties.h @@ -58,7 +58,7 @@ namespace TagLib { MidiConfEmbedded = 8 }; - AudioProperties(AudioProperties::ReadStyle propertiesStyle); + explicit AudioProperties(AudioProperties::ReadStyle propertiesStyle); virtual ~AudioProperties(); int length() const; diff --git a/taglib/mod/modfile.cpp b/taglib/mod/modfile.cpp index 395bb4ae..ad23f7aa 100644 --- a/taglib/mod/modfile.cpp +++ b/taglib/mod/modfile.cpp @@ -36,7 +36,7 @@ using namespace Mod; class Mod::File::FilePrivate { public: - FilePrivate(AudioProperties::ReadStyle propertiesStyle) + explicit FilePrivate(AudioProperties::ReadStyle propertiesStyle) : properties(propertiesStyle) { } diff --git a/taglib/mod/modfilebase.h b/taglib/mod/modfilebase.h index fabdbca8..ec6598ca 100644 --- a/taglib/mod/modfilebase.h +++ b/taglib/mod/modfilebase.h @@ -41,8 +41,8 @@ namespace TagLib { class TAGLIB_EXPORT FileBase : public TagLib::File { protected: - FileBase(FileName file); - FileBase(IOStream *stream); + explicit FileBase(FileName file); + explicit FileBase(IOStream *stream); void writeString(const String &s, unsigned int size, char padding = 0); void writeByte(unsigned char byte); diff --git a/taglib/mod/modproperties.h b/taglib/mod/modproperties.h index a5edd1f8..2e7f2c82 100644 --- a/taglib/mod/modproperties.h +++ b/taglib/mod/modproperties.h @@ -40,7 +40,7 @@ namespace TagLib { friend class File; public: - AudioProperties(AudioProperties::ReadStyle propertiesStyle); + explicit AudioProperties(AudioProperties::ReadStyle propertiesStyle); virtual ~AudioProperties(); int length() const; diff --git a/taglib/mp4/mp4atom.h b/taglib/mp4/mp4atom.h index 2a75a6aa..41844dc6 100644 --- a/taglib/mp4/mp4atom.h +++ b/taglib/mp4/mp4atom.h @@ -77,7 +77,7 @@ namespace TagLib { class Atom { public: - Atom(File *file); + explicit Atom(File *file); ~Atom(); Atom *find(const char *name1, const char *name2 = 0, const char *name3 = 0, const char *name4 = 0); bool path(AtomList &path, const char *name1, const char *name2 = 0, const char *name3 = 0); @@ -95,7 +95,7 @@ namespace TagLib { class Atoms { public: - Atoms(File *file); + explicit Atoms(File *file); ~Atoms(); Atom *find(const char *name1, const char *name2 = 0, const char *name3 = 0, const char *name4 = 0); AtomList path(const char *name1, const char *name2 = 0, const char *name3 = 0, const char *name4 = 0); diff --git a/taglib/mpeg/id3v2/frames/relativevolumeframe.h b/taglib/mpeg/id3v2/frames/relativevolumeframe.h index db00c99d..e85e48e7 100644 --- a/taglib/mpeg/id3v2/frames/relativevolumeframe.h +++ b/taglib/mpeg/id3v2/frames/relativevolumeframe.h @@ -109,7 +109,7 @@ namespace TagLib { /*! * Constructs a RelativeVolumeFrame based on the contents of \a data. */ - RelativeVolumeFrame(const ByteVector &data); + explicit RelativeVolumeFrame(const ByteVector &data); /*! * Destroys the RelativeVolumeFrame instance. diff --git a/taglib/mpeg/id3v2/frames/uniquefileidentifierframe.h b/taglib/mpeg/id3v2/frames/uniquefileidentifierframe.h index decf1b0d..9b2211bb 100644 --- a/taglib/mpeg/id3v2/frames/uniquefileidentifierframe.h +++ b/taglib/mpeg/id3v2/frames/uniquefileidentifierframe.h @@ -48,7 +48,7 @@ namespace TagLib { /*! * Creates a unique file identifier frame based on \a data. */ - UniqueFileIdentifierFrame(const ByteVector &data); + explicit UniqueFileIdentifierFrame(const ByteVector &data); /*! * Creates a unique file identifier frame with the owner \a owner and diff --git a/taglib/mpeg/id3v2/frames/unknownframe.h b/taglib/mpeg/id3v2/frames/unknownframe.h index 6559f4ed..d7af28bc 100644 --- a/taglib/mpeg/id3v2/frames/unknownframe.h +++ b/taglib/mpeg/id3v2/frames/unknownframe.h @@ -51,7 +51,7 @@ namespace TagLib { friend class FrameFactory; public: - UnknownFrame(const ByteVector &data); + explicit UnknownFrame(const ByteVector &data); virtual ~UnknownFrame(); virtual String toString() const; diff --git a/taglib/mpeg/id3v2/id3v2frame.h b/taglib/mpeg/id3v2/id3v2frame.h index 65df3856..77f4caca 100644 --- a/taglib/mpeg/id3v2/id3v2frame.h +++ b/taglib/mpeg/id3v2/id3v2frame.h @@ -175,7 +175,7 @@ namespace TagLib { * The ownership of this header will be assigned to the frame and the * header will be deleted when the frame is destroyed. */ - Frame(Header *h); + explicit Frame(Header *h); /*! * Returns a pointer to the frame header. diff --git a/taglib/mpeg/id3v2/id3v2header.h b/taglib/mpeg/id3v2/id3v2header.h index 12fb6d02..7d5043f2 100644 --- a/taglib/mpeg/id3v2/id3v2header.h +++ b/taglib/mpeg/id3v2/id3v2header.h @@ -56,7 +56,7 @@ namespace TagLib { * Constructs an ID3v2 header based on \a data. parse() is called * immediately. */ - Header(const ByteVector &data); + explicit Header(const ByteVector &data); /*! * Destroys the header. diff --git a/taglib/mpeg/mpegfile.cpp b/taglib/mpeg/mpegfile.cpp index 9c0f3451..b3f925cb 100644 --- a/taglib/mpeg/mpegfile.cpp +++ b/taglib/mpeg/mpegfile.cpp @@ -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), diff --git a/taglib/mpeg/mpegheader.h b/taglib/mpeg/mpegheader.h index 3ab986ab..0c68169f 100644 --- a/taglib/mpeg/mpegheader.h +++ b/taglib/mpeg/mpegheader.h @@ -52,7 +52,7 @@ namespace TagLib { * * \deprecated */ - Header(const ByteVector &data); + explicit Header(const ByteVector &data); /*! * Parses an MPEG header based on \a file and \a offset. diff --git a/taglib/mpeg/xingheader.h b/taglib/mpeg/xingheader.h index 27130df1..0f7c609f 100644 --- a/taglib/mpeg/xingheader.h +++ b/taglib/mpeg/xingheader.h @@ -77,7 +77,7 @@ namespace TagLib { * Parses an Xing/VBRI header based on \a data which contains the entire * first MPEG frame. */ - XingHeader(const ByteVector &data); + explicit XingHeader(const ByteVector &data); /*! * Destroy this XingHeader instance. diff --git a/taglib/ogg/oggfile.h b/taglib/ogg/oggfile.h index 7d889c2f..2c5a352a 100644 --- a/taglib/ogg/oggfile.h +++ b/taglib/ogg/oggfile.h @@ -88,7 +88,7 @@ namespace TagLib { * instantiated directly but rather should be used through the codec * specific subclasses. */ - File(FileName file); + explicit File(FileName file); /*! * Constructs an Ogg file from \a stream. @@ -100,7 +100,7 @@ namespace TagLib { * \note TagLib will *not* take ownership of the stream, the caller is * responsible for deleting it after the File object. */ - File(IOStream *stream); + explicit File(IOStream *stream); private: File(const File &); diff --git a/taglib/riff/rifffile.cpp b/taglib/riff/rifffile.cpp index a3df492b..158e3cf9 100644 --- a/taglib/riff/rifffile.cpp +++ b/taglib/riff/rifffile.cpp @@ -65,7 +65,7 @@ namespace class RIFF::File::FilePrivate { public: - FilePrivate(ByteOrder endianness) : + explicit FilePrivate(ByteOrder endianness) : endianness(endianness), size(0), sizeOffset(0) {} diff --git a/taglib/riff/wav/infotag.h b/taglib/riff/wav/infotag.h index 16c699eb..add6ef6f 100644 --- a/taglib/riff/wav/infotag.h +++ b/taglib/riff/wav/infotag.h @@ -66,7 +66,7 @@ namespace TagLib { /*! * Constructs an INFO tag read from \a data which is contents of "LIST" chunk. */ - Tag(const ByteVector &data); + explicit Tag(const ByteVector &data); virtual ~Tag(); diff --git a/taglib/s3m/s3mfile.cpp b/taglib/s3m/s3mfile.cpp index 39bfb107..cb879bbf 100644 --- a/taglib/s3m/s3mfile.cpp +++ b/taglib/s3m/s3mfile.cpp @@ -38,7 +38,7 @@ using namespace S3M; class S3M::File::FilePrivate { public: - FilePrivate(AudioProperties::ReadStyle propertiesStyle) + explicit FilePrivate(AudioProperties::ReadStyle propertiesStyle) : properties(propertiesStyle) { } diff --git a/taglib/s3m/s3mproperties.h b/taglib/s3m/s3mproperties.h index 4747331f..21451594 100644 --- a/taglib/s3m/s3mproperties.h +++ b/taglib/s3m/s3mproperties.h @@ -51,7 +51,7 @@ namespace TagLib { CustomData = 128 }; - AudioProperties(AudioProperties::ReadStyle propertiesStyle); + explicit AudioProperties(AudioProperties::ReadStyle propertiesStyle); virtual ~AudioProperties(); int length() const; diff --git a/taglib/toolkit/tbytevectorstream.cpp b/taglib/toolkit/tbytevectorstream.cpp index f75fd5f4..eaf23a8f 100644 --- a/taglib/toolkit/tbytevectorstream.cpp +++ b/taglib/toolkit/tbytevectorstream.cpp @@ -37,7 +37,7 @@ using namespace TagLib; class ByteVectorStream::ByteVectorStreamPrivate { public: - ByteVectorStreamPrivate(const ByteVector &data); + explicit ByteVectorStreamPrivate(const ByteVector &data); ByteVector data; long long position; diff --git a/taglib/toolkit/tbytevectorstream.h b/taglib/toolkit/tbytevectorstream.h index 101d5731..ee7001f8 100644 --- a/taglib/toolkit/tbytevectorstream.h +++ b/taglib/toolkit/tbytevectorstream.h @@ -46,7 +46,7 @@ namespace TagLib { * Construct a File object and opens the \a file. \a file should be a * be a C-string in the local file system encoding. */ - ByteVectorStream(const ByteVector &data); + explicit ByteVectorStream(const ByteVector &data); /*! * Destroys this ByteVectorStream instance. diff --git a/taglib/toolkit/tfile.h b/taglib/toolkit/tfile.h index 180de13b..9a3f2e1f 100644 --- a/taglib/toolkit/tfile.h +++ b/taglib/toolkit/tfile.h @@ -247,7 +247,7 @@ namespace TagLib { * \note Constructor is protected since this class should only be * instantiated through subclasses. */ - File(const FileName &fileName); + explicit File(const FileName &fileName); /*! * Construct a File object and use the \a stream instance. @@ -258,7 +258,7 @@ namespace TagLib { * \note Constructor is protected since this class should only be * instantiated through subclasses. */ - File(IOStream *stream); + explicit File(IOStream *stream); /*! * Marks the file as valid or invalid. diff --git a/taglib/toolkit/tfilestream.cpp b/taglib/toolkit/tfilestream.cpp index 455fa975..f5154d47 100644 --- a/taglib/toolkit/tfilestream.cpp +++ b/taglib/toolkit/tfilestream.cpp @@ -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(); } }; @@ -124,7 +124,7 @@ namespace class FileStream::FileStreamPrivate { public: - FileStreamPrivate(const FileName &fileName) : + explicit FileStreamPrivate(const FileName &fileName) : file(InvalidFileHandle), name(fileName), readOnly(true) {} diff --git a/taglib/toolkit/tiostream.cpp b/taglib/toolkit/tiostream.cpp index 530a9693..73d17ac5 100644 --- a/taglib/toolkit/tiostream.cpp +++ b/taglib/toolkit/tiostream.cpp @@ -56,10 +56,10 @@ public: FileNamePrivate() : data(new std::wstring()) {} - FileNamePrivate(const wchar_t *name) : + explicit FileNamePrivate(const wchar_t *name) : data(new std::wstring(name)) {} - FileNamePrivate(const char *name) : + explicit FileNamePrivate(const char *name) : data(new std::wstring(ansiToUnicode(name))) {} SHARED_PTR data; diff --git a/taglib/toolkit/tiostream.h b/taglib/toolkit/tiostream.h index aadcd3fb..2e4880e8 100644 --- a/taglib/toolkit/tiostream.h +++ b/taglib/toolkit/tiostream.h @@ -37,8 +37,8 @@ namespace TagLib { class TAGLIB_EXPORT FileName { public: - FileName(const wchar_t *name); - FileName(const char *name); + explicit FileName(const wchar_t *name); + explicit FileName(const char *name); FileName(const FileName &name); ~FileName(); diff --git a/taglib/toolkit/tsmartptr.h b/taglib/toolkit/tsmartptr.h index be00f89c..6cd20f3b 100644 --- a/taglib/toolkit/tsmartptr.h +++ b/taglib/toolkit/tsmartptr.h @@ -97,7 +97,7 @@ namespace TagLib class CounterImpl : public CounterBase { public: - CounterImpl(T *p) : + explicit CounterImpl(T *p) : p(p) {} virtual void dispose() diff --git a/taglib/trueaudio/trueaudiofile.cpp b/taglib/trueaudio/trueaudiofile.cpp index 0328e20a..4c55acda 100644 --- a/taglib/trueaudio/trueaudiofile.cpp +++ b/taglib/trueaudio/trueaudiofile.cpp @@ -52,7 +52,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), diff --git a/taglib/xm/xmfile.cpp b/taglib/xm/xmfile.cpp index ef48d29f..daf6d954 100644 --- a/taglib/xm/xmfile.cpp +++ b/taglib/xm/xmfile.cpp @@ -89,7 +89,7 @@ namespace class SkipReader : public Reader { public: - SkipReader(unsigned int size) : m_size(size) + explicit SkipReader(unsigned int size) : m_size(size) { } @@ -113,7 +113,7 @@ namespace class ValueReader : public Reader { public: - ValueReader(T &value) : value(value) + explicit ValueReader(T &value) : value(value) { } @@ -154,7 +154,7 @@ namespace class ByteReader : public ValueReader { public: - ByteReader(unsigned char &byte) : ValueReader(byte) {} + explicit ByteReader(unsigned char &byte) : ValueReader(byte) {} unsigned int read(TagLib::File &file, unsigned int limit) { @@ -360,7 +360,7 @@ namespace class XM::File::FilePrivate { public: - FilePrivate(AudioProperties::ReadStyle propertiesStyle) + explicit FilePrivate(AudioProperties::ReadStyle propertiesStyle) : tag(), properties(propertiesStyle) { } diff --git a/taglib/xm/xmproperties.h b/taglib/xm/xmproperties.h index a7de582b..261902c9 100644 --- a/taglib/xm/xmproperties.h +++ b/taglib/xm/xmproperties.h @@ -44,7 +44,7 @@ namespace TagLib { LinearFreqTable = 1 // otherwise its the amiga freq. table }; - AudioProperties(AudioProperties::ReadStyle propertiesStyle); + explicit AudioProperties(AudioProperties::ReadStyle propertiesStyle); virtual ~AudioProperties(); int length() const; diff --git a/tests/test_file.cpp b/tests/test_file.cpp index 42087ee5..63c579eb 100644 --- a/tests/test_file.cpp +++ b/tests/test_file.cpp @@ -32,7 +32,7 @@ using namespace TagLib; // File subclass that gives tests access to filesystem operations class PlainFile : public File { public: - PlainFile(FileName name) : File(name) { } + explicit PlainFile(FileName name) : File(name) { } Tag *tag() const { return NULL; } AudioProperties *audioProperties() const { return NULL; } bool save(){ return false; } diff --git a/tests/test_riff.cpp b/tests/test_riff.cpp index 249fd482..23746a99 100644 --- a/tests/test_riff.cpp +++ b/tests/test_riff.cpp @@ -37,7 +37,7 @@ using namespace TagLib; class PublicRIFF : public RIFF::File { public: - PublicRIFF(FileName file) : RIFF::File(file, BigEndian) {}; + explicit PublicRIFF(FileName file) : RIFF::File(file, BigEndian) {}; unsigned int riffSize() { return RIFF::File::riffSize(); }; size_t chunkCount() { return RIFF::File::chunkCount(); }; long long chunkOffset(unsigned int i) { return RIFF::File::chunkOffset(i); }; diff --git a/tests/test_smartptr.cpp b/tests/test_smartptr.cpp index 7ca2ab55..d671ac23 100644 --- a/tests/test_smartptr.cpp +++ b/tests/test_smartptr.cpp @@ -92,7 +92,7 @@ private: class DummyBase { public: - DummyBase(int x) : value(x) + explicit DummyBase(int x) : value(x) { } @@ -113,7 +113,7 @@ private: class DummyDerived : public DummyBase { public: - DummyDerived(int x) : DummyBase(x) + explicit DummyDerived(int x) : DummyBase(x) { }