[SCM] PostGIS branch master updated. 3.4.0rc1-1112-gde88a07ca

git at osgeo.org git at osgeo.org
Fri May 17 14:20:27 PDT 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  de88a07ca71e80f52ebf5be5e1aa74ce2f678280 (commit)
      from  e3658f6ff91a72be7e95851820aa86b376d005e9 (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 de88a07ca71e80f52ebf5be5e1aa74ce2f678280
Author: Sandro Santilli <strk at kbt.io>
Date:   Fri May 17 22:00:46 2024 +0200

    Fix printf formats to be safe on 32bit systems
    
    Closes #5728

diff --git a/liblwgeom/gserialized1.c b/liblwgeom/gserialized1.c
index dab925a51..08c8e7745 100644
--- a/liblwgeom/gserialized1.c
+++ b/liblwgeom/gserialized1.c
@@ -1132,7 +1132,7 @@ GSERIALIZED* gserialized1_from_lwgeom(LWGEOM *geom, size_t *size)
 
 	if ( expected_size != return_size ) /* Uh oh! */
 	{
-		lwerror("Return size (%d) not equal to expected size (%d)!", return_size, expected_size);
+		lwerror("Return size (%zu) not equal to expected size (%zu)!", return_size, expected_size);
 		return NULL;
 	}
 
diff --git a/liblwgeom/lwgeom_api.c b/liblwgeom/lwgeom_api.c
index 0ef5a103f..a4111cf32 100644
--- a/liblwgeom/lwgeom_api.c
+++ b/liblwgeom/lwgeom_api.c
@@ -447,9 +447,9 @@ void printPA(POINTARRAY *pa)
 	else mflag = "";
 
 	lwnotice("      POINTARRAY%s{", mflag);
-	lwnotice("                 ndims=%i,   ptsize=%i",
+	lwnotice("                 ndims=%i,   ptsize=%zu",
 	         FLAGS_NDIMS(pa->flags), ptarray_point_size(pa));
-	lwnotice("                 npoints = %i", pa->npoints);
+	lwnotice("                 npoints = %u", pa->npoints);
 
 	if (!pa)
 	{
diff --git a/liblwgeom/lwgeom_geos.c b/liblwgeom/lwgeom_geos.c
index 368a53b55..ed3c314b8 100644
--- a/liblwgeom/lwgeom_geos.c
+++ b/liblwgeom/lwgeom_geos.c
@@ -1353,7 +1353,7 @@ lwgeom_offsetcurve(const LWGEOM* geom, double size, int quadsegs, int joinStyle,
 
 	if (lwgeom_dimension(geom) != 1)
 	{
-		lwerror("%s: input is not linear", __func__, lwtype_name(geom->type));
+		lwerror("%s: input is not linear (type %s)", __func__, lwtype_name(geom->type));
 		return NULL;
 	}
 
diff --git a/liblwgeom/lwgeom_transform.c b/liblwgeom/lwgeom_transform.c
index 8adf4da44..87c0106bb 100644
--- a/liblwgeom/lwgeom_transform.c
+++ b/liblwgeom/lwgeom_transform.c
@@ -297,7 +297,7 @@ ptarray_transform(POINTARRAY *pa, LWPROJ *pj)
 
 		if (n_converted != n_points)
 		{
-			lwerror("ptarray_transform: converted (%d) != input (%d)", n_converted, n_points);
+			lwerror("ptarray_transform: converted (%zu) != input (%zu)", n_converted, n_points);
 			return LW_FAILURE;
 		}
 
diff --git a/liblwgeom/lwhomogenize.c b/liblwgeom/lwhomogenize.c
index 1d52ed945..6ed9b5702 100644
--- a/liblwgeom/lwhomogenize.c
+++ b/liblwgeom/lwhomogenize.c
@@ -264,7 +264,7 @@ lwgeom_homogenize(const LWGEOM *geom)
 	}
 
 	/* Unknown type */
-	lwerror("lwgeom_homogenize: Geometry Type not supported (%i)",
+	lwerror("lwgeom_homogenize: Geometry Type not supported (%s)",
 	        lwtype_name(geom->type));
 
 	return NULL; /* Never get here! */
diff --git a/liblwgeom/lwin_geojson.c b/liblwgeom/lwin_geojson.c
index 85b29ef80..13ba66e75 100644
--- a/liblwgeom/lwin_geojson.c
+++ b/liblwgeom/lwin_geojson.c
@@ -425,7 +425,7 @@ lwgeom_from_geojson(const char *geojson, char **srs)
 		snprintf(err, 256, "%s (at offset %d)", json_tokener_error_desc(jstok->err), jstok->char_offset);
 		json_tokener_free(jstok);
 		json_object_put(poObj);
-		lwerror(err);
+		lwerror("%s", err);
 		return NULL;
 	}
 	json_tokener_free(jstok);
diff --git a/liblwgeom/lwin_wkb.c b/liblwgeom/lwin_wkb.c
index 9b6e24fcd..3e1d5f0ff 100644
--- a/liblwgeom/lwin_wkb.c
+++ b/liblwgeom/lwin_wkb.c
@@ -96,7 +96,7 @@ uint8_t* bytes_from_hexbytes(const char *hexbuf, size_t hexsize)
 	uint32_t i;
 
 	if( hexsize % 2 )
-		lwerror("Invalid hex string, length (%d) has to be a multiple of two!", hexsize);
+		lwerror("Invalid hex string, length (%zu) has to be a multiple of two!", hexsize);
 
 	buf = lwalloc(hexsize/2);
 
diff --git a/liblwgeom/lwin_wkt.c b/liblwgeom/lwin_wkt.c
index 377cacbbd..6a60a15d5 100644
--- a/liblwgeom/lwin_wkt.c
+++ b/liblwgeom/lwin_wkt.c
@@ -943,7 +943,7 @@ LWGEOM *lwgeom_from_wkt(const char *wkt, const char check)
 
 	if( LW_FAILURE == lwgeom_parse_wkt(&r, (char*)wkt, check) )
 	{
-		lwerror(r.message);
+		lwerror("%s", r.message);
 		return NULL;
 	}
 
diff --git a/liblwgeom/lwstroke.c b/liblwgeom/lwstroke.c
index ff025ffde..3adfeb055 100644
--- a/liblwgeom/lwstroke.c
+++ b/liblwgeom/lwstroke.c
@@ -135,7 +135,7 @@ static double angle_increment_using_segments_per_quad(double tol)
 	// error out if tol != perQuad ? (not-round)
 	if ( perQuad != tol )
 	{
-		lwerror("lwarc_linearize: segments per quadrant must be an integer value, got %.15g", tol, perQuad);
+		lwerror("lwarc_linearize: segments per quadrant must be an integer value, got %.15g", tol);
 		return -1;
 	}
 	if ( perQuad < 1 )
diff --git a/liblwgeom/ptarray.c b/liblwgeom/ptarray.c
index b331c9558..eeeaa4763 100644
--- a/liblwgeom/ptarray.c
+++ b/liblwgeom/ptarray.c
@@ -530,7 +530,7 @@ ptarray_addPoint(const POINTARRAY *pa, uint8_t *p, size_t pdims, uint32_t where)
 
 	if ( pdims < 2 || pdims > 4 )
 	{
-		lwerror("ptarray_addPoint: point dimension out of range (%d)",
+		lwerror("ptarray_addPoint: point dimension out of range (%zu)",
 		        pdims);
 		return NULL;
 	}
diff --git a/liblwgeom/topo/lwgeom_topo.c b/liblwgeom/topo/lwgeom_topo.c
index 59cc06e90..3f48f8e29 100644
--- a/liblwgeom/topo/lwgeom_topo.c
+++ b/liblwgeom/topo/lwgeom_topo.c
@@ -36,6 +36,8 @@
 #include "lwt_edgeend_star.h"
 #include "lwgeom_geos.h"
 
+#include <inttypes.h>
+
 /*********************************************************************
  *
  * Backend iface
@@ -672,7 +674,7 @@ _lwt_CheckEdgeCrossing( LWT_TOPOLOGY* topo,
 
     if ( ! edge->geom ) {
       _lwt_release_edges(edges, num_edges);
-      lwerror("Edge %d has NULL geometry!", edge_id);
+      lwerror("Edge %" LWTFMT_ELEMID " has NULL geometry!", edge_id);
       return -1;
     }
 
@@ -782,8 +784,7 @@ _lwt_CheckEdgeCrossing( LWT_TOPOLOGY* topo,
       if ( match == 2 ) {
         lwerror("GEOSRelatePatternMatch error: %s", lwgeom_geos_errmsg);
       } else {
-        lwerror("Spatial exception - boundary of edge % touches interior of geometry"
-                LWTFMT_ELEMID, edge_id);
+        lwerror("Spatial exception - boundary of edge %" LWTFMT_ELEMID" touches interior of geometry", edge_id);
       }
       return -1;
     }
@@ -997,7 +998,7 @@ _lwt_EdgeSplit( LWT_TOPOLOGY* topo, LWT_ELEMID edge, LWPOINT* pt, int skipISOChe
     else
     {
       lwerror("Backend coding error: getEdgeById callback returned NULL "
-              "but numelements output parameter has value %d "
+              "but numelements output parameter has value %" PRIu64
               "(expected 0 or 1)", i);
       return NULL;
     }
@@ -1154,12 +1155,12 @@ lwt_ModEdgeSplit( LWT_TOPOLOGY* topo, LWT_ELEMID edge,
   } else if ( ret == 0 ) {
     _lwt_release_edges(oldedge, 1);
     lwcollection_free(split_col);
-    lwerror("Edge being split (%d) disappeared during operations?", oldedge->edge_id);
+    lwerror("Edge being split (%" LWTFMT_ELEMID ") disappeared during operations?", oldedge->edge_id);
     return -1;
   } else if ( ret > 1 ) {
     _lwt_release_edges(oldedge, 1);
     lwcollection_free(split_col);
-    lwerror("More than a single edge found with id %d !", oldedge->edge_id);
+    lwerror("More than a single edge found with id %" LWTFMT_ELEMID " !", oldedge->edge_id);
     return -1;
   }
 
@@ -1596,7 +1597,7 @@ _lwt_FindAdjacentEdges( LWT_TOPOLOGY* topo, LWT_ELEMID node, edgeend *data,
       getPoint2d_p(pa, 0, &p1);
       if ( ! _lwt_FirstDistinctVertex2D(pa, &p1, 0, 1, &p2) )
       {
-        lwerror("Edge %d has no distinct vertices: [%.15g %.15g,%.15g %.15g]: ",
+        lwerror("Edge %" LWTFMT_ELEMID " has no distinct vertices: [%.15g %.15g,%.15g %.15g]: ",
                 edge->edge_id, p1.x, p1.y, p2.x, p2.y);
         return -1;
       }
@@ -1608,8 +1609,9 @@ _lwt_FindAdjacentEdges( LWT_TOPOLOGY* topo, LWT_ELEMID node, edgeend *data,
         LWT_ELEMID id = edge->edge_id;
         _lwt_release_edges(edges, numedges);
         lwgeom_free(cleangeom);
-        lwerror("error computing azimuth of edge %d first edgeend [%.15g %.15g,%.15g %.15g]",
-                id, p1.x, p1.y, p2.x, p2.y);
+        lwerror("error computing azimuth of edge %"
+          LWTFMT_ELEMID " first edgeend [%.15g %.15g,%.15g %.15g]",
+          id, p1.x, p1.y, p2.x, p2.y);
         return -1;
       }}
       azdif = az - data->myaz;
@@ -1658,7 +1660,7 @@ _lwt_FindAdjacentEdges( LWT_TOPOLOGY* topo, LWT_ELEMID node, edgeend *data,
       getPoint2d_p(pa, pa->npoints-1, &p1);
       if ( ! _lwt_FirstDistinctVertex2D(pa, &p1, pa->npoints-1, -1, &p2) )
       {
-        lwerror("Edge %d has no distinct vertices: [%.15g %.15g,%.15g %.15g]: ",
+        lwerror("Edge %" LWTFMT_ELEMID " has no distinct vertices: [%.15g %.15g,%.15g %.15g]: ",
                 edge->edge_id, p1.x, p1.y, p2.x, p2.y);
         return -1;
       }
@@ -1669,8 +1671,9 @@ _lwt_FindAdjacentEdges( LWT_TOPOLOGY* topo, LWT_ELEMID node, edgeend *data,
         LWT_ELEMID id = edge->edge_id;
         _lwt_release_edges(edges, numedges);
         lwgeom_free(cleangeom);
-        lwerror("error computing azimuth of edge %d last edgeend [%.15g %.15g,%.15g %.15g]",
-                id, p1.x, p1.y, p2.x, p2.y);
+        lwerror("error computing azimuth of edge %"
+          LWTFMT_ELEMID " last edgeend [%.15g %.15g,%.15g %.15g]",
+          id, p1.x, p1.y, p2.x, p2.y);
         return -1;
       }}
       azdif = az - data->myaz;
@@ -1813,7 +1816,8 @@ _lwt_MakeRingShell(LWT_TOPOLOGY *topo, LWT_ELEMID *signed_edge_ids, uint64_t num
   {
     lwfree( signed_edge_ids );
     _lwt_release_edges(ring_edges, i);
-    lwerror("Unexpected error: %d edges found when expecting %d", i, numedges);
+    lwerror("Unexpected error: %" LWTFMT_ELEMID
+      " edges found when expecting %" PRIu64, i, numedges);
     return NULL;
   }
 
@@ -2020,7 +2024,7 @@ _lwt_AddFaceSplit( LWT_TOPOLOGY* topo,
     {
       lwfree( signed_edge_ids );
       lwpoly_free(shell); /* NOTE: owns shellbox */
-      lwerror("Unexpected error: %d faces found when expecting 1", nfaces);
+      lwerror("Unexpected error: %" PRIu64 " faces found when expecting 1", nfaces);
       return -2;
     }
     newface.mbr = oldface->mbr;
@@ -2132,7 +2136,7 @@ _lwt_AddFaceSplit( LWT_TOPOLOGY* topo,
         lwfree(forward_edges); /* contents owned by edges */
         lwfree(backward_edges); /* contents owned by edges */
         _lwt_release_edges(edges, numfaceedges);
-        lwerror("Edge %d is empty", e->edge_id);
+        lwerror("Edge %" LWTFMT_ELEMID " is empty", e->edge_id);
         return -2;
       }
 
@@ -3182,7 +3186,7 @@ lwt_GetFaceEdges(LWT_TOPOLOGY* topo, LWT_ELEMID face_id, LWT_ELEMID **out )
         _lwt_release_edges(edges, numfaceedges);
         lwgeom_free(face);
         lwfree(seid);
-        lwerror("No edge (among %d) found to be defining geometry of face %"
+        lwerror("No edge (among %" PRIu64 ") found to be defining geometry of face %"
                 LWTFMT_ELEMID, numfaceedges, face_id);
         return -1;
       }
@@ -3288,7 +3292,7 @@ lwt_ChangeEdgeGeom(LWT_TOPOLOGY* topo, LWT_ELEMID edge_id, LWLINE *geom)
     else
     {
       lwerror("Backend coding error: getEdgeById callback returned NULL "
-              "but numelements output parameter has value %d "
+              "but numelements output parameter has value %" PRIu64 " "
               "(expected 0 or 1)", i);
       return -1;
     }
@@ -3458,7 +3462,7 @@ lwt_ChangeEdgeGeom(LWT_TOPOLOGY* topo, LWT_ELEMID edge_id, LWLINE *geom)
   if (!res)
   {
     _lwt_release_edges(oldedge, 1);
-    lwerror("Unexpected error: %d edges updated when expecting 1", i);
+    lwerror("Unexpected error: %" PRIu64 " edges updated when expecting 1", i);
     return -1;
   }
 
@@ -3528,7 +3532,8 @@ lwt_ChangeEdgeGeom(LWT_TOPOLOGY* topo, LWT_ELEMID edge_id, LWLINE *geom)
       updatedBox = lwt_be_computeFaceMBR(topo, oldedge->face_left);
       if ( ! updatedBox )
       {
-        lwerror("Corrupted topology: face %d, left of edge %d, has no bbox",
+        lwerror("Corrupted topology: face %" LWTFMT_ELEMID
+          ", left of edge %" LWTFMT_ELEMID ", has no bbox",
           oldedge->face_left, edge_id);
         return -1;
       }
@@ -3543,7 +3548,8 @@ lwt_ChangeEdgeGeom(LWT_TOPOLOGY* topo, LWT_ELEMID edge_id, LWLINE *geom)
       updatedBox = lwt_be_computeFaceMBR(topo, oldedge->face_right);
       if ( ! updatedBox )
       {
-        lwerror("Corrupted topology: face %d, right of edge %d, has no bbox",
+        lwerror("Corrupted topology: face %"
+          LWTFMT_ELEMID ", right of edge %" LWTFMT_ELEMID ", has no bbox",
           oldedge->face_right, edge_id);
         return -1;
       }
@@ -3562,7 +3568,7 @@ lwt_ChangeEdgeGeom(LWT_TOPOLOGY* topo, LWT_ELEMID edge_id, LWLINE *geom)
 		    if (updatedFaces == UINT64_MAX)
 			    PGTOPO_BE_ERROR();
 		    else
-			    lwerror("Unexpected error: %d faces updated when expecting 1", updatedFaces);
+			    lwerror("Unexpected error: %" PRIu64 " faces updated when expecting 1", updatedFaces);
 		    return -1;
 	    }
     }
@@ -3764,7 +3770,7 @@ lwt_RemIsoEdge(LWT_TOPOLOGY* topo, LWT_ELEMID id)
   }
   if ( n != 1 )
   {
-    lwerror("Unexpected error: %d edges deleted when expecting 1", n);
+    lwerror("Unexpected error: %" PRIu64 " edges deleted when expecting 1", n);
     return -1;
   }
 
@@ -3902,7 +3908,7 @@ _lwt_RemEdge( LWT_TOPOLOGY* topo, LWT_ELEMID edge_id, int modFace )
 		{
 			lwerror(
 			    "Backend coding error: getEdgeById callback returned NULL "
-			    "but numelements output parameter has value %d "
+			    "but numelements output parameter has value %" PRIu64 " "
 			    "(expected 0 or 1)",
 			    i);
 			return -1;
@@ -4112,7 +4118,7 @@ _lwt_RemEdge( LWT_TOPOLOGY* topo, LWT_ELEMID edge_id, int modFace )
 	if (result != 1)
 	{
 		_lwt_release_edges(edge, 1);
-		lwerror("Unexpected error: %d faces updated when expecting 1", i);
+		lwerror("Unexpected error: %" PRIu64 " faces updated when expecting 1", i);
 		return -1;
 	}
       }
@@ -4564,7 +4570,7 @@ _lwt_HealEdges( LWT_TOPOLOGY* topo, LWT_ELEMID eid1, LWT_ELEMID eid2,
     {
       lwline_free(newedge.geom);
       if ( edges ) _lwt_release_edges(edges, nedges);
-      lwerror("Unexpected error: %d edges updated when expecting 1", i);
+      lwerror("Unexpected error: %" PRIu64 " edges updated when expecting 1", i);
       return -1;
     }
   }
@@ -5224,7 +5230,9 @@ _lwt_SnapEdgeToExistingNode(
           n, op.x, op.y, pt->x, pt->y, splitNodeEdgeEnds[n].myaz);
         ret = _lwt_FindAdjacentEdges( topo, node->node_id, &(splitNodeEdgeEnds[n]), NULL, -1 );
         if ( ! ret ) {
-            lwerror("Unexpected backend return: _lwt_FindAdjacentEdges(%d) found no edges when we previously splitted edge %d on it",
+            lwerror("Unexpected backend return: _lwt_FindAdjacentEdges(%"
+              LWTFMT_ELEMID ") found no edges when we previously splitted edge %"
+              LWTFMT_ELEMID "d on it",
               node->node_id, edge->edge_id);
             return -1;
         }
@@ -5366,7 +5374,8 @@ _lwt_SnapEdgeToExistingNode(
         lwerror("Edge %" LWTFMT_ELEMID " disappeared during operations", selEdge.edge_id);
         return -1;
       } else if ( ret > 1 ) {
-        lwerror("More than a single edge found with edge_id %d ! (corrupted topology?)", selEdge.edge_id);
+        lwerror("More than a single edge found with id %"
+          LWTFMT_ELEMID " ! (corrupted topology?)", selEdge.edge_id);
         return -1;
       }
     }
@@ -5415,7 +5424,8 @@ _lwt_SnapEdgeToExistingNode(
         lwerror("Edge %" LWTFMT_ELEMID " disappeared during operations", selEdge.edge_id);
         return -1;
       } else if ( ret > 1 ) {
-        lwerror("More than a single edge found with edge_id %d ! (corrupted topology?)", selEdge.edge_id);
+        lwerror("More than a single edge found with edge_id %"
+          LWTFMT_ELEMID " ! (corrupted topology?)", selEdge.edge_id);
         return -1;
       }
     }
@@ -5553,7 +5563,8 @@ _lwt_SnapEdgeToExistingNode(
           lwerror("Edge %" LWTFMT_ELEMID " disappeared during operations", selEdge.edge_id);
           return -1;
         } else if ( ret > 1 ) {
-          lwerror("More than a single edge found with next_left %d ! (corrupted topology?)", selEdge.next_left);
+          lwerror("More than a single edge found with next_left %"
+            LWTFMT_ELEMID " ! (corrupted topology?)", selEdge.next_left);
           return -1;
         }
       }
