[SCM] PostGIS branch master updated. 3.4.0rc1-914-g703825535

git at osgeo.org git at osgeo.org
Thu Feb 8 12:07:30 PST 2024


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".

The branch, master has been updated
       via  7038255354da9e2402db3612090953d9af8424a9 (commit)
      from  6d8aa3f758649f75bdd08b1f287bc1f306c5b538 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 7038255354da9e2402db3612090953d9af8424a9
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Thu Feb 8 12:07:24 2024 -0800

    const correctness in XML patch

diff --git a/postgis/lwgeom_in_gml.c b/postgis/lwgeom_in_gml.c
index 6bdb81998..f1eafb572 100644
--- a/postgis/lwgeom_in_gml.c
+++ b/postgis/lwgeom_in_gml.c
@@ -126,8 +126,8 @@ Datum geom_from_gml(PG_FUNCTION_ARGS)
 static inline bool
 is_gml_element(xmlNodePtr xn, const char *gml_name)
 {
-	char *colon_pos;
-	char *node_name;
+	const char *colon_pos;
+	const char *node_name;
 
 	/* Not an element node, can't do anything */
 	if (!xn || xn->type != XML_ELEMENT_NODE)
@@ -136,7 +136,7 @@ is_gml_element(xmlNodePtr xn, const char *gml_name)
 	/* If there's a colon in the element name, */
 	/* move past it before checking for equality with */
 	/* the element name we are looking for */
-	node_name = (char*)xn->name;
+	node_name = (const char*)xn->name;
 	colon_pos = strchr(node_name, ':');
 	if (colon_pos)
 		node_name = colon_pos + 1;
diff --git a/postgis/lwgeom_in_kml.c b/postgis/lwgeom_in_kml.c
index 0185587a3..38f3f5c59 100644
--- a/postgis/lwgeom_in_kml.c
+++ b/postgis/lwgeom_in_kml.c
@@ -67,8 +67,8 @@ static LWGEOM* parse_kml(xmlNodePtr xnode, bool *hasz);
 static inline bool
 is_kml_element(xmlNodePtr xn, const char *kml_name)
 {
-	char *colon_pos;
-	char *node_name;
+	const char *colon_pos;
+	const char *node_name;
 
 	/* Not an element node, can't do anything */
 	if (!xn || xn->type != XML_ELEMENT_NODE)
@@ -77,7 +77,7 @@ is_kml_element(xmlNodePtr xn, const char *kml_name)
 	/* If there's a colon in the element name, */
 	/* move past it before checking for equality with */
 	/* the element name we are looking for */
-	node_name = (char*)xn->name;
+	node_name = (const char*)xn->name;
 	colon_pos = strchr(node_name, ':');
 	if (colon_pos)
 		node_name = colon_pos + 1;
@@ -111,7 +111,6 @@ Datum geom_from_kml(PG_FUNCTION_ARGS)
 	/* Begin to Parse XML doc */
 	xmlInitParser();
 	xmldoc = xmlReadMemory(xml, xml_size, NULL, NULL, 0);
-	// xmldoc = xmlReadMemory(xml, xml_size, NULL, NULL, XML_PARSE_SAX1);
 	if (!xmldoc || (xmlroot = xmlDocGetRootElement(xmldoc)) == NULL)
 	{
 		xmlFreeDoc(xmldoc);
diff --git a/postgis/lwgeom_in_marc21.c b/postgis/lwgeom_in_marc21.c
index 282db4d56..8b4974fc4 100644
--- a/postgis/lwgeom_in_marc21.c
+++ b/postgis/lwgeom_in_marc21.c
@@ -94,7 +94,8 @@ Datum ST_GeomFromMARC21(PG_FUNCTION_ARGS) {
 static inline bool
 is_xml_element(xmlNodePtr xn, const char *xml_name)
 {
-	char *colon_pos, *node_name;
+	const char *colon_pos;
+	const char *node_name;
 
 	/* Not an element node, can't do anything */
 	if (!xn || xn->type != XML_ELEMENT_NODE)
@@ -103,7 +104,7 @@ is_xml_element(xmlNodePtr xn, const char *xml_name)
 	/* If there's a colon in the element name, */
 	/* move past it before checking for equality with */
 	/* the element name we are looking for */
-	node_name = (char*)xn->name;
+	node_name = (const char*)xn->name;
 	colon_pos = strchr(node_name, ':');
 	if (colon_pos)
 		node_name = colon_pos + 1;

-----------------------------------------------------------------------

Summary of changes:
 postgis/lwgeom_in_gml.c    | 6 +++---
 postgis/lwgeom_in_kml.c    | 7 +++----
 postgis/lwgeom_in_marc21.c | 5 +++--
 3 files changed, 9 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list