[postgis-tickets] r16377 - Address warnings across liblwgeom/ and postgis/

Darafei komzpa at gmail.com
Tue Feb 13 05:08:25 PST 2018


Author: komzpa
Date: 2018-02-13 05:08:25 -0800 (Tue, 13 Feb 2018)
New Revision: 16377

Modified:
   trunk/liblwgeom/cunit/cu_in_geojson.c
   trunk/liblwgeom/cunit/cu_triangulate.c
   trunk/liblwgeom/effectivearea.c
   trunk/liblwgeom/lwgeodetic_tree.c
   trunk/liblwgeom/lwgeom_topo.c
   trunk/liblwgeom/lwhomogenize.c
   trunk/liblwgeom/lwin_geojson.c
   trunk/liblwgeom/lwin_wkt_parse.c
   trunk/liblwgeom/lwin_wkt_parse.y
   trunk/liblwgeom/lwlinearreferencing.c
   trunk/liblwgeom/lwout_svg.c
   trunk/liblwgeom/lwout_x3d.c
   trunk/liblwgeom/lwprint.c
   trunk/liblwgeom/lwstroke.c
   trunk/liblwgeom/measures.c
   trunk/postgis/brin_nd.c
   trunk/postgis/gserialized_estimate.c
   trunk/postgis/lwgeom_accum.c
   trunk/postgis/lwgeom_backend_api.c
   trunk/postgis/lwgeom_functions_basic.c
   trunk/postgis/lwgeom_in_geohash.c
   trunk/postgis/lwgeom_in_gml.c
   trunk/postgis/mvt.c
Log:
Address warnings across liblwgeom/ and postgis/

Patch by Raúl Marín Rodríguez

Closes https://github.com/postgis/postgis/pull/207
Closes #4014


Modified: trunk/liblwgeom/cunit/cu_in_geojson.c
===================================================================
--- trunk/liblwgeom/cunit/cu_in_geojson.c	2018-02-10 21:08:18 UTC (rev 16376)
+++ trunk/liblwgeom/cunit/cu_in_geojson.c	2018-02-13 13:08:25 UTC (rev 16377)
@@ -18,7 +18,7 @@
 #include "liblwgeom_internal.h"
 #include "cu_tester.h"
 
-static void do_geojson_test(const char * exp, char * in, char * exp_srs, int precision, int has_bbox)
+static void do_geojson_test(const char * exp, char * in, char * exp_srs)
 {
 	LWGEOM *g;
 	char * h = NULL;
@@ -71,37 +71,37 @@
 	do_geojson_test(
 	    "LINESTRING(0 1,2 3,4 5)",
 	    "{\"type\":\"LineString\",\"crs\":{\"type\":\"name\",\"properties\":{\"name\":\"EPSG:4326\"}},\"coordinates\":[[0,1],[2,3],[4,5]]}",
-	    "EPSG:4326", 0, 0);
+	    "EPSG:4326");
 
 	/* Polygon */
 	do_geojson_test(
 	    "POLYGON((0 1,2 3,4 5,0 1))",
 	    "{\"type\":\"Polygon\",\"crs\":{\"type\":\"name\",\"properties\":{\"name\":\"EPSG:4326\"}},\"coordinates\":[[[0,1],[2,3],[4,5],[0,1]]]}",
-	    "EPSG:4326", 0, 0);
+	    "EPSG:4326");
 
 	/* Polygon - with internal ring */
 	do_geojson_test(
 	    "POLYGON((0 1,2 3,4 5,0 1),(6 7,8 9,10 11,6 7))",
 	    "{\"type\":\"Polygon\",\"crs\":{\"type\":\"name\",\"properties\":{\"name\":\"EPSG:4326\"}},\"coordinates\":[[[0,1],[2,3],[4,5],[0,1]],[[6,7],[8,9],[10,11],[6,7]]]}",
-	    "EPSG:4326", 0, 0);
+	    "EPSG:4326");
 
 	/* Multiline */
 	do_geojson_test(
 	    "MULTILINESTRING((0 1,2 3,4 5),(6 7,8 9,10 11))",
 	    "{\"type\":\"MultiLineString\",\"crs\":{\"type\":\"name\",\"properties\":{\"name\":\"EPSG:4326\"}},\"coordinates\":[[[0,1],[2,3],[4,5]],[[6,7],[8,9],[10,11]]]}",
-	    "EPSG:4326", 0, 0);
+	    "EPSG:4326");
 
 	/* MultiPolygon */
 	do_geojson_test(
 	    "MULTIPOLYGON(((0 1,2 3,4 5,0 1)),((6 7,8 9,10 11,6 7)))",
 	    "{\"type\":\"MultiPolygon\",\"crs\":{\"type\":\"name\",\"properties\":{\"name\":\"EPSG:4326\"}},\"coordinates\":[[[[0,1],[2,3],[4,5],[0,1]]],[[[6,7],[8,9],[10,11],[6,7]]]]}",
-	    "EPSG:4326", 0, 0);
+	    "EPSG:4326");
 
 	/* Empty GeometryCollection */
 	do_geojson_test(
 	    "GEOMETRYCOLLECTION EMPTY",
 	    "{\"type\":\"GeometryCollection\",\"crs\":{\"type\":\"name\",\"properties\":{\"name\":\"EPSG:4326\"}},\"geometries\":[]}",
-	    "EPSG:4326", 0, 0);
+	    "EPSG:4326");
 }
 
 static void in_geojson_test_bbox(void)