@@ -5617,10 +5628,11 @@ _lwt_SnapEdgeToExistingNode(
         PGTOPO_BE_ERROR();
         return -1;
       } else if ( ret == 0 ) {
-        lwerror("Edge being split (%d) disappeared during operations?", selEdge.edge_id);
+        lwerror("Edge being split (%" LWTFMT_ELEMID ") disappeared during operations?", selEdge.edge_id);
         return -1;
       } else if ( ret > 1 ) {
-        lwerror("More than a single edge found with id %d !", selEdge.edge_id);
+        lwerror("More than a single edge found with id %"
+          LWTFMT_ELEMID " !", selEdge.edge_id);
         return -1;
       }
     }
@@ -5669,10 +5681,11 @@ _lwt_SnapEdgeToExistingNode(
       PGTOPO_BE_ERROR();
       return -1;
     } else if ( ret == 0 ) {
-      lwerror("Edge being split (%d) disappeared during operations?", selEdge.edge_id);
+      lwerror("Edge being split (%" LWTFMT_ELEMID ") disappeared during operations?", selEdge.edge_id);
       return -1;
     } else if ( ret > 1 ) {
-      lwerror("More than a single edge found with id %d !", selEdge.edge_id);
+      lwerror("More than a single edge found with id %"
+        LWTFMT_ELEMID " !", selEdge.edge_id);
       return -1;
     }
 
