From 9f02def8da7b1888fa0eabc88acaab67cc0509d8 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Thu, 17 Feb 2005 15:54:01 +0000 Subject: [PATCH] Syntaxes cleanups. git-svn-id: http://svn.osgeo.org/postgis/trunk@1405 b70326c6-7e19-0410-871a-916f4a2858ee --- lwgeom/lwgeom_functions_analytic.c | 2 +- lwgeom/lwgeom_functions_basic.c | 4 +++- lwgeom/lwgeom_geos.c | 3 +-- lwgeom/lwgeom_geos_wrapper.cpp | 2 ++ lwgeom/lwgeom_ogc.c | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lwgeom/lwgeom_functions_analytic.c b/lwgeom/lwgeom_functions_analytic.c index 124a2ab0e..947ae57e8 100644 --- a/lwgeom/lwgeom_functions_analytic.c +++ b/lwgeom/lwgeom_functions_analytic.c @@ -731,8 +731,8 @@ LWPOINT * lwpoint_grid(LWPOINT *point, gridspec *grid) { POINT2D p; - getPoint2d_p(point->point, 0, &p); double x, y; + getPoint2d_p(point->point, 0, &p); x = rint((p.x - grid->ipx)/grid->xsize) * grid->xsize + grid->ipx; y = rint((p.y - grid->ipy)/grid->ysize) * diff --git a/lwgeom/lwgeom_functions_basic.c b/lwgeom/lwgeom_functions_basic.c index 429f57fbd..667bbfd32 100644 --- a/lwgeom/lwgeom_functions_basic.c +++ b/lwgeom/lwgeom_functions_basic.c @@ -1413,8 +1413,10 @@ Datum LWGEOM_maxdistance2d_linestring(PG_FUNCTION_ARGS) for (i=0; ipoints->npoints; i++) { POINT2D p; + double dist; + getPoint2d_p(line1->points, i, &p); - double dist = distance2d_pt_ptarray(&p, line2->points); + dist = distance2d_pt_ptarray(&p, line2->points); if (dist > maxdist) maxdist = dist; } diff --git a/lwgeom/lwgeom_geos.c b/lwgeom/lwgeom_geos.c index 6b6ca5e19..21c9553b7 100644 --- a/lwgeom/lwgeom_geos.c +++ b/lwgeom/lwgeom_geos.c @@ -543,6 +543,7 @@ Datum convexhull(PG_FUNCTION_ARGS) PG_LWGEOM *result; LWGEOM *lwout; int SRID; + BOX2DFLOAT4 bbox; #ifdef PROFILE profstart(PROF_QRUN); @@ -595,8 +596,6 @@ Datum convexhull(PG_FUNCTION_ARGS) PG_RETURN_NULL(); //never get here } - BOX2DFLOAT4 bbox; - /* Copy input bbox if any */ if ( getbox2d_p(SERIALIZED_FORM(geom1), &bbox) ) { diff --git a/lwgeom/lwgeom_geos_wrapper.cpp b/lwgeom/lwgeom_geos_wrapper.cpp index b1ea70f27..1ca57b070 100644 --- a/lwgeom/lwgeom_geos_wrapper.cpp +++ b/lwgeom/lwgeom_geos_wrapper.cpp @@ -1075,7 +1075,9 @@ int GEOSGeometryTypeId(Geometry *g1) case GEOS_POINT: return POINTTYPE; case GEOS_LINESTRING: +#if GEOS_LAST_INTERFACE > 1 case GEOS_LINEARRING: +#endif return LINETYPE; case GEOS_POLYGON: return POLYGONTYPE; diff --git a/lwgeom/lwgeom_ogc.c b/lwgeom/lwgeom_ogc.c index 91f8b39e3..d8bd14e4e 100644 --- a/lwgeom/lwgeom_ogc.c +++ b/lwgeom/lwgeom_ogc.c @@ -327,7 +327,7 @@ Datum LWGEOM_exteriorring_polygon(PG_FUNCTION_ARGS) POINTARRAY *extring; LWLINE *line; PG_LWGEOM *result; - BOX2DFLOAT4 bbox, *bbox2; + BOX2DFLOAT4 bbox, *bbox2=NULL; if ( TYPE_GETTYPE(geom->type) != POLYGONTYPE ) { -- 2.40.0