@@ -110,43 +110,43 @@
 	do_geojson_test(
 	    "LINESTRING(0 1,2 3,4 5)",
 	    "{\"type\":\"LineString\",\"bbox\":[0,1,4,5],\"coordinates\":[[0,1],[2,3],[4,5]]}",
-	    NULL, 0, 1);
+	    NULL);
 
 	/* Polygon */
 	do_geojson_test(
 	    "POLYGON((0 1,2 3,4 5,0 1))",
 	    "{\"type\":\"Polygon\",\"bbox\":[0,1,4,5],\"coordinates\":[[[0,1],[2,3],[4,5],[0,1]]]}",
-	    NULL, 0, 1);
+	    NULL);
 
 	/* Polygon - with internal ring */
 	do_geojson_test(
 	    "POLYGON((0 1,2 3,4 5,0 1),(6 7,8 9,10 11,6 7))",
 	    "{\"type\":\"Polygon\",\"bbox\":[0,1,4,5],\"coordinates\":[[[0,1],[2,3],[4,5],[0,1]],[[6,7],[8,9],[10,11],[6,7]]]}",
-	    NULL, 0, 1);
+	    NULL);
 
 	/* Multiline */
 	do_geojson_test(
 	    "MULTILINESTRING((0 1,2 3,4 5),(6 7,8 9,10 11))",
 	    "{\"type\":\"MultiLineString\",\"bbox\":[0,1,10,11],\"coordinates\":[[[0,1],[2,3],[4,5]],[[6,7],[8,9],[10,11]]]}",
-	    NULL, 0, 1);
+	    NULL);
 
 	/* MultiPolygon */
 	do_geojson_test(
 	    "MULTIPOLYGON(((0 1,2 3,4 5,0 1)),((6 7,8 9,10 11,6 7)))",
 	    "{\"type\":\"MultiPolygon\",\"bbox\":[0,1,10,11],\"coordinates\":[[[[0,1],[2,3],[4,5],[0,1]]],[[[6,7],[8,9],[10,11],[6,7]]]]}",
-	    NULL, 0, 1);
+	    NULL);
 
 	/* GeometryCollection */
 	do_geojson_test(
 	    "GEOMETRYCOLLECTION(LINESTRING(0 1,-1 3),LINESTRING(2 3,4 5))",
 	    "{\"type\":\"GeometryCollection\",\"bbox\":[-1,1,4,5],\"geometries\":[{\"type\":\"LineString\",\"coordinates\":[[0,1],[-1,3]]},{\"type\":\"LineString\",\"coordinates\":[[2,3],[4,5]]}]}",
-	    NULL, 0, 1);
+	    NULL);
 
 	/* Empty GeometryCollection */
 	do_geojson_test(
 	    "GEOMETRYCOLLECTION EMPTY",
 	    "{\"type\":\"GeometryCollection\",\"geometries\":[]}",
-	    NULL, 0, 1);
+	    NULL);
 }
 
 static void in_geojson_test_geoms(void)
