fix coverity issues

This commit is contained in:
wmayer
2016-10-08 17:43:30 +02:00
parent 6d3e2a396a
commit 68ea7fdac5
12 changed files with 54 additions and 48 deletions

View File

@@ -1639,9 +1639,6 @@ Base::Placement AttachEngineLine::calculateAttachedPlacement(Base::Placement ori
switch (mmode) {
case mmDeactivated:
//should have been filtered out already!
break;
case mm1AxisInertia1:
case mm1AxisInertia2:
case mm1AxisInertia3:{
@@ -1802,7 +1799,7 @@ Base::Placement AttachEngineLine::calculateAttachedPlacement(Base::Placement ori
//=================================================================================
TYPESYSTEM_SOURCE(Attacher::AttachEnginePoint, Attacher::AttachEngine);
TYPESYSTEM_SOURCE(Attacher::AttachEnginePoint, Attacher::AttachEngine)
AttachEnginePoint::AttachEnginePoint()
{
@@ -1874,7 +1871,7 @@ Base::Placement AttachEnginePoint::calculateAttachedPlacement(Base::Placement or
std::vector<eRefType> types;
readLinks(this->references, parts, shapes, copiedShapeStorage, types);
if (parts.size() == 0)
if (parts.empty())
throw ExceptionCancel();
@@ -1884,9 +1881,6 @@ Base::Placement AttachEnginePoint::calculateAttachedPlacement(Base::Placement or
switch (mmode) {
case mmDeactivated:
//should have been filtered out already!
break;
case mm0Vertex:{
std::vector<gp_Pnt> points;
assert(shapes.size()>0);

View File

@@ -86,9 +86,11 @@ void ViewProviderBoolean::updateData(const App::Property* prop)
if (hist.size() != 2)
return;
Part::Boolean* objBool = dynamic_cast<Part::Boolean*>(getObject());
if (!objBool)
return;
Part::Feature* objBase = dynamic_cast<Part::Feature*>(objBool->Base.getValue());
Part::Feature* objTool = dynamic_cast<Part::Feature*>(objBool->Tool.getValue());
if (objBool && objBase && objTool) {
if (objBase && objTool) {
const TopoDS_Shape& baseShape = objBase->Shape.getValue();
const TopoDS_Shape& toolShape = objTool->Shape.getValue();
const TopoDS_Shape& boolShape = objBool->Shape.getValue();

View File

@@ -67,7 +67,7 @@ PROPERTY_SOURCE(PartGui::ViewProviderCurveNet,PartGui::ViewProviderPart)
ViewProviderCurveNet::ViewProviderCurveNet()
: bInEdit(false),bMovePointMode(false)
: bInEdit(false),bMovePointMode(false),EdgeRoot(0),VertexRoot(0)
{
LineWidth.setValue(4.0f);
PointSize.setValue(0.05f);

View File

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