[postgis-tickets] [SCM] PostGIS branch master updated. 3.3.0alpha1-55-g650293b85

git at osgeo.org git at osgeo.org
Wed Jun 15 12:25:45 PDT 2022


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  650293b850a4c4a027f8cf55ee6e937350fb6be4 (commit)
       via  99e3ce177a0c110077d4d6f1e6ee1010ab6839c8 (commit)
       via  32cf5897fca31c0cabf109e44f7b0cdf9cddd1ca (commit)
       via  31187e414ac212e04dfec3a69153c115a72725ff (commit)
       via  4b464e6d7a4d3cb925e9bfc5cc5edb4744a95104 (commit)
       via  648a20d6eb3b20180495f404b03cbfc5316cb3b8 (commit)
      from  c31450b6430f651817c2e15c7aba1454a58aa6f3 (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 650293b850a4c4a027f8cf55ee6e937350fb6be4
Merge: c31450b64 99e3ce177
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Wed Jun 15 12:25:39 2022 -0700

    Merge branch 'lbartoletti-fix_unused_variable'


commit 99e3ce177a0c110077d4d6f1e6ee1010ab6839c8
Author: Loïc Bartoletti <loic.bartoletti at oslandia.com>
Date:   Wed Jun 15 15:52:02 2022 +0200

    fix std_pg_hash: declaration-after-statement

diff --git a/extensions/address_standardizer/std_pg_hash.c b/extensions/address_standardizer/std_pg_hash.c
index 20a02252b..06907af0f 100644
--- a/extensions/address_standardizer/std_pg_hash.c
+++ b/extensions/address_standardizer/std_pg_hash.c
@@ -616,7 +616,6 @@ static int load_lex(LEXICON *lex, char *tab)
 
     int ntuples;
     int total_tuples = 0;
-    (void) total_tuples; // avoid an unused variable warning.
 
     lex_columns_t lex_columns = {.seq = -1, .word = -1, .stdword = -1, .token = -1};
 
@@ -708,6 +707,9 @@ static int load_lex(LEXICON *lex, char *tab)
     ELAPSED_T(t1, t2);
     DBG("Time to read %i lexicon records: %.1f ms.", total_tuples, elapsed);
 
+    (void) total_tuples; // avoid an unused variable warning.
+                         // must be after declaration to pet -Werror=declaration-after-statement
+
     return 0;
 }
 
@@ -743,7 +745,6 @@ static int load_rules(RULES *rules, char *tab)
 
     int ntuples;
     int total_tuples = 0;
-    (void) total_tuples; // avoid an unused variable warning.
 
     rules_columns_t rules_columns = {.rule = -1};
 
@@ -838,6 +839,8 @@ static int load_rules(RULES *rules, char *tab)
     ELAPSED_T(t1, t2);
     DBG("Time to read %i rule records: %.1f ms.", total_tuples, elapsed);
 
+    (void) total_tuples; // avoid an unused variable warning.
+                         // must be after declaration to pet -Werror=declaration-after-statement
     return 0;
 }
 

commit 32cf5897fca31c0cabf109e44f7b0cdf9cddd1ca
Author: Loïc Bartoletti <loic.bartoletti at oslandia.com>
Date:   Wed Jun 15 15:07:53 2022 +0200

    gserialized_estimate.c: fix and remove unused variable

