From: Sandro Santilli Date: Mon, 3 Jun 2013 08:26:51 +0000 (+0000) Subject: Remove warnings from liblwgeom X-Git-Tag: 2.1.0beta3~25 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7d7ea5caf5d4d2225892708c278766ece26a0c4b;p=postgis Remove warnings from liblwgeom These are mostly unused variables git-svn-id: http://svn.osgeo.org/postgis/trunk@11511 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/liblwgeom/lwgeodetic.c b/liblwgeom/lwgeodetic.c index c92d8ecc3..dcbabeca7 100644 --- a/liblwgeom/lwgeodetic.c +++ b/liblwgeom/lwgeodetic.c @@ -947,6 +947,7 @@ double sphere_direction(const GEOGRAPHIC_POINT *s, const GEOGRAPHIC_POINT *e, do return heading; } +#if 0 /* unused */ /** * Computes the spherical excess of a spherical triangle defined by * the three vectices A, B, C. Computes on the unit sphere (i.e., divides @@ -970,6 +971,7 @@ static double sphere_excess(const GEOGRAPHIC_POINT *a, const GEOGRAPHIC_POINT *b double E = tan(ss/2.0)*tan((ss-a_dist)/2.0)*tan((ss-b_dist)/2.0)*tan((ss-c_dist)/2.0); return 4.0 * atan(sqrt(fabs(E))) * sign; } +#endif /** @@ -3167,7 +3169,7 @@ int ptarray_contains_point_sphere(const POINTARRAY *pa, const POINT2D *pt_outsid { POINT3D S1, S2; /* Stab line end points */ POINT3D E1, E2; /* Edge end points (3-space) */ - POINT2D p, q; /* Edge end points (lon/lat) */ + POINT2D p; /* Edge end points (lon/lat) */ int count = 0, i, inter; /* Null input, not enough points for a ring? You ain't closed! */ @@ -3181,7 +3183,6 @@ int ptarray_contains_point_sphere(const POINTARRAY *pa, const POINT2D *pt_outsid /* Initialize first point */ getPoint2d_p(pa, 0, &p); ll2cart(&p, &E1); - q = p; /* Walk every edge and see if the stab line hits it */ for ( i = 1; i < pa->npoints; i++ ) @@ -3239,7 +3240,6 @@ int ptarray_contains_point_sphere(const POINTARRAY *pa, const POINT2D *pt_outsid /* Increment to next edge */ E1 = E2; - q = p; } LWDEBUGF(4,"final count == %d", count); diff --git a/liblwgeom/lwgeodetic_tree.c b/liblwgeom/lwgeodetic_tree.c index 02f000288..1ab59606d 100644 --- a/liblwgeom/lwgeodetic_tree.c +++ b/liblwgeom/lwgeodetic_tree.c @@ -498,10 +498,10 @@ circ_tree_distance_tree(const CIRC_NODE* n1, const CIRC_NODE* n2, const SPHEROID double min_dist = MAXFLOAT; double max_dist = MAXFLOAT; GEOGRAPHIC_POINT closest1, closest2; - double distance1, distance2; + double distance2; double threshold_radians = threshold / spheroid->radius; - distance1 = circ_tree_distance_tree_internal(n1, n2, threshold_radians, &min_dist, &max_dist, &closest1, &closest2); + circ_tree_distance_tree_internal(n1, n2, threshold_radians, &min_dist, &max_dist, &closest1, &closest2); distance2 = spheroid_distance(&closest1, &closest2, spheroid); return distance2; diff --git a/liblwgeom/lwout_geojson.c b/liblwgeom/lwout_geojson.c index f7ec7e49c..034b067e0 100644 --- a/liblwgeom/lwout_geojson.c +++ b/liblwgeom/lwout_geojson.c @@ -37,7 +37,6 @@ lwgeom_to_geojson(const LWGEOM *geom, char *srs, int precision, int has_bbox) int type = geom->type; GBOX *bbox = NULL; GBOX tmp; - int rv; if ( precision > OUT_MAX_DOUBLE_PRECISION ) precision = OUT_MAX_DOUBLE_PRECISION; @@ -45,7 +44,7 @@ lwgeom_to_geojson(const LWGEOM *geom, char *srs, int precision, int has_bbox) { /* Whether these are geography or geometry, the GeoJSON expects a cartesian bounding box */ - rv = lwgeom_calculate_gbox_cartesian(geom, &tmp); + lwgeom_calculate_gbox_cartesian(geom, &tmp); bbox = &tmp; } diff --git a/liblwgeom/lwout_x3d.c b/liblwgeom/lwout_x3d.c index a1a9c4a34..12c262def 100644 --- a/liblwgeom/lwout_x3d.c +++ b/liblwgeom/lwout_x3d.c @@ -312,10 +312,7 @@ asx3d3_poly_buf(const LWPOLY *poly, char *srs, char *output, int precision, int { int i; char *ptr=output; - int dimension=2; - if (FLAGS_GET_Z(poly->flags)) - dimension = 3; ptr += pointArray_toX3D3(poly->rings[0], ptr, precision, opts, 1); for (i=1; inrings; i++) {