[SCM] PostGIS branch master updated. 3.5.0-269-g0a8765ba9
git at osgeo.org
git at osgeo.org
Tue Apr 15 10:16:54 PDT 2025
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 0a8765ba91e3289390c34906214d0b0cb21c48de (commit)
from 023057fbc076af0f5148f0c1dea6de6075572184 (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 0a8765ba91e3289390c34906214d0b0cb21c48de
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date: Tue Apr 15 10:15:33 2025 -0700
The POSTGIS_DEBUGF() format specifiers are quite old and new
compilers do not like them. This updates them to the
formats that make clang happy at least, though surely
some other compiler will have other opinions, particularly
gcc on non-64bit architectures.
diff --git a/deps/flatgeobuf/flatgeobuf_c.cpp b/deps/flatgeobuf/flatgeobuf_c.cpp
index ad5c40c76..16a259375 100644
--- a/deps/flatgeobuf/flatgeobuf_c.cpp
+++ b/deps/flatgeobuf/flatgeobuf_c.cpp
@@ -103,7 +103,7 @@ int flatgeobuf_encode_header(ctx *ctx)
}
ctx->buf = (uint8_t *) lwrealloc(ctx->buf, ctx->offset + size);
- LWDEBUGF(2, "copying to ctx->buf at offset %ld", ctx->offset);
+ LWDEBUGF(2, "copying to ctx->buf at offset %llu", ctx->offset);
memcpy(ctx->buf + ctx->offset, buffer, size);
ctx->offset += size;
@@ -138,7 +138,7 @@ int flatgeobuf_encode_feature(ctx *ctx)
const auto buffer = fbb.GetBufferPointer();
const auto size = fbb.GetSize();
- LWDEBUGF(3, "encode_feature size %ld", size);
+ LWDEBUGF(3, "encode_feature size %u", size);
Verifier verifier(buffer, size - sizeof(uoffset_t));
if (VerifySizePrefixedFeatureBuffer(verifier)) {
@@ -146,9 +146,9 @@ int flatgeobuf_encode_feature(ctx *ctx)
return -1;
}
- LWDEBUGF(3, "reallocating ctx->buf to size %ld", ctx->offset + size);
+ LWDEBUGF(3, "reallocating ctx->buf to size %llu", ctx->offset + size);
ctx->buf = (uint8_t * ) lwrealloc(ctx->buf, ctx->offset + size);
- LWDEBUGF(3, "copying feature to ctx->buf at offset %ld", ctx->offset);
+ LWDEBUGF(3, "copying feature to ctx->buf at offset %llu", ctx->offset);
memcpy(ctx->buf + ctx->offset, buffer, size);
if (ctx->create_index) {
@@ -220,7 +220,7 @@ void flatgeobuf_create_index(ctx *ctx)
for (auto item : items) {
auto featureItem = std::static_pointer_cast<FeatureItem>(item);
ctx->buf = (uint8_t *) lwrealloc(ctx->buf, ctx->offset + featureItem->size);
- LWDEBUGF(2, "copy from offset %ld", featureItem->offset);
+ LWDEBUGF(2, "copy from offset %llu", featureItem->offset);
memcpy(ctx->buf + ctx->offset, oldbuf + featureItem->offset, featureItem->size);
ctx->offset += featureItem->size;
}
@@ -229,9 +229,9 @@ void flatgeobuf_create_index(ctx *ctx)
int flatgeobuf_decode_feature(ctx *ctx)
{
- LWDEBUGF(2, "reading size prefix at %ld", ctx->offset);
+ LWDEBUGF(2, "reading size prefix at %llu", ctx->offset);
auto size = flatbuffers::GetPrefixedSize(ctx->buf + ctx->offset);
- LWDEBUGF(2, "size is %ld (without size prefix)", size);
+ LWDEBUGF(2, "size is %u (without size prefix)", size);
Verifier verifier(ctx->buf + ctx->offset, size);
if (VerifySizePrefixedFeatureBuffer(verifier)) {
@@ -267,9 +267,9 @@ int flatgeobuf_decode_feature(ctx *ctx)
int flatgeobuf_decode_header(ctx *ctx)
{
- LWDEBUGF(2, "reading size prefix at %ld", ctx->offset);
+ LWDEBUGF(2, "reading size prefix at %llu", ctx->offset);
auto size = flatbuffers::GetPrefixedSize(ctx->buf + ctx->offset);
- LWDEBUGF(2, "size is %ld (without size prefix)", size);
+ LWDEBUGF(2, "size is %u (without size prefix)", size);
Verifier verifier(ctx->buf + ctx->offset, size);
if (VerifySizePrefixedHeaderBuffer(verifier)) {
@@ -279,7 +279,7 @@ int flatgeobuf_decode_header(ctx *ctx)
ctx->offset += sizeof(uoffset_t);
- LWDEBUGF(2, "reading header at %ld with size %ld", ctx->offset, size);
+ LWDEBUGF(2, "reading header at %llu with size %u", ctx->offset, size);
auto header = GetHeader(ctx->buf + ctx->offset);
ctx->offset += size;
@@ -312,9 +312,9 @@ int flatgeobuf_decode_header(ctx *ctx)
if (ctx->index_node_size > 0 && ctx->features_count > 0) {
auto treeSize = PackedRTree::size(ctx->features_count, ctx->index_node_size);
- LWDEBUGF(2, "Adding tree size %ld to offset", treeSize);
+ LWDEBUGF(2, "Adding tree size %llu to offset", treeSize);
ctx->offset += treeSize;
}
return 0;
-}
\ No newline at end of file
+}
diff --git a/liblwgeom/bytebuffer.c b/liblwgeom/bytebuffer.c
index 814cbe7f5..90edf4b16 100644
--- a/liblwgeom/bytebuffer.c
+++ b/liblwgeom/bytebuffer.c
@@ -71,19 +71,19 @@ bytebuffer_destroy_buffer(bytebuffer_t *s)
static inline void
bytebuffer_makeroom(bytebuffer_t *s, size_t size_to_add)
{
- LWDEBUGF(2,"Entered bytebuffer_makeroom with space need of %d", size_to_add);
+ LWDEBUGF(2,"Entered bytebuffer_makeroom with space need of %zu", size_to_add);
size_t current_write_size = (s->writecursor - s->buf_start);
size_t capacity = s->capacity;
size_t required_size = current_write_size + size_to_add;
- LWDEBUGF(2,"capacity = %d and required size = %d",capacity ,required_size);
+ LWDEBUGF(2,"capacity = %zu and required size = %zu", capacity, required_size);
while (capacity < required_size)
capacity *= 2;
if ( capacity > s->capacity )
{
size_t current_read_size = (s->readcursor - s->buf_start);
- LWDEBUGF(4,"We need to realloc more memory. New capacity is %d", capacity);
+ LWDEBUGF(4,"We need to realloc more memory. New capacity is %zu", capacity);
if ( s->buf_start == s->buf_static )
{
s->buf_start = lwalloc(capacity);
diff --git a/liblwgeom/effectivearea.c b/liblwgeom/effectivearea.c
index ca3cdddea..f0f67c2ea 100644
--- a/liblwgeom/effectivearea.c
+++ b/liblwgeom/effectivearea.c
@@ -265,7 +265,7 @@ static void tune_areas(EFFECTIVE_AREAS *ea, int avoid_collaps, int set_area, dou
for (i=0;i<npoints;i++)
{
((areanode*) tree.key_array[i])->treeindex=i;
- LWDEBUGF(4,"Check ordering qsort gives, area=%lf and belong to point %d",((areanode*) tree.key_array[i])->area, tree.key_array[i]-ea->initial_arealist);
+ LWDEBUGF(4,"Check ordering qsort gives, area=%lf and belong to point %ld",((areanode*) tree.key_array[i])->area, tree.key_array[i]-ea->initial_arealist);
}
/*Ok, now we have a minHeap, just need to keep it*/
diff --git a/liblwgeom/gserialized1.c b/liblwgeom/gserialized1.c
index 02b9e2bdf..6a34cf1f6 100644
--- a/liblwgeom/gserialized1.c
+++ b/liblwgeom/gserialized1.c
@@ -594,7 +594,7 @@ static size_t gserialized1_from_lwpoint_size(const LWPOINT *point)
size += 4; /* Number of points (one or zero (empty)). */
size += sizeof(double) * point->point->npoints * FLAGS_NDIMS(point->flags);
- LWDEBUGF(3, "point size = %d", size);
+ LWDEBUGF(3, "point size = %zu", size);
return size;
}
@@ -608,7 +608,7 @@ static size_t gserialized1_from_lwline_size(const LWLINE *line)
size += 4; /* Number of points (zero => empty). */
size += sizeof(double) * line->points->npoints * FLAGS_NDIMS(line->flags);
- LWDEBUGF(3, "linestring size = %d", size);
+ LWDEBUGF(3, "linestring size = %zu", size);
return size;
}
@@ -622,7 +622,7 @@ static size_t gserialized1_from_lwtriangle_size(const LWTRIANGLE *triangle)
size += 4; /* Number of points (zero => empty). */
size += sizeof(double) * triangle->points->npoints * FLAGS_NDIMS(triangle->flags);
- LWDEBUGF(3, "triangle size = %d", size);
+ LWDEBUGF(3, "triangle size = %zu", size);
return size;
}
@@ -644,7 +644,7 @@ static size_t gserialized1_from_lwpoly_size(const LWPOLY *poly)
size += sizeof(double) * poly->rings[i]->npoints * FLAGS_NDIMS(poly->flags);
}
- LWDEBUGF(3, "polygon size = %d", size);
+ LWDEBUGF(3, "polygon size = %zu", size);
return size;
}
@@ -658,7 +658,7 @@ static size_t gserialized1_from_lwcircstring_size(const LWCIRCSTRING *curve)
size += 4; /* Number of points (zero => empty). */
size += sizeof(double) * curve->points->npoints * FLAGS_NDIMS(curve->flags);
- LWDEBUGF(3, "circstring size = %d", size);
+ LWDEBUGF(3, "circstring size = %zu", size);
return size;
}
@@ -676,10 +676,10 @@ static size_t gserialized1_from_lwcollection_size(const LWCOLLECTION *col)
{
size_t subsize = gserialized1_from_any_size(col->geoms[i]);
size += subsize;
- LWDEBUGF(3, "lwcollection subgeom(%d) size = %d", i, subsize);
+ LWDEBUGF(3, "lwcollection subgeom(%d) size = %zu", i, subsize);
}
- LWDEBUGF(3, "lwcollection size = %d", size);
+ LWDEBUGF(3, "lwcollection size = %zu", size);
return size;
}
@@ -728,7 +728,7 @@ size_t gserialized1_from_lwgeom_size(const LWGEOM *geom)
size += gbox_serialized_size(geom->flags);
size += gserialized1_from_any_size(geom);
- LWDEBUGF(3, "%s size = %d", __func__, size);
+ LWDEBUGF(3, "%s size = %zu", __func__, size);
return size;
}
@@ -1054,7 +1054,7 @@ static size_t gserialized1_from_gbox(const GBOX *gbox, uint8_t *buf)
loc += sizeof(float);
return_size = (size_t)(loc - buf);
- LWDEBUGF(4, "returning size %d", return_size);
+ LWDEBUGF(4, "returning size %zu", return_size);
return return_size;
}
@@ -1081,7 +1081,7 @@ static size_t gserialized1_from_gbox(const GBOX *gbox, uint8_t *buf)
loc += sizeof(float);
}
return_size = (size_t)(loc - buf);
- LWDEBUGF(4, "returning size %d", return_size);
+ LWDEBUGF(4, "returning size %zu", return_size);
return return_size;
}
diff --git a/liblwgeom/gserialized2.c b/liblwgeom/gserialized2.c
index 714bae9b7..8829e60db 100644
--- a/liblwgeom/gserialized2.c
+++ b/liblwgeom/gserialized2.c
@@ -647,7 +647,7 @@ static size_t gserialized2_from_lwpoint_size(const LWPOINT *point)
size += 4; /* Number of points (one or zero (empty)). */
size += sizeof(double) * point->point->npoints * FLAGS_NDIMS(point->flags);
- LWDEBUGF(3, "point size = %d", size);
+ LWDEBUGF(3, "point size = %zu", size);
return size;
}
@@ -661,7 +661,7 @@ static size_t gserialized2_from_lwline_size(const LWLINE *line)
size += 4; /* Number of points (zero => empty). */
size += sizeof(double) * line->points->npoints * FLAGS_NDIMS(line->flags);
- LWDEBUGF(3, "linestring size = %d", size);
+ LWDEBUGF(3, "linestring size = %zu", size);
return size;
}
@@ -675,7 +675,7 @@ static size_t gserialized2_from_lwtriangle_size(const LWTRIANGLE *triangle)
size += 4; /* Number of points (zero => empty). */
size += sizeof(double)* triangle->points->npoints * FLAGS_NDIMS(triangle->flags);
- LWDEBUGF(3, "triangle size = %d", size);
+ LWDEBUGF(3, "triangle size = %zu", size);
return size;
}
@@ -698,7 +698,7 @@ static size_t gserialized2_from_lwpoly_size(const LWPOLY *poly)
size += poly->rings[i]->npoints * point_size;
}
- LWDEBUGF(3, "polygon size = %d", size);
+ LWDEBUGF(3, "polygon size = %zu", size);
return size;
}
@@ -712,7 +712,7 @@ static size_t gserialized2_from_lwcircstring_size(const LWCIRCSTRING *curve)
size += 4; /* Number of points (zero => empty). */
size += sizeof(double) * curve->points->npoints * FLAGS_NDIMS(curve->flags);
- LWDEBUGF(3, "circstring size = %d", size);
+ LWDEBUGF(3, "circstring size = %zu", size);
return size;
}
@@ -730,10 +730,10 @@ static size_t gserialized2_from_lwcollection_size(const LWCOLLECTION *col)
{
size_t subsize = gserialized2_from_any_size(col->geoms[i]);
size += subsize;
- LWDEBUGF(3, "lwcollection subgeom(%d) size = %d", i, subsize);
+ LWDEBUGF(3, "lwcollection subgeom(%d) size = %zu", i, subsize);
}
- LWDEBUGF(3, "lwcollection size = %d", size);
+ LWDEBUGF(3, "lwcollection size = %zu", size);
return size;
}
@@ -787,7 +787,7 @@ size_t gserialized2_from_lwgeom_size(const LWGEOM *geom)
size += gbox_serialized_size(geom->flags);
size += gserialized2_from_any_size(geom);
- LWDEBUGF(3, "%s size = %d", __func__, size);
+ LWDEBUGF(3, "%s size = %zu", __func__, size);
return size;
}
@@ -1119,7 +1119,7 @@ static size_t gserialized2_from_gbox(const GBOX *gbox, uint8_t *buf)
loc += 2 * sizeof(float);
return_size = (size_t)(loc - buf);
- LWDEBUGF(4, "returning size %d", return_size);
+ LWDEBUGF(4, "returning size %zu", return_size);
return return_size;
}
@@ -1137,7 +1137,7 @@ static size_t gserialized2_from_gbox(const GBOX *gbox, uint8_t *buf)
loc += 2 * sizeof(float);
}
return_size = (size_t)(loc - buf);
- LWDEBUGF(4, "returning size %d", return_size);
+ LWDEBUGF(4, "returning size %zu", return_size);
return return_size;
}
diff --git a/liblwgeom/lwalgorithm.c b/liblwgeom/lwalgorithm.c
index a60d0b0f2..cb3727f15 100644
--- a/liblwgeom/lwalgorithm.c
+++ b/liblwgeom/lwalgorithm.c
@@ -413,8 +413,8 @@ int lw_segment_intersects(const POINT2D *p1, const POINT2D *p2, const POINT2D *q
** location of the other end-point. Only touches by the first point
** will be considered "real" to avoid double counting.
*/
- LWDEBUGF(4, "pq1=%.15g pq2=%.15g", pq1, pq2);
- LWDEBUGF(4, "qp1=%.15g qp2=%.15g", qp1, qp2);
+ LWDEBUGF(4, "pq1=%d pq2=%d", pq1, pq2);
+ LWDEBUGF(4, "qp1=%d qp2=%d", qp1, qp2);
/* Second point of p or q touches, it's not a crossing. */
if ( pq2 == 0 || qp2 == 0 )
@@ -518,7 +518,7 @@ int lwline_crossing_direction(const LWLINE *l1, const LWLINE *l2)
this_cross = lw_segment_intersects(p1, p2, q1, q2);
- LWDEBUGF(4, "i=%d, j=%d (%.8g %.8g, %.8g %.8g)", this_cross, i, j, p1->x, p1->y, p2->x, p2->y);
+ LWDEBUGF(4, "i=%d, j=%d (%.8g %.8g, %.8g %.8g)", i, j, p1->x, p1->y, p2->x, p2->y);
if ( this_cross == SEG_CROSS_LEFT )
{
diff --git a/liblwgeom/lwgeodetic.c b/liblwgeom/lwgeodetic.c
index 5d995e630..128ce4591 100644
--- a/liblwgeom/lwgeodetic.c
+++ b/liblwgeom/lwgeodetic.c
@@ -3558,7 +3558,7 @@ int ptarray_contains_point_sphere(const POINTARRAY *pa, const POINT2D *pt_outsid
if ( inter & PIR_B_TOUCH_RIGHT || inter & PIR_COLINEAR )
{
/* Do nothing, to avoid double counts. */
- LWDEBUGF(4," edge (%d) crossed, disregarding to avoid double count", i, count);
+ LWDEBUGF(4," edge (%d) crossed, count == %d, disregarding to avoid double count", i, count);
}
else
{
diff --git a/liblwgeom/lwgeodetic_tree.c b/liblwgeom/lwgeodetic_tree.c
index 7031df4be..f4426a988 100644
--- a/liblwgeom/lwgeodetic_tree.c
+++ b/liblwgeom/lwgeodetic_tree.c
@@ -168,7 +168,7 @@ circ_center_spherical(const GEOGRAPHIC_POINT* c1, const GEOGRAPHIC_POINT* c2, do
/* Direction from c1 to c2 */
double dir = sphere_direction(c1, c2, distance);
- LWDEBUGF(4,"calculating spherical center", dir);
+ LWDEBUG(4,"calculating spherical center");
LWDEBUGF(4,"dir is %g", dir);
diff --git a/liblwgeom/lwout_twkb.c b/liblwgeom/lwout_twkb.c
index 000bcbc52..f6f77d60a 100644
--- a/liblwgeom/lwout_twkb.c
+++ b/liblwgeom/lwout_twkb.c
@@ -32,7 +32,7 @@ static uint8_t lwgeom_twkb_type(const LWGEOM *geom)
{
uint8_t twkb_type = 0;
- LWDEBUGF(2, "Entered lwgeom_twkb_type",0);
+ LWDEBUG(2, "Entered lwgeom_twkb_type");
switch ( geom->type )
{
@@ -168,7 +168,7 @@ static int ptarray_to_twkb_buf(const POINTARRAY *pa, TWKB_GLOBALS *globals, TWKB
/* last accumulated point. This is important to not build up an */
/* accumulated error when rounding the coordinates */
nextdelta[j] = (int64_t) llround(globals->factor[j] * dbl_ptr[j]) - ts->accum_rels[j];
- LWDEBUGF(4, "deltavalue: %d, ", nextdelta[j]);
+ LWDEBUGF(4, "deltavalue: %lld, ", nextdelta[j]);
diff += llabs(nextdelta[j]);
}
diff --git a/liblwgeom/lwout_wkt.c b/liblwgeom/lwout_wkt.c
index d99d385a6..e8b5ee776 100644
--- a/liblwgeom/lwout_wkt.c
+++ b/liblwgeom/lwout_wkt.c
@@ -616,7 +616,7 @@ static void lwpsurface_to_wkt_sb(const LWPSURFACE *psurf, stringbuffer_t *sb, in
static void lwgeom_to_wkt_sb(const LWGEOM *geom, stringbuffer_t *sb, int precision, uint8_t variant)
{
LWDEBUGF(4, "lwgeom_to_wkt_sb: type %s, hasz %d, hasm %d",
- lwtype_name(geom->type), (geom->type),
+ lwtype_name(geom->type),
FLAGS_GET_Z(geom->flags)?1:0, FLAGS_GET_M(geom->flags)?1:0);
switch (geom->type)
diff --git a/liblwgeom/lwtree.c b/liblwgeom/lwtree.c
index 481b329f6..f06eeedf8 100644
--- a/liblwgeom/lwtree.c
+++ b/liblwgeom/lwtree.c
@@ -939,7 +939,7 @@ rect_tree_intersects_tree_recursive(RECT_NODE *n1, RECT_NODE *n2)
#if POSTGIS_DEBUG_LEVEL >= 4
char *n1_str = rect_node_to_str(n1);
char *n2_str = rect_node_to_str(n2);
- LWDEBUGF(4,"n1 %s n2 %s", n1, n2);
+ LWDEBUGF(4,"n1 %s n2 %s", n1_str, n2_str);
lwfree(n1_str);
lwfree(n2_str);
#endif
diff --git a/liblwgeom/measures.c b/liblwgeom/measures.c
index 2a1f73ec3..f41d760d8 100644
--- a/liblwgeom/measures.c
+++ b/liblwgeom/measures.c
@@ -1152,7 +1152,7 @@ lw_dist2d_pt_ptarray(const POINT2D *p, POINTARRAY *pa, DISTPTS *dl)
if (!lw_dist2d_pt_seg(p, start, end, dl))
return LW_FALSE;
- LWDEBUGF(2, "lw_dist2d_pt_ptarray: distance from seg %lu ? : %.15g", t, dl->distance);
+ LWDEBUGF(2, "lw_dist2d_pt_ptarray: distance from seg %u ? : %.15g", t, dl->distance);
if (dl->distance <= dl->tolerance && dl->mode == DIST_MIN)
return LW_TRUE; /*just a check if the answer is already given*/
diff --git a/liblwgeom/ptarray.c b/liblwgeom/ptarray.c
index bab9a7668..adccbb364 100644
--- a/liblwgeom/ptarray.c
+++ b/liblwgeom/ptarray.c
@@ -130,7 +130,7 @@ ptarray_insert_point(POINTARRAY *pa, const POINT4D *p, uint32_t where)
{
size_t copy_size = point_size * (pa->npoints - where);
memmove(getPoint_internal(pa, where+1), getPoint_internal(pa, where), copy_size);
- LWDEBUGF(5,"copying %d bytes to start vertex %d from start vertex %d", copy_size, where+1, where);
+ LWDEBUGF(5,"copying %zu bytes to start vertex %d from start vertex %d", copy_size, where+1, where);
}
/* We have one more point */
@@ -138,7 +138,7 @@ ptarray_insert_point(POINTARRAY *pa, const POINT4D *p, uint32_t where)
/* Copy the new point into the gap */
ptarray_set_point4d(pa, where, p);
- LWDEBUGF(5,"copying new point to start vertex %d", point_size, where);
+ LWDEBUGF(5,"copying new point to start vertex %zu", point_size);
return LW_SUCCESS;
}
@@ -485,7 +485,7 @@ ptarray_same(const POINTARRAY *pa1, const POINTARRAY *pa2)
LWDEBUG(5,"npoints are the same");
ptsize = ptarray_point_size(pa1);
- LWDEBUGF(5, "ptsize = %d", ptsize);
+ LWDEBUGF(5, "ptsize = %zu", ptsize);
for (i=0; i<pa1->npoints; i++)
{
@@ -525,7 +525,7 @@ ptarray_addPoint(const POINTARRAY *pa, uint8_t *p, size_t pdims, uint32_t where)
POINT4D pbuf;
size_t ptsize = ptarray_point_size(pa);
- LWDEBUGF(3, "pa %x p %x size %d where %d",
+ LWDEBUGF(3, "pa %p p %p size %zu where %u",
pa, p, pdims, where);
if ( pdims < 2 || pdims > 4 )
@@ -542,7 +542,7 @@ ptarray_addPoint(const POINTARRAY *pa, uint8_t *p, size_t pdims, uint32_t where)
return NULL;
}
- LWDEBUG(3, "called with a %dD point");
+ LWDEBUG(3, "called with a point");
pbuf.x = pbuf.y = pbuf.z = pbuf.m = 0.0;
memcpy((uint8_t *)&pbuf, p, pdims*sizeof(double));
@@ -576,7 +576,7 @@ ptarray_removePoint(POINTARRAY *pa, uint32_t which)
POINTARRAY *ret;
size_t ptsize = ptarray_point_size(pa);
- LWDEBUGF(3, "pa %x which %d", pa, which);
+ LWDEBUGF(3, "pa %p which %u", pa, which);
assert(which <= pa->npoints-1);
assert(pa->npoints >= 3);
diff --git a/liblwgeom/topo/lwgeom_topo.c b/liblwgeom/topo/lwgeom_topo.c
index 94b4df044..27a3909d6 100644
--- a/liblwgeom/topo/lwgeom_topo.c
+++ b/liblwgeom/topo/lwgeom_topo.c
@@ -626,7 +626,7 @@ _lwt_CheckEdgeCrossing( LWT_TOPOLOGY* topo,
/* loop over each node within the edge's gbox */
nodes = lwt_be_getNodeWithinBox2D( topo, edgebox, &num_nodes,
LWT_COL_NODE_ALL, 0 );
- LWDEBUGF(1, "lwt_be_getNodeWithinBox2D returned %lu nodes", num_nodes);
+ LWDEBUGF(1, "lwt_be_getNodeWithinBox2D returned %llu nodes", num_nodes);
if (num_nodes == UINT64_MAX)
{
PGTOPO_BE_ERROR();
@@ -655,7 +655,7 @@ _lwt_CheckEdgeCrossing( LWT_TOPOLOGY* topo,
/* loop over each edge within the edge's gbox */
edges = lwt_be_getEdgeWithinBox2D( topo, edgebox, &num_edges, LWT_COL_EDGE_ALL, 0 );
- LWDEBUGF(1, "lwt_be_getEdgeWithinBox2D returned %lu edges", num_edges);
+ LWDEBUGF(1, "lwt_be_getEdgeWithinBox2D returned %llu edges", num_edges);
if (num_edges == UINT64_MAX)
{
GEOSGeom_destroy(edgegg);
@@ -787,7 +787,7 @@ _lwt_CheckEdgeCrossing( LWT_TOPOLOGY* topo,
GEOSFree(relate);
}
- LWDEBUGF(1, "No edge crossing detected among the %lu candidate edges", num_edges);
+ LWDEBUGF(1, "No edge crossing detected among the %llu candidate edges", num_edges);
if ( edges ) _lwt_release_edges(edges, num_edges);
/* would be NULL if num_edges was 0 */
@@ -977,7 +977,7 @@ _lwt_EdgeSplit( LWT_TOPOLOGY* topo, LWT_ELEMID edge, LWPOINT* pt, int skipISOChe
LWDEBUGG(2, lwline_as_lwgeom(oldedge[0]->geom), "Edge to be split");
if ( ! *oldedge )
{
- LWDEBUGF(1, "lwt_be_getEdgeById returned NULL and set i=%lu", i);
+ LWDEBUGF(1, "lwt_be_getEdgeById returned NULL and set i=%llu", i);
if (i == UINT64_MAX)
{
PGTOPO_BE_ERROR();
@@ -1556,7 +1556,7 @@ _lwt_FindAdjacentEdges( LWT_TOPOLOGY* topo, LWT_ELEMID node, edgeend *data,
return 0;
}
- LWDEBUGF(1, "getEdgeByNode returned %lu edges, minaz=%g, maxaz=%g",
+ LWDEBUGF(1, "getEdgeByNode returned %llu edges, minaz=%g, maxaz=%g",
numedges, minaz, maxaz);
/* For each incident edge-end (1 or 2): */
@@ -1822,7 +1822,7 @@ _lwt_MakeRingShell(LWT_TOPOLOGY *topo, LWT_ELEMID *signed_edge_ids, uint64_t num
for ( i=0; i<num_signed_edge_ids; ++i )
{
LWT_ELEMID eid = signed_edge_ids[i];
- LWDEBUGF(2, "Edge %lu in ring is edge %" LWTFMT_ELEMID, i, eid);
+ LWDEBUGF(2, "Edge %llu in ring is edge %" LWTFMT_ELEMID, i, eid);
LWT_ISO_EDGE *edge = NULL;
POINTARRAY *epa;
for ( j=0; j<numedges; ++j )
@@ -1911,7 +1911,7 @@ _lwt_AddFaceSplit( LWT_TOPOLOGY* topo,
PGTOPO_BE_ERROR();
return -2;
}
- LWDEBUGF(1, "getRingEdges returned %lu edges", num_signed_edge_ids);
+ LWDEBUGF(1, "getRingEdges returned %llu edges", num_signed_edge_ids);
/* You can't get to the other side of an edge forming a ring */
for (i=0; i<num_signed_edge_ids; ++i) {
@@ -2078,7 +2078,7 @@ _lwt_AddFaceSplit( LWT_TOPOLOGY* topo,
PGTOPO_BE_ERROR();
return -2;
}
- LWDEBUGF(1, "_lwt_AddFaceSplit: lwt_be_getEdgeByFace(%" LWTFMT_ELEMID ") returned %lu edges", face, numfaceedges);
+ LWDEBUGF(1, "_lwt_AddFaceSplit: lwt_be_getEdgeByFace(%" LWTFMT_ELEMID ") returned %llu edges", face, numfaceedges);
if ( numfaceedges )
{
@@ -2867,7 +2867,7 @@ lwt_GetFaceGeometry(LWT_TOPOLOGY* topo, LWT_ELEMID faceid)
PGTOPO_BE_ERROR();
return NULL;
}
- LWDEBUGF(1, "lwt_GetFaceGeometry: lwt_be_getEdgeByFace returned %lu edges", numfaceedges);
+ LWDEBUGF(1, "lwt_GetFaceGeometry: lwt_be_getEdgeByFace returned %llu edges", numfaceedges);
if ( numfaceedges == 0 )
{
@@ -3115,7 +3115,7 @@ lwt_GetFaceEdges(LWT_TOPOLOGY* topo, LWT_ELEMID face_id, LWT_ELEMID **out )
return -1;
}
if ( ! numfaceedges ) return 0; /* no edges in output */
- LWDEBUGF(1, "lwt_GetFaceEdges: lwt_be_getEdgeByFace returned %lu edges", numfaceedges);
+ LWDEBUGF(1, "lwt_GetFaceEdges: lwt_be_getEdgeByFace returned %llu edges", numfaceedges);
/* order edges by occurrence in face */
@@ -3276,7 +3276,7 @@ lwt_ChangeEdgeGeom(LWT_TOPOLOGY* topo, LWT_ELEMID edge_id, LWLINE *geom)
if ( ! oldedge )
{
LWDEBUGF(1, "lwt_ChangeEdgeGeom: "
- "lwt_be_getEdgeById returned NULL and set i=%lu", i);
+ "lwt_be_getEdgeById returned NULL and set i=%llu", i);
if (i == UINT64_MAX)
{
PGTOPO_BE_ERROR();
@@ -3393,7 +3393,7 @@ lwt_ChangeEdgeGeom(LWT_TOPOLOGY* topo, LWT_ELEMID edge_id, LWLINE *geom)
uint64_t numnodes;
nodes = lwt_be_getNodeWithinBox2D(topo, &mbox, &numnodes,
LWT_COL_NODE_ALL, 0);
- LWDEBUGF(1, "lwt_be_getNodeWithinBox2D returned %lu nodes", numnodes);
+ LWDEBUGF(1, "lwt_be_getNodeWithinBox2D returned %llu nodes", numnodes);
if (numnodes == UINT64_MAX)
{
_lwt_release_edges(oldedge, 1);
@@ -3476,7 +3476,7 @@ lwt_ChangeEdgeGeom(LWT_TOPOLOGY* topo, LWT_ELEMID edge_id, LWLINE *geom)
PGTOPO_BE_ERROR();
return -1;
}
- LWDEBUGF(1, "getRingEdges returned %lu edges", num_signed_edge_ids);
+ LWDEBUGF(1, "getRingEdges returned %llu edges", num_signed_edge_ids);
shell = _lwt_MakeRingShell(topo, signed_edge_ids, num_signed_edge_ids);
if ( ! shell ) {
@@ -3580,7 +3580,7 @@ lwt_ChangeEdgeGeom(LWT_TOPOLOGY* topo, LWT_ELEMID edge_id, LWLINE *geom)
PGTOPO_BE_ERROR();
return -1;
}
- LWDEBUGF(1, "getRingEdges returned %lu edges", num_signed_edge_ids);
+ LWDEBUGF(1, "getRingEdges returned %llu edges", num_signed_edge_ids);
shell = _lwt_MakeRingShell(topo, signed_edge_ids, num_signed_edge_ids);
if ( ! shell ) {
@@ -3661,7 +3661,7 @@ lwt_ChangeEdgeGeom(LWT_TOPOLOGY* topo, LWT_ELEMID edge_id, LWLINE *geom)
/* ownership transferred to faces[] */
faces[facestoupdate++].mbr = updatedBox;
}
- LWDEBUGF(1, "%lu faces to update", facestoupdate);
+ LWDEBUGF(1, "%llu faces to update", facestoupdate);
if ( facestoupdate )
{
uint64_t updatedFaces = lwt_be_updateFacesById(topo, &(faces[0]), facestoupdate);
@@ -3998,7 +3998,7 @@ _lwt_RemEdge( LWT_TOPOLOGY* topo, LWT_ELEMID edge_id, int modFace )
edge = lwt_be_getEdgeById(topo, &edge_id, &i, LWT_COL_EDGE_ALL);
if (!edge)
{
- LWDEBUGF(1, "lwt_be_getEdgeById returned NULL and set i=%lu", i);
+ LWDEBUGF(1, "lwt_be_getEdgeById returned NULL and set i=%llu", i);
if (i == UINT64_MAX)
{
PGTOPO_BE_ERROR();
@@ -4112,7 +4112,7 @@ _lwt_RemEdge( LWT_TOPOLOGY* topo, LWT_ELEMID edge_id, int modFace )
return -1;
}
}
- LWDEBUGF(1, "releasing %lu updateable edges in %p", nedges, upd_edge);
+ LWDEBUGF(1, "releasing %llu updateable edges in %p", nedges, upd_edge);
lwfree(upd_edge);
/* Id of face that will take up all the space previously
@@ -5273,7 +5273,7 @@ _lwt_SnapEdgeToExistingNode(
existingEdges[n] = NULL;
if ( existingEdgeId == 0 )
{
- LWDEBUGF(1, "Split component %lu is a new edge, computing edgeEndInfo", n);
+ LWDEBUGF(1, "Split component %llu is a new edge, computing edgeEndInfo", n);
{
// Compute nextCW and nextCCW of the split edge now
// incident to the split point
@@ -5314,7 +5314,7 @@ _lwt_SnapEdgeToExistingNode(
);
return -1;
}
- LWDEBUGF(1, "Azimuth of split component %lu edgeend [%.15g %.15g,%.15g %.15g] is %.15g",
+ LWDEBUGF(1, "Azimuth of split component %llu edgeend [%.15g %.15g,%.15g %.15g] is %.15g",
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 ) {
@@ -5324,14 +5324,14 @@ _lwt_SnapEdgeToExistingNode(
node->node_id, edge->edge_id);
return -1;
}
- LWDEBUGF(1, "Component %lu of split edge %" LWTFMT_ELEMID
+ LWDEBUGF(1, "Component %llu of split edge %" LWTFMT_ELEMID
" next CW is %" LWTFMT_ELEMID ", next CCW is %" LWTFMT_ELEMID,
n, edge->edge_id, splitNodeEdgeEnds[n].nextCW, splitNodeEdgeEnds[n].nextCCW);
}
}
else
{
- LWDEBUGF(1, "Split component %lu matches existing edge %" LWTFMT_ELEMID
+ LWDEBUGF(1, "Split component %llu matches existing edge %" LWTFMT_ELEMID
" (%s)", n, existingEdgeId, forward ? "forward" : "backward" );
/* Get existing edge */
for ( uint64_t t=0; t<splitNodeEdges->numEdges; t++ )
@@ -5621,7 +5621,7 @@ _lwt_SnapEdgeToExistingNode(
LWDEBUGF(1, "Looking for next CCW edge of split edge %"
LWTFMT_ELEMID " on common node %" LWTFMT_ELEMID
- " having %lu attached edges",
+ " having %llu attached edges",
edge->edge_id,
commonNodeID, commonNodeEdges->numEdges
);
@@ -6744,7 +6744,7 @@ _lwt_AddPoint(LWT_TOPOLOGY* topo, LWPOINT* point, double tol, int
}
if ( num )
{
- LWDEBUGF(1, "New point is within %.15g units of %lu nodes", tol, num);
+ LWDEBUGF(1, "New point is within %.15g units of %llu nodes", tol, num);
/* Order by distance if there are more than a single return */
if ( num > 1 )
{{
@@ -6804,7 +6804,7 @@ _lwt_AddPoint(LWT_TOPOLOGY* topo, LWPOINT* point, double tol, int
PGTOPO_BE_ERROR();
return -1;
}
- LWDEBUGF(1, "New point is within %.15g units of %lu edges", tol, num);
+ LWDEBUGF(1, "New point is within %.15g units of %llu edges", tol, num);
if ( num )
{
id = _lwt_SplitAllEdgesToNewNode(topo, edges, num, lwgeom_as_lwpoint(pt), tol, moved);
@@ -7140,7 +7140,7 @@ _lwt_AddLine(LWT_TOPOLOGY* topo, LWLINE* line, double tol, int* nedges,
PGTOPO_BE_ERROR();
return NULL;
}
- LWDEBUGF(1, "Line has %u points, its bbox intersects %lu edges bboxes",
+ LWDEBUGF(1, "Line has %u points, its bbox intersects %llu edges bboxes",
line->points->npoints, numedges);
if ( numedges )
{{
@@ -7184,7 +7184,7 @@ _lwt_AddLine(LWT_TOPOLOGY* topo, LWLINE* line, double tol, int* nedges,
PGTOPO_BE_ERROR();
return NULL;
}
- LWDEBUGF(1, "Line bbox intersects %lu nodes bboxes", numnodes);
+ LWDEBUGF(1, "Line bbox intersects %llu nodes bboxes", numnodes);
if ( numnodes )
{{
/* collect those whose distance from us is < tol */
@@ -7418,7 +7418,7 @@ _lwt_AddLine(LWT_TOPOLOGY* topo, LWLINE* line, double tol, int* nedges,
{
size_t sz;
char *wkt1 = lwgeom_to_wkt(g, WKT_EXTENDED, 15, &sz);
- LWDEBUGF(1, "Component %lu of split line is: %s", i, wkt1);
+ LWDEBUGF(1, "Component %llu of split line is: %s", i, wkt1);
lwfree(wkt1);
}
#endif
@@ -7433,11 +7433,11 @@ _lwt_AddLine(LWT_TOPOLOGY* topo, LWLINE* line, double tol, int* nedges,
}
if ( ! id )
{
- LWDEBUGF(1, "Component %lu of split line collapsed", i);
+ LWDEBUGF(1, "Component %llu of split line collapsed", i);
continue;
}
- LWDEBUGF(1, "Component %lu of split line is %s edge %" LWTFMT_ELEMID,
+ LWDEBUGF(1, "Component %llu of split line is %s edge %" LWTFMT_ELEMID,
i, forward ? "forward" : "backward", id);
ids[num++] = forward ? id : -id; /* TODO: skip duplicates */
}
diff --git a/liblwgeom/topo/lwgeom_topo_polygonizer.c b/liblwgeom/topo/lwgeom_topo_polygonizer.c
index 6023e25b4..8742e60f1 100644
--- a/liblwgeom/topo/lwgeom_topo_polygonizer.c
+++ b/liblwgeom/topo/lwgeom_topo_polygonizer.c
@@ -280,14 +280,14 @@ _lwt_UpdateEdgeRingSideFace(LWT_TOPOLOGY *topo, LWT_EDGERING *ring,
LWT_ELEMID id = edge->edge_id;
if ( elem->left )
{
- LWDEBUGF(3, "Forward edge %d is %d", forward_edges_count, id);
+ LWDEBUGF(3, "Forward edge %d is %lld", forward_edges_count, id);
forward_edges[forward_edges_count].edge_id = id;
forward_edges[forward_edges_count++].face_left = face;
edge->face_left = face;
}
else
{
- LWDEBUGF(3, "Backward edge %d is %d", forward_edges_count, id);
+ LWDEBUGF(3, "Backward edge %d is %lld", forward_edges_count, id);
backward_edges[backward_edges_count].edge_id = id;
backward_edges[backward_edges_count++].face_right = face;
edge->face_right = face;
@@ -364,7 +364,7 @@ _lwt_BuildEdgeRing(__attribute__((__unused__)) LWT_TOPOLOGY *topo, LWT_ISO_EDGE_
cur = edge;
curside = side;
- LWDEBUGF(2, "Building rings for edge %d (side %d)", cur->edge_id, side);
+ LWDEBUGF(2, "Building rings for edge %lld (side %d)", cur->edge_id, side);
do {
LWT_ELEMID next;
@@ -380,7 +380,7 @@ _lwt_BuildEdgeRing(__attribute__((__unused__)) LWT_TOPOLOGY *topo, LWT_ISO_EDGE_
LWT_EDGERING_PUSH(ring, elem);
next = elem->left ? cur->next_left : cur->next_right;
- LWDEBUGF(3, " next edge is %d", next);
+ LWDEBUGF(3, " next edge is %lld", next);
if ( next > 0 ) curside = 1;
else { curside = -1; next = -next; }
@@ -392,7 +392,7 @@ _lwt_BuildEdgeRing(__attribute__((__unused__)) LWT_TOPOLOGY *topo, LWT_ISO_EDGE_
}
} while (cur != edge || curside != side);
- LWDEBUGF(1, "Ring for edge %d has %d elems", edge->edge_id*side, ring->size);
+ LWDEBUGF(1, "Ring for edge %lld has %d elems", edge->edge_id*side, ring->size);
return ring;
}
@@ -585,7 +585,7 @@ _lwt_RegisterFaceOnEdgeSide(LWT_TOPOLOGY *topo, LWT_ISO_EDGE *edge,
/* Create new face */
LWT_ISO_FACE newface;
- LWDEBUGF(1, "Ring of edge %d is a shell (shell %d)", edge->edge_id * side, shells->size);
+ LWDEBUGF(1, "Ring of edge %lld is a shell (shell %d)", edge->edge_id * side, shells->size);
newface.mbr = _lwt_EdgeRingGetBbox(ring);
@@ -619,7 +619,7 @@ _lwt_RegisterFaceOnEdgeSide(LWT_TOPOLOGY *topo, LWT_ISO_EDGE *edge,
}
else /* cw, so is an hole */
{
- LWDEBUGF(1, "Ring of edge %d is a hole (hole %d)", edge->edge_id * side, holes->size);
+ LWDEBUGF(1, "Ring of edge %lld is a hole (hole %d)", edge->edge_id * side, holes->size);
*registered = placeholder_faceid;
LWT_EDGERING_ARRAY_PUSH(holes, ring);
}
@@ -676,7 +676,7 @@ _lwt_FindFaceContainingRing(LWT_TOPOLOGY* topo, LWT_EDGERING *ring,
{
LWT_EDGERING *sring = shells->rings[i];
const GBOX* shellbox = _lwt_EdgeRingGetBbox(sring);
- LWDEBUGF(2, "GBOX of shell %p for edge %d is %g %g,%g %g",
+ LWDEBUGF(2, "GBOX of shell %p for edge %lld is %g %g,%g %g",
sring, sring->elems[0]->edge->edge_id, shellbox->xmin,
shellbox->ymin, shellbox->xmax, shellbox->ymax);
POINTARRAY *pa = ptarray_construct(0, 0, 2);
@@ -701,7 +701,7 @@ _lwt_FindFaceContainingRing(LWT_TOPOLOGY* topo, LWT_EDGERING *ring,
LWT_EDGERING_ARRAY candidates;
LWT_EDGERING_ARRAY_INIT(&candidates);
GEOSSTRtree_query(shells->tree, ghole, &_lwt_AccumulateCanditates, &candidates);
- LWDEBUGF(1, "Found %d candidate shells containing first point of ring's originating edge %d",
+ LWDEBUGF(1, "Found %d candidate shells containing first point of ring's originating edge %lld",
candidates.size, ring->elems[0]->edge->edge_id * ( ring->elems[0]->left ? 1 : -1 ) );
/* TODO: sort candidates by bounding box size */
@@ -714,7 +714,7 @@ _lwt_FindFaceContainingRing(LWT_TOPOLOGY* topo, LWT_EDGERING *ring,
if ( sring->elems[0]->edge->edge_id == ring->elems[0]->edge->edge_id )
{
- LWDEBUGF(1, "Shell %d is on other side of ring",
+ LWDEBUGF(1, "Shell %lld is on other side of ring",
_lwt_EdgeRingGetFace(sring));
continue;
}
@@ -722,7 +722,7 @@ _lwt_FindFaceContainingRing(LWT_TOPOLOGY* topo, LWT_EDGERING *ring,
/* The hole envelope cannot equal the shell envelope */
if ( gbox_same(shellbox, testbox) )
{
- LWDEBUGF(1, "Bbox of shell %d equals that of hole ring",
+ LWDEBUGF(1, "Bbox of shell %lld equals that of hole ring",
_lwt_EdgeRingGetFace(sring));
continue;
}
@@ -730,7 +730,7 @@ _lwt_FindFaceContainingRing(LWT_TOPOLOGY* topo, LWT_EDGERING *ring,
/* Skip if ring box is not in shell box */
if ( ! gbox_contains_2d(shellbox, testbox) )
{
- LWDEBUGF(1, "Bbox of shell %d does not contain bbox of ring point",
+ LWDEBUGF(1, "Bbox of shell %lld does not contain bbox of ring point",
_lwt_EdgeRingGetFace(sring));
continue;
}
@@ -739,7 +739,7 @@ _lwt_FindFaceContainingRing(LWT_TOPOLOGY* topo, LWT_EDGERING *ring,
* and this shell's bbox is not contained in the other */
if ( minenv && ! gbox_contains_2d(minenv, shellbox) )
{
- LWDEBUGF(2, "Bbox of shell %d (face %d) not contained by bbox "
+ LWDEBUGF(2, "Bbox of shell %d (face %lld) not contained by bbox "
"of last shell found to contain the point",
i, _lwt_EdgeRingGetFace(sring));
continue;
@@ -751,7 +751,7 @@ _lwt_FindFaceContainingRing(LWT_TOPOLOGY* topo, LWT_EDGERING *ring,
/* Continue until all shells are tested, as we want to
* use the one with the smallest bounding box */
/* IDEA: sort shells by bbox size, stopping on first match */
- LWDEBUGF(1, "Shell %d contains hole of edge %d",
+ LWDEBUGF(1, "Shell %lld contains hole of edge %lld",
_lwt_EdgeRingGetFace(sring),
ring->elems[0]->edge->edge_id);
minenv = shellbox;
@@ -872,14 +872,14 @@ lwt_Polygonize(LWT_TOPOLOGY* topo)
LWT_ELEMID newface = -1;
- LWDEBUGF(1, "Next face-missing edge has id:%d, face_left:%d, face_right:%d",
+ LWDEBUGF(1, "Next face-missing edge has id:%lld, face_left:%lld, face_right:%lld",
edge->edge_id, edge->face_left, edge->face_right);
if ( edge->face_left == -1 )
{
err = _lwt_RegisterFaceOnEdgeSide(topo, edge, 1, &edgetable,
&holes, &shells, &newface);
if ( err ) break;
- LWDEBUGF(1, "New face on the left of edge %d is %d",
+ LWDEBUGF(1, "New face on the left of edge %lld is %lld",
edge->edge_id, newface);
edge->face_left = newface;
}
@@ -888,7 +888,7 @@ lwt_Polygonize(LWT_TOPOLOGY* topo)
err = _lwt_RegisterFaceOnEdgeSide(topo, edge, -1, &edgetable,
&holes, &shells, &newface);
if ( err ) break;
- LWDEBUGF(1, "New face on the right of edge %d is %d",
+ LWDEBUGF(1, "New face on the right of edge %lld is %lld",
edge->edge_id, newface);
edge->face_right = newface;
}
diff --git a/liblwgeom/topo/lwt_edgeend_star.c b/liblwgeom/topo/lwt_edgeend_star.c
index 892545b25..600e7b6da 100644
--- a/liblwgeom/topo/lwt_edgeend_star.c
+++ b/liblwgeom/topo/lwt_edgeend_star.c
@@ -99,15 +99,15 @@ lwt_edgeEndStar_addEdge( LWT_EDGEEND_STAR *star, const LWT_ISO_EDGE *edge )
}
LWDEBUGF(1, "Edge %" LWTFMT_ELEMID
- " got %" PRIu64 " ends incident to star node %" LWTFMT_ELEMID,
+ " got %d" " ends incident to star node %" LWTFMT_ELEMID,
edge->edge_id, numEdgeEnds, star->nodeID );
newCapacity = star->numEdgeEnds + numEdgeEnds;
- LWDEBUGF(3, "Current star capacity:%d, required:%d",
+ LWDEBUGF(3, "Current star capacity:%lld, required:%lld",
star->edgeEndsCapacity, newCapacity);
if ( newCapacity > star->edgeEndsCapacity )
{
- LWDEBUGF(3, "Reallocating edgeEnds from %p to new size %d", star->edgeEnds, newCapacity * sizeof(LWT_EDGEEND *));
+ LWDEBUGF(3, "Reallocating edgeEnds from %p to new size %lld", star->edgeEnds, newCapacity * sizeof(LWT_EDGEEND *));
if ( star->edgeEnds ) {
star->edgeEnds = lwrealloc(star->edgeEnds, newCapacity * sizeof(LWT_EDGEEND *));
} else {
@@ -115,7 +115,7 @@ lwt_edgeEndStar_addEdge( LWT_EDGEEND_STAR *star, const LWT_ISO_EDGE *edge )
}
LWDEBUGF(3, "Reallocated edgeEnds are %p", star->edgeEnds);
star->edgeEndsCapacity = newCapacity;
- LWDEBUGF(3, "New star capacity: %d", newCapacity);
+ LWDEBUGF(3, "New star capacity: %lld", newCapacity);
}
for (int i=0; i<numEdgeEnds; ++i)
@@ -138,7 +138,7 @@ lwt_edgeEnd_compare(const void *i1, const void *i2)
else
ret = 0;
- LWDEBUGF(4, "qsort comparator for %s edge %d with azimuth %g and %s edge %d with azimuth %g returning %d",
+ LWDEBUGF(4, "qsort comparator for %s edge %lld with azimuth %g and %s edge %lld with azimuth %g returning %d",
ee1->outgoing ? "outgoing" : "incoming", ee1->edge->edge_id, ee1->azimuth,
ee2->outgoing ? "outgoing" : "incoming", ee2->edge->edge_id, ee2->azimuth,
ret
diff --git a/loader/pgsql2shp-core.c b/loader/pgsql2shp-core.c
index 2e6fe7f9c..c2895ab23 100644
--- a/loader/pgsql2shp-core.c
+++ b/loader/pgsql2shp-core.c
@@ -391,7 +391,7 @@ create_linestring(SHPDUMPERSTATE *state, LWLINE *lwlinestring)
zpts[i] = p4d.z;
mpts[i] = p4d.m;
- LWDEBUGF(4, "Linestring - Point: %g %g %g %g", i, xpts[i], ypts[i], zpts[i], mpts[i]);
+ LWDEBUGF(4, "Linestring - Point: [%u] %g %g %g %g", i, xpts[i], ypts[i], zpts[i], mpts[i]);
}
obj = SHPCreateObject(state->outshptype, -1, 0, NULL, NULL, lwlinestring->points->npoints, xpts, ypts, zpts, mpts);
@@ -1383,7 +1383,7 @@ ShpDumperOpenTable(SHPDUMPERSTATE *state)
state->table);
}
- LWDEBUGF(3, "query is: %s\n", query);
+ LWDEBUGF(3, "query is: %s\n", stringbuffer_getstring(&sb));
res = PQexec(state->conn, stringbuffer_getstring(&sb));
stringbuffer_release(&sb);
@@ -2080,7 +2080,7 @@ int ShpLoaderGenerateShapeRow(SHPDUMPERSTATE *state)
hexewkb = convert_bytes_to_hex((unsigned char *)val, hexewkb_len);
}
- LWDEBUGF(4, "HexEWKB - length: %d value: %s", strlen(hexewkb), hexewkb);
+ LWDEBUGF(4, "HexEWKB - length: %lu value: %s", strlen(hexewkb), hexewkb);
/* Deserialize the LWGEOM */
lwgeom = lwgeom_from_hexwkb(hexewkb, LW_PARSER_CHECK_NONE);
diff --git a/postgis/flatgeobuf.c b/postgis/flatgeobuf.c
index 9fa5be2b3..e6c5f5c87 100644
--- a/postgis/flatgeobuf.c
+++ b/postgis/flatgeobuf.c
@@ -143,7 +143,7 @@ static void ensure_items_len(struct flatgeobuf_agg_ctx *ctx)
}
if (ctx->ctx->items_len < (ctx->ctx->features_count + 1)) {
ctx->ctx->items_len = ctx->ctx->items_len * 2;
- POSTGIS_DEBUGF(2, "flatgeobuf: reallocating items to len %ld", ctx->ctx->items_len);
+ POSTGIS_DEBUGF(2, "flatgeobuf: reallocating items to len %lld", ctx->ctx->items_len);
ctx->ctx->items = repalloc(ctx->ctx->items, sizeof(flatgeobuf_item *) * ctx->ctx->items_len);
ensure_items_len(ctx);
}
@@ -491,7 +491,7 @@ void flatgeobuf_decode_row(struct flatgeobuf_decode_ctx *ctx)
POSTGIS_DEBUGF(3, "fid now %d", ctx->fid);
if (ctx->ctx->offset == ctx->ctx->size) {
- POSTGIS_DEBUGF(3, "reached end at %ld", ctx->ctx->offset);
+ POSTGIS_DEBUGF(3, "reached end at %lld", ctx->ctx->offset);
ctx->done = true;
}
}
@@ -556,7 +556,7 @@ void flatgeobuf_agg_transfn(struct flatgeobuf_agg_ctx *ctx)
*/
uint8_t *flatgeobuf_agg_finalfn(struct flatgeobuf_agg_ctx *ctx)
{
- POSTGIS_DEBUGF(3, "called at offset %ld", ctx->ctx->offset);
+ POSTGIS_DEBUGF(3, "called at offset %lld", ctx->ctx->offset);
if (ctx == NULL)
flatgeobuf_agg_ctx_init(NULL, false);
// header only result
@@ -569,6 +569,5 @@ uint8_t *flatgeobuf_agg_finalfn(struct flatgeobuf_agg_ctx *ctx)
if (ctx->tupdesc != NULL)
ReleaseTupleDesc(ctx->tupdesc);
SET_VARSIZE(ctx->ctx->buf, ctx->ctx->offset);
- POSTGIS_DEBUGF(3, "returning at offset %ld", ctx->ctx->offset);
return ctx->ctx->buf;
}
diff --git a/postgis/lwgeom_geos.c b/postgis/lwgeom_geos.c
index 717a597e4..16ee36e89 100644
--- a/postgis/lwgeom_geos.c
+++ b/postgis/lwgeom_geos.c
@@ -1982,13 +1982,6 @@ Datum polygonize_garray(PG_FUNCTION_ARGS)
GEOSGeometry *geos_result;
const GEOSGeometry **vgeoms;
int32_t srid = SRID_UNKNOWN;
-#if POSTGIS_DEBUG_LEVEL >= 3
- static int call=1;
-#endif
-
-#if POSTGIS_DEBUG_LEVEL >= 3
- call++;
-#endif
if (PG_ARGISNULL(0))
PG_RETURN_NULL();
diff --git a/postgis/lwgeom_in_flatgeobuf.c b/postgis/lwgeom_in_flatgeobuf.c
index 1cd73dd7f..8435cd14e 100644
--- a/postgis/lwgeom_in_flatgeobuf.c
+++ b/postgis/lwgeom_in_flatgeobuf.c
@@ -99,7 +99,7 @@ Datum pgis_tablefromflatgeobuf(PG_FUNCTION_ARGS)
ctx = palloc0(sizeof(*ctx));
ctx->ctx = palloc0(sizeof(flatgeobuf_ctx));
ctx->ctx->size = VARSIZE_ANY_EXHDR(data);
- POSTGIS_DEBUGF(3, "bytea data size is %ld", ctx->ctx->size);
+ POSTGIS_DEBUGF(3, "bytea data size is %lld", ctx->ctx->size);
ctx->ctx->buf = lwalloc(ctx->ctx->size);
memcpy(ctx->ctx->buf, VARDATA_ANY(data), ctx->ctx->size);
ctx->ctx->offset = 0;
@@ -183,7 +183,7 @@ Datum pgis_fromflatgeobuf(PG_FUNCTION_ARGS)
ctx->tupdesc = tupdesc;
ctx->ctx = palloc0(sizeof(flatgeobuf_ctx));
ctx->ctx->size = VARSIZE_ANY_EXHDR(data);
- POSTGIS_DEBUGF(3, "VARSIZE_ANY_EXHDR %ld", ctx->ctx->size);
+ POSTGIS_DEBUGF(3, "VARSIZE_ANY_EXHDR %lld", ctx->ctx->size);
ctx->ctx->buf = palloc(ctx->ctx->size);
memcpy(ctx->ctx->buf, VARDATA_ANY(data), ctx->ctx->size);
ctx->ctx->offset = 0;
@@ -201,10 +201,10 @@ Datum pgis_fromflatgeobuf(PG_FUNCTION_ARGS)
flatgeobuf_check_magicbytes(ctx);
flatgeobuf_decode_header(ctx->ctx);
- POSTGIS_DEBUGF(2, "header decoded now at offset %ld", ctx->ctx->offset);
+ POSTGIS_DEBUGF(2, "header decoded now at offset %lld", ctx->ctx->offset);
if (ctx->ctx->size == ctx->ctx->offset) {
- POSTGIS_DEBUGF(2, "no feature data offset %ld", ctx->ctx->offset);
+ POSTGIS_DEBUGF(2, "no feature data offset %lld", ctx->ctx->offset);
MemoryContextSwitchTo(oldcontext);
SRF_RETURN_DONE(funcctx);
}
diff --git a/postgis/lwgeom_in_marc21.c b/postgis/lwgeom_in_marc21.c
index 8b4974fc4..b5d2b9981 100644
--- a/postgis/lwgeom_in_marc21.c
+++ b/postgis/lwgeom_in_marc21.c
@@ -377,7 +377,6 @@ static double parse_geo_literal(char *literal) {
}
- POSTGIS_DEBUGF(2, "=> parse_geo_literal returns: %.*f (in decimal degrees)", literal_length-(3+start_literal), result);
return result;
}
diff --git a/raster/rt_core/librtcore.h b/raster/rt_core/librtcore.h
index cfc8981df..beced79c4 100644
--- a/raster/rt_core/librtcore.h
+++ b/raster/rt_core/librtcore.h
@@ -68,7 +68,6 @@
#endif
#endif
-
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) /* seems to work like Linux... */
#if !defined(LINUX)
#define LINUX
diff --git a/raster/rt_core/rt_context.c b/raster/rt_core/rt_context.c
index 263656716..8ee187cc4 100644
--- a/raster/rt_core/rt_context.c
+++ b/raster/rt_core/rt_context.c
@@ -190,7 +190,7 @@ rt_set_handlers_options(rt_allocator allocator, rt_reallocator reallocator,
void *
rtalloc(size_t size) {
void * mem = ctx_t.alloc(size);
- RASTER_DEBUGF(5, "rtalloc called: %d@%p", size, mem);
+ RASTER_DEBUGF(5, "rtalloc called: %zu@%p", size, mem);
return mem;
}
@@ -198,7 +198,7 @@ rtalloc(size_t size) {
void *
rtrealloc(void * mem, size_t size) {
void * result = ctx_t.realloc(mem, size);
- RASTER_DEBUGF(5, "rtrealloc called: %d@%p", size, result);
+ RASTER_DEBUGF(5, "rtrealloc called: %zu@%p", size, result);
return result;
}
diff --git a/raster/rt_core/rt_serialize.c b/raster/rt_core/rt_serialize.c
index a3e1ce0a2..4673b3e0c 100644
--- a/raster/rt_core/rt_serialize.c
+++ b/raster/rt_core/rt_serialize.c
@@ -535,9 +535,9 @@ rt_raster_serialize(rt_raster raster) {
memset(ret, '-', size);
ptr = ret;
- RASTER_DEBUGF(3, "sizeof(struct rt_raster_serialized_t):%u",
+ RASTER_DEBUGF(3, "sizeof(struct rt_raster_serialized_t):%lu",
sizeof (struct rt_raster_serialized_t));
- RASTER_DEBUGF(3, "sizeof(struct rt_raster_t):%u",
+ RASTER_DEBUGF(3, "sizeof(struct rt_raster_t):%lu",
sizeof (struct rt_raster_t));
RASTER_DEBUGF(3, "serialized size:%lu", (long unsigned) size);
@@ -909,7 +909,7 @@ rt_raster_deserialize(void* serialized, int header_only) {
++ptr;
}
- RASTER_DEBUGF(3, "rt_raster_deserialize: skip %d bytes of 8-bytes boundary padding", ptr - padbeg);
+ RASTER_DEBUGF(3, "rt_raster_deserialize: skip %ld bytes of 8-bytes boundary padding", ptr - padbeg);
/* Consistency checking (ptr is pixbytes-aligned) */
assert(!((ptr - beg) % pixbytes));
diff --git a/raster/rt_core/rt_statistics.c b/raster/rt_core/rt_statistics.c
index f3cc0c45b..b5a6c7025 100644
--- a/raster/rt_core/rt_statistics.c
+++ b/raster/rt_core/rt_statistics.c
@@ -281,7 +281,7 @@ rt_band_get_summary_stats(
y += diff + offset;
diff = sample_int - offset;
}
- RASTER_DEBUGF(5, "(x, y, z) = (%d, %d, %d)", x, y, z);
+ RASTER_DEBUGF(5, "(x, y, z) = (%u, %lld, %u)", x, y, z);
if (y >= band->height || z > sample_per) break;
rtn = rt_band_get_pixel(band, x, y, &value, &isnodata);
@@ -1050,7 +1050,7 @@ rt_band_get_quantiles_stream(
assert(NULL != band);
assert(cov_count > 1);
assert(NULL != rtn_count);
- RASTER_DEBUGF(3, "cov_count = %d", cov_count);
+ RASTER_DEBUGF(3, "cov_count = %llu", cov_count);
data = rt_band_get_data(band);
if (data == NULL) {
@@ -1135,7 +1135,7 @@ rt_band_get_quantiles_stream(
qll->tau = cov_count - (*qlls)[i - 1].tau + 1;
}
- RASTER_DEBUGF(4, "qll init: (algeq, quantile, count, tau, sum1, sum2) = (%d, %f, %d, %d, %d, %d)",
+ RASTER_DEBUGF(4, "qll init: (algeq, quantile, count, tau, sum1, sum2) = (%d, %f, %d, %llu, %llu, %llu)",
qll->algeq, qll->quantile, qll->count, qll->tau, qll->sum1, qll->sum2);
RASTER_DEBUGF(4, "qll init: (head, tail) = (%p, %p)", qll->head, qll->tail);
}
@@ -1192,7 +1192,7 @@ rt_band_get_quantiles_stream(
y += diff + offset;
diff = sample_int - offset;
}
- RASTER_DEBUGF(5, "(x, y, z) = (%d, %d, %d)", x, y, z);
+ RASTER_DEBUGF(5, "(x, y, z) = (%u, %lld, %u)", x, y, z);
if (y >= band->height || z > sample_per) break;
status = rt_band_get_pixel(band, x, y, &value, &isnodata);
@@ -1205,7 +1205,7 @@ rt_band_get_quantiles_stream(
qll = &((*qlls)[a]);
qls = NULL;
RASTER_DEBUGF(4, "%d of %d (%f)", a + 1, *qlls_count, qll->quantile);
- RASTER_DEBUGF(5, "qll before: (algeq, quantile, count, tau, sum1, sum2) = (%d, %f, %d, %d, %d, %d)",
+ RASTER_DEBUGF(5, "qll before: (algeq, quantile, count, tau, sum1, sum2) = (%d, %f, %d, %lld, %lld, %lld)",
qll->algeq, qll->quantile, qll->count, qll->tau, qll->sum1, qll->sum2);
RASTER_DEBUGF(5, "qll before: (head, tail) = (%p, %p)", qll->head, qll->tail);
@@ -1444,7 +1444,7 @@ rt_band_get_quantiles_stream(
}
}
- RASTER_DEBUGF(5, "sum2, tau = %d, %d", qll->sum2, qll->tau);
+ RASTER_DEBUGF(5, "sum2, tau = %lld, %lld", qll->sum2, qll->tau);
if (qll->sum2 >= qll->tau) {
/* AL-GEQ */
if (qll->algeq) {
@@ -1498,14 +1498,14 @@ rt_band_get_quantiles_stream(
}
}
- RASTER_DEBUGF(5, "qll after: (algeq, quantile, count, tau, sum1, sum2) = (%d, %f, %d, %d, %d, %d)",
+ RASTER_DEBUGF(5, "qll after: (algeq, quantile, count, tau, sum1, sum2) = (%d, %f, %d, %lld, %lld, %lld)",
qll->algeq, qll->quantile, qll->count, qll->tau, qll->sum1, qll->sum2);
RASTER_DEBUGF(5, "qll after: (head, tail) = (%p, %p)\n\n", qll->head, qll->tail);
}
}
else {
- RASTER_DEBUGF(5, "skipping value at (x, y) = (%d, %d)", x, y);
+ RASTER_DEBUGF(5, "skipping value at (x, y) = (%u, %lld)", x, y);
}
z++;
@@ -1530,7 +1530,7 @@ rt_band_get_quantiles_stream(
}
if (exists) continue;
- RASTER_DEBUGF(5, "qll: (algeq, quantile, count, tau, sum1, sum2) = (%d, %f, %d, %d, %d, %d)",
+ RASTER_DEBUGF(5, "qll: (algeq, quantile, count, tau, sum1, sum2) = (%d, %f, %d, %lld, %lld, %lld)",
qll->algeq, qll->quantile, qll->count, qll->tau, qll->sum1, qll->sum2);
RASTER_DEBUGF(5, "qll: (head, tail) = (%p, %p)", qll->head, qll->tail);
@@ -1552,7 +1552,7 @@ rt_band_get_quantiles_stream(
for (j = i + 1; j < *qlls_count; j++) {
if (FLT_EQ((*qlls)[j].quantile, qll->quantile)) {
- RASTER_DEBUGF(5, "qlls[%d]: (algeq, quantile, count, tau, sum1, sum2) = (%d, %f, %d, %d, %d, %d)",
+ RASTER_DEBUGF(5, "qlls[%d]: (algeq, quantile, count, tau, sum1, sum2) = (%d, %f, %d, %lld, %lld, %lld)",
j, (*qlls)[j].algeq, (*qlls)[j].quantile, (*qlls)[j].count, (*qlls)[j].tau, (*qlls)[j].sum1, (*qlls)[j].sum2);
RASTER_DEBUGF(5, "qlls[%d]: (head, tail) = (%p, %p)", j, (*qlls)[j].head, (*qlls)[j].tail);
diff --git a/raster/rt_core/rt_wkb.c b/raster/rt_core/rt_wkb.c
index 84b7ed55b..88daa9665 100644
--- a/raster/rt_core/rt_wkb.c
+++ b/raster/rt_core/rt_wkb.c
@@ -183,7 +183,7 @@ rt_band_from_wkb(
memcpy(band->data.offline.path, *ptr, sz);
band->data.offline.path[sz] = '\0';
- RASTER_DEBUGF(3, "OFFDB band path is %s (size is %d)",
+ RASTER_DEBUGF(3, "OFFDB band path is %s (size is %zu)",
band->data.offline.path, sz);
*ptr += sz + 1;
@@ -295,7 +295,7 @@ rt_raster_from_wkb(const uint8_t* wkb, uint32_t wkbsize) {
}
wkbend = wkb + wkbsize;
- RASTER_DEBUGF(3, "Parsing header from wkb position %d (expected 0)",
+ RASTER_DEBUGF(3, "Parsing header from wkb position %zu (expected 0)",
d_binptr_to_pos(ptr, wkbend, wkbsize));
CHECK_BINPTR_POSITION(ptr, wkbend, wkbsize, 0);
@@ -344,7 +344,7 @@ rt_raster_from_wkb(const uint8_t* wkb, uint32_t wkbsize) {
rast->srid);
RASTER_DEBUGF(3, "rt_raster_from_wkb: Raster dims: %dx%d",
rast->width, rast->height);
- RASTER_DEBUGF(3, "Parsing raster header finished at wkb position %d (expected 61)",
+ RASTER_DEBUGF(3, "Parsing raster header finished at wkb position %zu (expected 61)",
d_binptr_to_pos(ptr, wkbend, wkbsize));
CHECK_BINPTR_POSITION(ptr, wkbend, wkbsize, 61);
@@ -377,7 +377,7 @@ rt_raster_from_wkb(const uint8_t* wkb, uint32_t wkbsize) {
assert(ptr <= wkbend);
for (i = 0; i < rast->numBands; ++i) {
- RASTER_DEBUGF(3, "Parsing band %d from wkb position %d", i,
+ RASTER_DEBUGF(3, "Parsing band %d from wkb position %zu", i,
d_binptr_to_pos(ptr, wkbend, wkbsize));
rt_band band = rt_band_from_wkb(rast->width, rast->height,
@@ -524,7 +524,7 @@ rt_raster_to_wkb(rt_raster raster, int outasin, uint32_t *wkbsize) {
#if POSTGIS_DEBUG_LEVEL > 2
wkbend = ptr + (*wkbsize);
#endif
- RASTER_DEBUGF(3, "Writing raster header to wkb on position %d (expected 0)",
+ RASTER_DEBUGF(3, "Writing raster header to wkb on position %zu (expected 0)",
d_binptr_to_pos(ptr, wkbend, *wkbsize));
/* Write endianness */
@@ -538,7 +538,7 @@ rt_raster_to_wkb(rt_raster raster, int outasin, uint32_t *wkbsize) {
memcpy(ptr, &(raster->numBands), sizeof (struct rt_raster_serialized_t) - 6);
ptr += sizeof (struct rt_raster_serialized_t) - 6;
- RASTER_DEBUGF(3, "Writing bands header to wkb position %d (expected 61)",
+ RASTER_DEBUGF(3, "Writing bands header to wkb position %zu (expected 61)",
d_binptr_to_pos(ptr, wkbend, *wkbsize));
/* Serialize bands now */
@@ -548,7 +548,7 @@ rt_raster_to_wkb(rt_raster raster, int outasin, uint32_t *wkbsize) {
int pixbytes = rt_pixtype_size(pixtype);
RASTER_DEBUGF(3, "Writing WKB for band %d", i);
- RASTER_DEBUGF(3, "Writing band pixel type to wkb position %d",
+ RASTER_DEBUGF(3, "Writing band pixel type to wkb position %zu",
d_binptr_to_pos(ptr, wkbend, *wkbsize));
if (pixbytes < 1) {
@@ -575,7 +575,7 @@ rt_raster_to_wkb(rt_raster raster, int outasin, uint32_t *wkbsize) {
assert(!(((uint64_t) ptr) % pixbytes));
#endif
- RASTER_DEBUGF(3, "Writing band nodata to wkb position %d",
+ RASTER_DEBUGF(3, "Writing band nodata to wkb position %zu",
d_binptr_to_pos(ptr, wkbend, *wkbsize));
/* Add nodata value */
-----------------------------------------------------------------------
Summary of changes:
deps/flatgeobuf/flatgeobuf_c.cpp | 24 ++++++-------
liblwgeom/bytebuffer.c | 6 ++--
liblwgeom/effectivearea.c | 2 +-
liblwgeom/gserialized1.c | 20 +++++------
liblwgeom/gserialized2.c | 20 +++++------
liblwgeom/lwalgorithm.c | 6 ++--
liblwgeom/lwgeodetic.c | 2 +-
liblwgeom/lwgeodetic_tree.c | 2 +-
liblwgeom/lwout_twkb.c | 4 +--
liblwgeom/lwout_wkt.c | 2 +-
liblwgeom/lwtree.c | 2 +-
liblwgeom/measures.c | 2 +-
liblwgeom/ptarray.c | 12 +++----
liblwgeom/topo/lwgeom_topo.c | 58 ++++++++++++++++----------------
liblwgeom/topo/lwgeom_topo_polygonizer.c | 34 +++++++++----------
liblwgeom/topo/lwt_edgeend_star.c | 10 +++---
loader/pgsql2shp-core.c | 6 ++--
postgis/flatgeobuf.c | 7 ++--
postgis/lwgeom_geos.c | 7 ----
postgis/lwgeom_in_flatgeobuf.c | 8 ++---
postgis/lwgeom_in_marc21.c | 1 -
raster/rt_core/librtcore.h | 1 -
raster/rt_core/rt_context.c | 4 +--
raster/rt_core/rt_serialize.c | 6 ++--
raster/rt_core/rt_statistics.c | 20 +++++------
raster/rt_core/rt_wkb.c | 16 ++++-----
26 files changed, 136 insertions(+), 146 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list