@@ -5841,10 +5854,11 @@ _lwt_SnapEdgeToExistingNode(
       PGTOPO_BE_ERROR();
       return -1;
     } else if ( ret == 0 ) {
-      lwerror("Edge being split (%d) disappeared during operations?", selEdge.edge_id);
+      lwerror("Edge being split (%" LWTFMT_ELEMID ") disappeared during operations?", selEdge.edge_id);
       return -1;
     } else if ( ret > 1 ) {
-      lwerror("More than a single edge found with id %d !", selEdge.edge_id);
+      lwerror("More than a single edge found with id %"
+        LWTFMT_ELEMID " !", selEdge.edge_id);
       return -1;
     }
 
@@ -5873,10 +5887,11 @@ _lwt_SnapEdgeToExistingNode(
         PGTOPO_BE_ERROR();
         return -1;
       } else if ( ret == 0 ) {
-        lwerror("Edge being split (%d) disappeared during operations?", selEdge.edge_id);
+        lwerror("Edge being split (%" LWTFMT_ELEMID ") disappeared during operations?", selEdge.edge_id);
         return -1;
       } else if ( ret > 1 ) {
-        lwerror("More than a single edge found with id %d !", selEdge.edge_id);
+        lwerror("More than a single edge found with id %"
+          LWTFMT_ELEMID " !", selEdge.edge_id);
         return -1;
       }
     }
