]> granicus.if.org Git - postgis/commitdiff
Address warnings across liblwgeom/ and postgis/
authorDarafei Praliaskouski <me@komzpa.net>
Tue, 13 Feb 2018 13:08:25 +0000 (13:08 +0000)
committerDarafei Praliaskouski <me@komzpa.net>
Tue, 13 Feb 2018 13:08:25 +0000 (13:08 +0000)
Patch by Raúl Marín Rodríguez

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

git-svn-id: http://svn.osgeo.org/postgis/trunk@16377 b70326c6-7e19-0410-871a-916f4a2858ee

23 files changed:
liblwgeom/cunit/cu_in_geojson.c
liblwgeom/cunit/cu_triangulate.c
liblwgeom/effectivearea.c
liblwgeom/lwgeodetic_tree.c
liblwgeom/lwgeom_topo.c
liblwgeom/lwhomogenize.c
liblwgeom/lwin_geojson.c
liblwgeom/lwin_wkt_parse.c
liblwgeom/lwin_wkt_parse.y
liblwgeom/lwlinearreferencing.c
liblwgeom/lwout_svg.c
liblwgeom/lwout_x3d.c
liblwgeom/lwprint.c
liblwgeom/lwstroke.c
liblwgeom/measures.c
postgis/brin_nd.c
postgis/gserialized_estimate.c
postgis/lwgeom_accum.c
postgis/lwgeom_backend_api.c
postgis/lwgeom_functions_basic.c
postgis/lwgeom_in_geohash.c
postgis/lwgeom_in_gml.c
postgis/mvt.c

index 0f3a0287e64aaabf9ef37e1e1e2c6af8fb32a875..bb3ce749d16a7a09fc4e713e0a9c8239b64a9ff0 100644 (file)
@@ -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 @@ static void in_geojson_test_srid(void)
        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 @@ static void in_geojson_test_bbox(void)
        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 @@ static void in_geojson_test_geoms(void)
        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);
 }
 
 /*
index ed633409bd6fcaa0e786652343ec5620392c9fc7..f2a30a4279e41915549ecf52adb24666367b5534 100644 (file)
@@ -87,7 +87,7 @@ static void test_lwgeom_voronoi_diagram_custom_envelope(void)
 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));
index d756ed60c4af2877fe6eca7a7888030896771694..93fe7d920914d2cf94145a2e7d5f966432d3c99d 100644 (file)
@@ -166,7 +166,7 @@ static void down(MINHEAP *tree,areanode *arealist,int parent)
 
 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;
index 24c66762da16223e5102418242f876950a891020..fe2c5276a8c6c8430b038b1c319906fe57a02354 100644 (file)
@@ -624,7 +624,7 @@ circ_nodes_sort_cmp(const void *a, const void *b)
 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 */
index a11e1ea605b299e66ed54ea408fa15607dc40cb1..ade95ee4eee1db05628eabdfe8a78b91d6111262 100644 (file)
@@ -6329,7 +6329,7 @@ _lwt_EdgeRingIterator_begin(LWT_EDGERING *er)
 #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 @@ _lwt_UpdateEdgeRingSideFace(LWT_TOPOLOGY *topo, LWT_EDGERING *ring,
  * @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;
index 737d4a2dc1deb50cd24e44c9149b75048388f489..047b1e7491bcf8209e4ce6e76fd518584e108339 100644 (file)
@@ -104,9 +104,11 @@ lwcollection_build_buffer(const LWCOLLECTION *col, HomogenizeBuffer *buffer)
                                /* 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;
                        }
                }
        }
index ef907ee799395b95db77f98c2598007384855fd7..f9b4161abd2b0b50c40c6e267415dc14feb5944a 100644 (file)
@@ -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);
index afe816931d4e5b740f3b33a1b6c01832972bd423..d17eb940a8dfbd88aa9c1db8559021ef3c69ab9d 100644 (file)
@@ -124,7 +124,7 @@ int wkt_yydebug = 0;
 * 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 )
index 1ddb06c29d1e87ff463a52453d2e734442a1b388..359725f0b348340f529c7f4d940367f6119520b6 100644 (file)
@@ -27,7 +27,7 @@ int wkt_yydebug = 0;
 * 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 ) 
index 3ecbd77ca6bcaa6df72aceb31d062f8478b7767b..7a22ba9c48adcbe587cd77d6eeb3d12d0a71b184 100644 (file)
@@ -180,7 +180,7 @@ lwmline_locate_along(const LWMLINE *lwmline, double m, double offset)
 }
 
 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 @@ lwpoint_locate_along(const LWPOINT *lwpoint, double m, double offset)
 }
 
 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;
index 2f3bbc5c46be1619030ce7050a8281449ef2cc98..ca1645cdd4b0d4f16bce97e7f18f4d86769f329a 100644 (file)
@@ -104,7 +104,7 @@ lwgeom_to_svg(const LWGEOM *geom, int precision, int relative)
  */
 
 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 @@ assvg_point(const LWPOINT *point, int circle, int precision)
  */
 
 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 @@ assvg_line(const LWLINE *line, int relative, int precision)
  */
 
 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;
