From 0c1eb71448ee285174905e321e3ea68903a00223 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Fri, 3 May 2013 14:15:10 +0200 Subject: [PATCH] Some potential bugs spotted by llvm/clang src/TextClass.h src/insets/InsetTabular.h Overloaded virtual method missing the 'const' qualifier src/insets/InsetCommandParams.h Missing constructor (breaks compilation with llvm/clang) src/frontends/qt4/GuiWorkArea.cpp Missing parenthesis: `+' has priority over `?:' (I do not know whether this has a visible effect). src/mathed/InsetMathFont.cpp Use of == instead of = in mathmlize() --- src/TextClass.h | 2 +- src/frontends/qt4/GuiWorkArea.cpp | 2 +- src/insets/InsetCommandParams.h | 2 ++ src/insets/InsetTabular.h | 2 +- src/mathed/InsetMathFont.cpp | 4 ++-- status.20x | 4 ++++ 6 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/TextClass.h b/src/TextClass.h index dc47192e03..dc30062922 100644 --- a/src/TextClass.h +++ b/src/TextClass.h @@ -361,7 +361,7 @@ public: /// \return true if there is a Layout with latexname lay bool hasLaTeXLayout(std::string const & lay) const; /// A DocumentClass nevers count as loaded, since it is dynamic - virtual bool loaded() { return false; } + virtual bool loaded() const { return false; } /// \return the layout object of an inset given by name. If the name /// is not found as such, the part after the ':' is stripped off, and /// searched again. In this way, an error fallback can be provided: diff --git a/src/frontends/qt4/GuiWorkArea.cpp b/src/frontends/qt4/GuiWorkArea.cpp index df9dfe8150..049831d58d 100644 --- a/src/frontends/qt4/GuiWorkArea.cpp +++ b/src/frontends/qt4/GuiWorkArea.cpp @@ -940,7 +940,7 @@ void GuiWorkArea::generateSyntheticMouseEvent() buffer_view_->scroll(up ? -step : step); buffer_view_->updateMetrics(); } else { - buffer_view_->scrollDocView(value + up ? -step : step, false); + buffer_view_->scrollDocView(value + (up ? -step : step), false); } // In which paragraph do we have to set the cursor ? diff --git a/src/insets/InsetCommandParams.h b/src/insets/InsetCommandParams.h index 7dc59fa5ee..219d79b27e 100644 --- a/src/insets/InsetCommandParams.h +++ b/src/insets/InsetCommandParams.h @@ -31,6 +31,8 @@ class Lexer; class ParamInfo { public: + /// + ParamInfo() {} /// Types of parameters enum ParamType { LATEX_OPTIONAL, /// normal optional argument diff --git a/src/insets/InsetTabular.h b/src/insets/InsetTabular.h index bc4542c5a2..2049e54309 100644 --- a/src/insets/InsetTabular.h +++ b/src/insets/InsetTabular.h @@ -55,7 +55,7 @@ public: /// InsetCode lyxCode() const { return CELL_CODE; } /// - Inset * clone() { return new InsetTableCell(*this); } + Inset * clone() const { return new InsetTableCell(*this); } /// bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus & status) const; diff --git a/src/mathed/InsetMathFont.cpp b/src/mathed/InsetMathFont.cpp index efd43ced12..9c02a3cbb2 100644 --- a/src/mathed/InsetMathFont.cpp +++ b/src/mathed/InsetMathFont.cpp @@ -140,7 +140,7 @@ void InsetMathFont::htmlize(HtmlStream & os) const || tag == "textbf") variant = "bold"; else if (tag == "mathcal") - variant == "script"; + variant = "script"; else if (tag == "mathit" || tag == "textsl" || tag == "emph" || tag == "textit") variant = "italic"; @@ -180,7 +180,7 @@ void InsetMathFont::mathmlize(MathStream & os) const || tag == "textbf") variant = "bold"; else if (tag == "mathcal") - variant == "script"; + variant = "script"; else if (tag == "mathit" || tag == "textsl" || tag == "emph" || tag == "textit") variant = "italic"; diff --git a/status.20x b/status.20x index e13dcc0985..922ea2df1f 100644 --- a/status.20x +++ b/status.20x @@ -77,3 +77,7 @@ What's new * BUILD/INSTALLATION + +- Add support for automake 1.13. + +- Fix compilation with clang LLVM compiler. -- 2.39.5