diff --git a/include/exiv2/basicio.hpp b/include/exiv2/basicio.hpp index df3707af..e3f21508 100644 --- a/include/exiv2/basicio.hpp +++ b/include/exiv2/basicio.hpp @@ -270,7 +270,7 @@ namespace Exiv2 { //! @name Creators //@{ //! Constructor, takes a BasicIo reference - IoCloser(BasicIo& bio) : bio_(bio) {} + explicit IoCloser(BasicIo& bio) : bio_(bio) {} //! Destructor, closes the BasicIo reference virtual ~IoCloser() { close(); } //@} @@ -307,7 +307,7 @@ namespace Exiv2 { therefore never failes. @param path The full path of a file */ - FileIo(const std::string& path); + explicit FileIo(const std::string& path); #ifdef EXV_UNICODE_PATH /*! @brief Like FileIo(const std::string& path) but accepts a @@ -778,7 +778,7 @@ namespace Exiv2 { //! @name Creators //@{ //! Default constructor that reads data from stdin/data uri path and writes them to the temp file. - XPathIo(const std::string& orgPath); + explicit XPathIo(const std::string& orgPath); #ifdef EXV_UNICODE_PATH /*! @brief Like XPathIo(const std::string& orgPath) but accepts a diff --git a/include/exiv2/bmpimage.hpp b/include/exiv2/bmpimage.hpp index b598f2a5..07b0f3a3 100644 --- a/include/exiv2/bmpimage.hpp +++ b/include/exiv2/bmpimage.hpp @@ -77,7 +77,7 @@ namespace Exiv2 { instance after it is passed to this method. Use the Image::io() method to get a temporary reference. */ - BmpImage(BasicIo::AutoPtr io); + explicit BmpImage(BasicIo::AutoPtr io); //@} //! @name Manipulators diff --git a/include/exiv2/exif.hpp b/include/exiv2/exif.hpp index 5523650a..a0f15d97 100644 --- a/include/exiv2/exif.hpp +++ b/include/exiv2/exif.hpp @@ -236,7 +236,7 @@ namespace Exiv2 { //! @name Creators //@{ //! Constructor. - ExifThumbC(const ExifData& exifData); + explicit ExifThumbC(const ExifData& exifData); //@} //! @name Accessors @@ -305,7 +305,7 @@ namespace Exiv2 { //! @name Creators //@{ //! Constructor. - ExifThumb(ExifData& exifData); + explicit ExifThumb(ExifData& exifData); //@} //! @name Manipulators diff --git a/include/exiv2/gifimage.hpp b/include/exiv2/gifimage.hpp index 0649a756..479edc74 100644 --- a/include/exiv2/gifimage.hpp +++ b/include/exiv2/gifimage.hpp @@ -78,7 +78,7 @@ namespace Exiv2 { instance after it is passed to this method. Use the Image::io() method to get a temporary reference. */ - GifImage(BasicIo::AutoPtr io); + explicit GifImage(BasicIo::AutoPtr io); //@} //! @name Manipulators diff --git a/include/exiv2/ini.hpp b/include/exiv2/ini.hpp index d08bf8aa..17d544b5 100755 --- a/include/exiv2/ini.hpp +++ b/include/exiv2/ini.hpp @@ -140,7 +140,7 @@ public: /*! @brief Construct INIReader and parse given filename. See ini.h for more info about the parsing. */ - INIReader(std::string filename); + explicit INIReader(const std::string& filename); /*! @brief Return the result of ini_parse(), i.e., 0 on success, line number of first error on parse error, or -1 on file open error. diff --git a/include/exiv2/preview.hpp b/include/exiv2/preview.hpp index 14d4814a..b18d0a49 100644 --- a/include/exiv2/preview.hpp +++ b/include/exiv2/preview.hpp @@ -174,7 +174,7 @@ namespace Exiv2 { //! @name Constructors //@{ //! Constructor. - PreviewManager(const Image& image); + explicit PreviewManager(const Image& image); //@} //! @name Accessors diff --git a/include/exiv2/properties.hpp b/include/exiv2/properties.hpp index ee227c5f..ab6d01eb 100644 --- a/include/exiv2/properties.hpp +++ b/include/exiv2/properties.hpp @@ -76,14 +76,14 @@ namespace Exiv2 { //! For comparison with prefix struct Prefix { //! Constructor. - Prefix(const std::string& prefix); + explicit Prefix(const std::string& prefix); //! The prefix string. std::string prefix_; }; //! For comparison with namespace struct Ns { //! Constructor. - Ns(const std::string& ns); + explicit Ns(const std::string& ns); //! The namespace string std::string ns_; }; diff --git a/include/exiv2/psdimage.hpp b/include/exiv2/psdimage.hpp index 205be811..cbe1ff28 100644 --- a/include/exiv2/psdimage.hpp +++ b/include/exiv2/psdimage.hpp @@ -79,7 +79,7 @@ namespace Exiv2 { instance after it is passed to this method. Use the Image::io() method to get a temporary reference. */ - PsdImage(BasicIo::AutoPtr io); + explicit PsdImage(BasicIo::AutoPtr io); //@} //! @name Manipulators diff --git a/include/exiv2/rw2image.hpp b/include/exiv2/rw2image.hpp index adea5a76..21f49d5b 100644 --- a/include/exiv2/rw2image.hpp +++ b/include/exiv2/rw2image.hpp @@ -69,7 +69,7 @@ namespace Exiv2 { instance after it is passed to this method. Use the Image::io() method to get a temporary reference. */ - Rw2Image(BasicIo::AutoPtr io); + explicit Rw2Image(BasicIo::AutoPtr io); //@} //! @name Manipulators diff --git a/include/exiv2/rwlock.hpp b/include/exiv2/rwlock.hpp index 36608278..1ebbdb90 100644 --- a/include/exiv2/rwlock.hpp +++ b/include/exiv2/rwlock.hpp @@ -90,7 +90,7 @@ namespace Exiv2 { { public: //! constructor (acquires the lock) - RWLock(const pthread_rwlockattr_t *attr = 0) + explicit RWLock(const pthread_rwlockattr_t *attr = 0) { pthread_rwlock_init(&rwlock_, attr); } @@ -151,7 +151,7 @@ namespace Exiv2 { { public: //! constructor - locks the object - ScopedReadLock(RWLock &rwlock): + explicit ScopedReadLock(RWLock &rwlock): rwlock_(rwlock) { rwlock_.rdlock(); @@ -173,7 +173,7 @@ namespace Exiv2 { { public: //! constructor - locks the object - ScopedWriteLock(RWLock &rwlock): + explicit ScopedWriteLock(RWLock &rwlock): rwlock_(rwlock) { rwlock_.wrlock(); diff --git a/include/exiv2/tags.hpp b/include/exiv2/tags.hpp index 90e92568..8ca8d61a 100644 --- a/include/exiv2/tags.hpp +++ b/include/exiv2/tags.hpp @@ -73,7 +73,7 @@ namespace Exiv2 { //! Search key to find a GroupInfo by its group name. struct GroupInfo::GroupName { - GroupName(const std::string& groupName); //!< Constructor + explicit GroupName(const std::string& groupName); std::string g_; //!< Group name }; @@ -176,7 +176,8 @@ namespace Exiv2 { @throw Error if the key cannot be constructed from the tag number and group name. */ - ExifKey(const TagInfo& ti); + explicit ExifKey(const TagInfo& ti); + //! Copy constructor ExifKey(const ExifKey& rhs); //! Destructor diff --git a/include/exiv2/tgaimage.hpp b/include/exiv2/tgaimage.hpp index 11941355..2c40f0bf 100644 --- a/include/exiv2/tgaimage.hpp +++ b/include/exiv2/tgaimage.hpp @@ -79,7 +79,7 @@ namespace Exiv2 { instance after it is passed to this method. Use the Image::io() method to get a temporary reference. */ - TgaImage(BasicIo::AutoPtr io); + explicit TgaImage(BasicIo::AutoPtr io); //@} //! @name Manipulators diff --git a/include/exiv2/types.hpp b/include/exiv2/types.hpp index ece9ef62..73280c09 100644 --- a/include/exiv2/types.hpp +++ b/include/exiv2/types.hpp @@ -195,7 +195,7 @@ namespace Exiv2 { */ struct EXIV2API DataBufRef { //! Constructor - DataBufRef(std::pair rhs) : p(rhs) {} + explicit DataBufRef(std::pair rhs) : p(rhs) {} //! Pointer to a byte array and its size std::pair p; }; diff --git a/samples/geotag.cpp b/samples/geotag.cpp index 217c5131..4d8b47f0 100644 --- a/samples/geotag.cpp +++ b/samples/geotag.cpp @@ -282,7 +282,7 @@ time_t Position::deltaMax_ = 60 ; class UserData { public: - UserData(Options& options): + explicit UserData(Options& options): indent(0) , count(0) , nTrkpt(0) diff --git a/src/cr2header_int.hpp b/src/cr2header_int.hpp index dd6bd949..8e31e34e 100644 --- a/src/cr2header_int.hpp +++ b/src/cr2header_int.hpp @@ -45,7 +45,7 @@ namespace Exiv2 { //! @name Creators //@{ //! Default constructor - Cr2Header(ByteOrder byteOrder =littleEndian); + explicit Cr2Header(ByteOrder byteOrder =littleEndian); //! Destructor. ~Cr2Header(); //@} diff --git a/src/ini.cpp b/src/ini.cpp index 43336e81..f35f18d0 100755 --- a/src/ini.cpp +++ b/src/ini.cpp @@ -208,7 +208,7 @@ int Exiv2::ini_parse(const char* filename, ini_handler handler, void* user) return error; } -INIReader::INIReader(string filename) +INIReader::INIReader(const std::string &filename) { _error = ini_parse(filename.c_str(), ValueHandler, this); } diff --git a/src/orfimage_int.hpp b/src/orfimage_int.hpp index b9001b8f..4803885a 100644 --- a/src/orfimage_int.hpp +++ b/src/orfimage_int.hpp @@ -49,7 +49,7 @@ namespace Exiv2 { //! @name Creators //@{ //! Default constructor - OrfHeader(ByteOrder byteOrder =littleEndian); + explicit OrfHeader(ByteOrder byteOrder =littleEndian); //! Destructor. ~OrfHeader(); //@} diff --git a/src/tiffimage_int.hpp b/src/tiffimage_int.hpp index 5fc5c0e7..c3fa5eee 100644 --- a/src/tiffimage_int.hpp +++ b/src/tiffimage_int.hpp @@ -476,7 +476,7 @@ namespace Exiv2 { class FindExifdatum { public: //! Constructor, initializes the object with the IfdId to look for. - FindExifdatum(Exiv2::Internal::IfdId ifdId) : ifdId_(ifdId) {} + explicit FindExifdatum(Exiv2::Internal::IfdId ifdId) : ifdId_(ifdId) {} //! Returns true if IFD id matches. bool operator()(const Exiv2::Exifdatum& md) const { return ifdId_ == md.ifdId(); }