From 1c1f0dfe49f97ef8639a99440ec4115d21e8997f Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 9 Aug 2016 13:16:26 +0200 Subject: [PATCH] fix various compiler warnings --- src/3rdParty/salomesmesh/inc/SMDS_MeshElement.hxx | 2 +- src/3rdParty/salomesmesh/inc/SMDS_VolumeTool.hxx | 2 +- src/3rdParty/salomesmesh/inc/utilities.h | 2 ++ src/Mod/Part/App/FeaturePartCommon.cpp | 2 +- src/Mod/Part/App/FeaturePartFuse.cpp | 2 +- src/Mod/Part/Gui/DlgRevolution.cpp | 2 +- src/Mod/Sandbox/Gui/AppSandboxGui.cpp | 2 +- src/Mod/TechDraw/App/DrawViewSection.cpp | 2 +- src/Mod/TechDraw/Gui/QGIPrimPath.cpp | 1 + src/Mod/TechDraw/Gui/QGIViewDimension.cpp | 2 +- 10 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/3rdParty/salomesmesh/inc/SMDS_MeshElement.hxx b/src/3rdParty/salomesmesh/inc/SMDS_MeshElement.hxx index 8d0d674e0..14a6d9a76 100644 --- a/src/3rdParty/salomesmesh/inc/SMDS_MeshElement.hxx +++ b/src/3rdParty/salomesmesh/inc/SMDS_MeshElement.hxx @@ -158,7 +158,7 @@ public: }; struct NonNullFilter: public Filter { - bool operator()(const SMDS_MeshElement* e) const { return e; } + bool operator()(const SMDS_MeshElement* e) const { return e != 0; } }; struct TypeFilter : public Filter { diff --git a/src/3rdParty/salomesmesh/inc/SMDS_VolumeTool.hxx b/src/3rdParty/salomesmesh/inc/SMDS_VolumeTool.hxx index 7e88f7c1a..bbc81c3b0 100644 --- a/src/3rdParty/salomesmesh/inc/SMDS_VolumeTool.hxx +++ b/src/3rdParty/salomesmesh/inc/SMDS_VolumeTool.hxx @@ -74,7 +74,7 @@ class SMDS_EXPORT SMDS_VolumeTool int ID() const; // return element ID - bool IsPoly() const { return myPolyedre; } + bool IsPoly() const { return myPolyedre != 0; } // ----------------------- // general info diff --git a/src/3rdParty/salomesmesh/inc/utilities.h b/src/3rdParty/salomesmesh/inc/utilities.h index 772cde2a9..2084c6ad0 100644 --- a/src/3rdParty/salomesmesh/inc/utilities.h +++ b/src/3rdParty/salomesmesh/inc/utilities.h @@ -75,6 +75,7 @@ DEF_MSG_BUFFER << os.str() << std::endl; /* --- To print date and time of compilation of current source --- */ +#ifndef COMPILER #if defined ( __GNUC__ ) #define COMPILER "g++" #elif defined ( __sun ) @@ -90,6 +91,7 @@ DEF_MSG_BUFFER << os.str() << std::endl; #else #define COMPILER "undefined" #endif +#endif #ifdef INFOS_COMPILATION #error INFOS_COMPILATION already defined diff --git a/src/Mod/Part/App/FeaturePartCommon.cpp b/src/Mod/Part/App/FeaturePartCommon.cpp index 61d03fb4f..c70dad2cd 100644 --- a/src/Mod/Part/App/FeaturePartCommon.cpp +++ b/src/Mod/Part/App/FeaturePartCommon.cpp @@ -156,7 +156,7 @@ App::DocumentObjectExecReturn *MultiCommon::execute(void) TopTools_IndexedMapOfShape facesOfCompound; TopAbs_ShapeEnum type = TopAbs_FACE; TopExp::MapShapes(compoundOfArguments, type, facesOfCompound); - for (int iChild = 0; iChild < history.size(); iChild++){ //loop over children of source compound + for (std::size_t iChild = 0; iChild < history.size(); iChild++){ //loop over children of source compound //for each face of a child, find the inex of the face in compound, and assign the corresponding right-hand-size of the history TopTools_IndexedMapOfShape facesOfChild; TopExp::MapShapes(s[iChild], type, facesOfChild); diff --git a/src/Mod/Part/App/FeaturePartFuse.cpp b/src/Mod/Part/App/FeaturePartFuse.cpp index 13ebe2212..56ede6b8a 100644 --- a/src/Mod/Part/App/FeaturePartFuse.cpp +++ b/src/Mod/Part/App/FeaturePartFuse.cpp @@ -181,7 +181,7 @@ App::DocumentObjectExecReturn *MultiFuse::execute(void) TopTools_IndexedMapOfShape facesOfCompound; TopAbs_ShapeEnum type = TopAbs_FACE; TopExp::MapShapes(compoundOfArguments, type, facesOfCompound); - for (int iChild = 0; iChild < history.size(); iChild++){ //loop over children of source compound + for (std::size_t iChild = 0; iChild < history.size(); iChild++){ //loop over children of source compound //for each face of a child, find the inex of the face in compound, and assign the corresponding right-hand-size of the history TopTools_IndexedMapOfShape facesOfChild; TopExp::MapShapes(s[iChild], type, facesOfChild); diff --git a/src/Mod/Part/Gui/DlgRevolution.cpp b/src/Mod/Part/Gui/DlgRevolution.cpp index 4171f39e5..16cfe1de2 100644 --- a/src/Mod/Part/Gui/DlgRevolution.cpp +++ b/src/Mod/Part/Gui/DlgRevolution.cpp @@ -458,7 +458,7 @@ void DlgRevolution::on_txtAxisLink_textChanged(QString) } en = false; } - } catch (Base::Exception &err){ + } catch (Base::Exception &){ } catch (...){ diff --git a/src/Mod/Sandbox/Gui/AppSandboxGui.cpp b/src/Mod/Sandbox/Gui/AppSandboxGui.cpp index 5e098d4b5..695c4dee0 100644 --- a/src/Mod/Sandbox/Gui/AppSandboxGui.cpp +++ b/src/Mod/Sandbox/Gui/AppSandboxGui.cpp @@ -23,8 +23,8 @@ #include "PreCompiled.h" #ifndef _PreComp_ -# include # include +# include # include # include # include diff --git a/src/Mod/TechDraw/App/DrawViewSection.cpp b/src/Mod/TechDraw/App/DrawViewSection.cpp index 8f34970f9..b55e917c6 100644 --- a/src/Mod/TechDraw/App/DrawViewSection.cpp +++ b/src/Mod/TechDraw/App/DrawViewSection.cpp @@ -159,7 +159,7 @@ App::DocumentObjectExecReturn *DrawViewSection::execute(void) pnts.push_back(Base::Vector3d(bb.MinX,bb.MaxY,bb.MaxZ)); pnts.push_back(Base::Vector3d(bb.MaxX,bb.MaxY,bb.MaxZ)); - double uMax = 0, vMax = 0, wMax; + double uMax = 0, vMax = 0, wMax = 0; for(std::vector::const_iterator it = pnts.begin(); it != pnts.end(); ++it) { // Project each bounding box point onto projection plane and find larges u,v values diff --git a/src/Mod/TechDraw/Gui/QGIPrimPath.cpp b/src/Mod/TechDraw/Gui/QGIPrimPath.cpp index 22c5f2e84..f255c6db6 100644 --- a/src/Mod/TechDraw/Gui/QGIPrimPath.cpp +++ b/src/Mod/TechDraw/Gui/QGIPrimPath.cpp @@ -82,6 +82,7 @@ void QGIPrimPath::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) { QGIView *view = dynamic_cast (parentItem()); //this is temp for debug?? assert(view != 0); + Q_UNUSED(view); if(!isSelected() && !isHighlighted) { setPrettyNormal(); } diff --git a/src/Mod/TechDraw/Gui/QGIViewDimension.cpp b/src/Mod/TechDraw/Gui/QGIViewDimension.cpp index 5273581c4..d3e52824e 100644 --- a/src/Mod/TechDraw/Gui/QGIViewDimension.cpp +++ b/src/Mod/TechDraw/Gui/QGIViewDimension.cpp @@ -768,7 +768,7 @@ void QGIViewDimension::draw() Base::Vector3d pointOnCurve,curveCenter; double radius; - TechDrawGeometry::AOC* geomArc; + TechDrawGeometry::AOC* geomArc = 0; bool isArc = false; if(dim->References2D.getValues().size() == 1 && TechDraw::DrawUtil::getGeomTypeFromName(SubNames[0]) == "Edge") {