fix Coverity issues

This commit is contained in:
wmayer
2016-08-21 18:46:40 +02:00
parent 82f7944966
commit e8b36592c0
20 changed files with 50 additions and 53 deletions

View File

@@ -733,9 +733,6 @@ GProp_GProps AttachEngine::getInertialPropsOfShape(const std::vector<const TopoD
default:
throw Base::Exception("AttachEngine::getInertialPropsOfShape: unexpected shape type");
}
assert(false);//exec shouldn't ever get here
return GProp_GProps();
}
/*!

View File

@@ -346,7 +346,7 @@ bool Extrusion::isInside(const TopoDS_Wire& wire1, const TopoDS_Wire& wire2) con
// because otherwise we have some intersections which is not allowed
else
return false;
xp.Next();
//xp.Next();
}
return false;

View File

@@ -464,9 +464,6 @@ PyObject* GeometryCurvePy::makeRuledSurface(PyObject *args)
PyErr_SetString(PartExceptionOCCError, e->GetMessageString());
return 0;
}
PyErr_SetString(PartExceptionOCCError, "Geometry is not a curve");
return 0;
}
PyObject* GeometryCurvePy::intersect2d(PyObject *args)

View File

@@ -2313,11 +2313,11 @@ struct MeshVertex
Standard_Integer i;
MeshVertex(Standard_Real X, Standard_Real Y, Standard_Real Z)
: x(X),y(Y),z(Z)
: x(X),y(Y),z(Z),i(0)
{
}
MeshVertex(const gp_Pnt& p)
: x(p.X()),y(p.Y()),z(p.Z())
: x(p.X()),y(p.Y()),z(p.Z()),i(0)
{
}

View File

@@ -624,9 +624,6 @@ PyObject* TopoShapeEdgePy::split(PyObject *args)
PyErr_SetString(PartExceptionOCCError, e->GetMessageString());
return 0;
}
PyErr_SetString(PartExceptionOCCError, "Geometry is not a curve");
return 0;
}
PyObject* TopoShapeEdgePy::isSeam(PyObject *args)

View File

@@ -683,10 +683,9 @@ Py::Object TopoShapeFacePy::getOuterWire(void) const
TopoDS_Wire clWire = ShapeAnalysis::OuterWire(clFace);
return Py::Object(new TopoShapeWirePy(new TopoShape(clWire)),true);
}
else
else {
throw Py::Exception("Internal error, TopoDS_Shape is not a face!");
return Py::Object();
}
}
Py::Object TopoShapeFacePy::getMass(void) const

View File

@@ -683,6 +683,7 @@ void DlgPrimitives::createPrimitive(const QString& placement)
Location::Location(QWidget* parent)
{
mode = 0;
ui.setupUi(this);
}

View File

@@ -65,6 +65,7 @@ public:
EdgeSelection()
: Gui::SelectionFilterGate((Gui::SelectionFilter*)0)
{
canSelect = false;
}
bool allow(App::Document*pDoc, App::DocumentObject*pObj, const char*sSubName)
{

View File

@@ -1232,8 +1232,10 @@ void PartGui::ArcEngine::defaultValues()
SO_ENGINE_OUTPUT(pointCount, SoSFInt32, setValue(2));
}
PartGui::SteppedSelection::SteppedSelection(const uint& buttonCountIn, QWidget* parent):
QWidget(parent)
PartGui::SteppedSelection::SteppedSelection(const uint& buttonCountIn, QWidget* parent)
: QWidget(parent)
, stepActive(0)
, stepDone(0)
{
if (buttonCountIn < 1)
return;

View File

@@ -69,7 +69,7 @@ void ViewProviderCompound::updateData(const App::Property* prop)
if (prop->getTypeId() == Part::PropertyShapeHistory::getClassTypeId()) {
const std::vector<Part::ShapeHistory>& hist = static_cast<const Part::PropertyShapeHistory*>
(prop)->getValues();
Part::Compound* objComp = dynamic_cast<Part::Compound*>(getObject());
Part::Compound* objComp = static_cast<Part::Compound*>(getObject());
std::vector<App::DocumentObject*> sources = objComp->Links.getValues();
if (hist.size() != sources.size())
return;
@@ -85,6 +85,9 @@ void ViewProviderCompound::updateData(const App::Property* prop)
int index=0;
for (std::vector<App::DocumentObject*>::iterator it = sources.begin(); it != sources.end(); ++it, ++index) {
Part::Feature* objBase = dynamic_cast<Part::Feature*>(*it);
if (!objBase)
continue;
const TopoDS_Shape& baseShape = objBase->Shape.getValue();
TopTools_IndexedMapOfShape baseMap;

View File

@@ -68,6 +68,10 @@ protected:
struct Node {
Gui::SoFCSelection *pcHighlight;
SoTransform *pcTransform;
Node() {
pcHighlight = 0;
pcTransform = 0;
}
};
std::list<Node> NodeList;

View File

@@ -239,7 +239,7 @@ void ViewProviderFillet::updateData(const App::Property* prop)
return;
Part::Fillet* objFill = dynamic_cast<Part::Fillet*>(getObject());
Part::Feature* objBase = dynamic_cast<Part::Feature*>(objFill->Base.getValue());
if (objBase) {
if (objFill && objBase) {
const TopoDS_Shape& baseShape = objBase->Shape.getValue();
const TopoDS_Shape& fillShape = objFill->Shape.getValue();
@@ -342,7 +342,7 @@ void ViewProviderChamfer::updateData(const App::Property* prop)
return;
Part::Chamfer* objCham = dynamic_cast<Part::Chamfer*>(getObject());
Part::Feature* objBase = dynamic_cast<Part::Feature*>(objCham->Base.getValue());
if (objBase) {
if (objCham && objBase) {
const TopoDS_Shape& baseShape = objBase->Shape.getValue();
const TopoDS_Shape& chamShape = objCham->Shape.getValue();