Fix clang compiler warnings:

+ fix -Winconsistent-missing-override
+ fix -Wpessimizing-move (Geometry::clone: moving a temporary object prevents copy elision -> remove std::move call here)
This commit is contained in:
wmayer
2019-08-09 15:42:02 +02:00
parent 5172c3bc08
commit 67b06d7a36
11 changed files with 47 additions and 47 deletions

View File

@@ -520,7 +520,7 @@ private:
}
}
virtual Py::Object invoke_method_varargs(void *method_def, const Py::Tuple &args)
virtual Py::Object invoke_method_varargs(void *method_def, const Py::Tuple &args) override
{
try {
return Py::ExtensionModule<Module>::invoke_method_varargs(method_def, args);

View File

@@ -78,16 +78,16 @@ public:
* TODO introduce a findBodiesOf() if needed (2015-08-04, Fat-Zer)
*/
static BodyBase* findBodyOf(const App::DocumentObject* f);
virtual PyObject* getPyObject();
virtual PyObject* getPyObject() override;
protected:
/// If BaseFeature is getting changed and Tip points to it reset the Tip
virtual void onBeforeChange (const App::Property* prop);
virtual void onBeforeChange (const App::Property* prop) override;
/// If BaseFeature is set and Tip is null set the Tip to it
virtual void onChanged (const App::Property* prop);
virtual void onChanged (const App::Property* prop) override;
virtual void handleChangedPropertyName(Base::XMLReader &reader,
const char * TypeName,
const char *PropName);
const char *PropName) override;
};

View File

@@ -46,7 +46,7 @@ public:
//short mustExecute();
/// returns the type name of the view provider
virtual const char* getViewProviderName(void) const = 0;
virtual const char* getViewProviderName(void) const override = 0;
/// Return a shape including Placement representing the datum feature
virtual TopoDS_Shape getShape() const;
@@ -57,8 +57,8 @@ public:
virtual App::DocumentObject *getSubObject(const char *subname, PyObject **pyObj,
Base::Matrix4D *mat, bool transform, int depth) const override;
protected:
void onDocumentRestored();
void handleChangedPropertyName(Base::XMLReader &reader, const char* TypeName, const char* PropName);
void onDocumentRestored() override;
void handleChangedPropertyName(Base::XMLReader &reader, const char* TypeName, const char* PropName) override;
};
} //namespace Part

View File

@@ -54,7 +54,7 @@ public:
/// Same as Part::Compound, except it marks the Shape as transient, and rebuild it during restore
class Compound2 : public Compound {
PROPERTY_HEADER(Part::Compound2);
PROPERTY_HEADER_WITH_OVERRIDE(Part::Compound2);
public:
Compound2();
virtual void onDocumentRestored() override;

View File

@@ -375,7 +375,7 @@ Geometry *Geometry::clone(void) const
cpy->tag = this->tag;
for(auto & ext: extensions)
cpy->extensions.push_back(std::move(ext->copy()));
cpy->extensions.push_back(ext->copy());
return cpy;
}

View File

