From 667560114752e668fbd59123faf9d454da632fb0 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Sat, 11 Jun 2016 23:39:45 -0400 Subject: [PATCH] Fix a number of other uninitialized members. Fixes coverity #23392, 23394, 23397, 23403, 23414, 23424, 23448, 23477. --- src/Encoding.h | 4 ++-- src/frontends/qt4/FancyLineEdit.cpp | 2 +- src/frontends/qt4/GuiCitation.cpp | 2 +- src/frontends/qt4/GuiGraphics.cpp | 2 +- src/frontends/qt4/GuiWorkArea.cpp | 1 + src/insets/ExternalTransforms.h | 2 +- src/insets/InsetCaption.cpp | 3 ++- src/insets/InsetNomencl.cpp | 2 +- src/mathed/InsetMathDecoration.cpp | 2 +- 9 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/Encoding.h b/src/Encoding.h index aac632e6da..5e289ca701 100644 --- a/src/Encoding.h +++ b/src/Encoding.h @@ -130,8 +130,8 @@ public: /// Represent any of the above packages static int const any; /// - Encoding() : fixedwidth_(true), unsafe_(false), start_encodable_(0), - package_(none), complete_(false) {} + Encoding() : fixedwidth_(true), unsafe_(false), forced_(0), + start_encodable_(0), package_(none), complete_(false) {} /// Encoding(std::string const & n, std::string const & l, std::string const & g, std::string const & i, diff --git a/src/frontends/qt4/FancyLineEdit.cpp b/src/frontends/qt4/FancyLineEdit.cpp index e0057daecf..1238afd262 100644 --- a/src/frontends/qt4/FancyLineEdit.cpp +++ b/src/frontends/qt4/FancyLineEdit.cpp @@ -264,7 +264,7 @@ void FancyLineEdit::setButtonFocusPolicy(Side side, Qt::FocusPolicy policy) // IconButton - helper class to represent a clickable icon IconButton::IconButton(QWidget *parent) - : QAbstractButton(parent), m_autoHide(false) + : QAbstractButton(parent), m_iconOpacity(0.0), m_autoHide(false) { setCursor(Qt::ArrowCursor); setFocusPolicy(Qt::NoFocus); diff --git a/src/frontends/qt4/GuiCitation.cpp b/src/frontends/qt4/GuiCitation.cpp index 63b6bc6b0c..028e874f66 100644 --- a/src/frontends/qt4/GuiCitation.cpp +++ b/src/frontends/qt4/GuiCitation.cpp @@ -89,7 +89,7 @@ static vector to_docstring_vector(QStringList const & qlist) GuiCitation::GuiCitation(GuiView & lv) : DialogView(lv, "citation", qt_("Citation")), - params_(insetCode("citation")) + style_(0), params_(insetCode("citation")) { setupUi(this); diff --git a/src/frontends/qt4/GuiGraphics.cpp b/src/frontends/qt4/GuiGraphics.cpp index 2ef5c6b6f6..7e4f9ef37b 100644 --- a/src/frontends/qt4/GuiGraphics.cpp +++ b/src/frontends/qt4/GuiGraphics.cpp @@ -110,7 +110,7 @@ static void setAutoTextCB(QCheckBox * checkBox, QLineEdit * lineEdit, GuiGraphics::GuiGraphics(GuiView & lv) - : GuiDialog(lv, "graphics", qt_("Graphics")) + : GuiDialog(lv, "graphics", qt_("Graphics")), bbChanged(false) { setupUi(this); diff --git a/src/frontends/qt4/GuiWorkArea.cpp b/src/frontends/qt4/GuiWorkArea.cpp index 4f63d16cc0..185c2f5308 100644 --- a/src/frontends/qt4/GuiWorkArea.cpp +++ b/src/frontends/qt4/GuiWorkArea.cpp @@ -1825,6 +1825,7 @@ void TabWorkArea::closeTab(int index) class DisplayPath { public: /// make vector happy + // coverity[UNINIT_CTOR] DisplayPath() {} /// DisplayPath(int tab, FileName const & filename) diff --git a/src/insets/ExternalTransforms.h b/src/insets/ExternalTransforms.h index 8e531f31d8..1d819001a5 100644 --- a/src/insets/ExternalTransforms.h +++ b/src/insets/ExternalTransforms.h @@ -334,7 +334,7 @@ typedef boost::function class TransformStore { public: - TransformStore() {} + TransformStore() : id(Rotate) {} /** Stores \c factory and a reminder of what \c data this \c factory * operates on. diff --git a/src/insets/InsetCaption.cpp b/src/insets/InsetCaption.cpp index b69d1ba71a..208ad1ac38 100644 --- a/src/insets/InsetCaption.cpp +++ b/src/insets/InsetCaption.cpp @@ -51,7 +51,8 @@ namespace lyx { InsetCaption::InsetCaption(Buffer * buf, string const & type) - : InsetText(buf, InsetText::PlainLayout), type_(type) + : InsetText(buf, InsetText::PlainLayout), + labelwidth_(0), is_subfloat_(false), type_(type) { setDrawFrame(true); setFrameColor(Color_collapsableframe); diff --git a/src/insets/InsetNomencl.cpp b/src/insets/InsetNomencl.cpp index 7ebfe4ae2c..f75ef15cd5 100644 --- a/src/insets/InsetNomencl.cpp +++ b/src/insets/InsetNomencl.cpp @@ -171,7 +171,7 @@ docstring InsetPrintNomencl::screenLabel() const struct NomenclEntry { - NomenclEntry() {} + NomenclEntry() : par(0) {} NomenclEntry(docstring s, docstring d, Paragraph const * p) : symbol(s), desc(d), par(p) {} diff --git a/src/mathed/InsetMathDecoration.cpp b/src/mathed/InsetMathDecoration.cpp index 37ae239d10..9e4a338eee 100644 --- a/src/mathed/InsetMathDecoration.cpp +++ b/src/mathed/InsetMathDecoration.cpp @@ -169,7 +169,7 @@ void InsetMathDecoration::infoize(odocstream & os) const namespace { struct Attributes { - Attributes() {} + Attributes() : over(false) {} Attributes(bool o, string t) : over(o), tag(t) {} bool over; -- 2.39.2