Commit 8a78bf03 authored by Darafei Praliaskouski's avatar Darafei Praliaskouski

Address warnings across liblwgeom/ and postgis/

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
parent d8e4cc49
Pipeline #17468180 passed with stage
in 16 minutes and 2 seconds
......@@ -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);
}
/*
......
......@@ -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));
......
......@@ -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;
......
......@@ -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 */
......
......@@ -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;
......
......@@ -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;
}
}
}
......
......@@ -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);
......
......@@ -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 )
......
......@@ -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 )
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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
......@@ -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;
......
......@@ -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;
}
......
......@@ -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;
......
......@@ -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 )
{
......
......@@ -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];
......
......@@ -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;
......
......@@ -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() ;
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment