From: Sandro Santilli Date: Mon, 3 Jun 2013 08:53:51 +0000 (+0000) Subject: More unused variables and functions warnings cleaned X-Git-Tag: 2.1.0beta3~24 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7dc81980ca568090ae4f010d6942b7c1cbe5583f;p=postgis More unused variables and functions warnings cleaned git-svn-id: http://svn.osgeo.org/postgis/trunk@11512 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/postgis/geography_measurement.c b/postgis/geography_measurement.c index c4ee647e8..952ddefe5 100644 --- a/postgis/geography_measurement.c +++ b/postgis/geography_measurement.c @@ -678,7 +678,6 @@ Datum geography_bestsrid(PG_FUNCTION_ARGS) GBOX gbox, gbox1, gbox2; GSERIALIZED *g1 = NULL; GSERIALIZED *g2 = NULL; - int type1, type2; int empty1 = LW_FALSE; int empty2 = LW_FALSE; double xwidth, ywidth; @@ -691,8 +690,6 @@ Datum geography_bestsrid(PG_FUNCTION_ARGS) g1 = (GSERIALIZED*)PG_DETOAST_DATUM(d1); /* Synchronize our box types */ gbox1.flags = g1->flags; - /* Read our types */ - type1 = gserialized_get_type(g1); /* Calculate if the geometry is empty. */ empty1 = gserialized_is_empty(g1); /* Calculate a geocentric bounds for the objects */ @@ -705,7 +702,6 @@ Datum geography_bestsrid(PG_FUNCTION_ARGS) if ( d1 != d2 ) { g2 = (GSERIALIZED*)PG_DETOAST_DATUM(d2); - type2 = gserialized_get_type(g2); gbox2.flags = g2->flags; empty2 = gserialized_is_empty(g2); if ( ! empty1 && gserialized_get_gbox_p(g2, &gbox2) == LW_FAILURE ) diff --git a/postgis/gserialized_estimate.c b/postgis/gserialized_estimate.c index cfe7efff4..d0aed06ca 100644 --- a/postgis/gserialized_estimate.c +++ b/postgis/gserialized_estimate.c @@ -274,13 +274,13 @@ range_quintile(int *vals, int nvals) } /** -* Given int array, return sum of values. +* Given double array, return sum of values. */ -static int -total_int(const int *vals, int nvals) +static double +total_double(const double *vals, int nvals) { int i; - int total = 0; + float total = 0; /* Calculate total */ for ( i = 0; i < nvals; i++ ) total += vals[i]; @@ -288,14 +288,16 @@ total_int(const int *vals, int nvals) return total; } +#if POSTGIS_DEBUG_LEVEL >= 3 + /** -* Given double array, return sum of values. +* Given int array, return sum of values. */ -static double -total_double(const double *vals, int nvals) +static int +total_int(const int *vals, int nvals) { int i; - float total = 0; + int total = 0; /* Calculate total */ for ( i = 0; i < nvals; i++ ) total += vals[i]; @@ -331,6 +333,7 @@ stddev(const int *vals, int nvals) } return sqrt(sigma2 / nvals); } +#endif /* POSTGIS_DEBUG_LEVEL >= 3 */ /** * Given a position in the n-d histogram (i,j,k) return the @@ -691,7 +694,9 @@ nd_box_array_distribution(const ND_BOX **nd_boxes, int num_boxes, const ND_BOX * int counts[num_bins]; double smin, smax; /* Spatial min, spatial max */ double swidth; /* Spatial width of dimension */ +#if POSTGIS_DEBUG_LEVEL >= 3 double average, sdev, sdev_ratio; +#endif int bmin, bmax; /* Bin min, bin max */ const ND_BOX *ndb; @@ -748,9 +753,11 @@ nd_box_array_distribution(const ND_BOX **nd_boxes, int num_boxes, const ND_BOX * /* How dispersed is the distribution of features across bins? */ range = range_quintile(counts, num_bins); +#if POSTGIS_DEBUG_LEVEL >= 3 average = avg(counts, num_bins); sdev = stddev(counts, num_bins); sdev_ratio = sdev/average; +#endif POSTGIS_DEBUGF(3, " dimension %d: range = %d", d, range); POSTGIS_DEBUGF(3, " dimension %d: average = %.6g", d, average);