diff --git a/common/geometry/shape_poly_set.cpp b/common/geometry/shape_poly_set.cpp index 7c0d2f38fc..ff2ad87425 100644 --- a/common/geometry/shape_poly_set.cpp +++ b/common/geometry/shape_poly_set.cpp @@ -942,7 +942,7 @@ void SHAPE_POLY_SET::unfractureSingle( SHAPE_POLY_SET::POLYGON& aPoly ) auto lc = aPoly[0]; lc.Simplify(); - EDGE_LIST_ENTRY edgeList[ lc.SegmentCount() ]; + auto edgeList = std::make_unique( lc.SegmentCount() ); for( int i = 0; i < lc.SegmentCount(); i++ ) { @@ -1004,7 +1004,7 @@ void SHAPE_POLY_SET::unfractureSingle( SHAPE_POLY_SET::POLYGON& aPoly ) queue.insert( &edgeList[i] ); } - EDGE_LIST_ENTRY* edgeBuf[ lc.SegmentCount() ]; + auto edgeBuf = std::make_unique( lc.SegmentCount() ); int n = 0; int outline = -1; diff --git a/qa/polygon_triangulation/test_polygon_triangulation.cpp b/qa/polygon_triangulation/test_polygon_triangulation.cpp index c23af207dd..432a323a1b 100644 --- a/qa/polygon_triangulation/test_polygon_triangulation.cpp +++ b/qa/polygon_triangulation/test_polygon_triangulation.cpp @@ -33,7 +33,7 @@ #include #include - +#include void unfracture( SHAPE_POLY_SET::POLYGON* aPoly, SHAPE_POLY_SET::POLYGON* aResult ) @@ -88,7 +88,7 @@ void unfracture( SHAPE_POLY_SET::POLYGON* aPoly, SHAPE_POLY_SET::POLYGON* aResul auto lc = (*aPoly)[0]; lc.Simplify(); - EDGE_LIST_ENTRY edgeList[ lc.SegmentCount() ]; + auto edgeList = std::make_unique( lc.SegmentCount() ); for(int i = 0; i < lc.SegmentCount(); i++) { @@ -149,7 +149,7 @@ void unfracture( SHAPE_POLY_SET::POLYGON* aPoly, SHAPE_POLY_SET::POLYGON* aResul //printf("Skip %d\n", i); } - EDGE_LIST_ENTRY* edgeBuf[ lc.SegmentCount() ]; + auto edgeBuf = std::make_unique( lc.SegmentCount() ); int n = 0; int outline = -1;