Mark constructors with only one parameter as explicit

Spotted by cppcheck
This commit is contained in:
Jean-Marc Lasgouttes 2019-09-15 23:56:17 +02:00
parent 19fb4db71e
commit decd2c74f1
25 changed files with 30 additions and 30 deletions

View File

@ -102,7 +102,7 @@ typedef void const * uid_type;
class InsetMath : public Inset {
public:
///
InsetMath(Buffer * buf = 0) : Inset(buf) {}
explicit InsetMath(Buffer * buf = 0) : Inset(buf) {}
/// identification as math inset
InsetMath * asInsetMath() { return this; }
/// identification as math inset

View File

@ -54,7 +54,7 @@ private:
class InsetMathFBox : public InsetMathNest {
public:
///
InsetMathFBox(Buffer * buf);
explicit InsetMathFBox(Buffer * buf);
///
mode_type currentMode() const { return TEXT_MODE; }
///
@ -116,7 +116,7 @@ private:
class InsetMathBoxed : public InsetMathNest {
public:
///
InsetMathBoxed(Buffer * buf);
explicit InsetMathBoxed(Buffer * buf);
///
marker_type marker(BufferView const *) const { return NO_MARKER; }
///

View File

@ -22,9 +22,9 @@ namespace lyx {
class InsetMathBrace : public InsetMathNest {
public:
///
InsetMathBrace(Buffer * buf);
explicit InsetMathBrace(Buffer * buf);
///
InsetMathBrace(MathData const & ar);
explicit InsetMathBrace(MathData const & ar);
/// identifies brace insets
InsetMathBrace * asBraceInset() { return this; }
/// identifies brace insets

View File

@ -23,11 +23,11 @@ class latexkeys;
class InsetMathComment : public InsetMathNest {
public:
///
InsetMathComment(Buffer * buf);
explicit InsetMathComment(Buffer * buf);
///
InsetMathComment(MathData const & ar);
explicit InsetMathComment(MathData const & ar);
///
explicit InsetMathComment(Buffer * buf, docstring const &);
InsetMathComment(Buffer * buf, docstring const &);
///
void metrics(MetricsInfo & mi, Dimension & dim) const;
///

View File

@ -22,7 +22,7 @@ namespace lyx {
class InsetMathDiagram : public InsetMathGrid {
public:
///
InsetMathDiagram(Buffer * buf);
explicit InsetMathDiagram(Buffer * buf);
///
void metrics(MetricsInfo &, Dimension &) const;
///

View File

@ -24,7 +24,7 @@ namespace lyx {
class InsetMathDiff : public InsetMathNest {
public:
///
InsetMathDiff(Buffer * buf);
explicit InsetMathDiff(Buffer * buf);
///
void addDer(MathData const & der);
///

View File

@ -22,7 +22,7 @@ namespace lyx {
/// Inset for ensuring math mode
class InsetMathEnsureMath : public InsetMathNest {
public:
InsetMathEnsureMath(Buffer * buf);
explicit InsetMathEnsureMath(Buffer * buf);
///
mode_type currentMode() const { return MATH_MODE; }
///

View File

@ -96,7 +96,7 @@ public:
public:
/// sets nrows and ncols to 1, vertical alingment to 'c'
InsetMathGrid(Buffer * buf);
explicit InsetMathGrid(Buffer * buf);
/// Note: columns first!
InsetMathGrid(Buffer * buf, col_type m, row_type n);
///

View File

@ -41,7 +41,7 @@ public:
NOTAG
};
///
InsetMathHull(Buffer * buf);
explicit InsetMathHull(Buffer * buf);
///
InsetMathHull(Buffer * buf, HullType type);
///

View File

@ -23,7 +23,7 @@ namespace lyx {
class InsetMathLefteqn : public InsetMathNest {
public:
///
InsetMathLefteqn(Buffer * buf);
explicit InsetMathLefteqn(Buffer * buf);
///
docstring name() const;
///

View File

@ -24,7 +24,7 @@ namespace lyx {
// A # that failed to parse
class InsetMathHash : public InsetMath {
public:
InsetMathHash(docstring const & str = docstring()) : str_('#' + str) {};
explicit InsetMathHash(docstring const & str = docstring()) : str_('#' + str) {};
///
void metrics(MetricsInfo & mi, Dimension & dim) const;
///

View File

@ -250,7 +250,7 @@ void InsetDisplayLabelBox::draw(PainterInfo & pi, int x, int y) const
class InsetMathWrapper : public InsetMath {
public:
///
InsetMathWrapper(MathData const * value) : value_(value) {}
explicit InsetMathWrapper(MathData const * value) : value_(value) {}
///
void metrics(MetricsInfo & mi, Dimension & dim) const;
///
@ -755,7 +755,7 @@ class OptionalsMacroInstanceFix
{
public:
///
OptionalsMacroInstanceFix(int optionals) : optionals_(optionals) {}
explicit OptionalsMacroInstanceFix(int optionals) : optionals_(optionals) {}
///
void operator()(InsetMathMacro * macro)
{

View File

@ -27,7 +27,7 @@ class XHTMLStream;
class InsetMathMacroTemplate : public InsetMathNest {
public:
///
InsetMathMacroTemplate(Buffer * buf);
explicit InsetMathMacroTemplate(Buffer * buf);
///
InsetMathMacroTemplate(Buffer * buf, docstring const & name, int nargs,
int optional, MacroType type,

View File

@ -22,7 +22,7 @@ namespace lyx {
class InsetMathOverset : public InsetMathFracBase {
public:
///
InsetMathOverset(Buffer * buf) : InsetMathFracBase(buf) {}
explicit InsetMathOverset(Buffer * buf) : InsetMathFracBase(buf) {}
///
void metrics(MetricsInfo & mi, Dimension & dim) const;
///

View File

@ -21,7 +21,7 @@ namespace lyx {
class InsetMathPar : public InsetMathHull {
public:
///
InsetMathPar(Buffer * buf) : InsetMathHull(buf) {}
explicit InsetMathPar(Buffer * buf) : InsetMathHull(buf) {}
///
InsetMathPar(Buffer * buf, MathData const & ar);
///

View File

@ -23,7 +23,7 @@ class Buffer;
class InsetMathRef : public InsetMathCommand {
public:
///
InsetMathRef(Buffer * buf);
explicit InsetMathRef(Buffer * buf);
///
explicit InsetMathRef(Buffer * buf, docstring const & data);
///

View File

@ -23,7 +23,7 @@ namespace lyx {
class InsetMathRoot : public InsetMathNest {
public:
///
InsetMathRoot(Buffer * buf);
explicit InsetMathRoot(Buffer * buf);
///
bool idxUpDown(Cursor & cur, bool up) const;
///

View File

@ -25,7 +25,7 @@ namespace lyx {
class InsetMathScript : public InsetMathNest {
public:
/// create inset without scripts
InsetMathScript(Buffer * buf);
explicit InsetMathScript(Buffer * buf);
/// create inset with single script
explicit InsetMathScript(Buffer * buf, bool up);
/// create inset with single script and given nucleus

View File

@ -23,7 +23,7 @@ namespace lyx {
class InsetMathSqrt : public InsetMathNest {
public:
///
InsetMathSqrt(Buffer * buf);
explicit InsetMathSqrt(Buffer * buf);
///
void draw(PainterInfo &, int x, int y) const;
///

View File

@ -23,7 +23,7 @@ namespace lyx {
class InsetMathSubstack : public InsetMathGrid {
public:
///
InsetMathSubstack(Buffer * buf);
explicit InsetMathSubstack(Buffer * buf);
///
void metrics(MetricsInfo & mi, Dimension & dim) const;
///

View File

@ -22,7 +22,7 @@ namespace lyx {
class InsetMathUnderset : public InsetMathFracBase {
public:
///
InsetMathUnderset(Buffer * buf) : InsetMathFracBase(buf) {}
explicit InsetMathUnderset(Buffer * buf) : InsetMathFracBase(buf) {}
///
void metrics(MetricsInfo & mi, Dimension & dim) const;
///

View File

@ -39,7 +39,7 @@ enum MacroType {
class MacroData {
public:
/// Constructor to make STL containers happy
MacroData(Buffer * buf = 0);
explicit MacroData(Buffer * buf = 0);
/// Create lazy MacroData which only queries the macro template when needed
MacroData(Buffer * buf, DocIterator const & pos);
/// Create non-lazy MacroData which directly queries the macro template

View File

@ -24,7 +24,7 @@ namespace lyx {
class MathCompletionList : public CompletionList {
public:
///
MathCompletionList(Cursor const & cur);
explicit MathCompletionList(Cursor const & cur);
///
virtual ~MathCompletionList();

View File

@ -68,7 +68,7 @@ public:
public:
///
MathData(Buffer * buf = 0) : minasc_(0), mindes_(0), slevel_(0),
explicit MathData(Buffer * buf = 0) : minasc_(0), mindes_(0), slevel_(0),
sshift_(0), buffer_(buf) {}
///
MathData(Buffer * buf, const_iterator from, const_iterator to);

View File

@ -307,7 +307,7 @@ public:
class ETag {
public:
///
ETag(char const * const tag) : tag_(tag) {}
explicit ETag(char const * const tag) : tag_(tag) {}
///
char const * const tag_;
};