From 62670d0514bb049f73dd2e427cbdd2cdf4848c0b Mon Sep 17 00:00:00 2001 From: curt Date: Thu, 18 Mar 1999 04:31:10 +0000 Subject: [PATCH] Let's not pass copies of huge structures on the stack ... ye might see a segfault ... :-) --- Clipper/clipper.hxx | 5 +++++ Triangulate/triangle.cxx | 10 ++++++++-- Triangulate/triangle.hxx | 6 +++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/Clipper/clipper.hxx b/Clipper/clipper.hxx index 617b92f45..874d49485 100644 --- a/Clipper/clipper.hxx +++ b/Clipper/clipper.hxx @@ -54,6 +54,7 @@ FG_USING_STD(vector); typedef vector < gpc_polygon * > gpcpoly_container; typedef gpcpoly_container::iterator gpcpoly_iterator; +typedef gpcpoly_container::const_iterator const_gpcpoly_iterator; #define FG_MAX_AREAS 20 @@ -108,6 +109,10 @@ public: // $Log$ +// Revision 1.4 1999/03/18 04:31:10 curt +// Let's not pass copies of huge structures on the stack ... ye might see a +// segfault ... :-) +// // Revision 1.3 1999/03/17 23:48:59 curt // minor renaming and a bit of rearranging. // diff --git a/Triangulate/triangle.cxx b/Triangulate/triangle.cxx index 2a226dd3b..992549214 100644 --- a/Triangulate/triangle.cxx +++ b/Triangulate/triangle.cxx @@ -36,13 +36,13 @@ FGTriangle::~FGTriangle( void ) { // populate this class based on the specified gpc_polys list -int FGTriangle::build( FGgpcPolyList gpc_polys ) { +int FGTriangle::build( const FGgpcPolyList& gpc_polys ) { // traverse the gpc_polys and build a unified node list and a set // of Triangle PSLG that reference the node list by index // (starting at zero) gpc_polygon *gpc_poly; - gpcpoly_iterator current, last; + const_gpcpoly_iterator current, last; // process polygons in priority order cout << "prepairing node list and polygons" << endl; @@ -64,10 +64,16 @@ int FGTriangle::build( FGgpcPolyList gpc_polys ) { } } } + + return 0; } // $Log$ +// Revision 1.2 1999/03/18 04:31:11 curt +// Let's not pass copies of huge structures on the stack ... ye might see a +// segfault ... :-) +// // Revision 1.1 1999/03/17 23:51:59 curt // Initial revision. // diff --git a/Triangulate/triangle.hxx b/Triangulate/triangle.hxx index 5879abd18..1dbb85e24 100644 --- a/Triangulate/triangle.hxx +++ b/Triangulate/triangle.hxx @@ -66,7 +66,7 @@ public: ~FGTriangle( void ); // populate this class based on the specified gpc_polys list - int build( FGgpcPolyList gpc_polys ); + int build( const FGgpcPolyList& gpc_polys ); }; @@ -74,6 +74,10 @@ public: // $Log$ +// Revision 1.2 1999/03/18 04:31:12 curt +// Let's not pass copies of huge structures on the stack ... ye might see a +// segfault ... :-) +// // Revision 1.1 1999/03/17 23:51:59 curt // Initial revision. // -- 2.39.2