Merge pull request #2211 from neheb/1

clang-tidy: default member init
main
Luis Díaz Más 3 years ago committed by GitHub
commit 471b816491
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -162,7 +162,7 @@ class Print : public Task {
@return 1 if a line was written, 0 if the information was not found. @return 1 if a line was written, 0 if the information was not found.
*/ */
int printTag(const Exiv2::ExifData& exifData, EasyAccessFct easyAccessFct, const std::string& label = "", int printTag(const Exiv2::ExifData& exifData, EasyAccessFct easyAccessFct, const std::string& label = "",
EasyAccessFct easyAccessFctFallback = NULL) const; EasyAccessFct easyAccessFctFallback = nullptr) const;
private: private:
std::string path_; std::string path_;

@ -176,26 +176,10 @@ int main(int argc, char* const argv[]) {
Params::Params() : Params::Params() :
optstring_(":hVvqfbuktTFa:Y:O:D:r:p:P:d:e:i:c:m:M:l:S:g:K:n:Q:"), optstring_(":hVvqfbuktTFa:Y:O:D:r:p:P:d:e:i:c:m:M:l:S:g:K:n:Q:"),
help_(false),
version_(false),
verbose_(false),
force_(false),
binary_(false),
unknown_(true),
preserve_(false),
timestamp_(false),
timestampOnly_(false),
fileExistsPolicy_(askPolicy),
adjust_(false),
printMode_(pmSummary),
printItems_(0),
printTags_(Exiv2::mdNone),
action_(0),
target_(ctExif | ctIptc | ctComment | ctXmp), target_(ctExif | ctIptc | ctComment | ctXmp),
adjustment_(0),
format_("%Y%m%d_%H%M%S"), format_("%Y%m%d_%H%M%S") {
formatSet_(false),
first_(true) {
yodAdjust_[yodYear] = emptyYodAdjust_[yodYear]; yodAdjust_[yodYear] = emptyYodAdjust_[yodYear];
yodAdjust_[yodMonth] = emptyYodAdjust_[yodMonth]; yodAdjust_[yodMonth] = emptyYodAdjust_[yodMonth];
yodAdjust_[yodDay] = emptyYodAdjust_[yodDay]; yodAdjust_[yodDay] = emptyYodAdjust_[yodDay];
@ -1453,9 +1437,10 @@ bool parseLine(ModifyCmd& modifyCmd, const std::string& line, int num) {
CmdId commandId(const std::string& cmdString) { CmdId commandId(const std::string& cmdString) {
int i = 0; int i = 0;
for (; cmdIdAndString[i].cmdId_ != invalidCmdId && cmdIdAndString[i].cmdString_ != cmdString; ++i) { while (cmdIdAndString[i].first != invalidCmdId && cmdIdAndString[i].second != cmdString) {
++i;
} }
return cmdIdAndString[i].cmdId_; return cmdIdAndString[i].first;
} }
std::string parseEscapes(const std::string& input) { std::string parseEscapes(const std::string& input) {

@ -39,25 +39,19 @@ enum MetadataId {
//! Structure for one parsed modification command //! Structure for one parsed modification command
struct ModifyCmd { struct ModifyCmd {
//! C'tor //! C'tor
ModifyCmd() : ModifyCmd() = default;
cmdId_(invalidCmdId), metadataId_(invalidMetadataId), typeId_(Exiv2::invalidTypeId), explicitType_(false) { CmdId cmdId_{invalidCmdId}; //!< Command identifier
} std::string key_; //!< Exiv2 key string
CmdId cmdId_; //!< Command identifier MetadataId metadataId_{invalidMetadataId}; //!< Metadata identifier
std::string key_; //!< Exiv2 key string Exiv2::TypeId typeId_{Exiv2::invalidTypeId}; //!< Exiv2 type identifier
MetadataId metadataId_; //!< Metadata identifier
Exiv2::TypeId typeId_; //!< Exiv2 type identifier
//! Flag to indicate if the type was explicitly specified (true) //! Flag to indicate if the type was explicitly specified (true)
bool explicitType_; bool explicitType_{false};
std::string value_; //!< Data std::string value_; //!< Data
}; };
//! Container for modification commands //! Container for modification commands
using ModifyCmds = std::vector<ModifyCmd>; using ModifyCmds = std::vector<ModifyCmd>;
//! Structure to link command identifiers to strings //! Structure to link command identifiers to strings
struct CmdIdAndString { using CmdIdAndString = std::pair<CmdId, std::string>;
CmdId cmdId_; //!< Commands identifier
std::string cmdString_; //!< Command string
};
/*! /*!
@brief Implements the command line handling for the program. @brief Implements the command line handling for the program.
@ -182,28 +176,28 @@ class Params : public Util::Getopt {
long adjustment_; //!< Adjustment value. long adjustment_; //!< Adjustment value.
}; };
bool help_; //!< Help option flag. bool help_{false}; //!< Help option flag.
bool version_; //!< Version option flag. bool version_{false}; //!< Version option flag.
bool verbose_; //!< Verbose (talkative) option flag. bool verbose_{false}; //!< Verbose (talkative) option flag.
bool force_; //!< Force overwrites flag. bool force_{false}; //!< Force overwrites flag.
bool binary_; //!< Suppress long binary values. bool binary_{false}; //!< Suppress long binary values.
bool unknown_; //!< Suppress unknown tags. bool unknown_{true}; //!< Suppress unknown tags.
bool preserve_; //!< Preserve timestamps flag. bool preserve_{false}; //!< Preserve timestamps flag.
bool timestamp_; //!< Rename also sets the file timestamp. bool timestamp_{false}; //!< Rename also sets the file timestamp.
bool timestampOnly_; //!< Rename only sets the file timestamp. bool timestampOnly_{false}; //!< Rename only sets the file timestamp.
FileExistsPolicy fileExistsPolicy_; //!< What to do if file to rename exists. FileExistsPolicy fileExistsPolicy_{askPolicy}; //!< What to do if file to rename exists.
bool adjust_; //!< Adjustment flag. bool adjust_{false}; //!< Adjustment flag.
PrintMode printMode_; //!< Print mode. PrintMode printMode_{pmSummary}; //!< Print mode.
unsigned long printItems_; //!< Print items. unsigned long printItems_{0}; //!< Print items.
unsigned long printTags_; //!< Print tags (bitmap of MetadataId flags). unsigned long printTags_{Exiv2::mdNone}; //!< Print tags (bitmap of MetadataId flags).
//! %Action (integer rather than TaskType to avoid dependency). //! %Action (integer rather than TaskType to avoid dependency).
int action_; int action_{0};
int target_; //!< What common target to process. int target_; //!< What common target to process.
long adjustment_; //!< Adjustment in seconds. long adjustment_{0}; //!< Adjustment in seconds.
YodAdjust yodAdjust_[3]; //!< Year, month and day adjustment info. YodAdjust yodAdjust_[3]; //!< Year, month and day adjustment info.
std::string format_; //!< Filename format (-r option arg). std::string format_; //!< Filename format (-r option arg).
bool formatSet_; //!< Whether the format is set with -r bool formatSet_{false}; //!< Whether the format is set with -r
CmdFiles cmdFiles_; //!< Names of the modification command files CmdFiles cmdFiles_; //!< Names of the modification command files
CmdLines cmdLines_; //!< Commands from the command line CmdLines cmdLines_; //!< Commands from the command line
ModifyCmds modifyCmds_; //!< Parsed modification commands ModifyCmds modifyCmds_; //!< Parsed modification commands
@ -219,7 +213,7 @@ class Params : public Util::Getopt {
Exiv2::DataBuf stdinBuf; //!< DataBuf with the binary bytes from stdin Exiv2::DataBuf stdinBuf; //!< DataBuf with the binary bytes from stdin
private: private:
bool first_; bool first_{true};
Params(); Params();

@ -79,9 +79,6 @@ int getopt(int argc, char* const argv[], const char* optstring) {
// ***************************************************************************** // *****************************************************************************
// class Getopt // class Getopt
Getopt::Getopt() : errcnt_(0) {
}
int Getopt::getopt(int argc, char* const argv[], const std::string& optstring) { int Getopt::getopt(int argc, char* const argv[], const std::string& optstring) {
progname_ = fs::path(argv[0]).filename().string(); progname_ = fs::path(argv[0]).filename().string();
Util::optind = 0; // reset the Util::Getopt scanner Util::optind = 0; // reset the Util::Getopt scanner

@ -29,7 +29,7 @@ int getopt(int argc, char* const argv[], const char* optstring);
class Getopt { class Getopt {
public: public:
//! Default constructor. //! Default constructor.
Getopt(); Getopt() = default;
//! Destructor. //! Destructor.
virtual ~Getopt() = default; virtual ~Getopt() = default;
@ -96,7 +96,7 @@ class Getopt {
private: private:
std::string progname_; std::string progname_;
int errcnt_; int errcnt_{0};
}; };
}; // namespace Util }; // namespace Util

@ -582,7 +582,7 @@ class EXIV2API CommentValue : public StringValueBase {
public: public:
// DATA // DATA
ByteOrder byteOrder_; //!< Byte order of the comment string that was read ByteOrder byteOrder_{littleEndian}; //!< Byte order of the comment string that was read
}; // class CommentValue }; // class CommentValue

@ -143,11 +143,6 @@ void ExifTags::taglist(std::ostream& os, const std::string& groupName) {
//! %Internal Pimpl structure with private members and data of class ExifKey. //! %Internal Pimpl structure with private members and data of class ExifKey.
struct ExifKey::Impl { struct ExifKey::Impl {
//! @name Creators
//@{
Impl() = default; //!< Default constructor
//@}
//! @name Manipulators //! @name Manipulators
//@{ //@{
/*! /*!

@ -330,10 +330,10 @@ CommentValue::CharsetId CommentValue::CharsetInfo::charsetIdByCode(const std::st
return charsetTable_[i].charsetId_ == lastCharsetId ? invalidCharsetId : charsetTable_[i].charsetId_; return charsetTable_[i].charsetId_ == lastCharsetId ? invalidCharsetId : charsetTable_[i].charsetId_;
} }
CommentValue::CommentValue() : StringValueBase(Exiv2::undefined), byteOrder_(littleEndian) { CommentValue::CommentValue() : StringValueBase(Exiv2::undefined) {
} }
CommentValue::CommentValue(const std::string& comment) : StringValueBase(Exiv2::undefined), byteOrder_(littleEndian) { CommentValue::CommentValue(const std::string& comment) : StringValueBase(Exiv2::undefined) {
read(comment); read(comment);
} }

Loading…
Cancel
Save