[postgis-tickets] r15909 - Make lwgeom_dimensionality use a const argument

Paul Ramsey pramsey at cleverelephant.ca
Thu Oct 5 12:36:45 PDT 2017


Author: pramsey
Date: 2017-10-05 12:36:45 -0700 (Thu, 05 Oct 2017)
New Revision: 15909

Modified:
   trunk/liblwgeom/liblwgeom.h.in
   trunk/liblwgeom/lwgeom.c
Log:
Make lwgeom_dimensionality use a const argument


Modified: trunk/liblwgeom/liblwgeom.h.in
===================================================================
--- trunk/liblwgeom/liblwgeom.h.in	2017-10-05 19:34:16 UTC (rev 15908)
+++ trunk/liblwgeom/liblwgeom.h.in	2017-10-05 19:36:45 UTC (rev 15909)
@@ -1305,7 +1305,7 @@
 /**
 * Return the dimensionality (relating to point/line/poly) of an lwgeom
 */
-extern int lwgeom_dimensionality(LWGEOM *geom);
+extern int lwgeom_dimensionality(const LWGEOM *geom);
 
 /* Is lwgeom1 geometrically equal to lwgeom2 ? */
 extern char lwgeom_same(const LWGEOM *lwgeom1, const LWGEOM *lwgeom2);

Modified: trunk/liblwgeom/lwgeom.c
===================================================================
--- trunk/liblwgeom/lwgeom.c	2017-10-05 19:34:16 UTC (rev 15908)
+++ trunk/liblwgeom/lwgeom.c	2017-10-05 19:36:45 UTC (rev 15909)
@@ -1426,7 +1426,7 @@
 }
 
 
-static int lwcollection_dimensionality(LWCOLLECTION *col)
+static int lwcollection_dimensionality(const LWCOLLECTION *col)
 {
 	int i;
 	int dimensionality = 0;
@@ -1439,7 +1439,7 @@
 	return dimensionality;
 }
 
-extern int lwgeom_dimensionality(LWGEOM *geom)
+extern int lwgeom_dimensionality(const LWGEOM *geom)
 {
 	int dim;
 
@@ -1474,7 +1474,7 @@
 		break;
 
 	case COLLECTIONTYPE:
-		return lwcollection_dimensionality((LWCOLLECTION *)geom);
+		return lwcollection_dimensionality((const LWCOLLECTION *)geom);
 		break;
 	default:
 		lwerror("lwgeom_dimensionality: unsupported input geometry type: %s",



More information about the postgis-tickets mailing list