@@ -155,50 +155,50 @@
 	do_geojson_test(
 	    "LINESTRING(0 1,2 3,4 5)",
 	    "{\"type\":\"LineString\",\"coordinates\":[[0,1],[2,3],[4,5]]}",
-	    NULL, 0, 0);
+	    NULL);
 
 	/* Polygon */
 	do_geojson_test(
 	    "POLYGON((0 1,2 3,4 5,0 1))",
 	    "{\"type\":\"Polygon\",\"coordinates\":[[[0,1],[2,3],[4,5],[0,1]]]}",
-	    NULL, 0, 0);
+	    NULL);
 
 	/* Polygon - with internal ring */
 	do_geojson_test(
 	    "POLYGON((0 1,2 3,4 5,0 1),(6 7,8 9,10 11,6 7))",
 	    "{\"type\":\"Polygon\",\"coordinates\":[[[0,1],[2,3],[4,5],[0,1]],[[6,7],[8,9],[10,11],[6,7]]]}",
-	    NULL, 0, 0);
+	    NULL);
 
 	/* Multiline */
 	do_geojson_test(
 	    "MULTILINESTRING((0 1,2 3,4 5),(6 7,8 9,10 11))",
 	    "{\"type\":\"MultiLineString\",\"coordinates\":[[[0,1],[2,3],[4,5]],[[6,7],[8,9],[10,11]]]}",
-	    NULL, 0, 0);
+	    NULL);
 
 	/* MultiPolygon */
 	do_geojson_test(
 	    "MULTIPOLYGON(((0 1,2 3,4 5,0 1)),((6 7,8 9,10 11,6 7)))",
 	    "{\"type\":\"MultiPolygon\",\"coordinates\":[[[[0,1],[2,3],[4,5],[0,1]]],[[[6,7],[8,9],[10,11],[6,7]]]]}",
-	    NULL, 0, 0);
+	    NULL);
 
 	/* MultiPolygon with internal rings */
 	/* See http://trac.osgeo.org/postgis/ticket/2216 */
 	do_geojson_test(
 	    "MULTIPOLYGON(((4 0,0 -4,-4 0,0 4,4 0),(2 0,0 2,-2 0,0 -2,2 0)),((24 0,20 -4,16 0,20 4,24 0),(22 0,20 2,18 0,20 -2,22 0)),((44 0,40 -4,36 0,40 4,44 0),(42 0,40 2,38 0,40 -2,42 0)))",
 	    "{'type':'MultiPolygon','coordinates':[[[[4,0],[0,-4],[-4,0],[0,4],[4,0]],[[2,0],[0,2],[-2,0],[0,-2],[2,0]]],[[[24,0],[20,-4],[16,0],[20,4],[24,0]],[[22,0],[20,2],[18,0],[20,-2],[22,0]]],[[[44,0],[40,-4],[36,0],[40,4],[44,0]],[[42,0],[40,2],[38,0],[40,-2],[42,0]]]]}",
-	    NULL, 0, 0);
+	    NULL);
 
 	/* GeometryCollection */
 	do_geojson_test(
 	    "GEOMETRYCOLLECTION(POINT(0 1),LINESTRING(2 3,4 5))",
 	    "{\"type\":\"GeometryCollection\",\"geometries\":[{\"type\":\"Point\",\"coordinates\":[0,1]},{\"type\":\"LineString\",\"coordinates\":[[2,3],[4,5]]}]}",
-	    NULL, 0, 0);
+	    NULL);
 
 	/* Empty GeometryCollection */
 	do_geojson_test(
 	    "GEOMETRYCOLLECTION EMPTY",
 	    "{\"type\":\"GeometryCollection\",\"geometries\":[]}",
-	    NULL, 0, 0);
+	    NULL);
 }
 
 /*

Modified: trunk/liblwgeom/cunit/cu_triangulate.c
===================================================================
--- trunk/liblwgeom/cunit/cu_triangulate.c	2018-02-10 21:08:18 UTC (rev 16376)
+++ trunk/liblwgeom/cunit/cu_triangulate.c	2018-02-13 13:08:25 UTC (rev 16377)
@@ -87,7 +87,7 @@
 static void assert_empty_diagram(char* wkt, double tolerance)
 {
 	LWGEOM* in = lwgeom_from_wkt(wkt, LW_PARSER_CHECK_NONE);
-	LWGEOM* out = lwgeom_voronoi_diagram(in, NULL, 0, 0);
+	LWGEOM* out = lwgeom_voronoi_diagram(in, NULL, tolerance, 0);
 
 	CU_ASSERT_TRUE(lwgeom_is_collection(out));
 	CU_ASSERT_EQUAL(COLLECTIONTYPE, lwgeom_get_type(out));

Modified: trunk/liblwgeom/effectivearea.c
===================================================================
--- trunk/liblwgeom/effectivearea.c	2018-02-10 21:08:18 UTC (rev 16376)
+++ trunk/liblwgeom/effectivearea.c	2018-02-13 13:08:25 UTC (rev 16377)
@@ -166,7 +166,7 @@
 
 Sift Up
 */
