diff --git a/src/Gui/GestureNavigationStyle.cpp b/src/Gui/GestureNavigationStyle.cpp index 4f148e738..efafd2607 100644 --- a/src/Gui/GestureNavigationStyle.cpp +++ b/src/Gui/GestureNavigationStyle.cpp @@ -375,7 +375,7 @@ SbBool GestureNavigationStyle::processSoEvent(const SoEvent * const ev) this->mousedownConsumedEvent[cnt] = *event;//hopefully, a shallow copy is enough. There are no pointers stored in events, apparently. Will loose a subclass, though. cnt++; assert(cnt<=2); - if(cnt>sizeof(mousedownConsumedEvent)){ + if(cnt>static_cast(sizeof(mousedownConsumedEvent))){ cnt=sizeof(mousedownConsumedEvent);//we are in trouble } processed = true;//just consume this event, and wait for the move threshold to be broken to start dragging/panning diff --git a/src/Gui/QuantitySpinBox.cpp b/src/Gui/QuantitySpinBox.cpp index 2afc4fa38..9e679c551 100644 --- a/src/Gui/QuantitySpinBox.cpp +++ b/src/Gui/QuantitySpinBox.cpp @@ -67,6 +67,7 @@ public: QString copy = input; int len = copy.size(); + pos = len; const bool plus = max >= 0; const bool minus = min <= 0; @@ -274,7 +275,7 @@ void QuantitySpinBox::userInput(const QString & text) Q_D(QuantitySpinBox); QString tmp = text; - int pos; + int pos = 0; QValidator::State state; Base::Quantity res = d->validateAndInterpret(tmp, pos, state); if (state == QValidator::Acceptable) { @@ -446,7 +447,7 @@ void QuantitySpinBox::focusOutEvent(QFocusEvent * event) { Q_D(QuantitySpinBox); - int pos; + int pos = 0; QString text = lineEdit()->text(); QValidator::State state; d->validateAndInterpret(text, pos, state); diff --git a/src/Gui/Quarter/QtCoinCompatibility.cpp b/src/Gui/Quarter/QtCoinCompatibility.cpp index 542c35b96..3ffd38cf8 100644 --- a/src/Gui/Quarter/QtCoinCompatibility.cpp +++ b/src/Gui/Quarter/QtCoinCompatibility.cpp @@ -60,7 +60,7 @@ QtCoinCompatibility::SbImageToQImage(const SbImage & sbimage, QImage & img) "Implementation not tested for 3 colors or more" ); } - QImage::Format format; + QImage::Format format=QImage::Format_Invalid; if (nc==3||nc==4) { format=QImage::Format_RGB32; } diff --git a/src/Mod/Complete/Gui/AppCompleteGui.cpp b/src/Mod/Complete/Gui/AppCompleteGui.cpp index 32b9d712f..b875cebf8 100644 --- a/src/Mod/Complete/Gui/AppCompleteGui.cpp +++ b/src/Mod/Complete/Gui/AppCompleteGui.cpp @@ -63,7 +63,7 @@ void CompleteGuiExport initCompleteGui() // try to load dependent modules, currently not (AssemblyGui, CamGui) char *modules[] = {"PartGui", "MeshGui", "MeshPartGui", "PointsGui", "DrawingGui", "RaytracingGui", "SketcherGui", "PartDesignGui", "ImageGui", "TestGui"}; - char nModules = sizeof(modules) / sizeof(char*); + size_t nModules = sizeof(modules) / sizeof(char*); for (size_t i = 0; i < nModules; i++) { try { Base::Interpreter().loadModule(modules[i]); diff --git a/src/Mod/Draft/App/AppDraftUtils.cpp b/src/Mod/Draft/App/AppDraftUtils.cpp index 0528f4420..c2ef092bc 100644 --- a/src/Mod/Draft/App/AppDraftUtils.cpp +++ b/src/Mod/Draft/App/AppDraftUtils.cpp @@ -46,7 +46,7 @@ extern "C" { PyErr_SetString(PyExc_ImportError, e.what()); return; } - PyObject* DraftUtilsModule = Py_InitModule3("DraftUtils", DraftUtils_methods, module_DraftUtils_doc); /* mod name, table ptr */ + Py_InitModule3("DraftUtils", DraftUtils_methods, module_DraftUtils_doc); /* mod name, table ptr */ Base::Console().Log("Loading DraftUtils module... done\n"); } diff --git a/src/Mod/Drawing/Gui/ViewProviderPage.cpp b/src/Mod/Drawing/Gui/ViewProviderPage.cpp index 3998058cd..9f08e2fa4 100644 --- a/src/Mod/Drawing/Gui/ViewProviderPage.cpp +++ b/src/Mod/Drawing/Gui/ViewProviderPage.cpp @@ -152,8 +152,7 @@ bool ViewProviderDrawingPage::onDelete(const std::vector & items) void ViewProviderDrawingPage::setupContextMenu(QMenu* menu, QObject* receiver, const char* member) { - QAction* act; - act = menu->addAction(QObject::tr("Show drawing"), receiver, member); + menu->addAction(QObject::tr("Show drawing"), receiver, member); } bool ViewProviderDrawingPage::setEdit(int ModNum) diff --git a/src/Mod/Image/Gui/XpmImages.h b/src/Mod/Image/Gui/XpmImages.h index 9fa1d15fd..ff18e3f7b 100644 --- a/src/Mod/Image/Gui/XpmImages.h +++ b/src/Mod/Image/Gui/XpmImages.h @@ -65,6 +65,7 @@ static const char *image_oneToOne[]={ ".##############.", "................"}; +#if 0 /* XPM */ static const char *image_orig[]={ "16 16 5 1", @@ -114,6 +115,7 @@ static const char *image_bright[]={ ".cccccccccccccc.", ".cccccccccccccc.", "................"}; +#endif } // namespace ImageGui diff --git a/src/Mod/Import/App/StepShape.cpp b/src/Mod/Import/App/StepShape.cpp index 66b926ef7..018cac864 100644 --- a/src/Mod/Import/App/StepShape.cpp +++ b/src/Mod/Import/App/StepShape.cpp @@ -81,7 +81,7 @@ int StepShape::read(const char* fileName) Handle(TColStd_HSequenceOfTransient) list = aReader.GiveList(); //Use method StepData_StepModel::NextNumberForLabel to find its rank with the following: - Standard_CString label = "#..."; + //Standard_CString label = "#..."; Handle_StepData_StepModel model = aReader.StepModel(); //rank = model->NextNumberForLabe(label, 0, Standard_False); diff --git a/src/Mod/Mesh/App/Core/Projection.cpp b/src/Mod/Mesh/App/Core/Projection.cpp index aaf34ba80..042eaa2e5 100644 --- a/src/Mod/Mesh/App/Core/Projection.cpp +++ b/src/Mod/Mesh/App/Core/Projection.cpp @@ -325,7 +325,7 @@ bool MeshProjection::connectLines(std::list< std::pairfirst); float fD2 = Base::DistanceP2(curr, it->second); diff --git a/src/Mod/Mesh/App/Mesh.cpp b/src/Mod/Mesh/App/Mesh.cpp index 87807a88e..17f7af8a5 100644 --- a/src/Mod/Mesh/App/Mesh.cpp +++ b/src/Mod/Mesh/App/Mesh.cpp @@ -860,6 +860,9 @@ void MeshObject::cut(const Base::Polygon2D& polygon2d, case OUTER: inner = false; break; + default: + inner = true; + break; } MeshCore::MeshFacetGrid meshGrid(this->_kernel); diff --git a/src/Mod/Part/App/BSplineSurfacePyImp.cpp b/src/Mod/Part/App/BSplineSurfacePyImp.cpp index 49311af0a..9d1264a04 100644 --- a/src/Mod/Part/App/BSplineSurfacePyImp.cpp +++ b/src/Mod/Part/App/BSplineSurfacePyImp.cpp @@ -1281,7 +1281,7 @@ PyObject* BSplineSurfacePy::approximate(PyObject *args) Standard_Failure::Raise("not enough points given"); } - GeomAbs_Shape c; + GeomAbs_Shape c = GeomAbs_CN; switch(continuity){ case 0: c = GeomAbs_C0; diff --git a/src/Mod/Part/App/Part2DObject.cpp b/src/Mod/Part/App/Part2DObject.cpp index 7a8d34b7e..ec7ec1150 100644 --- a/src/Mod/Part/App/Part2DObject.cpp +++ b/src/Mod/Part/App/Part2DObject.cpp @@ -215,7 +215,7 @@ bool Part2DObject::seekTrimPoints(const std::vector &geomlist, gp_Pln plane(gp_Pnt(0,0,0),gp_Dir(0,0,1)); Standard_Boolean periodic=Standard_False; - double period; + double period = 0; Handle_Geom2d_Curve primaryCurve; Handle_Geom_Geometry geom = (geomlist[GeoId])->handle(); Handle_Geom_Curve curve3d = Handle_Geom_Curve::DownCast(geom); diff --git a/src/Mod/Part/App/TopoShapePyImp.cpp b/src/Mod/Part/App/TopoShapePyImp.cpp index e50efd1a7..6b4f5174a 100644 --- a/src/Mod/Part/App/TopoShapePyImp.cpp +++ b/src/Mod/Part/App/TopoShapePyImp.cpp @@ -1748,18 +1748,21 @@ PyObject* TopoShapePy::distToShape(PyObject *args) pSuppType1 = PyString_FromString("Vertex"); pSupportIndex1 = _getSupportIndex("Vertex",ts1,suppS1); pParm1 = Py_None; + pParm2 = Py_None; break; case BRepExtrema_IsOnEdge: pSuppType1 = PyString_FromString("Edge"); pSupportIndex1 = _getSupportIndex("Edge",ts1,suppS1); extss.ParOnEdgeS1(i,t1); pParm1 = PyFloat_FromDouble(t1); + pParm2 = Py_None; break; case BRepExtrema_IsInFace: pSuppType1 = PyString_FromString("Face"); pSupportIndex1 = _getSupportIndex("Face",ts1,suppS1); extss.ParOnFaceS1(i,u1,v1); pParm1 = PyTuple_New(2); + pParm2 = Py_None; PyTuple_SetItem(pParm1,0,PyFloat_FromDouble(u1)); PyTuple_SetItem(pParm1,1,PyFloat_FromDouble(v1)); break; @@ -1768,6 +1771,7 @@ PyObject* TopoShapePy::distToShape(PyObject *args) pSuppType1 = PyString_FromString("Unknown"); pSupportIndex1 = PyInt_FromLong(-1); pParm1 = Py_None; + pParm2 = Py_None; } P2 = extss.PointOnShape2(i); diff --git a/src/Mod/Part/Gui/CrossSections.cpp b/src/Mod/Part/Gui/CrossSections.cpp index 0fb4583bf..be3402125 100644 --- a/src/Mod/Part/Gui/CrossSections.cpp +++ b/src/Mod/Part/Gui/CrossSections.cpp @@ -333,7 +333,7 @@ void CrossSections::on_sectionsBox_toggled(bool b) else { CrossSections::Plane type = plane(); Base::Vector3d c = bbox.CalcCenter(); - double value; + double value = 0; switch (type) { case CrossSections::XY: value = c.z; @@ -362,7 +362,7 @@ void CrossSections::on_checkBothSides_toggled(bool b) void CrossSections::on_countSections_valueChanged(int v) { CrossSections::Plane type = plane(); - double dist; + double dist = 0; switch (type) { case CrossSections::XY: dist = bbox.LengthZ() / v; diff --git a/src/Mod/Path/App/Path.cpp b/src/Mod/Path/App/Path.cpp index 9fdda9f25..aafe99aef 100644 --- a/src/Mod/Path/App/Path.cpp +++ b/src/Mod/Path/App/Path.cpp @@ -92,7 +92,7 @@ void Toolpath::insertCommand(const Command &Cmd, int pos) { if (pos == -1) { addCommand(Cmd); - } else if (pos <= vpcCommands.size()) { + } else if (pos <= static_cast(vpcCommands.size())) { Command *tmp = new Command(Cmd); vpcCommands.insert(vpcCommands.begin()+pos,tmp); } else { @@ -106,7 +106,7 @@ void Toolpath::deleteCommand(int pos) if (pos == -1) { //delete(*vpcCommands.rbegin()); // causes crash vpcCommands.pop_back(); - } else if (pos <= vpcCommands.size()) { + } else if (pos <= static_cast(vpcCommands.size())) { vpcCommands.erase (vpcCommands.begin()+pos); } else { throw Base::Exception("Index not in range"); diff --git a/src/Mod/Path/Gui/TaskDlgPathCompound.cpp b/src/Mod/Path/Gui/TaskDlgPathCompound.cpp index 7477d0ca2..46f755b5a 100644 --- a/src/Mod/Path/Gui/TaskDlgPathCompound.cpp +++ b/src/Mod/Path/Gui/TaskDlgPathCompound.cpp @@ -134,7 +134,7 @@ bool TaskDlgPathCompound::accept() Path::FeatureCompound* pcCompound = static_cast(CompoundView->getObject()); App::Document* pcDoc = static_cast(pcCompound->getDocument()); std::vector names = parameter->getList(); - for(int i = 0; i < names.size(); i++) + for(std::size_t i = 0; i < names.size(); i++) { App::DocumentObject* pcPath = static_cast(pcDoc->getObject(names[i].c_str())); paths.push_back(pcPath); diff --git a/src/Mod/Path/Gui/ViewProviderPath.cpp b/src/Mod/Path/Gui/ViewProviderPath.cpp index 909a880e2..cfc449f74 100644 --- a/src/Mod/Path/Gui/ViewProviderPath.cpp +++ b/src/Mod/Path/Gui/ViewProviderPath.cpp @@ -274,7 +274,7 @@ void ViewProviderPath::updateData(const App::Property* prop) else norm.Set(0,0,1); Base::Vector3d center = (last + cmd.getCenter()); - double radius = (last - center).Length(); + //double radius = (last - center).Length(); double angle = (next - center).GetAngle(last - center); // BUGGY: not needed anyway? //Base::Vector3d anorm = (last - center) % (next - center); @@ -308,7 +308,7 @@ void ViewProviderPath::updateData(const App::Property* prop) } else if ((name=="G81")||(name=="G82")||(name=="G83")||(name=="G84")||(name=="G85")||(name=="G86")||(name=="G89")){ // drill,tap,bore - double r; + double r = 0; if (cmd.has("R")) r = cmd.getValue("R"); Base::Vector3d p1(next.x,next.y,last.z); diff --git a/src/Mod/Path/libarea/Area.h b/src/Mod/Path/libarea/Area.h index c23f8c58f..5895613d2 100644 --- a/src/Mod/Path/libarea/Area.h +++ b/src/Mod/Path/libarea/Area.h @@ -82,7 +82,7 @@ public: void Offset(double inwards_value); void Thicken(double value); void FitArcs(); - unsigned int num_curves(){return m_curves.size();} + unsigned int num_curves(){return static_cast(m_curves.size());} Point NearestPoint(const Point& p)const; void GetBox(CBox2D &box); void Reorder(); diff --git a/src/Mod/Path/libarea/AreaPocket.cpp b/src/Mod/Path/libarea/AreaPocket.cpp index 399d2eb88..5054d889f 100644 --- a/src/Mod/Path/libarea/AreaPocket.cpp +++ b/src/Mod/Path/libarea/AreaPocket.cpp @@ -428,17 +428,16 @@ void recur(std::list &arealist, const CArea& a1, const CAreaPocketParams static CArea make_obround(const Point& p0, const Point& p1, double radius) { Point dir = p1 - p0; - double d = dir.length(); dir.normalize(); Point right(dir.y, -dir.x); CArea obround; CCurve c; - if(fabs(radius) < 0.0000001)radius = (radius > 0.0) ? 0.002 : (-0.002); + if(fabs(radius) < 0.0000001)radius = (radius > 0.0) ? 0.002 : (-0.002); Point vt0 = p0 + right * radius; Point vt1 = p1 + right * radius; Point vt2 = p1 - right * radius; Point vt3 = p0 - right * radius; - c.append(vt0); + c.append(vt0); c.append(vt1); c.append(CVertex(1, vt2, p1)); c.append(vt3); @@ -446,12 +445,12 @@ static CArea make_obround(const Point& p0, const Point& p1, double radius) obround.append(c); return obround; } - + static bool feed_possible(const CArea &area_for_feed_possible, const Point& p0, const Point& p1, double tool_radius) { CArea obround = make_obround(p0, p1, tool_radius); obround.Subtract(area_for_feed_possible); - return obround.m_curves.size() == 0; + return obround.m_curves.empty(); } void MarkOverlappingOffsetIslands(std::list &offset_islands) diff --git a/src/Mod/Path/libarea/Curve.cpp b/src/Mod/Path/libarea/Curve.cpp index 3c2740a34..b2d1f4c62 100644 --- a/src/Mod/Path/libarea/Curve.cpp +++ b/src/Mod/Path/libarea/Curve.cpp @@ -86,7 +86,7 @@ bool CCurve::CheckForArc(const CVertex& prev_vt, std::list& migh if(might_be_an_arc.size() < 2)return false; // find middle point - int num = might_be_an_arc.size(); + int num = static_cast(might_be_an_arc.size()); int i = 0; const CVertex* mid_vt = NULL; int mid_i = (num-1)/2; @@ -465,7 +465,7 @@ void CCurve::ChangeStart(const Point &p) { bool started = false; bool finished = false; - int start_span; + int start_span = 0; bool closed = IsClosed(); for(int i = 0; i < (closed ? 2:1); i++) @@ -911,7 +911,6 @@ double CCurve::PointToPerim(const Point& p)const { double best_dist = 0.0; double perim_at_best_dist = 0.0; - Point best_point = Point(0, 0); bool best_dist_found = false; double perim = 0.0; diff --git a/src/Mod/Path/libarea/PythonStuff.cpp b/src/Mod/Path/libarea/PythonStuff.cpp index 9fd0b3dd1..ea33c3040 100644 --- a/src/Mod/Path/libarea/PythonStuff.cpp +++ b/src/Mod/Path/libarea/PythonStuff.cpp @@ -33,6 +33,13 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "Point.h" #include "kurve/geometry.h" +#if defined (_POSIX_C_SOURCE) +# undef _POSIX_C_SOURCE +#endif +#if defined (_XOPEN_SOURCE) +# undef _XOPEN_SOURCE +#endif + #if _DEBUG #undef _DEBUG #include @@ -86,7 +93,7 @@ boost::python::tuple transformed_point(const geoff_geometry::Matrix &matrix, dou static void print_curve(const CCurve& c) { - unsigned int nvertices = c.m_vertices.size(); + std::size_t nvertices = c.m_vertices.size(); printf("number of vertices = %d\n", nvertices); int i = 0; for(std::list::const_iterator It = c.m_vertices.begin(); It != c.m_vertices.end(); It++, i++) @@ -109,7 +116,7 @@ static void print_area(const CArea &a) static unsigned int num_vertices(const CCurve& curve) { - return curve.m_vertices.size(); + return static_cast(curve.m_vertices.size()); } static CVertex FirstVertex(const CCurve& curve) diff --git a/src/Mod/Robot/App/Trajectory.cpp b/src/Mod/Robot/App/Trajectory.cpp index f3c3f9a40..0d9d01fd0 100644 --- a/src/Mod/Robot/App/Trajectory.cpp +++ b/src/Mod/Robot/App/Trajectory.cpp @@ -152,9 +152,9 @@ void Trajectory::generateTrajectory(void) pcTrajectory = new KDL::Trajectory_Composite(); // pointer to the pieces while iterating - KDL::Trajectory_Segment *pcTrak; - KDL::Path *pcPath; - KDL::VelocityProfile *pcVelPrf; + KDL::Trajectory_Segment *pcTrak=0; + KDL::Path *pcPath=0; + KDL::VelocityProfile *pcVelPrf=0; KDL::Path_RoundedComposite *pcRoundComp=0; KDL::Frame Last; diff --git a/src/Mod/Robot/Gui/CommandExport.cpp b/src/Mod/Robot/Gui/CommandExport.cpp index 7b8bf81e7..0c88b0a0d 100644 --- a/src/Mod/Robot/Gui/CommandExport.cpp +++ b/src/Mod/Robot/Gui/CommandExport.cpp @@ -70,14 +70,14 @@ void CmdRobotExportKukaCompact::activated(int iMsg) std::vector Sel = getSelection().getSelection(); - Robot::RobotObject *pcRobotObject; + Robot::RobotObject *pcRobotObject=0; if(Sel[0].pObject->getTypeId() == Robot::RobotObject::getClassTypeId()) pcRobotObject = dynamic_cast(Sel[0].pObject); else if(Sel[1].pObject->getTypeId() == Robot::RobotObject::getClassTypeId()) pcRobotObject = dynamic_cast(Sel[1].pObject); std::string RoboName = pcRobotObject->getNameInDocument(); - Robot::TrajectoryObject *pcTrajectoryObject; + Robot::TrajectoryObject *pcTrajectoryObject=0; if(Sel[0].pObject->getTypeId() == Robot::TrajectoryObject::getClassTypeId()) pcTrajectoryObject = dynamic_cast(Sel[0].pObject); else if(Sel[1].pObject->getTypeId() == Robot::TrajectoryObject::getClassTypeId()) @@ -135,14 +135,14 @@ void CmdRobotExportKukaFull::activated(int iMsg) std::vector Sel = getSelection().getSelection(); - Robot::RobotObject *pcRobotObject; + Robot::RobotObject *pcRobotObject=0; if(Sel[0].pObject->getTypeId() == Robot::RobotObject::getClassTypeId()) pcRobotObject = dynamic_cast(Sel[0].pObject); else if(Sel[1].pObject->getTypeId() == Robot::RobotObject::getClassTypeId()) pcRobotObject = dynamic_cast(Sel[1].pObject); std::string RoboName = pcRobotObject->getNameInDocument(); - Robot::TrajectoryObject *pcTrajectoryObject; + Robot::TrajectoryObject *pcTrajectoryObject=0; if(Sel[0].pObject->getTypeId() == Robot::TrajectoryObject::getClassTypeId()) pcTrajectoryObject = dynamic_cast(Sel[0].pObject); else if(Sel[1].pObject->getTypeId() == Robot::TrajectoryObject::getClassTypeId()) diff --git a/src/Mod/Robot/Gui/CommandTrajectory.cpp b/src/Mod/Robot/Gui/CommandTrajectory.cpp index c2b3494d6..3abe5f640 100644 --- a/src/Mod/Robot/Gui/CommandTrajectory.cpp +++ b/src/Mod/Robot/Gui/CommandTrajectory.cpp @@ -115,14 +115,14 @@ void CmdRobotInsertWaypoint::activated(int iMsg) std::vector Sel = getSelection().getSelection(); - Robot::RobotObject *pcRobotObject; + Robot::RobotObject *pcRobotObject=0; if(Sel[0].pObject->getTypeId() == Robot::RobotObject::getClassTypeId()) pcRobotObject = dynamic_cast(Sel[0].pObject); else if(Sel[1].pObject->getTypeId() == Robot::RobotObject::getClassTypeId()) pcRobotObject = dynamic_cast(Sel[1].pObject); std::string RoboName = pcRobotObject->getNameInDocument(); - Robot::TrajectoryObject *pcTrajectoryObject; + Robot::TrajectoryObject *pcTrajectoryObject=0; if(Sel[0].pObject->getTypeId() == Robot::TrajectoryObject::getClassTypeId()) pcTrajectoryObject = dynamic_cast(Sel[0].pObject); else if(Sel[1].pObject->getTypeId() == Robot::TrajectoryObject::getClassTypeId()) diff --git a/src/Mod/Sandbox/App/DocumentThread.cpp b/src/Mod/Sandbox/App/DocumentThread.cpp index 4a9a266d2..5df40b2aa 100644 --- a/src/Mod/Sandbox/App/DocumentThread.cpp +++ b/src/Mod/Sandbox/App/DocumentThread.cpp @@ -52,7 +52,7 @@ void DocumentThread::run() { App::Document* doc = App::GetApplication().getActiveDocument(); DocumentProtector dp(doc); - App::DocumentObject* obj = dp.addObject("Mesh::Ellipsoid", (const char*)objectName().toAscii()); + dp.addObject("Mesh::Ellipsoid", (const char*)objectName().toAscii()); dp.recompute(); } @@ -82,6 +82,7 @@ void WorkerThread::run() } seq.next(true); } + Q_UNUSED(val); } // --------------------------------------