PVS: V730 Not all members of a class are initialized inside the constructor

This commit is contained in:
wmayer
2020-07-16 20:38:30 +02:00
parent 7566bd1343
commit cbb5f99ade
17 changed files with 32 additions and 17 deletions

View File

@@ -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;

View File

@@ -488,7 +488,8 @@ public:
std::string string;
std::pair<FunctionExpression::Function,std::string> 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

View File

@@ -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) \

View File

@@ -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<const DocumentObject>(_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<const DocumentObject>(_owner);

View File

@@ -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

View File

@@ -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");

View File

@@ -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);

View File

@@ -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<std::string,std::string> elementName;

View File

@@ -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;

View File

@@ -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");

View File

@@ -38,6 +38,7 @@ TYPESYSTEM_SOURCE(Path::Tooltable , Base::Persistence)
Tooltable::Tooltable()
{
Version = 0;
}
Tooltable::~Tooltable()

View File

@@ -172,6 +172,7 @@ struct EditData {
EditData():
sketchHandler(0),
buttonPress(false),
handleEscapeButton(false),
DragPoint(-1),
DragCurve(-1),
PreselectPoint(-1),

View File

@@ -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();
}

View File

@@ -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);

View File

@@ -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);

View File

@@ -51,7 +51,7 @@
using namespace TechDrawGui;
QGCustomText::QGCustomText(QGraphicsItem* parent) :
QGraphicsTextItem(parent)
QGraphicsTextItem(parent), isHighlighted(false)
{
setCacheMode(QGraphicsItem::NoCache);
setAcceptHoverEvents(false);

View File

@@ -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);