]> git.lyx.org Git - features.git/commitdiff
Mark constructors with only one parameter as explicit
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Sun, 15 Sep 2019 22:01:48 +0000 (00:01 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Sun, 15 Sep 2019 22:01:48 +0000 (00:01 +0200)
Spotted by cppcheck

src/support/FileName.cpp
src/support/TempFile.cpp
src/support/unicode.cpp

index 42956b05b6f76f938c3e96b3b8ffd5ab83175c92..f77ccb73a665e68c952541eb70dc057f43de1e57 100644 (file)
@@ -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);
index 6e5a91d6e67b281b71db96eb438736b39d783ec5..e8ee5586b481cd71ffe567d06561aa7cb34d3917 100644 (file)
@@ -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())
index 001ec948ae70cc34c1137df60fcdb0be493a49f9..d79e02c41ead13cd0b4b6444a56ddb4232a09341 100644 (file)
@@ -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 << ')');