From cbb5f99ade6a2193d25f51d8273e9d3829bcd961 Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 16 Jul 2020 20:38:30 +0200 Subject: [PATCH] PVS: V730 Not all members of a class are initialized inside the constructor --- src/App/DocumentObjectPyImp.cpp | 2 +- src/App/ExpressionParser.h | 3 ++- src/App/Link.h | 4 ++-- src/App/ObjectIdentifier.cpp | 7 ++++++- src/App/PropertyLinks.cpp | 3 +-- src/Gui/CommandDoc.cpp | 4 ++++ src/Gui/GuiApplicationNativeEventAware.cpp | 2 +- src/Gui/Selection.h | 8 +++++--- src/Mod/Fem/Gui/ViewProviderFemPostFunction.h | 2 +- src/Mod/Part/Gui/TaskCheckGeometry.cpp | 3 ++- src/Mod/Path/App/Tooltable.cpp | 1 + src/Mod/Sketcher/Gui/ViewProviderSketch.cpp | 1 + src/Mod/TechDraw/App/Cosmetic.cpp | 1 + src/Mod/TechDraw/App/DrawDimHelper.h | 2 +- src/Mod/TechDraw/App/EdgeWalker.h | 2 +- src/Mod/TechDraw/Gui/QGCustomText.cpp | 2 +- src/Mod/TechDraw/Gui/QGIRichAnno.cpp | 2 +- 17 files changed, 32 insertions(+), 17 deletions(-) diff --git a/src/App/DocumentObjectPyImp.cpp b/src/App/DocumentObjectPyImp.cpp index eabbfe8b17..ac5ec8db08 100644 --- a/src/App/DocumentObjectPyImp.cpp +++ b/src/App/DocumentObjectPyImp.cpp @@ -460,7 +460,7 @@ PyObject* DocumentObjectPy::getSubObject(PyObject *args, PyObject *keywds) Py::Object obj; Py::Object pyObj; Base::Matrix4D mat; - SubInfo(const Base::Matrix4D &mat):mat(mat){} + SubInfo(const Base::Matrix4D &mat) : sobj(nullptr), mat(mat){} }; Base::Matrix4D mat; diff --git a/src/App/ExpressionParser.h b/src/App/ExpressionParser.h index f7c802357e..f5b9545708 100644 --- a/src/App/ExpressionParser.h +++ b/src/App/ExpressionParser.h @@ -488,7 +488,8 @@ public: std::string string; std::pair func; ObjectIdentifier::String string_or_identifier; - semantic_type() : expr(0), ivalue(0), fvalue(0), func({FunctionExpression::NONE, std::string()}) {} + semantic_type() : component(0), expr(0), ivalue(0), fvalue(0) + , func({FunctionExpression::NONE, std::string()}) {} }; #define YYSTYPE semantic_type diff --git a/src/App/Link.h b/src/App/Link.h index 503ea3a457..dff79717e0 100644 --- a/src/App/Link.h +++ b/src/App/Link.h @@ -181,10 +181,10 @@ public: const char *doc; PropInfo(int index, const char *name,Base::Type type,const char *doc) - :index(index),name(name),type(type),doc(doc) + : index(index), name(name), type(type), doc(doc) {} - PropInfo() {} + PropInfo() : index(0), name(0), doc(0) {} }; #define LINK_PROP_INFO(_1,_var,_param) \ diff --git a/src/App/ObjectIdentifier.cpp b/src/App/ObjectIdentifier.cpp index 2618a8a1fd..c6aadd936e 100644 --- a/src/App/ObjectIdentifier.cpp +++ b/src/App/ObjectIdentifier.cpp @@ -115,6 +115,7 @@ ObjectIdentifier::ObjectIdentifier(const App::PropertyContainer * _owner, , documentNameSet(false) , documentObjectNameSet(false) , localProperty(false) + , _hash(0) { if (_owner) { const DocumentObject * docObj = freecad_dynamic_cast(_owner); @@ -134,7 +135,11 @@ ObjectIdentifier::ObjectIdentifier(const App::PropertyContainer * _owner, } ObjectIdentifier::ObjectIdentifier(const App::PropertyContainer * _owner, bool localProperty) - :localProperty(localProperty) + : owner(0) + , documentNameSet(false) + , documentObjectNameSet(false) + , localProperty(localProperty) + , _hash(0) { if (_owner) { const DocumentObject * docObj = freecad_dynamic_cast(_owner); diff --git a/src/App/PropertyLinks.cpp b/src/App/PropertyLinks.cpp index fa035a57bd..c5036cffd9 100644 --- a/src/App/PropertyLinks.cpp +++ b/src/App/PropertyLinks.cpp @@ -898,12 +898,11 @@ TYPESYSTEM_SOURCE(App::PropertyLinkSubHidden, App::PropertyLinkSub) PropertyLinkSub::PropertyLinkSub() -:_pcLinkSub(0) + : _pcLinkSub(0), _restoreLabel(false) { } - PropertyLinkSub::~PropertyLinkSub() { //in case this property is dynamically removed diff --git a/src/Gui/CommandDoc.cpp b/src/Gui/CommandDoc.cpp index bc7d25974f..c7fa81fb16 100644 --- a/src/Gui/CommandDoc.cpp +++ b/src/Gui/CommandDoc.cpp @@ -1539,6 +1539,10 @@ class StdCmdExpression : public Gui::Command { public: StdCmdExpression() : Command("Std_Expressions") + , pcActionCopyAll(nullptr) + , pcActionCopySel(nullptr) + , pcActionCopyActive(nullptr) + , pcActionPaste(nullptr) { sGroup = QT_TR_NOOP("Edit"); sMenuText = QT_TR_NOOP("Expression actions"); diff --git a/src/Gui/GuiApplicationNativeEventAware.cpp b/src/Gui/GuiApplicationNativeEventAware.cpp index b63667a9e8..10dfe7bf28 100644 --- a/src/Gui/GuiApplicationNativeEventAware.cpp +++ b/src/Gui/GuiApplicationNativeEventAware.cpp @@ -46,7 +46,7 @@ #endif // Spacemice Gui::GUIApplicationNativeEventAware::GUIApplicationNativeEventAware(int &argc, char *argv[]) : - QApplication (argc, argv) + QApplication (argc, argv), spaceballPresent(false) { #if defined(_USE_3DCONNEXION_SDK) || defined(SPNAV_FOUND) nativeEvent = new Gui::GuiNativeEvent(this); diff --git a/src/Gui/Selection.h b/src/Gui/Selection.h index 4733288b92..22a2191bed 100644 --- a/src/Gui/Selection.h +++ b/src/Gui/Selection.h @@ -688,9 +688,11 @@ protected: std::string FeatName; std::string SubName; std::string TypeName; - App::Document* pDoc; - App::DocumentObject* pObject; - float x,y,z; + App::Document* pDoc = 0; + App::DocumentObject* pObject = 0; + float x = 0.0f; + float y = 0.0f; + float z = 0.0f; bool logged = false; std::pair elementName; diff --git a/src/Mod/Fem/Gui/ViewProviderFemPostFunction.h b/src/Mod/Fem/Gui/ViewProviderFemPostFunction.h index 2b318324ae..0956f77adf 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemPostFunction.h +++ b/src/Mod/Fem/Gui/ViewProviderFemPostFunction.h @@ -49,7 +49,7 @@ class FemGuiExport FunctionWidget : public QWidget { Q_OBJECT public: - FunctionWidget() {} + FunctionWidget() : m_block(false), m_view(0), m_object(0) {} virtual ~FunctionWidget() {} virtual void applyPythonCode() = 0; diff --git a/src/Mod/Part/Gui/TaskCheckGeometry.cpp b/src/Mod/Part/Gui/TaskCheckGeometry.cpp index ad84da3252..ecad1873fa 100644 --- a/src/Mod/Part/Gui/TaskCheckGeometry.cpp +++ b/src/Mod/Part/Gui/TaskCheckGeometry.cpp @@ -947,7 +947,8 @@ void PartGui::goSetupResultUnorientableShapeFace(ResultEntry *entry) //////////////////////////////////////////////////////////////////////////////////////////////// -TaskCheckGeometryDialog::TaskCheckGeometryDialog() : widget(0), contentLabel(0) +TaskCheckGeometryDialog::TaskCheckGeometryDialog() + : widget(0), contentLabel(0), okBtn(0), settingsBtn(0), resultsBtn(0) { ParameterGrp::handle group = App::GetApplication().GetUserParameter(). GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod")->GetGroup("Part")->GetGroup("CheckGeometry"); diff --git a/src/Mod/Path/App/Tooltable.cpp b/src/Mod/Path/App/Tooltable.cpp index ed79e2b87d..2ae50f2fef 100644 --- a/src/Mod/Path/App/Tooltable.cpp +++ b/src/Mod/Path/App/Tooltable.cpp @@ -38,6 +38,7 @@ TYPESYSTEM_SOURCE(Path::Tooltable , Base::Persistence) Tooltable::Tooltable() { + Version = 0; } Tooltable::~Tooltable() diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp index 6543cb5d84..a9cadb65c5 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp @@ -172,6 +172,7 @@ struct EditData { EditData(): sketchHandler(0), buttonPress(false), + handleEscapeButton(false), DragPoint(-1), DragCurve(-1), PreselectPoint(-1), diff --git a/src/Mod/TechDraw/App/Cosmetic.cpp b/src/Mod/TechDraw/App/Cosmetic.cpp index efea15a0e9..82d9025f9e 100644 --- a/src/Mod/TechDraw/App/Cosmetic.cpp +++ b/src/Mod/TechDraw/App/Cosmetic.cpp @@ -342,6 +342,7 @@ TYPESYSTEM_SOURCE(TechDraw::CosmeticEdge,Base::Persistence) CosmeticEdge::CosmeticEdge() { // Base::Console().Message("CE::CE()\n"); + permaRadius = 0.0; m_geometry = new TechDraw::BaseGeom(); initialize(); } diff --git a/src/Mod/TechDraw/App/DrawDimHelper.h b/src/Mod/TechDraw/App/DrawDimHelper.h index 9b6df86c73..82b60fd051 100644 --- a/src/Mod/TechDraw/App/DrawDimHelper.h +++ b/src/Mod/TechDraw/App/DrawDimHelper.h @@ -37,7 +37,7 @@ class DrawViewPart; class TechDrawExport hTrimCurve { public: - hTrimCurve() {} + hTrimCurve() : first(0.0), last(0.0) {} hTrimCurve(Handle(Geom2d_Curve) hCurveIn, double parm1, double parm2); diff --git a/src/Mod/TechDraw/App/EdgeWalker.h b/src/Mod/TechDraw/App/EdgeWalker.h index deb40c212a..21354de1d5 100644 --- a/src/Mod/TechDraw/App/EdgeWalker.h +++ b/src/Mod/TechDraw/App/EdgeWalker.h @@ -129,7 +129,7 @@ private: class incidenceItem { public: - incidenceItem() {} + incidenceItem() {iEdge = 0; angle = 0.0;} incidenceItem(int idx, double a, edge_t ed) {iEdge = idx; angle = a; eDesc = ed;} ~incidenceItem() {} static bool iiCompare(const incidenceItem& i1, const incidenceItem& i2); diff --git a/src/Mod/TechDraw/Gui/QGCustomText.cpp b/src/Mod/TechDraw/Gui/QGCustomText.cpp index 091ff00551..e471145dcd 100644 --- a/src/Mod/TechDraw/Gui/QGCustomText.cpp +++ b/src/Mod/TechDraw/Gui/QGCustomText.cpp @@ -51,7 +51,7 @@ using namespace TechDrawGui; QGCustomText::QGCustomText(QGraphicsItem* parent) : - QGraphicsTextItem(parent) + QGraphicsTextItem(parent), isHighlighted(false) { setCacheMode(QGraphicsItem::NoCache); setAcceptHoverEvents(false); diff --git a/src/Mod/TechDraw/Gui/QGIRichAnno.cpp b/src/Mod/TechDraw/Gui/QGIRichAnno.cpp index 737d4492a7..5920005bb4 100644 --- a/src/Mod/TechDraw/Gui/QGIRichAnno.cpp +++ b/src/Mod/TechDraw/Gui/QGIRichAnno.cpp @@ -88,7 +88,7 @@ using namespace TechDrawGui; //************************************************************** QGIRichAnno::QGIRichAnno(QGraphicsItem* myParent, TechDraw::DrawRichAnno* anno) : - m_isExporting(false) + m_isExporting(false), m_hasHover(false) { setHandlesChildEvents(false); setAcceptHoverEvents(false);