]> 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 21:56:17 +0000 (23:56 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Sun, 15 Sep 2019 21:56:17 +0000 (23:56 +0200)
Spotted by cppcheck

25 files changed:
src/mathed/InsetMath.h
src/mathed/InsetMathBox.h
src/mathed/InsetMathBrace.h
src/mathed/InsetMathComment.h
src/mathed/InsetMathDiagram.h
src/mathed/InsetMathDiff.h
src/mathed/InsetMathEnsureMath.h
src/mathed/InsetMathGrid.h
src/mathed/InsetMathHull.h
src/mathed/InsetMathLefteqn.h
src/mathed/InsetMathMacroArgument.h
src/mathed/InsetMathMacroTemplate.cpp
src/mathed/InsetMathMacroTemplate.h
src/mathed/InsetMathOverset.h
src/mathed/InsetMathPar.h
src/mathed/InsetMathRef.h
src/mathed/InsetMathRoot.h
src/mathed/InsetMathScript.h
src/mathed/InsetMathSqrt.h
src/mathed/InsetMathSubstack.h
src/mathed/InsetMathUnderset.h
src/mathed/MacroTable.h
src/mathed/MathCompletionList.h
src/mathed/MathData.h
src/mathed/MathStream.h

index 32f265950ca7b18dd0323145f72c05cc6f81fffe..421cd162b99d6be92c7e529404bd3a64f4edda79 100644 (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
index af166c19c71b5cf75df874a2d8cb8be522393e05..e07fed9c48176c3511a317da759635190bcc0819 100644 (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; }
        ///
index 82393e97fc7339f722fba734cec47ff326951fe1..4a9efa716a48b4fa06457e83127f77fbfa092829 100644 (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
index 8cfe1368d7cb01cbf7465b8d096af8776194cdf0..10b244613f336795d2ad0cbf1548e4770e34c9d2 100644 (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;
        ///
index 732cd4ee1b57d34bfd92d53d4928a7588d1a514d..c7928ef57677818d5ea0d143df2c4bd30489f897 100644 (file)
@@ -22,7 +22,7 @@ namespace lyx {
 class InsetMathDiagram : public InsetMathGrid {
 public:
        ///
-       InsetMathDiagram(Buffer * buf);
+       explicit InsetMathDiagram(Buffer * buf);
        ///
        void metrics(MetricsInfo &, Dimension &) const;
        ///
index 063e5214cf73f703a3b20387a2a1f357bdab149b..f0d16f12bbb4051fff1a3186106880dd0d6fdc90 100644 (file)
@@ -24,7 +24,7 @@ namespace lyx {
 class InsetMathDiff : public InsetMathNest {
 public:
        ///
-       InsetMathDiff(Buffer * buf);
+       explicit InsetMathDiff(Buffer * buf);
        ///
        void addDer(MathData const & der);
        ///
index 41c3ad654ab74f5f392abd167594eb779a5c16d7..45dfa2ba9a41b3a73c090452a19d4baa45bc7a28 100644 (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; }
        ///
index a61439cfcd568bf685738ff730547e7ed666ff1f..b6d8044057df932754a0c9951971dc82c745398c 100644 (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);
        ///
index a6fc8c9d6415efd79d0eb437732553849bd54cc9..c801a4f936f2c363bea90d23c2bc8ba75a9e1609 100644 (file)
@@ -41,7 +41,7 @@ public:
                NOTAG
        };
        ///
-       InsetMathHull(Buffer * buf);
+       explicit InsetMathHull(Buffer * buf);
        ///
        InsetMathHull(Buffer * buf, HullType type);
        ///
index 1adb0bd4001de7ecc8723d1dddb7b269a732ebfa..0ad64af111b815ecae5ca6856798852370c829eb 100644 (file)
@@ -23,7 +23,7 @@ namespace lyx {
 class InsetMathLefteqn : public InsetMathNest {
 public:
        ///
-       InsetMathLefteqn(Buffer * buf);
+       explicit InsetMathLefteqn(Buffer * buf);
        ///
        docstring name() const;
        ///
index 178c89818d3679bf2fe8c1d3f67b95eefa7cb973..fe42f2be3662c60a84865f2cfa9867ea208f21fd 100644 (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;
        ///
index c300b2c2f2bc713eb5f1999051dadccfb6e6ad8b..dd9bec9accf2b8917e6752e10db0789482f1e7a7 100644 (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)
        {
index ddcfe4df78d2b0511c773f52540f274883cf6444..978aa64ed7db7f723683c1505bf54a78c89ef5c4 100644 (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,
index 213c96f5b3ef90915c8b7f9d19ed23749dd1811a..d7b8353922ef6bde3802b3cd8872b97290317198 100644 (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;
        ///
index 0a178f439642951f2c6a46bde0a247f286c27b2c..5aadfa8b3ac5abb6017189d53ae72455e63a9453 100644 (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);
        ///
index d1046d9aba8b1d1ba3545c73a47019c8d3e7dee8..204e9c474698da52a9fc533bc065d2ef2a9e740c 100644 (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);
        ///
index 088be24c050be975dff041a3946d36fc3c124733..144ecdf7a6ece8f72b034b278ec19a6148c3ec68 100644 (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;
        ///
index d29ffbd50b267856cab3b80e630a668cbd5e6b2a..7d7d852fb1211ef05867cf01a388ba86ee384659 100644 (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
index d2aab3282b027c2665b6baf34fffa098c178f3a3..8a9a6fc4555958c7a48de2ec8069194bb194864e 100644 (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;
        ///
index 822b0aa4533427ec71dc22a9cd50cf3012a33478..bb3089b61a442944e4234677347863bdfdc01d8e 100644 (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;
        ///
index 50143ae4d54446677e020af950f2df991fb78f43..565f0d5cc4fc4ce20fc695b5bb89b6b278fe50f8 100644 (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;
        ///
index eb613cae073c1987b272f62893324dab9fd1ccc3..d31d04b35bb58da48a25d07ee59c64c9046ff7d9 100644 (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
index 7d36557fcb35723fbbc83e280f1d97d01151fab8..5131f87e1f9fdcb0e3845d81a1e7752d0813b325 100644 (file)
@@ -24,7 +24,7 @@ namespace lyx {
 class MathCompletionList : public CompletionList {
 public:
        ///
-       MathCompletionList(Cursor const & cur);
+       explicit MathCompletionList(Cursor const & cur);
        ///
        virtual ~MathCompletionList();
 
index 810223d5be970c9721c1169d9fe633bd428d717e..3c93421821230f6b78bd8b1f7af3dfad5b44f6e6 100644 (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);
index 777992157744e92f644fca02ece5604a270e467c..df9d61088f45b87d9d7ad018114babe6389569db 100644 (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_;
 };