Coverity: Structurally/Logically dead code

This commit is contained in:
wmayer
2020-07-20 12:07:21 +02:00
parent 410e65ce2f
commit 1a16cde1f5
8 changed files with 13 additions and 24 deletions

View File

@@ -459,7 +459,6 @@ class ViewProviderDraft(object):
return ":/icons/Draft_ShapeString_tree.svg"
else:
return ":/icons/Draft_Draft.svg"
return ":/icons/Draft_Draft.svg"
def claimChildren(self):
"""Return objects that will be placed under it in the tree view.

View File

@@ -116,8 +116,8 @@ class Part21Parser:
# del self._number_of_ancestors[item]
def get_schema_name(self):
return self._schema_name
print(schema_name)
return self._schema_name
def get_number_of_instances(self):
return len(list(self._instances_definition.keys()))

View File

@@ -487,9 +487,6 @@ PyObject* GeometrySurfacePy::projectPoint(PyObject *args, PyObject* kwds)
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
return nullptr;
}
PyErr_SetString(PartExceptionOCCError, "Geometry is not a surface");
return nullptr;
}
PyObject* GeometrySurfacePy::isUmbillic(PyObject *args)

View File

@@ -136,7 +136,7 @@ public:
const int32_t *texindices,
const int nbind,
const int mbind,
const int texture);
SbBool texture);
static void context_destruction_cb(uint32_t context, void * userdata)
{
@@ -1285,7 +1285,7 @@ void SoBrepFaceSet::renderHighlight(SoGLRenderAction *action, SelContextPtr ctx)
doTextures = false;
renderShape(action, false, static_cast<const SoGLCoordinateElement*>(coords), &(cindices[start]), length,
&(pindices[id]), 1, normals, nindices, &mb, mindices, &tb, tindices, nbind, mbind, doTextures?1:0);
&(pindices[id]), 1, normals, nindices, &mb, mindices, &tb, tindices, nbind, mbind, doTextures);
}
state->pop();
@@ -1384,7 +1384,7 @@ void SoBrepFaceSet::renderSelection(SoGLRenderAction *action, SelContextPtr ctx,
renderShape(action, false, static_cast<const SoGLCoordinateElement*>(coords), &(cindices[start]), length,
&(pindices[id]), numparts, normals_s, nindices_s, &mb, mindices, &tb, tindices, nbind, mbind, doTextures?1:0);
}
if(push) {
if (push) {
state->pop();
// SoCacheElement::invalidate(state);
}
@@ -1407,7 +1407,7 @@ void SoBrepFaceSet::VBO::render(SoGLRenderAction * action,
const int32_t *texindices,
const int nbind,
const int mbind,
const int texture)
SbBool texture)
{
(void)texcoords; (void)texindices; (void)texture;
const SbVec3f * coords3d = NULL;
@@ -1736,7 +1736,7 @@ void SoBrepFaceSet::renderShape(SoGLRenderAction * action,
const int32_t *texindices,
const int nbind,
const int mbind,
const int texture)
SbBool texture)
{
// Can we use vertex buffer objects?
if (hasVBO) {

View File

@@ -128,7 +128,7 @@ private:
const int32_t *texindices,
const int nbind,
const int mbind,
const int texture);
SbBool texture);
typedef Gui::SoFCSelectionContextEx SelContext;
typedef Gui::SoFCSelectionContextExPtr SelContextPtr;

View File

@@ -1122,8 +1122,9 @@ void prepareProfileBased(PartDesign::Body *pcActiveBody, Gui::Command* cmd, cons
Gui::Selection().clearSelection();
pickDlg = new PartDesignGui::TaskDlgFeaturePick(sketches, status, accepter, sketch_worker);
if (!bNoSketchWasSelected && extReference)
pickDlg->showExternal(true);
// Logically dead code because 'bNoSketchWasSelected' must be true
//if (!bNoSketchWasSelected && extReference)
// pickDlg->showExternal(true);
Gui::Control().showDialog(pickDlg);
}

View File

@@ -217,10 +217,7 @@ void getReferencedSelection(const App::DocumentObject* thisObj, const Gui::Selec
bool originfeature = selObj->isDerivedFrom(App::OriginFeature::getClassTypeId());
if (!originfeature && body) {
PartDesign::Body* selBody = PartDesignGui::getBodyFor(selObj, false);
if(!selBody || body != selBody) {
auto* pcActivePart = PartDesignGui::getPartFor(body, false);
if (!selBody || body != selBody) {
QDialog dia(Gui::getMainWindow());
Ui_DlgReference dlg;
dlg.setupUi(&dia);
@@ -230,14 +227,11 @@ void getReferencedSelection(const App::DocumentObject* thisObj, const Gui::Selec
selObj = NULL;
return;
}
else if(!dlg.radioXRef->isChecked()) {
else if (!dlg.radioXRef->isChecked()) {
App::Document* document = thisObj->getDocument();
document->openTransaction("Make copy");
auto copy = PartDesignGui::TaskFeaturePick::makeCopy(selObj, subname, dlg.radioIndependent->isChecked());
if (body)
body->addObject(copy);
else if (pcActivePart)
pcActivePart->addObject(copy);
body->addObject(copy);
selObj = copy;
subname.erase(std::remove_if(subname.begin(), subname.end(), &isdigit), subname.end());

View File

@@ -1566,8 +1566,6 @@ void CmdSketcherCompCopy::activated(int iMsg)
sc.activate();
pcAction->setShortcut(QString::fromLatin1(""));
}
else
return;
}
Gui::Action * CmdSketcherCompCopy::createAction(void)