@@ -5906,10 +5921,11 @@ _lwt_SnapEdgeToExistingNode(
         PGTOPO_BE_ERROR();
         return -1;
       } else if ( ret == 0 ) {
-        lwerror("Edge being split (%d) disappeared during operations?", selEdge.edge_id);
+        lwerror("Edge being split (%" LWTFMT_ELEMID ") disappeared during operations?", selEdge.edge_id);
         return -1;
       } else if ( ret > 1 ) {
-        lwerror("More than a single edge found with id %d !", selEdge.edge_id);
+        lwerror("More than a single edge found with id %"
+          LWTFMT_ELEMID " !", selEdge.edge_id);
         return -1;
       }
     }
@@ -5952,10 +5968,11 @@ _lwt_SnapEdgeToExistingNode(
         PGTOPO_BE_ERROR();
         return -1;
       } else if ( ret == 0 ) {
-        lwerror("Edge being split (%d) disappeared during operations?", selEdge.edge_id);
+        lwerror("Edge being split (%" LWTFMT_ELEMID ") disappeared during operations?", selEdge.edge_id);
         return -1;
       } else if ( ret > 1 ) {
-        lwerror("More than a single edge found with id %d !", selEdge.edge_id);
+        lwerror("More than a single edge found with id %"
+          LWTFMT_ELEMID " !", selEdge.edge_id);
         return -1;
       }
     }
