From 5300ba20740f6b909caf67285d0caca3c3bd99e6 Mon Sep 17 00:00:00 2001 From: Alexander Mai Date: Thu, 13 Nov 2014 21:39:14 +0100 Subject: [PATCH] Make single-argument constructors explicit --- cli/pathmatch.h | 2 +- lib/checkio.cpp | 2 +- lib/checkunusedvar.cpp | 12 ++++++------ lib/tokenlist.cpp | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cli/pathmatch.h b/cli/pathmatch.h index b7880a77c..e35228233 100644 --- a/cli/pathmatch.h +++ b/cli/pathmatch.h @@ -37,7 +37,7 @@ public: * @param caseSensitive Match the case of the characters when * matching paths? */ - PathMatch(const std::vector &masks, bool caseSensitive = true); + explicit PathMatch(const std::vector &masks, bool caseSensitive = true); /** * @brief Match path against list of masks. diff --git a/lib/checkio.cpp b/lib/checkio.cpp index 8b0424f4a..16ff14a44 100644 --- a/lib/checkio.cpp +++ b/lib/checkio.cpp @@ -88,7 +88,7 @@ struct Filepointer { unsigned int op_indent; enum AppendMode { UNKNOWN_AM, APPEND, APPEND_EX }; AppendMode append_mode; - Filepointer(OpenMode mode_ = UNKNOWN_OM) + explicit Filepointer(OpenMode mode_ = UNKNOWN_OM) : mode(mode_), mode_indent(0), lastOperation(NONE), op_indent(0), append_mode(UNKNOWN_AM) { } }; diff --git a/lib/checkunusedvar.cpp b/lib/checkunusedvar.cpp index 6f02fcf20..23a71d071 100644 --- a/lib/checkunusedvar.cpp +++ b/lib/checkunusedvar.cpp @@ -40,12 +40,12 @@ public: /** Store information about variable usage */ class VariableUsage { public: - VariableUsage(const Variable *var = nullptr, - VariableType type = standard, - bool read = false, - bool write = false, - bool modified = false, - bool allocateMemory = false) : + explicit VariableUsage(const Variable *var = nullptr, + VariableType type = standard, + bool read = false, + bool write = false, + bool modified = false, + bool allocateMemory = false) : _var(var), _lastAccess(var?var->nameToken():0), _type(type), diff --git a/lib/tokenlist.cpp b/lib/tokenlist.cpp index cf265e01f..271b28d19 100644 --- a/lib/tokenlist.cpp +++ b/lib/tokenlist.cpp @@ -427,7 +427,7 @@ struct AST_state { unsigned int depth; unsigned int inArrayAssignment; bool cpp; - AST_state(bool cpp_) : depth(0), inArrayAssignment(0), cpp(cpp_) {} + explicit AST_state(bool cpp_) : depth(0), inArrayAssignment(0), cpp(cpp_) {} }; static bool iscast(const Token *tok)