]> granicus.if.org Git - postgis/commitdiff
More unused variables and functions warnings cleaned
authorSandro Santilli <strk@keybit.net>
Mon, 3 Jun 2013 08:53:51 +0000 (08:53 +0000)
committerSandro Santilli <strk@keybit.net>
Mon, 3 Jun 2013 08:53:51 +0000 (08:53 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@11512 b70326c6-7e19-0410-871a-916f4a2858ee

postgis/geography_measurement.c
postgis/gserialized_estimate.c

index c4ee647e80c1cdf9a347e0dabc45a7542ac805ee..952ddefe540cbc6064d9a942d7dedce8d6364155 100644 (file)
@@ -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 )
index cfe7efff49f9f8fa670a37c9ac2cf2862b832256..d0aed06ca6f94bffb2b03cb8db72f391d57de0e5 100644 (file)
@@ -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);