@@ -6041,8 +6058,9 @@ _lwt_SnapEdgeToExistingNode(
     // Sanity check
     if ( edge->face_right == edge->face_left )
     {
-      lwerror("Unexpectedly, dangling edge %d was replaced by "
-        "edges %d and %d when snap to node %d",
+      lwerror("Unexpectedly, dangling edge %" LWTFMT_ELEMID " was replaced by "
+        "edges %" LWTFMT_ELEMID " and %" LWTFMT_ELEMID
+        " when snap to node %" LWTFMT_ELEMID,
         edge->edge_id, replacedBy[0], replacedBy[1], node->node_id);
       return -1;
     }
@@ -6109,10 +6127,11 @@ _lwt_SnapEdgeToExistingNode(
         PGTOPO_BE_ERROR();
         return -1;
       } else if ( ret == 0 ) {
-        lwerror("Edge being split (%d) disappeared during operations?", selEdge.edge_id);
+        lwerror("Edge being split (%" LWTFMT_ELEMID ") disappeared during operations?", selEdge.edge_id);
         return -1;
       } else if ( ret > 1 ) {
-        lwerror("More than a single edge found with id %d !", selEdge.edge_id);
+        lwerror("More than a single edge found with id %"
+          LWTFMT_ELEMID " !", selEdge.edge_id);
         return -1;
       }
     }
@@ -6159,10 +6178,11 @@ _lwt_SnapEdgeToExistingNode(
         PGTOPO_BE_ERROR();
         return -1;
       } else if ( ret == 0 ) {
-        lwerror("Edge being split (%d) disappeared during operations?", selEdge.edge_id);
+        lwerror("Edge being split (%" LWTFMT_ELEMID ") disappeared during operations?", selEdge.edge_id);
         return -1;
       } else if ( ret > 1 ) {
-        lwerror("More than a single edge found with id %d !", selEdge.edge_id);
+        lwerror("More than a single edge found with id %"
+          LWTFMT_ELEMID " !", selEdge.edge_id);
         return -1;
       }
     }