@@ -32,7 +32,7 @@ namespace Part {
template <typename T>
class PartExport GeometryDefaultExtension: public Part::GeometryExtension
{
TYPESYSTEM_HEADER();
TYPESYSTEM_HEADER_WITH_OVERRIDE();
public:
inline GeometryDefaultExtension();
GeometryDefaultExtension(const T& val, std::string name = std::string());

View File

@@ -57,7 +57,7 @@ class PartExport Part2DObject : public Part::Feature, public Part::AttachExtensi
public:
Part2DObject();
virtual void transformPlacement(const Base::Placement &transform);
virtual void transformPlacement(const Base::Placement &transform) override;
/// returns the number of construction lines (to be used as axes)
virtual int getAxisCount(void) const;
@@ -85,19 +85,19 @@ public:
/** @name methods override Feature */
//@{
/// recalculate the Feature
App::DocumentObjectExecReturn *execute(void);
App::DocumentObjectExecReturn *execute(void) override;
/// returns the type name of the ViewProvider
const char* getViewProviderName(void) const {
const char* getViewProviderName(void) const override {
return "PartGui::ViewProvider2DObject";
}
//@}
void Restore(Base::XMLReader &reader);
void Restore(Base::XMLReader &reader) override;
protected:
void handleChangedPropertyType(Base::XMLReader &reader, const char * TypeName, App::Property * prop);
void handleChangedPropertyName(Base::XMLReader &reader, const char * TypeName, const char *PropName);
void handleChangedPropertyType(Base::XMLReader &reader, const char * TypeName, App::Property * prop) override;
void handleChangedPropertyName(Base::XMLReader &reader, const char * TypeName, const char *PropName) override;
};
typedef App::FeaturePythonT<Part2DObject> Part2DObjectPython;

View File

@@ -46,7 +46,7 @@ class PartFeaturePy;
*/
class PartExport Feature : public App::GeoFeature
{
PROPERTY_HEADER(Part::Feature);
PROPERTY_HEADER_WITH_OVERRIDE(Part::Feature);
public:
/// Constructor
@@ -57,14 +57,14 @@ public:
/** @name methods override feature */
//@{
virtual short mustExecute(void) const;
virtual short mustExecute() const override;
//@}
/// returns the type name of the ViewProvider
virtual const char* getViewProviderName(void) const;
virtual const App::PropertyComplexGeoData* getPropertyOfGeometry() const;
virtual const char* getViewProviderName() const override;
virtual const App::PropertyComplexGeoData* getPropertyOfGeometry() const override;
virtual PyObject* getPyObject(void);
virtual PyObject* getPyObject() override;
TopLoc_Location getLocation() const;
@@ -111,10 +111,10 @@ public:
protected:
/// recompute only this object
virtual App::DocumentObjectExecReturn *recompute(void);
virtual App::DocumentObjectExecReturn *recompute() override;
/// recalculate the feature
virtual App::DocumentObjectExecReturn *execute(void);
virtual void onChanged(const App::Property* prop);
virtual App::DocumentObjectExecReturn *execute() override;
virtual void onChanged(const App::Property* prop) override;
/**
* Build a history of changes
* MakeShape: The operation that created the changes, e.g. BRepAlgoAPI_Common

View File

@@ -42,14 +42,14 @@ public:
/** @name methods override feature */
//@{
/// recalculate the feature
App::DocumentObjectExecReturn *execute(void);
short mustExecute() const;
PyObject* getPyObject();
App::DocumentObjectExecReturn *execute(void) override;
short mustExecute() const override;
PyObject* getPyObject() override;
//@}
protected:
void Restore(Base::XMLReader &reader);
void onChanged (const App::Property* prop);
void Restore(Base::XMLReader &reader) override;
void onChanged (const App::Property* prop) override;
};
class PartExport Vertex : public Part::Primitive

View File

@@ -628,9 +628,9 @@ void DlgFilletEdges::setupFillet(const std::vector<App::DocumentObject*>& objs)
App::Document* doc = d->object->getDocument();
// get current selection and their sub-elements
std::vector<Gui::SelectionObject> selObj = Gui::Selection().getSelectionEx(doc->getName());
std::vector<Gui::SelectionObject>::iterator selIt = std::find_if(selObj.begin(), selObj.end(),
Private::SelectionObjectCompare(d->object));
//std::vector<Gui::SelectionObject> selObj = Gui::Selection().getSelectionEx(doc->getName());
//std::vector<Gui::SelectionObject>::iterator selIt = std::find_if(selObj.begin(), selObj.end(),
// Private::SelectionObjectCompare(d->object));
/*

View File

@@ -64,7 +64,7 @@ class SoBrepPointSet;
class PartGuiExport ViewProviderPartExt : public Gui::ViewProviderGeometryObject
{
PROPERTY_HEADER(PartGui::ViewProviderPartExt);
PROPERTY_HEADER_WITH_OVERRIDE(PartGui::ViewProviderPartExt);
public:
/// constructor
@@ -91,14 +91,14 @@ public:
// Faces (Gui::ViewProviderGeometryObject::ShapeColor and Gui::ViewProviderGeometryObject::ShapeMaterial apply)
App::PropertyColorList DiffuseColor;
virtual void attach(App::DocumentObject *);
virtual void setDisplayMode(const char* ModeName);
virtual void attach(App::DocumentObject *) override;
virtual void setDisplayMode(const char* ModeName) override;
/// returns a list of all possible modes
virtual std::vector<std::string> getDisplayModes(void) const;
virtual std::vector<std::string> getDisplayModes(void) const override;
/// Update the view representation
void reload();
virtual void updateData(const App::Property*);
virtual void updateData(const App::Property*) override;
/** @name Selection handling
* This group of methods do the selection handling.
@@ -107,13 +107,13 @@ public:
*/
//@{
/// indicates if the ViewProvider use the new Selection model
virtual bool useNewSelectionModel(void) const {return true;}
virtual bool useNewSelectionModel(void) const override {return true;}
/// return a hit element to the selection path or 0
virtual std::string getElement(const SoDetail*) const;
virtual SoDetail* getDetail(const char*) const;
virtual std::vector<Base::Vector3d> getModelPoints(const SoPickedPoint *) const;
virtual std::string getElement(const SoDetail*) const override;
virtual SoDetail* getDetail(const char*) const override;
virtual std::vector<Base::Vector3d> getModelPoints(const SoPickedPoint *) const override;
/// return the highlight lines for a given element or the whole shape
virtual std::vector<Base::Vector3d> getSelectionShape(const char* Element) const;
virtual std::vector<Base::Vector3d> getSelectionShape(const char* Element) const override;
//@}
/** @name Highlight handling
@@ -136,16 +136,16 @@ public:
/** @name Edit methods */
//@{
void setupContextMenu(QMenu*, QObject*, const char*);
void setupContextMenu(QMenu*, QObject*, const char*) override;
protected:
bool setEdit(int ModNum);
void unsetEdit(int ModNum);
bool setEdit(int ModNum) override;
void unsetEdit(int ModNum) override;
//@}
protected:
/// get called by the container whenever a property has been changed
virtual void onChanged(const App::Property* prop);
virtual void onChanged(const App::Property* prop) override;
bool loadParameter();
void updateVisual();
void getNormals(const TopoDS_Face& theFace, const Handle(Poly_Triangulation)& aPolyTri,