Mark constructors with only one parameter as explicit

Spotted by cppcheck
This commit is contained in:
Jean-Marc Lasgouttes 2019-09-16 00:01:48 +02:00
parent 8d080364d2
commit c6d8592ffb
3 changed files with 4 additions and 3 deletions

View 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);

View 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())

View 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 << ')');