From 71df967fdf3bf45d0903ab4746db2b53a7cf3006 Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 21 Sep 2016 16:05:36 +0200 Subject: [PATCH] fix -Wextra in FreeCADApp --- src/App/ComplexGeoData.cpp | 56 ++++++++++++++++++++++++++++++++++ src/App/ComplexGeoData.h | 15 +++++---- src/App/Document.cpp | 8 +++-- src/App/Document.h | 2 +- src/App/DocumentObserver.cpp | 20 ++++++++++++ src/App/DocumentObserver.h | 15 +++------ src/App/Expression.cpp | 3 +- src/App/Expression.h | 2 +- src/App/FeaturePythonPyImp.inl | 3 +- src/App/PropertyContainer.h | 9 ++++++ src/App/PropertyStandard.cpp | 2 +- src/App/PropertyStandard.h | 4 +-- src/App/PropertyUnits.cpp | 4 +-- src/App/Transactions.cpp | 4 +-- 14 files changed, 115 insertions(+), 32 deletions(-) diff --git a/src/App/ComplexGeoData.cpp b/src/App/ComplexGeoData.cpp index e427ccb799..dc61854a80 100644 --- a/src/App/ComplexGeoData.cpp +++ b/src/App/ComplexGeoData.cpp @@ -92,3 +92,59 @@ Base::Placement ComplexGeoData::getPlacement() const mat[2][3]), Base::Rotation(mat)); } + +void ComplexGeoData::getLinesFromSubelement(const Segment*, + std::vector &Points, + std::vector &lines) const +{ + (void)Points; + (void)lines; +} + +void ComplexGeoData::getFacesFromSubelement(const Segment*, + std::vector &Points, + std::vector &PointNormals, + std::vector &faces) const +{ + (void)Points; + (void)PointNormals; + (void)faces; +} + +Base::Vector3d ComplexGeoData::getPointFromLineIntersection(const Base::Vector3f& base, + const Base::Vector3f& dir) const +{ + (void)base; + (void)dir; + return Base::Vector3d(); +} + +void ComplexGeoData::getPoints(std::vector &Points, + std::vector &Normals, + float Accuracy, uint16_t flags) const +{ + (void)Points; + (void)Normals; + (void)Accuracy; + (void)flags; +} + +void ComplexGeoData::getLines(std::vector &Points, + std::vector &lines, + float Accuracy, uint16_t flags) const +{ + (void)Points; + (void)lines; + (void)Accuracy; + (void)flags; +} + +void ComplexGeoData::getFaces(std::vector &Points, + std::vector &faces, + float Accuracy, uint16_t flags) const +{ + (void)Points; + (void)faces; + (void)Accuracy; + (void)flags; +} diff --git a/src/App/ComplexGeoData.h b/src/App/ComplexGeoData.h index 950ed25881..4260c044ed 100644 --- a/src/App/ComplexGeoData.h +++ b/src/App/ComplexGeoData.h @@ -84,13 +84,13 @@ public: virtual void getLinesFromSubelement( const Segment*, std::vector &Points, - std::vector &lines) const {} + std::vector &lines) const; /** Get faces from segment */ virtual void getFacesFromSubelement( const Segment*, std::vector &Points, std::vector &PointNormals, - std::vector &faces) const {} + std::vector &faces) const; //@} /** @name Placement control */ @@ -133,19 +133,18 @@ public: virtual Base::BoundBox3d getBoundBox(void)const=0; /** Get point from line object intersection */ virtual Base::Vector3d getPointFromLineIntersection( - const Base::Vector3f& Base, - const Base::Vector3f& Dir) const - { return Base::Vector3d(); } + const Base::Vector3f& base, + const Base::Vector3f& dir) const; /** Get points from object with given accuracy */ virtual void getPoints(std::vector &Points, std::vector &Normals, - float Accuracy, uint16_t flags=0) const {} + float Accuracy, uint16_t flags=0) const; /** Get lines from object with given accuracy */ virtual void getLines(std::vector &Points,std::vector &lines, - float Accuracy, uint16_t flags=0) const {} + float Accuracy, uint16_t flags=0) const; /** Get faces from object with given accuracy */ virtual void getFaces(std::vector &Points,std::vector &faces, - float Accuracy, uint16_t flags=0) const {} + float Accuracy, uint16_t flags=0) const; //@} protected: diff --git a/src/App/Document.cpp b/src/App/Document.cpp index c6cb3a0473..ece4201380 100644 --- a/src/App/Document.cpp +++ b/src/App/Document.cpp @@ -2317,11 +2317,12 @@ DocumentObject * Document::getObject(const char *Name) const } // Note: This method is only used in Tree.cpp slotChangeObject(), see explanation there -const bool Document::isIn(const DocumentObject *pFeat) const +bool Document::isIn(const DocumentObject *pFeat) const { - for (std::map::const_iterator o = d->objectMap.begin(); o != d->objectMap.end(); o++) + for (std::map::const_iterator o = d->objectMap.begin(); o != d->objectMap.end(); ++o) { if (o->second == pFeat) return true; + } return false; } @@ -2330,9 +2331,10 @@ const char * Document::getObjectName(DocumentObject *pFeat) const { std::map::const_iterator pos; - for (pos = d->objectMap.begin();pos != d->objectMap.end();++pos) + for (pos = d->objectMap.begin();pos != d->objectMap.end();++pos) { if (pos->second == pFeat) return pos->first.c_str(); + } return 0; } diff --git a/src/App/Document.h b/src/App/Document.h index 6f7f375ebd..947f537166 100644 --- a/src/App/Document.h +++ b/src/App/Document.h @@ -208,7 +208,7 @@ public: /// Returns a Object of this document DocumentObject *getObject(const char *Name) const; /// Returns true if the DocumentObject is contained in this document - const bool isIn(const DocumentObject *pFeat) const; + bool isIn(const DocumentObject *pFeat) const; /// Returns a Name of an Object or 0 const char *getObjectName(DocumentObject *pFeat) const; /// Returns a Name of an Object or 0 diff --git a/src/App/DocumentObserver.cpp b/src/App/DocumentObserver.cpp index 25e2eb2f31..904292f0aa 100644 --- a/src/App/DocumentObserver.cpp +++ b/src/App/DocumentObserver.cpp @@ -241,6 +241,26 @@ void DocumentObserver::detachDocument() } } +void DocumentObserver::slotCreatedDocument(const App::Document& /*Doc*/) +{ +} + +void DocumentObserver::slotDeletedDocument(const App::Document& /*Doc*/) +{ +} + +void DocumentObserver::slotCreatedObject(const App::DocumentObject& /*Obj*/) +{ +} + +void DocumentObserver::slotDeletedObject(const App::DocumentObject& /*Obj*/) +{ +} + +void DocumentObserver::slotChangedObject(const App::DocumentObject& /*Obj*/, const App::Property& /*Prop*/) +{ +} + // ----------------------------------------------------------------------------- DocumentObjectObserver::DocumentObjectObserver() diff --git a/src/App/DocumentObserver.h b/src/App/DocumentObserver.h index 804d91d9f7..0ecc8fd98a 100644 --- a/src/App/DocumentObserver.h +++ b/src/App/DocumentObserver.h @@ -142,20 +142,15 @@ public: private: /** Checks if a new document was created */ - virtual void slotCreatedDocument(const App::Document& Doc) - {} + virtual void slotCreatedDocument(const App::Document& Doc); /** Checks if the given document is about to be closed */ - virtual void slotDeletedDocument(const App::Document& Doc) - {} + virtual void slotDeletedDocument(const App::Document& Doc); /** Checks if a new object was added. */ - virtual void slotCreatedObject(const App::DocumentObject& Obj) - {} + virtual void slotCreatedObject(const App::DocumentObject& Obj); /** Checks if the given object is about to be removed. */ - virtual void slotDeletedObject(const App::DocumentObject& Obj) - {} + virtual void slotDeletedObject(const App::DocumentObject& Obj); /** The property of an observed object has changed */ - virtual void slotChangedObject(const App::DocumentObject& Obj, const App::Property& Prop) - {} + virtual void slotChangedObject(const App::DocumentObject& Obj, const App::Property& Prop); protected: Document* getDocument() const; diff --git a/src/App/Expression.cpp b/src/App/Expression.cpp index 6f4087bc96..96fcd74c72 100644 --- a/src/App/Expression.cpp +++ b/src/App/Expression.cpp @@ -1619,7 +1619,7 @@ int ConstantExpression::priority() const TYPESYSTEM_SOURCE_ABSTRACT(App::BooleanExpression, App::NumberExpression); BooleanExpression::BooleanExpression(const DocumentObject *_owner, bool _value) - : NumberExpression(owner, _value ? 1.0 : 0.0) + : NumberExpression(_owner, _value ? 1.0 : 0.0) { } @@ -1699,6 +1699,7 @@ namespace ExpressionParser { void ExpressionParser_yyerror(const char *errorinfo) { + (void)errorinfo; } /* helper function for tuning number strings with groups in a locale agnostic way... */ diff --git a/src/App/Expression.h b/src/App/Expression.h index 8c9a1df3d8..5cee6c15a4 100644 --- a/src/App/Expression.h +++ b/src/App/Expression.h @@ -92,7 +92,7 @@ public: virtual int priority() const { return 0; } - virtual void getDeps(std::set &props) const { } + virtual void getDeps(std::set &/*props*/) const { } virtual Expression * simplify() const = 0; diff --git a/src/App/FeaturePythonPyImp.inl b/src/App/FeaturePythonPyImp.inl index af076e56a3..fcd64f6c70 100644 --- a/src/App/FeaturePythonPyImp.inl +++ b/src/App/FeaturePythonPyImp.inl @@ -76,7 +76,8 @@ PyTypeObject FeaturePythonPyT::Type = { 0, /*tp_cache */ 0, /*tp_subclasses */ 0, /*tp_weaklist */ - 0 /*tp_del */ + 0, /*tp_del */ + 0 /*tp_version_tag */ }; /// Methods structure of FeaturePythonPyT diff --git a/src/App/PropertyContainer.h b/src/App/PropertyContainer.h index 8b134c3de5..b458865fdf 100644 --- a/src/App/PropertyContainer.h +++ b/src/App/PropertyContainer.h @@ -136,15 +136,24 @@ public: const char* type, const char* name=0, const char* group=0, const char* doc=0, short attr=0, bool ro=false, bool hidden=false){ + (void)type; + (void)name; + (void)group; + (void)doc; + (void)attr; + (void)ro; + (void)hidden; return 0; } virtual bool removeDynamicProperty(const char* name) { + (void)name; return false; } virtual std::vector getDynamicPropertyNames() const { return std::vector(); } virtual App::Property *getDynamicPropertyByName(const char* name) const { + (void)name; return 0; } virtual void addDynamicProperties(const PropertyContainer*) { diff --git a/src/App/PropertyStandard.cpp b/src/App/PropertyStandard.cpp index 82cbae057c..f5c83a98a5 100644 --- a/src/App/PropertyStandard.cpp +++ b/src/App/PropertyStandard.cpp @@ -1354,7 +1354,7 @@ unsigned int PropertyString::getMemSize (void) const return static_cast(_cValue.size()); } -void PropertyString::setPathValue(const ObjectIdentifier &path, const boost::any &value) +void PropertyString::setPathValue(const ObjectIdentifier &path, const boost::any & /*value*/) { verifyPath(path); } diff --git a/src/App/PropertyStandard.h b/src/App/PropertyStandard.h index d2f9defd0b..b3e68bd1c8 100644 --- a/src/App/PropertyStandard.h +++ b/src/App/PropertyStandard.h @@ -78,7 +78,7 @@ public: virtual unsigned int getMemSize (void) const{return sizeof(long);} virtual void setPathValue(const App::ObjectIdentifier & path, const boost::any & value); - virtual const boost::any getPathValue(const App::ObjectIdentifier & path) const { return _lValue; } + virtual const boost::any getPathValue(const App::ObjectIdentifier & /*path*/) const { return _lValue; } protected: long _lValue; @@ -199,7 +199,7 @@ public: virtual void Paste(const Property &from); virtual void setPathValue(const App::ObjectIdentifier & path, const boost::any & value); - virtual const boost::any getPathValue(const App::ObjectIdentifier & path) const { return _enum; } + virtual const boost::any getPathValue(const App::ObjectIdentifier & /*path*/) const { return _enum; } private: Enumeration _enum; diff --git a/src/App/PropertyUnits.cpp b/src/App/PropertyUnits.cpp index cb6eeb12f5..9a399d691f 100644 --- a/src/App/PropertyUnits.cpp +++ b/src/App/PropertyUnits.cpp @@ -118,7 +118,7 @@ void PropertyQuantity::setPyObject(PyObject *value) PropertyFloat::setValue(quant.getValue()); } -void PropertyQuantity::setPathValue(const ObjectIdentifier &path, const boost::any &value) +void PropertyQuantity::setPathValue(const ObjectIdentifier & /*path*/, const boost::any &value) { if (value.type() == typeid(double)) setValue(boost::any_cast(value)); @@ -128,7 +128,7 @@ void PropertyQuantity::setPathValue(const ObjectIdentifier &path, const boost::a throw bad_cast(); } -const boost::any PropertyQuantity::getPathValue(const ObjectIdentifier &path) const +const boost::any PropertyQuantity::getPathValue(const ObjectIdentifier & /*path*/) const { return Quantity(_dValue, _Unit); } diff --git a/src/App/Transactions.cpp b/src/App/Transactions.cpp index ddf9e6c1b5..f4f4ba4982 100644 --- a/src/App/Transactions.cpp +++ b/src/App/Transactions.cpp @@ -243,11 +243,11 @@ TransactionObject::~TransactionObject() delete It->second; } -void TransactionObject::applyDel(Document &Doc, TransactionalObject *pcObj) +void TransactionObject::applyDel(Document & /*Doc*/, TransactionalObject * /*pcObj*/) { } -void TransactionObject::applyNew(Document &Doc, TransactionalObject *pcObj) +void TransactionObject::applyNew(Document & /*Doc*/, TransactionalObject * /*pcObj*/) { }