index c35599dd833d2dffe51ca56d9a44f0a7e3a3222d..86c88fcadd3ab4e3f6e110b792fc7559846a910f 100644 (file)
@@ -111,7 +111,8 @@ lwgeom_to_x3d3_sb(const LWGEOM *geom, char *srs, int precision, int opts, const
 }
 
 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 @@ asx3d3_mpoly_coordindex_sb(const LWMPOLY *psur, stringbuffer_t *sb)
 
 /** 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 @@ asx3d3_line_sb(const LWLINE *line, char *srs, int precision, int opts, const cha
 
 /** 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 @@ asx3d3_poly_sb(const LWPOLY *poly, char *srs, int precision, int opts, int is_pa
 }
 
 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 @@ asx3d3_triangle_sb(const LWTRIANGLE *triangle, char *srs, int precision, int opt
  * 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 @@ asx3d3_psurface_sb(const LWPSURFACE *psur, char *srs, int precision, int opts, c
  * 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;
index abc07795994ed8c68ca1d568ec33e66f2a87a9a4..7caba5c44def50a81b1bc314615a524eb3719b35 100644 (file)
@@ -505,7 +505,7 @@ lwprint_double(double d, int maxdd, char* buf, size_t bufsize)
        {
                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
index ded6d4f298a75296ae295debb3333202c0d616f7..d2562a7798128c6157dbfeed3618fc9e25121cb8 100644 (file)
@@ -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 @@ geom_from_pa(const POINTARRAY *pa, int srid, int is_arc, int start, int end)
 }
 
 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 @@ lwline_unstroke(const LWLINE *line)
        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 @@ lwpolygon_unstroke(const LWPOLY *poly)
        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;
index fab1d85ce2ef0ed616ac7dde12d46e7d63cb841f..f2846328129e5aebcbf81a3b489a75eb5ea948af 100644 (file)
@@ -392,6 +392,7 @@ lw_dist2d_distribute_bruteforce(const LWGEOM *lwg1,const LWGEOM *lwg2, DISTPTS *
                                        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 @@ lw_dist2d_distribute_bruteforce(const LWGEOM *lwg1,const LWGEOM *lwg2, DISTPTS *
                                        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 @@ lw_dist2d_distribute_bruteforce(const LWGEOM *lwg1,const LWGEOM *lwg2, DISTPTS *
                                        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 @@ lw_dist2d_distribute_bruteforce(const LWGEOM *lwg1,const LWGEOM *lwg2, DISTPTS *
                                        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 @@ lw_dist2d_distribute_bruteforce(const LWGEOM *lwg1,const LWGEOM *lwg2, DISTPTS *
                                        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;
 }
 
index ad1470d93ad27d091b802636a14b56b5c0e22cde..1e0c93368c78781ebb5b99eb61133aa20b4bb8fc 100644 (file)
@@ -59,8 +59,8 @@ geom4d_brin_inclusion_add_value(PG_FUNCTION_ARGS)
 }
 
 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;
index 4b0b10e0c2e556e6cb170b1120cb7798b39ae985..5c6e8d4bff7fcae24b4fe3483d8b586b7eb5c393 100644 (file)
@@ -945,7 +945,7 @@ pg_get_nd_stats(const Oid table_oid, AttrNumber att_num, int mode, bool only_par
                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 )
        {
index 8ebba7e7a41f4b30a0eabb6cd8dda0da85e555f1..8b5fe6332975999c45a448df8da5e24d83e9adb0 100644 (file)
@@ -179,7 +179,7 @@ Datum pgis_accum_finalfn(pgis_abs *p, MemoryContext mctx, FunctionCallInfo fcinf
 ** 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];
index da8a38a576e306dd015283538408f6afe5663b31..a9c1fe39f89bc72c295a34ac79b764c729587d25 100644 (file)
@@ -98,7 +98,7 @@ struct lwgeom_backend_definition lwgeom_backends[LWGEOM_NUM_BACKENDS] = {
 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;
 
index 355f93961e4f858f717b235f2ea529350e5462e9..5fb8fea162ecdd0bd7dd3d492a623170e8718311 100644 (file)
@@ -2486,7 +2486,7 @@ Datum LWGEOM_angle(PG_FUNCTION_ARGS)
                        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() ;
index 7a8f1604c405fc32bddd0cd935f4f695c69fc041..9eaad8b53f30ef9104c6848dd03034a7a16f679d 100644 (file)
@@ -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);
index 09e3e40442f30901c9d07768a1142e9dc45bfa0a..06bd9545b44f2254e4f81c83bd38d813a0d5cfd6 100644 (file)
@@ -78,7 +78,7 @@ gmlSrs;
 
 
 
-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);
index 8cbb711f524e74cde9df56fa9842e46d5ea0d496..53d4e9bbae9e7ed563d5586e0da1831350fc4986 100644 (file)
@@ -103,8 +103,8 @@ static inline uint32_t p_int(int32_t value)
        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 @@ bytea * mvt_ctx_serialize(mvt_agg_context *ctx)
        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);
 }