Skip to content

Commit

Permalink
[Postgis] Avoid warnings when using ARR_DATA_PTR
Browse files Browse the repository at this point in the history
  • Loading branch information
Algunenano committed Jan 10, 2018
1 parent eba5211 commit d7b836f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions postgis/lwgeom_functions_basic.c
Expand Up @@ -1560,7 +1560,10 @@ Datum LWGEOM_makepoly(PG_FUNCTION_ARGS)
holes = lwalloc(sizeof(LWLINE *)*nholes);
for (i=0; i<nholes; i++)
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wsign-compare"
GSERIALIZED *g = (GSERIALIZED *)(ARR_DATA_PTR(array)+offset);
#pragma GCC diagnostic pop
LWLINE *hole;
offset += INTALIGN(VARSIZE(g));
if ( gserialized_get_type(g) != LINETYPE )
Expand Down
5 changes: 5 additions & 0 deletions postgis/lwgeom_geos.c
Expand Up @@ -420,7 +420,12 @@ Datum pgis_union_geometry_array(PG_FUNCTION_ARGS)

/* One geom, good geom? Return it */
if ( count == 1 && nelems == 1 )
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wsign-compare"
PG_RETURN_POINTER((GSERIALIZED *)(ARR_DATA_PTR(array)));
#pragma GCC diagnostic pop
}

/* Ok, we really need GEOS now ;) */
initGEOS(lwpgnotice, lwgeom_geos_error);
Expand Down

0 comments on commit d7b836f

Please sign in to comment.