-static void up(MINHEAP *tree,areanode *arealist,int c)
+static void up(MINHEAP *tree, __attribute__((__unused__)) areanode *e,int c)
 {
 	LWDEBUG(2, "Entered  up");
 	void *tmp;

Modified: trunk/liblwgeom/lwgeodetic_tree.c
===================================================================
--- trunk/liblwgeom/lwgeodetic_tree.c	2018-02-10 21:08:18 UTC (rev 16376)
+++ trunk/liblwgeom/lwgeodetic_tree.c	2018-02-13 13:08:25 UTC (rev 16377)
@@ -624,7 +624,7 @@
 static void
 circ_internal_nodes_sort(CIRC_NODE **nodes, uint32_t num_nodes, const CIRC_NODE *target_node)
 {
-	int i;
+	uint32_t i;
 	struct sort_node sort_nodes[CIRC_NODE_SIZE];
 
 	/* Copy incoming nodes into sorting array and calculate */

Modified: trunk/liblwgeom/lwgeom_topo.c
===================================================================
--- trunk/liblwgeom/lwgeom_topo.c	2018-02-10 21:08:18 UTC (rev 16376)
+++ trunk/liblwgeom/lwgeom_topo.c	2018-02-13 13:08:25 UTC (rev 16377)
@@ -6329,7 +6329,7 @@
 #define LWT_HOLES_FACE_PLACEHOLDER INT32_MIN
 
 static int
-_lwt_FetchNextUnvisitedEdge(LWT_TOPOLOGY *topo, LWT_ISO_EDGE_TABLE *etab, int from)
+_lwt_FetchNextUnvisitedEdge(__attribute__((__unused__)) LWT_TOPOLOGY *topo, LWT_ISO_EDGE_TABLE *etab, int from)
 {
   while (
     from < etab->size &&
@@ -6458,7 +6458,7 @@
  * @param side 1 for left side, -1 for right side
  */
 static LWT_EDGERING *
-_lwt_BuildEdgeRing(LWT_TOPOLOGY *topo, LWT_ISO_EDGE_TABLE *edges,
+_lwt_BuildEdgeRing(__attribute__((__unused__)) LWT_TOPOLOGY *topo, LWT_ISO_EDGE_TABLE *edges,
                    LWT_ISO_EDGE *edge, int side)
 {
   LWT_EDGERING *ring;

Modified: trunk/liblwgeom/lwhomogenize.c
===================================================================
--- trunk/liblwgeom/lwhomogenize.c	2018-02-10 21:08:18 UTC (rev 16376)
+++ trunk/liblwgeom/lwhomogenize.c	2018-02-13 13:08:25 UTC (rev 16377)
@@ -104,9 +104,11 @@
 				/* Increment count for this singleton type */
 				buffer->cnt[geom->type] = buffer->cnt[geom->type] + 1;
 			}
+			/* FALLTHROUGH */
 			default:
 			{
 				lwcollection_build_buffer(lwgeom_as_lwcollection(geom), buffer);
+				break;
 			}
 		}
 	}

Modified: trunk/liblwgeom/lwin_geojson.c
===================================================================
--- trunk/liblwgeom/lwin_geojson.c	2018-02-10 21:08:18 UTC (rev 16376)
+++ trunk/liblwgeom/lwin_geojson.c	2018-02-13 13:08:25 UTC (rev 16377)
@@ -52,7 +52,7 @@
 
 #include <string.h>
 
-static void geojson_lwerror(char *msg, int error_code)
+static void geojson_lwerror(char *msg, __attribute__((__unused__)) int error_code)
 {
 	LWDEBUGF(3, "lwgeom_from_geojson ERROR %i", error_code);
 	lwerror("%s", msg);

Modified: trunk/liblwgeom/lwin_wkt_parse.c
===================================================================
--- trunk/liblwgeom/lwin_wkt_parse.c	2018-02-10 21:08:18 UTC (rev 16376)
+++ trunk/liblwgeom/lwin_wkt_parse.c	2018-02-13 13:08:25 UTC (rev 16377)
@@ -124,7 +124,7 @@
 * from WKT_ERROR in the grammar, but we keep this one
 * around just in case.
 */
-void wkt_yyerror(const char *str)
+void wkt_yyerror(__attribute__((__unused__)) const char *str)
 {
 	/* If we haven't already set a message and location, let's set one now. */
 	if ( ! global_parser_result.message )

Modified: trunk/liblwgeom/lwin_wkt_parse.y
===================================================================
--- trunk/liblwgeom/lwin_wkt_parse.y	2018-02-10 21:08:18 UTC (rev 16376)
+++ trunk/liblwgeom/lwin_wkt_parse.y	2018-02-13 13:08:25 UTC (rev 16377)
@@ -27,7 +27,7 @@
 * from WKT_ERROR in the grammar, but we keep this one 
 * around just in case.
 */
-void wkt_yyerror(const char *str)
+void wkt_yyerror(__attribute__((__unused__)) const char *str)
 {
 	/* If we haven't already set a message and location, let's set one now. */
 	if ( ! global_parser_result.message ) 

Modified: trunk/liblwgeom/lwlinearreferencing.c
===================================================================
--- trunk/liblwgeom/lwlinearreferencing.c	2018-02-10 21:08:18 UTC (rev 16376)
+++ trunk/liblwgeom/lwlinearreferencing.c	2018-02-13 13:08:25 UTC (rev 16377)
@@ -180,7 +180,7 @@
 }
 
 static LWMPOINT*
-lwpoint_locate_along(const LWPOINT *lwpoint, double m, double offset)
+lwpoint_locate_along(const LWPOINT *lwpoint, double m, __attribute__((__unused__)) double offset)
 {
 	double point_m = lwpoint_get_m(lwpoint);
 	LWGEOM *lwg = lwpoint_as_lwgeom(lwpoint);
@@ -193,7 +193,7 @@
 }
 
 static LWMPOINT*
-lwmpoint_locate_along(const LWMPOINT *lwin, double m, double offset)
+lwmpoint_locate_along(const LWMPOINT *lwin, double m, __attribute__((__unused__)) double offset)
 {
 	LWGEOM *lwg = lwmpoint_as_lwgeom(lwin);
 	LWMPOINT *lwout = NULL;

Modified: trunk/liblwgeom/lwout_svg.c
===================================================================
--- trunk/liblwgeom/lwout_svg.c	2018-02-10 21:08:18 UTC (rev 16376)
+++ trunk/liblwgeom/lwout_svg.c	2018-02-13 13:08:25 UTC (rev 16377)
@@ -104,7 +104,7 @@
  */
 
 static size_t
-assvg_point_size(const LWPOINT *point, int circle, int precision)
+assvg_point_size(__attribute__((__unused__)) const LWPOINT *point, int circle, int precision)
 {
 	size_t size;
 
@@ -153,7 +153,7 @@
  */
 
 static size_t
-assvg_line_size(const LWLINE *line, int relative, int precision)
+assvg_line_size(const LWLINE *line, __attribute__((__unused__)) int relative, int precision)
 {
 	size_t size;
 
@@ -197,7 +197,7 @@
  */
 
 static size_t
-assvg_polygon_size(const LWPOLY *poly, int relative, int precision)
+assvg_polygon_size(const LWPOLY *poly, __attribute__((__unused__)) int relative, int precision)
 {
 	uint32_t i;
 	size_t size=0;

Modified: trunk/liblwgeom/lwout_x3d.c
===================================================================
--- trunk/liblwgeom/lwout_x3d.c	2018-02-10 21:08:18 UTC (rev 16376)
+++ trunk/liblwgeom/lwout_x3d.c	2018-02-13 13:08:25 UTC (rev 16377)
@@ -111,7 +111,8 @@
 }
 
 static int
-asx3d3_point_sb(const LWPOINT *point, char *srs, int precision, int opts, const char *defid, stringbuffer_t *sb)
+asx3d3_point_sb(const LWPOINT *point, __attribute__((__unused__)) char *srs, int precision,
+		int opts, __attribute__((__unused__)) const char *defid, stringbuffer_t *sb)
 {
 	/** for point we just output the coordinates **/
 	return ptarray_to_x3d3_sb(point->point, precision, opts, 0, sb);
@@ -215,7 +216,8 @@
 
 /** Return the linestring as an X3D LineSet */
 static int
-asx3d3_line_sb(const LWLINE *line, char *srs, int precision, int opts, const char *defid, stringbuffer_t *sb)
+asx3d3_line_sb(const LWLINE *line, __attribute__((__unused__)) char *srs, int precision,
+	       int opts, __attribute__((__unused__)) const char *defid, stringbuffer_t *sb)
 {
 
 	/* int dimension=2; */
@@ -241,7 +243,8 @@
 
 /** Compute the X3D coordinates of the polygon and add to string buffer **/
 static int
-asx3d3_poly_sb(const LWPOLY *poly, char *srs, int precision, int opts, int is_patch, const char *defid, stringbuffer_t *sb)
+asx3d3_poly_sb(const LWPOLY *poly, __attribute__((__unused__))  char *srs, int precision,
+	       int opts, __attribute__((__unused__)) int is_patch, __attribute__((__unused__)) const char *defid, stringbuffer_t *sb)
 {
 	uint32_t i;
 	for (i=0; i<poly->nrings; i++)
@@ -253,7 +256,8 @@
 }
 
 static int
-asx3d3_triangle_sb(const LWTRIANGLE *triangle, char *srs, int precision, int opts, const char *defid, stringbuffer_t *sb)
+asx3d3_triangle_sb(const LWTRIANGLE *triangle, __attribute__((__unused__))  char *srs, int precision,
+		   int opts, __attribute__((__unused__))  const char *defid, stringbuffer_t *sb)
 {
 	return  ptarray_to_x3d3_sb(triangle->points, precision, opts, 1, sb);
 }
@@ -263,7 +267,7 @@
  * Don't call this with single-geoms inspected!
  */
 static int
-asx3d3_multi_sb(const LWCOLLECTION *col, char *srs, int precision, int opts, const char *defid, stringbuffer_t *sb)
+asx3d3_multi_sb(const LWCOLLECTION *col, __attribute__((__unused__)) char *srs, int precision, int opts, const char *defid, stringbuffer_t *sb)
 {
 	char *x3dtype;
 	uint32_t i;
@@ -395,7 +399,7 @@
  * Computes X3D representation of TIN (as IndexedTriangleSet and adds to string buffer)
  */
 static int
-asx3d3_tin_sb(const LWTIN *tin, char *srs,  int precision, int opts, const char *defid, stringbuffer_t *sb)
+asx3d3_tin_sb(const LWTIN *tin, __attribute__((__unused__)) char *srs,  int precision, int opts, const char *defid, stringbuffer_t *sb)
 {
 	uint32_t i;
 	uint32_t k;

Modified: trunk/liblwgeom/lwprint.c
===================================================================
--- trunk/liblwgeom/lwprint.c	2018-02-10 21:08:18 UTC (rev 16376)
+++ trunk/liblwgeom/lwprint.c	2018-02-13 13:08:25 UTC (rev 16377)
@@ -505,7 +505,7 @@
 	{
 		length = snprintf(buf, bufsize, "%g", d);
 	}
-	assert(length < bufsize);
+	assert(length < (int) bufsize);
 	trim_trailing_zeros(buf);
 	return length;
 }
\ No newline at end of file

Modified: trunk/liblwgeom/lwstroke.c
===================================================================
--- trunk/liblwgeom/lwstroke.c	2018-02-10 21:08:18 UTC (rev 16376)
+++ trunk/liblwgeom/lwstroke.c	2018-02-13 13:08:25 UTC (rev 16377)
@@ -38,7 +38,7 @@
 #include "liblwgeom_internal.h"
 
 
-LWGEOM* pta_unstroke(const POINTARRAY *points, int type, int srid);
+LWGEOM* pta_unstroke(const POINTARRAY *points, int srid);
 LWGEOM* lwline_unstroke(const LWLINE *line);
 LWGEOM* lwpolygon_unstroke(const LWPOLY *poly);
 LWGEOM* lwmline_unstroke(const LWMLINE *mline);
@@ -827,7 +827,7 @@
 }
 
 LWGEOM*
-pta_unstroke(const POINTARRAY *points, int type, int srid)
+pta_unstroke(const POINTARRAY *points, int srid)
 {
 	int i = 0, j, k;
 	POINT4D a1, a2, a3, b;
@@ -994,7 +994,7 @@
 	LWDEBUG(2, "lwline_unstroke called.");
 
 	if ( line->points->npoints < 4 ) return lwline_as_lwgeom(lwline_clone(line));
-	else return pta_unstroke(line->points, line->flags, line->srid);
+	else return pta_unstroke(line->points, line->srid);
 }
 
 LWGEOM *
@@ -1008,7 +1008,7 @@
 	geoms = lwalloc(sizeof(LWGEOM *)*poly->nrings);
 	for (i=0; i<poly->nrings; i++)
 	{
-		geoms[i] = pta_unstroke(poly->rings[i], poly->flags, poly->srid);
+		geoms[i] = pta_unstroke(poly->rings[i], poly->srid);
 		if (geoms[i]->type == CIRCSTRINGTYPE || geoms[i]->type == COMPOUNDTYPE)
 		{
 			hascurve = 1;

Modified: trunk/liblwgeom/measures.c
===================================================================
--- trunk/liblwgeom/measures.c	2018-02-10 21:08:18 UTC (rev 16376)
+++ trunk/liblwgeom/measures.c	2018-02-13 13:08:25 UTC (rev 16377)
@@ -392,6 +392,7 @@
 					return lw_dist2d_point_curvepoly((LWPOINT *)lwg1, (LWCURVEPOLY *)lwg2, dl);
 				default:
 					lwerror("Unsupported geometry type: %s", lwtype_name(t2));
+					return LW_FALSE;
 			}
 		}
 		case LINETYPE:
@@ -412,6 +413,7 @@
 					return lw_dist2d_line_curvepoly((LWLINE *)lwg1, (LWCURVEPOLY *)lwg2, dl);
 				default:
 					lwerror("Unsupported geometry type: %s", lwtype_name(t2));
+					return LW_FALSE;
 			}
 		}
 		case CIRCSTRINGTYPE:
@@ -433,6 +435,7 @@
 					return lw_dist2d_circstring_curvepoly((LWCIRCSTRING *)lwg1, (LWCURVEPOLY *)lwg2, dl);
 				default:
 					lwerror("Unsupported geometry type: %s", lwtype_name(t2));
+					return LW_FALSE;
 			}
 		}
 		case POLYGONTYPE:
@@ -454,6 +457,7 @@
 					return lw_dist2d_poly_curvepoly((LWPOLY *)lwg1, (LWCURVEPOLY *)lwg2, dl);
 				default:
 					lwerror("Unsupported geometry type: %s", lwtype_name(t2));
+					return LW_FALSE;
 			}
 		}
 		case CURVEPOLYTYPE:
@@ -474,16 +478,16 @@
 					return lw_dist2d_curvepoly_curvepoly((LWCURVEPOLY *)lwg1, (LWCURVEPOLY *)lwg2, dl);
 				default:
 					lwerror("Unsupported geometry type: %s", lwtype_name(t2));
+					return LW_FALSE;
 			}
 		}
 		default:
 		{
 			lwerror("Unsupported geometry type: %s", lwtype_name(t1));
+			return LW_FALSE;
 		}
 	}
 
-	/*You shouldn't being able to get here*/
-	lwerror("unspecified error in function lw_dist2d_distribute_bruteforce");
 	return LW_FALSE;
 }
 

