[postgis-tickets] [SCM] PostGIS branch master updated. 3.3.0rc2-1017-g1985836e4
git at osgeo.org
git at osgeo.org
Tue Jun 27 12:23:24 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 1985836e47d4566a978d0b298ae2a86b89b6b283 (commit)
from 3874270a400eb1295f7512edad88e7fa22aad816 (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 1985836e47d4566a978d0b298ae2a86b89b6b283
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date: Tue Jun 27 12:23:21 2023 -0700
Change local var names to avoid shadows, references #5278
diff --git a/extensions/address_standardizer/gamma.c b/extensions/address_standardizer/gamma.c
index 413d957a9..0824c6535 100644
--- a/extensions/address_standardizer/gamma.c
+++ b/extensions/address_standardizer/gamma.c
@@ -163,7 +163,7 @@ RULES *rules_init( ERR_PARAM *err_p ) {
rules_free(rules);
- return NULL ;
+ return NULL;
}
rules -> r_p -> rule_space = r_s ;
diff --git a/loader/shp2pgsql-core.c b/loader/shp2pgsql-core.c
index a7a290c87..c50be7591 100644
--- a/loader/shp2pgsql-core.c
+++ b/loader/shp2pgsql-core.c
@@ -844,7 +844,6 @@ ShpLoaderOpenShape(SHPLOADERSTATE *state)
SHPObject *obj = NULL;
int ret = SHPLOADEROK;
char name[MAXFIELDNAMELEN];
- char name2[MAXFIELDNAMELEN];
DBFFieldType type = FTInvalid;
char *utf8str;
@@ -1164,24 +1163,26 @@ ShpLoaderOpenShape(SHPLOADERSTATE *state)
* or after pgsql reserved attribute names
*/
if (name[0] == '_' ||
- ! strcmp(name, "gid") || ! strcmp(name, "tableoid") ||
+ ! strcmp(name, "gid") ||
+ ! strcmp(name, "tableoid") ||
! strcmp(name, "cmin") ||
! strcmp(name, "cmax") ||
! strcmp(name, "xmin") ||
! strcmp(name, "xmax") ||
! strcmp(name, "primary") ||
- ! strcmp(name, "oid") || ! strcmp(name, "ctid"))
+ ! strcmp(name, "oid") ||
+ ! strcmp(name, "ctid"))
{
+ char tmp_name[MAXFIELDNAMELEN];
size_t len = strlen(name);
- if (len > (MAXFIELDNAMELEN - 2)){
+ if (len > (MAXFIELDNAMELEN - 2))
+ {
len = MAXFIELDNAMELEN - 2;
}
- strncpy(name2 + 2, name, MAXFIELDNAMELEN - 2);
- name2[MAXFIELDNAMELEN-1] = '\0';
- name2[len + 2] = '\0';
- name2[0] = '_';
- name2[1] = '_';
- strcpy(name, name2);
+ strncpy(tmp_name + 2, name, len);
+ tmp_name[len+1] = '\0';
+ tmp_name[0] = tmp_name[1] = '_';
+ strcpy(name, tmp_name);
}
/* Avoid duplicating field names */
diff --git a/postgis/gserialized_spgist_3d.c b/postgis/gserialized_spgist_3d.c
index 60371b6e0..8ee0cb38b 100644
--- a/postgis/gserialized_spgist_3d.c
+++ b/postgis/gserialized_spgist_3d.c
@@ -424,7 +424,6 @@ PGDLLEXPORT Datum gserialized_spgist_picksplit_3d(PG_FUNCTION_ARGS)
spgPickSplitOut *out = (spgPickSplitOut *)PG_GETARG_POINTER(1);
BOX3D *centroid;
int median, i;
- uint8 octant;
double *lowXs = palloc(sizeof(double) * in->nTuples);
double *highXs = palloc(sizeof(double) * in->nTuples);
double *lowYs = palloc(sizeof(double) * in->nTuples);
@@ -437,14 +436,14 @@ PGDLLEXPORT Datum gserialized_spgist_picksplit_3d(PG_FUNCTION_ARGS)
/* Calculate median of all 6D coordinates */
for (i = 0; i < in->nTuples; i++)
{
- box = DatumGetBox3DP(in->datums[i]);
-
- lowXs[i] = box->xmin;
- highXs[i] = box->xmax;
- lowYs[i] = box->ymin;
- highYs[i] = box->ymax;
- lowZs[i] = box->zmin;
- highZs[i] = box->zmax;
+ BOX3D* box_in = DatumGetBox3DP(in->datums[i]);
+
+ lowXs[i] = box_in->xmin;
+ highXs[i] = box_in->xmax;
+ lowYs[i] = box_in->ymin;
+ highYs[i] = box_in->ymax;
+ lowZs[i] = box_in->zmin;
+ highZs[i] = box_in->zmax;
}
qsort(lowXs, in->nTuples, sizeof(double), compareDoubles);
@@ -482,10 +481,10 @@ PGDLLEXPORT Datum gserialized_spgist_picksplit_3d(PG_FUNCTION_ARGS)
*/
for (i = 0; i < in->nTuples; i++)
{
- box = DatumGetBox3DP(in->datums[i]);
- octant = getOctant(centroid, box);
+ BOX3D* box_in = DatumGetBox3DP(in->datums[i]);
+ uint8 octant = getOctant(centroid, box_in);
- out->leafTupleDatums[i] = Box3DPGetDatum(box);
+ out->leafTupleDatums[i] = Box3DPGetDatum(box_in);
out->mapTuplesToNodes[i] = octant;
}
diff --git a/postgis/mvt.c b/postgis/mvt.c
index d35514952..8aa916052 100644
--- a/postgis/mvt.c
+++ b/postgis/mvt.c
@@ -1109,9 +1109,9 @@ static bytea *mvt_ctx_to_bytea(mvt_agg_context *ctx)
/* Zero features => empty bytea output */
if (ctx && ctx->layer && ctx->layer->n_features == 0)
{
- ba = palloc(VARHDRSZ);
- SET_VARSIZE(ba, VARHDRSZ);
- return ba;
+ bytea* ba_empty = palloc(VARHDRSZ);
+ SET_VARSIZE(ba_empty, VARHDRSZ);
+ return ba_empty;
}
/* Serialize the Tile */
-----------------------------------------------------------------------
Summary of changes:
extensions/address_standardizer/gamma.c | 2 +-
loader/shp2pgsql-core.c | 21 +++++++++++----------
postgis/gserialized_spgist_3d.c | 23 +++++++++++------------
postgis/mvt.c | 6 +++---
4 files changed, 26 insertions(+), 26 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list