PVS: V560 A part of conditional expression is always true

This commit is contained in:
wmayer
2019-02-17 13:56:48 +01:00
parent b52f8d1e1d
commit f581d5c8cb
16 changed files with 42 additions and 42 deletions

View File

@@ -235,7 +235,7 @@ Base::Placement AttachEngine::placementFactory(const gp_Dir &ZAxis,
gp_Ax3 ax3;//OCC representation of the final placement
if (!makeYVertical) {
ax3 = gp_Ax3(Origin, ZAxis, XAxis);
} else if (makeYVertical && !makeLegacyFlatFaceOrientation) {
} else if (!makeLegacyFlatFaceOrientation) {
//align Y along Z, if possible
gp_Vec YAxis(0.0,0.0,1.0);
XAxis = YAxis.Crossed(gp_Vec(ZAxis));
@@ -1163,7 +1163,7 @@ Base::Placement AttachEngine3D::calculateAttachedPlacement(Base::Placement origP
throw Base::ValueError("AttachEngine3D::calculateAttachedPlacement: not enough subshapes (need one false and one vertex).");
bool bThruVertex = false;
if (shapes[0]->ShapeType() == TopAbs_VERTEX && shapes.size()>=2) {
if (shapes[0]->ShapeType() == TopAbs_VERTEX) {
std::swap(shapes[0],shapes[1]);
bThruVertex = true;
}

View File

@@ -2507,8 +2507,10 @@ TopoDS_Shape TopoShape::makeOffset2D(double offset, short joinType, bool fill, b
{
if (_Shape.IsNull())
throw Base::ValueError("makeOffset2D: input shape is null!");
if (allowOpenResult && OCC_VERSION_HEX < 0x060900)
#if OCC_VERSION_HEX < 0x060900
if (allowOpenResult)
throw Base::AttributeError("openResult argument is not supported on OCC < 6.9.0.");
#endif
// OUTLINE OF MAKEOFFSET2D
// * Prepare shapes to process

View File

@@ -281,7 +281,7 @@ PyObject* TopoShapeSolidPy::offsetFaces(PyObject *args)
}
bool paramOK = false;
if (!paramOK && PyArg_ParseTuple(args, "Od", &obj,&offset)) {
if (PyArg_ParseTuple(args, "Od", &obj,&offset)) {
paramOK = true;
Py::Sequence list(obj);
for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) {

View File

@@ -758,7 +758,7 @@ void finishFeature(const Gui::Command* cmd, const std::string& FeatName,
pcActiveBody = PartDesignGui::getBody(/*messageIfNot = */false);
}
if (hidePrevSolid && prevSolidFeature && (prevSolidFeature != NULL))
if (hidePrevSolid && prevSolidFeature)
cmd->doCommand(cmd->Gui,"Gui.activeDocument().hide(\"%s\")", prevSolidFeature->getNameInDocument());
if (updateDocument)

View File

@@ -205,7 +205,7 @@ void ViewProvider::onChanged(const App::Property* prop) {
return;
Gui::ViewProviderDocumentObject* vpd = static_cast<ViewProviderDocumentObject*>(vp);
if(vpd && vpd->Visibility.getValue())
if (vpd->Visibility.getValue())
vpd->Visibility.setValue(false);
}
}

View File

@@ -5425,7 +5425,7 @@ const Part::Geometry* SketchObject::getGeometry(int GeoId) const
if (GeoId < int(geomlist.size()))
return geomlist[GeoId];
}
else if (GeoId <= -1 && -GeoId <= int(ExternalGeo.size()))
else if (-GeoId <= int(ExternalGeo.size()))
return ExternalGeo[-GeoId-1];
return 0;