Modified: trunk/postgis/brin_nd.c
===================================================================
--- trunk/postgis/brin_nd.c	2018-02-10 21:08:18 UTC (rev 16376)
+++ trunk/postgis/brin_nd.c	2018-02-13 13:08:25 UTC (rev 16377)
@@ -59,8 +59,8 @@
 }
 
 Datum
-gidx_brin_inclusion_add_value(BrinDesc *bdesc, BrinValues *column, Datum newval,
-		bool isnull, int max_dims)
+gidx_brin_inclusion_add_value(__attribute__((__unused__)) BrinDesc *bdesc,
+		BrinValues *column, Datum newval, bool isnull, int max_dims)
 {
 	char gboxmem[GIDX_MAX_SIZE];
 	GIDX *gidx_geom, *gidx_key;

Modified: trunk/postgis/gserialized_estimate.c
===================================================================
--- trunk/postgis/gserialized_estimate.c	2018-02-10 21:08:18 UTC (rev 16376)
+++ trunk/postgis/gserialized_estimate.c	2018-02-13 13:08:25 UTC (rev 16377)
@@ -945,7 +945,7 @@
 		POSTGIS_DEBUGF(2, "searching parent table stats for \"%s\"", get_rel_name(table_oid)? get_rel_name(table_oid) : "NULL");
 		stats_tuple = SearchSysCache3(STATRELATTINH, ObjectIdGetDatum(table_oid), Int16GetDatum(att_num), BoolGetDatum(false));
 		if ( stats_tuple )
-		POSTGIS_DEBUGF(2, "found parent table stats for \"%s\"", get_rel_name(table_oid)? get_rel_name(table_oid) : "NULL");
+			POSTGIS_DEBUGF(2, "found parent table stats for \"%s\"", get_rel_name(table_oid)? get_rel_name(table_oid) : "NULL");
 	}
 	if ( ! stats_tuple )
 	{

Modified: trunk/postgis/lwgeom_accum.c
===================================================================
--- trunk/postgis/lwgeom_accum.c	2018-02-10 21:08:18 UTC (rev 16376)
+++ trunk/postgis/lwgeom_accum.c	2018-02-13 13:08:25 UTC (rev 16377)
@@ -179,7 +179,7 @@
 ** using the PostgreSQL built-in function makeMdArrayResult
 */
 Datum
-pgis_accum_finalfn(pgis_abs *p, MemoryContext mctx, FunctionCallInfo fcinfo)
+pgis_accum_finalfn(pgis_abs *p, MemoryContext mctx, __attribute__((__unused__)) FunctionCallInfo fcinfo)
 {
 	int dims[1];
 	int lbs[1];

Modified: trunk/postgis/lwgeom_backend_api.c
===================================================================
--- trunk/postgis/lwgeom_backend_api.c	2018-02-10 21:08:18 UTC (rev 16376)
+++ trunk/postgis/lwgeom_backend_api.c	2018-02-13 13:08:25 UTC (rev 16377)
@@ -98,7 +98,7 @@
 char* lwgeom_backend_name;
 struct lwgeom_backend_definition* lwgeom_backend = &lwgeom_backends[0];
 
-static void lwgeom_backend_switch( const char* newvalue, void* extra )
+static void lwgeom_backend_switch( const char* newvalue, __attribute__((__unused__)) void* extra )
 {
     int i;
 

Modified: trunk/postgis/lwgeom_functions_basic.c
===================================================================
--- trunk/postgis/lwgeom_functions_basic.c	2018-02-10 21:08:18 UTC (rev 16376)
+++ trunk/postgis/lwgeom_functions_basic.c	2018-02-13 13:08:25 UTC (rev 16377)
@@ -2486,7 +2486,7 @@
 			default: /*always executed*/
 			for (j=0;j<=i;j++)
 				PG_FREE_IF_COPY(seri_geoms[j], j);
-
+			/*FALLTHROUGH*/
 			case 1:
 			lwpgerror("Empty geometry");
 			PG_RETURN_NULL() ;

Modified: trunk/postgis/lwgeom_in_geohash.c
===================================================================
--- trunk/postgis/lwgeom_in_geohash.c	2018-02-10 21:08:18 UTC (rev 16376)
+++ trunk/postgis/lwgeom_in_geohash.c	2018-02-13 13:08:25 UTC (rev 16377)
@@ -35,7 +35,7 @@
 Datum box2d_from_geohash(PG_FUNCTION_ARGS);
 Datum point_from_geohash(PG_FUNCTION_ARGS);
 
-static void geohash_lwpgerror(char *msg, int error_code)
+static void geohash_lwpgerror(char *msg, __attribute__((__unused__)) int error_code)
 {
 	POSTGIS_DEBUGF(3, "ST_Box2dFromGeoHash ERROR %i", error_code);
 	lwpgerror("%s", msg);

Modified: trunk/postgis/lwgeom_in_gml.c
===================================================================
--- trunk/postgis/lwgeom_in_gml.c	2018-02-10 21:08:18 UTC (rev 16376)
+++ trunk/postgis/lwgeom_in_gml.c	2018-02-13 13:08:25 UTC (rev 16377)
@@ -78,7 +78,7 @@
 
 
 
-static void gml_lwpgerror(char *msg, int error_code)
+static void gml_lwpgerror(char *msg, __attribute__((__unused__)) int error_code)
 {
         POSTGIS_DEBUGF(3, "ST_GeomFromGML ERROR %i", error_code);
         lwpgerror("%s", msg);

Modified: trunk/postgis/mvt.c
===================================================================
--- trunk/postgis/mvt.c	2018-02-10 21:08:18 UTC (rev 16376)
+++ trunk/postgis/mvt.c	2018-02-13 13:08:25 UTC (rev 16377)
@@ -103,8 +103,8 @@
 	return (value << 1) ^ (value >> 31);
 }
 
-static uint32_t encode_ptarray(mvt_agg_context *ctx, enum mvt_type type,
-			       POINTARRAY *pa, uint32_t *buffer,
+static uint32_t encode_ptarray(__attribute__((__unused__)) mvt_agg_context *ctx,
+			       enum mvt_type type, POINTARRAY *pa, uint32_t *buffer,
 			       int32_t *px, int32_t *py)
 {
 	uint32_t offset = 0;
@@ -921,12 +921,12 @@
 	return mvt_ctx_to_bytea(ctx);
 }
 
-static void * mvt_allocator(void *data, size_t size)
+static void * mvt_allocator(__attribute__((__unused__)) void *data, size_t size)
 {
 	return palloc(size);
 }
 
-static void mvt_deallocator(void *data, void *ptr)
+static void mvt_deallocator(__attribute__((__unused__)) void *data, void *ptr)
 {
 	return pfree(ptr);
 }



More information about the postgis-tickets mailing list