From: Jean-Marc Lasgouttes Date: Sun, 15 Sep 2019 22:01:48 +0000 (+0200) Subject: Mark constructors with only one parameter as explicit X-Git-Tag: lyx-2.4.0dev-acb2ca7b~1515 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=c6d8592ffb55b5f12207f08fb1152fe04f701e85;p=features.git Mark constructors with only one parameter as explicit Spotted by cppcheck --- diff --git a/src/support/FileName.cpp b/src/support/FileName.cpp index 42956b05b6..f77ccb73a6 100644 --- a/src/support/FileName.cpp +++ b/src/support/FileName.cpp @@ -84,7 +84,8 @@ struct FileName::Private { Private() {} - Private(string const & abs_filename) : fi(toqstr(handleTildeName(abs_filename))) + explicit Private(string const & abs_filename) + : fi(toqstr(handleTildeName(abs_filename))) { name = fromqstr(fi.absoluteFilePath()); fi.setCaching(fi.exists() ? true : false); diff --git a/src/support/TempFile.cpp b/src/support/TempFile.cpp index 6e5a91d6e6..e8ee5586b4 100644 --- a/src/support/TempFile.cpp +++ b/src/support/TempFile.cpp @@ -30,7 +30,7 @@ namespace support { struct TempFile::Private { /// - Private(QString const & mask) : f(mask) + explicit Private(QString const & mask) : f(mask) { LYXERR(Debug::FILES, "Temporary file in " << fromqstr(mask)); if (f.open()) diff --git a/src/support/unicode.cpp b/src/support/unicode.cpp index 001ec948ae..d79e02c41e 100644 --- a/src/support/unicode.cpp +++ b/src/support/unicode.cpp @@ -51,7 +51,7 @@ namespace lyx { struct IconvProcessor::Handler { // assumes cd is valid - Handler(iconv_t const cd) : cd(cd) {} + explicit Handler(iconv_t const cd) : cd(cd) {} ~Handler() { if (iconv_close(cd) == -1) LYXERR0("Error returned from iconv_close(" << errno << ')');