@@ -6193,10 +6213,11 @@ _lwt_SnapEdgeToExistingNode(
         PGTOPO_BE_ERROR();
         return -1;
       } else if ( ret == 0 ) {
-        lwerror("Edge being split (%d) disappeared during operations?", selEdge.edge_id);
+        lwerror("Edge being split (%" LWTFMT_ELEMID ") disappeared during operations?", selEdge.edge_id);
         return -1;
       } else if ( ret > 1 ) {
-        lwerror("More than a single edge found with id %d !", selEdge.edge_id);
+        lwerror("More than a single edge found with id %"
+          LWTFMT_ELEMID " !", selEdge.edge_id);
         return -1;
       }
     }
@@ -6226,10 +6247,11 @@ _lwt_SnapEdgeToExistingNode(
         PGTOPO_BE_ERROR();
         return -1;
       } else if ( ret == 0 ) {
-        lwerror("Edge being split (%d) disappeared during operations?", selEdge.edge_id);
+        lwerror("Edge being split (%" LWTFMT_ELEMID ") disappeared during operations?", selEdge.edge_id);
         return -1;
       } else if ( ret > 1 ) {
-        lwerror("More than a single edge found with id %d !", selEdge.edge_id);
+        lwerror("More than a single edge found with id %"
+          LWTFMT_ELEMID " !", selEdge.edge_id);
         return -1;
       }
     }
