diff --git a/src/Mod/Path/libarea/Area.h b/src/Mod/Path/libarea/Area.h index add4dcdc1..23937196c 100644 --- a/src/Mod/Path/libarea/Area.h +++ b/src/Mod/Path/libarea/Area.h @@ -60,7 +60,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/AreaClipper.cpp b/src/Mod/Path/libarea/AreaClipper.cpp index 608707835..ec5e63730 100644 --- a/src/Mod/Path/libarea/AreaClipper.cpp +++ b/src/Mod/Path/libarea/AreaClipper.cpp @@ -169,7 +169,7 @@ static void OffsetWithLoops(const TPolyPolygon &pp, TPolyPolygon &pp_new, double { if(reverse) { - for(unsigned int j = p.size()-1; j > 1; j--)MakeLoop(p[j], p[j-1], p[j-2], radius); + for(std::size_t j = p.size()-1; j > 1; j--)MakeLoop(p[j], p[j-1], p[j-2], radius); MakeLoop(p[1], p[0], p[p.size()-1], radius); MakeLoop(p[0], p[p.size()-1], p[p.size()-2], radius); } @@ -177,7 +177,7 @@ static void OffsetWithLoops(const TPolyPolygon &pp, TPolyPolygon &pp_new, double { MakeLoop(p[p.size()-2], p[p.size()-1], p[0], radius); MakeLoop(p[p.size()-1], p[0], p[1], radius); - for(unsigned int j = 2; j < p.size(); j++)MakeLoop(p[j-2], p[j-1], p[j], radius); + for(std::size_t j = 2; j < p.size(); j++)MakeLoop(p[j-2], p[j-1], p[j], radius); } TPolygon loopy_polygon; @@ -213,8 +213,8 @@ static void OffsetWithLoops(const TPolyPolygon &pp, TPolyPolygon &pp_new, double const TPolygon& p = copy[i]; TPolygon p_new; p_new.resize(p.size()); - int size_minus_one = p.size() - 1; - for(unsigned int j = 0; j < p.size(); j++)p_new[j] = p[size_minus_one - j]; + std::size_t size_minus_one = p.size() - 1; + for(std::size_t j = 0; j < p.size(); j++)p_new[j] = p[size_minus_one - j]; pp_new[i] = p_new; } } @@ -290,8 +290,8 @@ static void OffsetSpansWithObrounds(const CArea& area, TPolyPolygon &pp_new, dou const TPolygon& p = copy[i]; TPolygon p_new; p_new.resize(p.size()); - int size_minus_one = p.size() - 1; - for(unsigned int j = 0; j < p.size(); j++)p_new[j] = p[size_minus_one - j]; + std::size_t size_minus_one = p.size() - 1; + for(std::size_t j = 0; j < p.size(); j++)p_new[j] = p[size_minus_one - j]; pp_new[i] = p_new; } } @@ -315,7 +315,7 @@ static void MakePolyPoly( const CArea& area, TPolyPolygon &pp, bool reverse = tr p.resize(pts_for_AddVertex.size()); if(reverse) { - unsigned int i = pts_for_AddVertex.size() - 1;// clipper wants them the opposite way to CArea + std::size_t i = pts_for_AddVertex.size() - 1;// clipper wants them the opposite way to CArea for(std::list::iterator It = pts_for_AddVertex.begin(); It != pts_for_AddVertex.end(); It++, i--) { p[i] = It->int_point(); @@ -498,4 +498,4 @@ void UnFitArcs(CCurve &curve) CVertex vertex(0, Point(pt.X / CArea::m_units, pt.Y / CArea::m_units), Point(0.0, 0.0)); curve.m_vertices.push_back(vertex); } -} \ No newline at end of file +} diff --git a/src/Mod/Path/libarea/CMakeLists.txt b/src/Mod/Path/libarea/CMakeLists.txt index f1b7807f9..167a66173 100644 --- a/src/Mod/Path/libarea/CMakeLists.txt +++ b/src/Mod/Path/libarea/CMakeLists.txt @@ -4,6 +4,10 @@ if (CMAKE_BUILD_TOOL MATCHES "make") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") endif (CMAKE_BUILD_TOOL MATCHES "make") +if(MSVC) + add_definitions(-D_CRT_SECURE_NO_WARNINGS) +endif(MSVC) + include_directories(${PYTHON_INCLUDE_DIRS}) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/src/Mod/Path/libarea/Curve.cpp b/src/Mod/Path/libarea/Curve.cpp index 707272520..98fa00984 100644 --- a/src/Mod/Path/libarea/Curve.cpp +++ b/src/Mod/Path/libarea/Curve.cpp @@ -62,10 +62,10 @@ 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 i = 0; + std::size_t num = might_be_an_arc.size(); + std::size_t i = 0; const CVertex* mid_vt = NULL; - int mid_i = (num-1)/2; + std::size_t mid_i = (num-1)/2; for(std::list::iterator It = might_be_an_arc.begin(); It != might_be_an_arc.end(); It++, i++) { if(i == mid_i) diff --git a/src/Mod/Path/libarea/PythonStuff.cpp b/src/Mod/Path/libarea/PythonStuff.cpp index 7f48114b3..12d99bec8 100644 --- a/src/Mod/Path/libarea/PythonStuff.cpp +++ b/src/Mod/Path/libarea/PythonStuff.cpp @@ -62,7 +62,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++) @@ -85,7 +85,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/Path/libarea/dxf.cpp b/src/Mod/Path/libarea/dxf.cpp index 4795281d4..adc63ece5 100644 --- a/src/Mod/Path/libarea/dxf.cpp +++ b/src/Mod/Path/libarea/dxf.cpp @@ -1,4 +1,5 @@ // dxf.cpp +// dxf.cpp // Copyright 2011, Dan Heeks // This program is released under the BSD license. See the file COPYING for details. @@ -1359,10 +1360,10 @@ void CDxfRead::get_line() m_ifs->getline(m_str, 1024); char str[1024]; - int len = strlen(m_str); - int j = 0; + std::size_t len = strlen(m_str); + std::size_t j = 0; bool non_white_found = false; - for(int i = 0; i