[postgis-tickets] r15926 - Mark non-mutating segmentize functions as const

Paul Ramsey pramsey at cleverelephant.ca
Fri Oct 6 14:49:20 PDT 2017


Author: pramsey
Date: 2017-10-06 14:49:20 -0700 (Fri, 06 Oct 2017)
New Revision: 15926

Modified:
   trunk/liblwgeom/liblwgeom.h.in
   trunk/liblwgeom/lwcollection.c
   trunk/liblwgeom/lwgeom.c
   trunk/liblwgeom/lwline.c
   trunk/liblwgeom/lwpoly.c
Log:
Mark non-mutating segmentize functions as const


Modified: trunk/liblwgeom/liblwgeom.h.in
===================================================================
--- trunk/liblwgeom/liblwgeom.h.in	2017-10-06 21:19:44 UTC (rev 15925)
+++ trunk/liblwgeom/liblwgeom.h.in	2017-10-06 21:49:20 UTC (rev 15926)
@@ -1474,11 +1474,11 @@
  * Ensure every segment is at most 'dist' long.
  * Returned LWGEOM might is unchanged if a POINT.
  */
-extern LWGEOM *lwgeom_segmentize2d(LWGEOM *line, double dist);
+extern LWGEOM *lwgeom_segmentize2d(const LWGEOM *line, double dist);
 extern POINTARRAY *ptarray_segmentize2d(const POINTARRAY *ipa, double dist);
-extern LWLINE *lwline_segmentize2d(LWLINE *line, double dist);
-extern LWPOLY *lwpoly_segmentize2d(LWPOLY *line, double dist);
-extern LWCOLLECTION *lwcollection_segmentize2d(LWCOLLECTION *coll, double dist);
+extern LWLINE *lwline_segmentize2d(const LWLINE *line, double dist);
+extern LWPOLY *lwpoly_segmentize2d(const LWPOLY *line, double dist);
+extern LWCOLLECTION *lwcollection_segmentize2d(const LWCOLLECTION *coll, double dist);
 
 /*
  * Point density functions

Modified: trunk/liblwgeom/lwcollection.c
===================================================================
--- trunk/liblwgeom/lwcollection.c	2017-10-06 21:19:44 UTC (rev 15925)
+++ trunk/liblwgeom/lwcollection.c	2017-10-06 21:49:20 UTC (rev 15926)
@@ -234,7 +234,7 @@
 
 
 LWCOLLECTION *
-lwcollection_segmentize2d(LWCOLLECTION *col, double dist)
+lwcollection_segmentize2d(const LWCOLLECTION *col, double dist)
 {
 	uint32_t i;
 	LWGEOM **newgeoms;

Modified: trunk/liblwgeom/lwgeom.c
===================================================================
--- trunk/liblwgeom/lwgeom.c	2017-10-06 21:19:44 UTC (rev 15925)
+++ trunk/liblwgeom/lwgeom.c	2017-10-06 21:49:20 UTC (rev 15926)
@@ -745,7 +745,7 @@
 }
 
 LWGEOM *
-lwgeom_segmentize2d(LWGEOM *lwgeom, double dist)
+lwgeom_segmentize2d(const LWGEOM *lwgeom, double dist)
 {
 	switch (lwgeom->type)
 	{

Modified: trunk/liblwgeom/lwline.c
===================================================================
--- trunk/liblwgeom/lwline.c	2017-10-06 21:19:44 UTC (rev 15925)
+++ trunk/liblwgeom/lwline.c	2017-10-06 21:49:20 UTC (rev 15926)
@@ -138,7 +138,7 @@
 
 
 LWLINE *
-lwline_segmentize2d(LWLINE *line, double dist)
+lwline_segmentize2d(const LWLINE *line, double dist)
 {
 	POINTARRAY *segmentized = ptarray_segmentize2d(line->points, dist);
 	if ( ! segmentized ) return NULL;

Modified: trunk/liblwgeom/lwpoly.c
===================================================================
--- trunk/liblwgeom/lwpoly.c	2017-10-06 21:19:44 UTC (rev 15925)
+++ trunk/liblwgeom/lwpoly.c	2017-10-06 21:49:20 UTC (rev 15926)
@@ -309,7 +309,7 @@
 }
 
 LWPOLY *
-lwpoly_segmentize2d(LWPOLY *poly, double dist)
+lwpoly_segmentize2d(const LWPOLY *poly, double dist)
 {
 	POINTARRAY **newrings;
 	uint32_t i;



More information about the postgis-tickets mailing list