@@ -7572,13 +7594,15 @@ lwt_GetFaceContainingPoint(LWT_TOPOLOGY* topo, const LWPOINT* pt)
       }
       if (numedges < 1 )
       {
-        lwerror("Unexpected backend return: getEdgeByNode(%d) returns no edges when we previously found edge %d ending on that node",
+        lwerror("Unexpected backend return: getEdgeByNode(%" LWTFMT_ELEMID
+          ") returns no edges when we previously found edge %"
+          LWTFMT_ELEMID " ending on that node",
           closestNode, closestEdge->edge_id);
         _lwt_release_edges(edges, numedges);
         _lwt_release_edges(closestEdge, 1);
         return -1;
       }
-      LWDEBUGF(1, "lwt_be_getEdgeByNode returned %d edges", numedges);
+      LWDEBUGF(1, "lwt_be_getEdgeByNode returned %" PRIu64 " edges", numedges);
       _lwt_release_edges(edges, numedges);
       _lwt_release_edges(closestEdge, 1);
       return containingFace;
@@ -7600,7 +7624,10 @@ lwt_GetFaceContainingPoint(LWT_TOPOLOGY* topo, const LWPOINT* pt)
 
     int found = _lwt_FindAdjacentEdges( topo, closestNode, &ee, NULL, -1 );
     if ( ! found ) {
-        lwerror("Unexpected backend return: _lwt_FindAdjacentEdges(%d) found no edges when we previously found edge %d ending on that node",
+        lwerror("Unexpected backend return: _lwt_FindAdjacentEdges(%"
+          LWTFMT_ELEMID
+          ") found no edges when we previously found edge %"
+          LWTFMT_ELEMID " ending on that node",
           closestNode, closestEdge->edge_id);
         _lwt_release_edges(closestEdge, 1);
         return -1;
diff --git a/liblwgeom/topo/lwgeom_topo_polygonizer.c b/liblwgeom/topo/lwgeom_topo_polygonizer.c
index 44c29a01d..6023e25b4 100644
--- a/liblwgeom/topo/lwgeom_topo_polygonizer.c
+++ b/liblwgeom/topo/lwgeom_topo_polygonizer.c
@@ -387,7 +387,7 @@ _lwt_BuildEdgeRing(__attribute__((__unused__)) LWT_TOPOLOGY *topo, LWT_ISO_EDGE_
     cur = _lwt_getIsoEdgeById(edges, next);
     if ( ! cur )
     {
-      lwerror("Could not find edge with id %d", next);
+      lwerror("Could not find edge with id %" LWTFMT_ELEMID, next);
       break;
     }
   } while (cur != edge || curside != side);
diff --git a/liblwgeom/topo/lwt_edgeend.c b/liblwgeom/topo/lwt_edgeend.c
index 54b9d6d2c..df692f5fd 100644
--- a/liblwgeom/topo/lwt_edgeend.c
+++ b/liblwgeom/topo/lwt_edgeend.c
@@ -81,7 +81,7 @@ lwt_edgeEnd_fromEdge( const LWT_ISO_EDGE *edge, int outgoing )
   );
   if (!ret)
   {
-    lwerror("No distinct vertices found in edge %d", edge->edge_id);
+    lwerror("No distinct vertices found in edge %" LWTFMT_ELEMID, edge->edge_id);
     return NULL;
   }
 
diff --git a/liblwgeom/topo/lwt_edgeend_star.c b/liblwgeom/topo/lwt_edgeend_star.c
index 616ed0e31..8dac15fe3 100644
--- a/liblwgeom/topo/lwt_edgeend_star.c
+++ b/liblwgeom/topo/lwt_edgeend_star.c
@@ -33,6 +33,8 @@
 #include "lwt_edgeend_star.h"
 #include "lwt_edgeend.h"
 
+#include <inttypes.h>
+
 LWT_EDGEEND_STAR *
 lwt_edgeEndStar_init( LWT_ELEMID nodeID )
 {
@@ -71,7 +73,8 @@ lwt_edgeEndStar_addEdge( LWT_EDGEEND_STAR *star, const LWT_ISO_EDGE *edge )
   {
     LWT_EDGEEND *ee = lwt_edgeEnd_fromEdge( edge, 1 );
     if ( ! ee ) {
-      lwerror("Could not construct outgoing EdgeEnd for edge %d", edge->edge_id);
+      lwerror("Could not construct outgoing EdgeEnd for edge %"
+        LWTFMT_ELEMID, edge->edge_id);
       return;
     }
     edgeEnds[numEdgeEnds++] = ee;
@@ -80,7 +83,8 @@ lwt_edgeEndStar_addEdge( LWT_EDGEEND_STAR *star, const LWT_ISO_EDGE *edge )
   {
     LWT_EDGEEND *ee = lwt_edgeEnd_fromEdge( edge, 0 );
     if ( ! ee ) {
-      lwerror("Could not construct outgoing incoming for edge %d", edge->edge_id);
+      lwerror("Could not construct outgoing incoming for edge %"
+        LWTFMT_ELEMID, edge->edge_id);
       return;
     }
     edgeEnds[numEdgeEnds++] = ee;
@@ -94,7 +98,8 @@ lwt_edgeEndStar_addEdge( LWT_EDGEEND_STAR *star, const LWT_ISO_EDGE *edge )
     return;
   }
 
-  LWDEBUGF(1, "Edge %d got %d ends incident to star node %d",
+  LWDEBUGF(1, "Edge %" LWTFMT_ELEMID
+    " got %" PRIu64 " ends incident to star node %" LWTFMT_ELEMID,
     edge->edge_id, numEdgeEnds, star->nodeID );
 
   newCapacity = star->numEdgeEnds + numEdgeEnds;
@@ -153,12 +158,12 @@ lwt_edgeEndStar_ensureSorted( LWT_EDGEEND_STAR *star )
 void
 lwt_EdgeEndStar_debugPrint( const LWT_EDGEEND_STAR *star )
 {
-  lwdebug(1, "Star around node %d has %d edgeEnds, %s",
+  lwdebug(1, "Star around node %" LWTFMT_ELEMID " has %" PRIu64 " edgeEnds, %s",
     star->nodeID, star->numEdgeEnds, star->sorted ? "sorted" : "unsorted" );
   for ( uint64_t i=0; i<star->numEdgeEnds; ++i )
   {
     LWT_EDGEEND *ee = star->edgeEnds[i];
-    lwdebug(1, " EdgeEnd %d is %s edge %d, azimuth=%g",
+    lwdebug(1, " EdgeEnd %" PRIu64 " is %s edge %" LWTFMT_ELEMID ", azimuth=%g",
       i, ee->outgoing ? "outgoing" : "incoming",
       ee->edge->edge_id, ee->azimuth
     );
@@ -181,7 +186,8 @@ lwt_edgeEndStar_getNextCW( LWT_EDGEEND_STAR *star, LWT_ISO_EDGE *edge, int outgo
     }
   }
   if ( ! thisEdgeEnd ) {
-    lwerror("Cound not find %s edge %d in the star", outgoing ?  "outgoing" : "incoming", edge->edge_id);
+    lwerror("Cound not find %s edge %" LWTFMT_ELEMID " in the star",
+      outgoing ?  "outgoing" : "incoming", edge->edge_id);
     return NULL;
   }
   LWT_EDGEEND *nextEdgeEnd = i < star->numEdgeEnds-1 ? star->edgeEnds[i+1] : star->edgeEnds[0];
@@ -204,7 +210,8 @@ lwt_edgeEndStar_getNextCCW( LWT_EDGEEND_STAR *star, LWT_ISO_EDGE *edge, int outg
     }
   }
   if ( ! thisEdgeEnd ) {
-    lwerror("Cound not find %s edge %d in the star", outgoing ?  "outgoing" : "incoming", edge->edge_id);
+    lwerror("Cound not find %s edge %" LWTFMT_ELEMID " in the star",
+      outgoing ?  "outgoing" : "incoming", edge->edge_id);
     return NULL;
   }
   LWT_EDGEEND *nextEdgeEnd = i > 0 ? star->edgeEnds[i-1] : star->edgeEnds[star->numEdgeEnds-1];
diff --git a/regress/core/offsetcurve_expected b/regress/core/offsetcurve_expected
index c3b00af60..b8a52fdb0 100644
--- a/regress/core/offsetcurve_expected
+++ b/regress/core/offsetcurve_expected
@@ -1,4 +1,4 @@
-ERROR:  lwgeom_offsetcurve: input is not linear
+ERROR:  lwgeom_offsetcurve: input is not linear (type Point)
 t0|SRID=42;LINESTRING(0 0,10 0)
 t1|SRID=42;LINESTRING(0 10,10 10)
 t2|SRID=42;LINESTRING(0 -10,10 -10)

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

Summary of changes:
 liblwgeom/gserialized1.c                 |   2 +-
 liblwgeom/lwgeom_api.c                   |   4 +-
 liblwgeom/lwgeom_geos.c                  |   2 +-
 liblwgeom/lwgeom_transform.c             |   2 +-
 liblwgeom/lwhomogenize.c                 |   2 +-
 liblwgeom/lwin_geojson.c                 |   2 +-
 liblwgeom/lwin_wkb.c                     |   2 +-
 liblwgeom/lwin_wkt.c                     |   2 +-
 liblwgeom/lwstroke.c                     |   2 +-
 liblwgeom/ptarray.c                      |   2 +-
 liblwgeom/topo/lwgeom_topo.c             | 135 ++++++++++++++++++-------------
 liblwgeom/topo/lwgeom_topo_polygonizer.c |   2 +-
 liblwgeom/topo/lwt_edgeend.c             |   2 +-
 liblwgeom/topo/lwt_edgeend_star.c        |  21 +++--
 regress/core/offsetcurve_expected        |   2 +-
 15 files changed, 109 insertions(+), 75 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list