diff --git a/postgis/gserialized_estimate.c b/postgis/gserialized_estimate.c
index eee95e0f4..b25f4698c 100644
--- a/postgis/gserialized_estimate.c
+++ b/postgis/gserialized_estimate.c
@@ -588,7 +588,7 @@ nd_box_init_bounds(ND_BOX *a)
 static void
 nd_box_from_gbox(const GBOX *gbox, ND_BOX *nd_box)
 {
-	int d = 0;
+	volatile int d = 0;
 	POSTGIS_DEBUGF(3, " %s", gbox_to_string(gbox));
 
 	nd_box_init(nd_box);
@@ -724,7 +724,6 @@ nd_box_ratio(const ND_BOX *b1, const ND_BOX *b2, int ndims)
 	bool covered = true;
 	double ivol = 1.0;
 	double vol2 = 1.0;
-	double vol1 = 1.0;
 
 	for ( d = 0 ; d < ndims; d++ )
 	{
@@ -740,11 +739,9 @@ nd_box_ratio(const ND_BOX *b1, const ND_BOX *b2, int ndims)
 
 	for ( d = 0; d < ndims; d++ )
 	{
-		double width1 = b1->max[d] - b1->min[d];
 		double width2 = b2->max[d] - b2->min[d];
 		double imin, imax, iwidth;
 
-		vol1 *= width1;
 		vol2 *= width2;
 
 		imin = Max(b1->min[d], b2->min[d]);
@@ -1389,7 +1386,6 @@ compute_gserialized_stats_mode(VacAttrStats *stats, AnalyzeAttrFetchFunc fetchfu
 	size_t    nd_stats_size;           /* Size to allocate */
 
 	double total_width = 0;            /* # of bytes used by sample */
-	double total_sample_volume = 0;    /* Area/volume coverage of the sample */
 	double total_cell_count = 0;       /* # of cells in histogram affected by sample */
 
 	ND_BOX sum;                        /* Sum of extents of sample boxes */
@@ -1734,7 +1730,6 @@ compute_gserialized_stats_mode(VacAttrStats *stats, AnalyzeAttrFetchFunc fetchfu
 		int at[ND_DIMS];
 		int d;
 		double num_cells = 0;
-		double tmp_volume = 1.0;
 		double min[ND_DIMS] = {0.0, 0.0, 0.0, 0.0};
 		double max[ND_DIMS] = {0.0, 0.0, 0.0, 0.0};
 		double cellsize[ND_DIMS] = {0.0, 0.0, 0.0, 0.0};
@@ -1760,14 +1755,8 @@ compute_gserialized_stats_mode(VacAttrStats *stats, AnalyzeAttrFetchFunc fetchfu
 			min[d] = nd_stats->extent.min[d];
 			max[d] = nd_stats->extent.max[d];
 			cellsize[d] = (max[d] - min[d])/(nd_stats->size[d]);
-
-			/* What's the volume (area) of this feature's box? */
-			tmp_volume *= (nd_box->max[d] - nd_box->min[d]);
 		}
 
-		/* Add feature volume (area) to our total */
-		total_sample_volume += tmp_volume;
-
 		/*
 		 * Move through all the overlaped histogram cells values and
 		 * add the box overlap proportion to them.

commit 31187e414ac212e04dfec3a69153c115a72725ff
Author: Loïc Bartoletti <loic.bartoletti at oslandia.com>
Date:   Wed Jun 15 15:07:22 2022 +0200

    address_standardizer/std_pg_hash.c: fix unused variable warning. These variables are used.

diff --git a/extensions/address_standardizer/std_pg_hash.c b/extensions/address_standardizer/std_pg_hash.c
index da2f18974..20a02252b 100644
--- a/extensions/address_standardizer/std_pg_hash.c
+++ b/extensions/address_standardizer/std_pg_hash.c
@@ -616,6 +616,7 @@ static int load_lex(LEXICON *lex, char *tab)
 
     int ntuples;
     int total_tuples = 0;
+    (void) total_tuples; // avoid an unused variable warning.
 
     lex_columns_t lex_columns = {.seq = -1, .word = -1, .stdword = -1, .token = -1};
 
@@ -742,6 +743,7 @@ static int load_rules(RULES *rules, char *tab)
 
     int ntuples;
     int total_tuples = 0;
+    (void) total_tuples; // avoid an unused variable warning.
 
     rules_columns_t rules_columns = {.rule = -1};
 

commit 4b464e6d7a4d3cb925e9bfc5cc5edb4744a95104
Author: Loïc Bartoletti <loic.bartoletti at oslandia.com>
Date:   Wed Jun 15 15:04:24 2022 +0200

    loader/shpopen.c: remove unused variable 'nCurrentRecordOffset'

diff --git a/loader/shpopen.c b/loader/shpopen.c
index 11693c0b8..4d12d2692 100644
--- a/loader/shpopen.c
+++ b/loader/shpopen.c
@@ -704,7 +704,6 @@ SHPRestoreSHX ( const char * pszLayer, const char * pszAccess, SAHooks *psHooks
     int             nLenWithoutExtension;
     unsigned int    nSHPFilesize;
 
-    unsigned int    nCurrentRecordOffset = 0;
     unsigned int    nCurrentSHPOffset = 100;
     size_t          nRealSHXContentSize = 100;
 
@@ -837,7 +836,6 @@ SHPRestoreSHX ( const char * pszLayer, const char * pszAccess, SAHooks *psHooks
             if ( !bBigEndian ) SwapWord( 4, &nRecordOffset );
             if ( !bBigEndian ) SwapWord( 4, &nRecordLength );
             nRecordOffset += nRecordLength + 4;
-            nCurrentRecordOffset += 8;
             nCurrentSHPOffset += 8 + nRecordLength * 2;
 
             psHooks->FSeek( fpSHP, nCurrentSHPOffset, 0 );

commit 648a20d6eb3b20180495f404b03cbfc5316cb3b8
Author: Loïc Bartoletti <loic.bartoletti at oslandia.com>
Date:   Wed Jun 15 14:19:53 2022 +0200

    parseaddress-api.c: remove unused variable 'comma'

diff --git a/extensions/address_standardizer/parseaddress-api.c b/extensions/address_standardizer/parseaddress-api.c
index 41efcf231..f88f830c1 100644
--- a/extensions/address_standardizer/parseaddress-api.c
+++ b/extensions/address_standardizer/parseaddress-api.c
@@ -173,7 +173,6 @@ ADDRESS *parseaddress(HHash *stH, char *s, int *reterr)
     int mi;
     size_t ui, uj;
     int rc;
-    int comma = 0;
     ADDRESS *ret;
 #ifdef USE_HSEARCH
     ENTRY e, *ep;
@@ -208,7 +207,7 @@ ADDRESS *parseaddress(HHash *stH, char *s, int *reterr)
     s[uj] = '\0';
 
     /* clean trailing punctuation */
-    comma |= clean_trailing_punct(s);
+    (void)clean_trailing_punct(s);
 
     /* assume country code is US */
 
@@ -227,7 +226,6 @@ ADDRESS *parseaddress(HHash *stH, char *s, int *reterr)
         }
         /* truncate the postalcode off the string */
         *(s+ovect[0]) = '\0';
-        comma = 0;
     }
     /* get canada zipcode components */
     else {
@@ -238,12 +236,11 @@ ADDRESS *parseaddress(HHash *stH, char *s, int *reterr)
             strcpy(ret->cc, "CA");
             /* truncate the postalcode off the string */
             *(s+ovect[0]) = '\0';
-            comma = 0;
         }
     }
 
     /* clean trailing punctuation */
-    comma |= clean_trailing_punct(s);
+    (void)clean_trailing_punct(s);
 
     /* get state components */
 
@@ -285,11 +282,10 @@ ADDRESS *parseaddress(HHash *stH, char *s, int *reterr)
             strcpy(ret->cc, "CA");
             // if (ret->cc) printf("  CC: %s\n", ret->cc);
         }
-        comma = 0;
     }
 
     /* clean trailing punctuation */
-    comma |= clean_trailing_punct(s);
+    (void)clean_trailing_punct(s);
 
     /* get city components */
 

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

Summary of changes:
 extensions/address_standardizer/parseaddress-api.c | 10 +++-------
 extensions/address_standardizer/std_pg_hash.c      |  5 +++++
 loader/shpopen.c                                   |  2 --
 postgis/gserialized_estimate.c                     | 13 +------------
 4 files changed, 9 insertions(+), 21 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list