commit c6d8592ffb55b5f12207f08fb1152fe04f701e85
Author: Jean-Marc Lasgouttes <[email protected]>
Date:   Mon Sep 16 00:01:48 2019 +0200

    Mark constructors with only one parameter as explicit
    
    Spotted by cppcheck
---
 src/support/FileName.cpp |    3 ++-
 src/support/TempFile.cpp |    2 +-
 src/support/unicode.cpp  |    2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/support/FileName.cpp b/src/support/FileName.cpp
index 42956b0..f77ccb7 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 6e5a91d..e8ee558 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 001ec94..d79e02c 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 << 
')');

Reply via email to