From 3998bd7f98e24a0c760e36dc9d6c9a2f1959b959 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 4 Oct 2015 13:27:44 +0200 Subject: [PATCH] + fix warnings: -Wunused-private-field and -Wtautological-compare --- src/Mod/Mesh/App/Core/Triangulation.cpp | 2 ++ src/Mod/Sketcher/App/PropertyConstraintList.cpp | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Mod/Mesh/App/Core/Triangulation.cpp b/src/Mod/Mesh/App/Core/Triangulation.cpp index 17896594c..447b2668f 100644 --- a/src/Mod/Mesh/App/Core/Triangulation.cpp +++ b/src/Mod/Mesh/App/Core/Triangulation.cpp @@ -653,6 +653,8 @@ void FlatTriangulator::PostProcessing(const std::vector&) ConstraintDelaunayTriangulator::ConstraintDelaunayTriangulator(float area) : fMaxArea(area) { + // silent warning: -Wunused-private-field + (void)fMaxArea; } ConstraintDelaunayTriangulator::~ConstraintDelaunayTriangulator() diff --git a/src/Mod/Sketcher/App/PropertyConstraintList.cpp b/src/Mod/Sketcher/App/PropertyConstraintList.cpp index 039e52ab6..e7790fc2b 100644 --- a/src/Mod/Sketcher/App/PropertyConstraintList.cpp +++ b/src/Mod/Sketcher/App/PropertyConstraintList.cpp @@ -421,7 +421,7 @@ void PropertyConstraintList::setPathValue(const ObjectIdentifier &path, const bo throw std::bad_cast(); if (c0.isArray() && path.numSubComponents() == 1) { - if (c0.getIndex() < 0 || c0.getIndex() >= _lValueList.size()) + if (c0.getIndex() >= _lValueList.size()) throw Base::Exception("Array out of bounds"); aboutToSetValue(); _lValueList[c0.getIndex()]->setValue(dvalue); @@ -448,7 +448,7 @@ const Constraint * PropertyConstraintList::getConstraint(const ObjectIdentifier const ObjectIdentifier::Component & c0 = path.getPropertyComponent(0); if (c0.isArray() && path.numSubComponents() == 1) { - if (c0.getIndex() < 0 || c0.getIndex() >= _lValueList.size()) + if (c0.getIndex() >= _lValueList.size()) throw Base::Exception("Array out of bounds"); return _lValueList[c0.getIndex()]; @@ -474,7 +474,7 @@ const ObjectIdentifier PropertyConstraintList::canonicalPath(const ObjectIdentif const ObjectIdentifier::Component & c0 = p.getPropertyComponent(0); if (c0.isArray() && p.numSubComponents() == 1) { - if (c0.getIndex() >= 0 && c0.getIndex() < _lValueList.size() && _lValueList[c0.getIndex()]->Name.size() > 0) + if (c0.getIndex() < _lValueList.size() && _lValueList[c0.getIndex()]->Name.size() > 0) return ObjectIdentifier(getContainer()) << ObjectIdentifier::Component::SimpleComponent(getName()) << ObjectIdentifier::Component::SimpleComponent(_lValueList[c0.getIndex()]->Name); return p;