From 3e97850e97a659efd0bf599f1a9260bf65beb247 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Wed, 4 Jan 2023 14:28:48 -0800 Subject: [PATCH] manual default member init clang-tidy suggests this but fails to apply it. Signed-off-by: Rosen Penev --- include/exiv2/image.hpp | 10 +++++++--- src/image.cpp | 9 +-------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/include/exiv2/image.hpp b/include/exiv2/image.hpp index bb4e4698..5b47ea58 100644 --- a/include/exiv2/image.hpp +++ b/include/exiv2/image.hpp @@ -479,9 +479,13 @@ class EXIV2API Image { private: // DATA - ImageType imageType_; //!< Image type - uint16_t supportedMetadata_; //!< Bitmap with all supported metadata types - bool writeXmpFromPacket_; //!< Determines the source when writing XMP + ImageType imageType_; //!< Image type + uint16_t supportedMetadata_; //!< Bitmap with all supported metadata types +#ifdef EXV_HAVE_XMP_TOOLKIT + bool writeXmpFromPacket_{false}; //!< Determines the source when writing XMP +#else + bool writeXmpFromPacket_{true}; //!< Determines the source when writing XMP +#endif ByteOrder byteOrder_{invalidByteOrder}; //!< Byte order std::map tags_; //!< Map of tags diff --git a/src/image.cpp b/src/image.cpp index 6f648a9d..1a30d866 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -128,14 +128,7 @@ std::string pathOfFileUrl(const std::string& url) { // class member definitions namespace Exiv2 { Image::Image(ImageType type, uint16_t supportedMetadata, BasicIo::UniquePtr io) : - io_(std::move(io)), - imageType_(type), - supportedMetadata_(supportedMetadata), -#ifdef EXV_HAVE_XMP_TOOLKIT - writeXmpFromPacket_(false) { -#else - writeXmpFromPacket_(true) { -#endif + io_(std::move(io)), imageType_(type), supportedMetadata_(supportedMetadata) { } void Image::printStructure(std::ostream&, PrintStructureOption, size_t /*depth*/) {