Make single-argument constructors explicit

This commit is contained in:
Alexander Mai 2014-11-13 21:39:14 +01:00
parent 0f007fa24e
commit 5300ba2074
4 changed files with 9 additions and 9 deletions

View File

@ -37,7 +37,7 @@ public:
* @param caseSensitive Match the case of the characters when * @param caseSensitive Match the case of the characters when
* matching paths? * matching paths?
*/ */
PathMatch(const std::vector<std::string> &masks, bool caseSensitive = true); explicit PathMatch(const std::vector<std::string> &masks, bool caseSensitive = true);
/** /**
* @brief Match path against list of masks. * @brief Match path against list of masks.

View File

@ -88,7 +88,7 @@ struct Filepointer {
unsigned int op_indent; unsigned int op_indent;
enum AppendMode { UNKNOWN_AM, APPEND, APPEND_EX }; enum AppendMode { UNKNOWN_AM, APPEND, APPEND_EX };
AppendMode append_mode; 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) { : mode(mode_), mode_indent(0), lastOperation(NONE), op_indent(0), append_mode(UNKNOWN_AM) {
} }
}; };

View File

@ -40,12 +40,12 @@ public:
/** Store information about variable usage */ /** Store information about variable usage */
class VariableUsage { class VariableUsage {
public: public:
VariableUsage(const Variable *var = nullptr, explicit VariableUsage(const Variable *var = nullptr,
VariableType type = standard, VariableType type = standard,
bool read = false, bool read = false,
bool write = false, bool write = false,
bool modified = false, bool modified = false,
bool allocateMemory = false) : bool allocateMemory = false) :
_var(var), _var(var),
_lastAccess(var?var->nameToken():0), _lastAccess(var?var->nameToken():0),
_type(type), _type(type),

View File

@ -427,7 +427,7 @@ struct AST_state {
unsigned int depth; unsigned int depth;
unsigned int inArrayAssignment; unsigned int inArrayAssignment;
bool cpp; 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) static bool iscast(const Token *tok)