[postgis-tickets] [SCM] PostGIS branch master updated. 3.3.0rc2-1016-g3874270a4

git at osgeo.org git at osgeo.org
Tue Jun 27 10:24:25 PDT 2023


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  3874270a400eb1295f7512edad88e7fa22aad816 (commit)
      from  9401093fc80073ae294d312a99be7338ceac7f66 (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 3874270a400eb1295f7512edad88e7fa22aad816
Author: Sandro Santilli <strk at kbt.io>
Date:   Tue Jun 27 19:23:25 2023 +0200

    const-correct getOctant
    
    References #5278

diff --git a/postgis/gserialized_spgist_3d.c b/postgis/gserialized_spgist_3d.c
index 9704fe831..60371b6e0 100644
--- a/postgis/gserialized_spgist_3d.c
+++ b/postgis/gserialized_spgist_3d.c
@@ -156,7 +156,7 @@ typedef struct
  * a corner of the box. This makes 64 octants in total.
  */
 static uint8
-getOctant(BOX3D *centroid, BOX3D *inBox)
+getOctant(const BOX3D *centroid, const BOX3D *inBox)
 {
 	uint8 octant = 0;
 
@@ -431,7 +431,7 @@ PGDLLEXPORT Datum gserialized_spgist_picksplit_3d(PG_FUNCTION_ARGS)
 	double *highYs = palloc(sizeof(double) * in->nTuples);
 	double *lowZs = palloc(sizeof(double) * in->nTuples);
 	double *highZs = palloc(sizeof(double) * in->nTuples);
-	BOX3D *box = DatumGetBox3DP(in->datums[0]);
+	const BOX3D *box = DatumGetBox3DP(in->datums[0]); /* we use to fetch srid */
 	int32_t srid = box->srid;
 
 	/* Calculate median of all 6D coordinates */
diff --git a/postgis/gserialized_spgist_nd.c b/postgis/gserialized_spgist_nd.c
index 4dc417611..9a748a703 100644
--- a/postgis/gserialized_spgist_nd.c
+++ b/postgis/gserialized_spgist_nd.c
@@ -122,7 +122,7 @@ compareFloats(const void *a, const void *b)
  * box. This makes 256 octants in total.
  */
 static uint16_t
-getOctant(GIDX *centroid, GIDX *inBox)
+getOctant(const GIDX *centroid, const GIDX *inBox)
 {
 	uint16_t octant = 0, dim = 0x01;
 	int ndims, i;
@@ -327,7 +327,7 @@ PGDLLEXPORT Datum gserialized_spgist_picksplit_nd(PG_FUNCTION_ARGS)
 	/* Calculate maxdims median of all ND coordinates */
 	for (tuple = 0; tuple < in->nTuples; tuple++)
 	{
-		GIDX *box = (GIDX *)DatumGetPointer(in->datums[tuple]);
+		const GIDX *box = (const GIDX *)DatumGetPointer(in->datums[tuple]);
 		ndims = GIDX_NDIMS(box);
 		if (maxdims < ndims)
 			maxdims = ndims;

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

Summary of changes:
 postgis/gserialized_spgist_3d.c | 4 ++--
 postgis/gserialized_spgist_nd.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list