From 4c8cc2fe8c56f3983eac8a9049c562eb8fa100d8 Mon Sep 17 00:00:00 2001 From: Paul Ramsey Date: Tue, 25 Feb 2014 17:56:51 +0000 Subject: [PATCH] Fix variable decls in debug statements git-svn-id: http://svn.osgeo.org/postgis/trunk@12283 b70326c6-7e19-0410-871a-916f4a2858ee --- postgis/geography_measurement_trees.c | 4 ++-- postgis/gserialized_estimate.c | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/postgis/geography_measurement_trees.c b/postgis/geography_measurement_trees.c index a80ab5da8..387661abb 100644 --- a/postgis/geography_measurement_trees.c +++ b/postgis/geography_measurement_trees.c @@ -85,7 +85,7 @@ CircTreePIP(const CIRC_NODE* tree1, const GSERIALIZED* g1, const POINT4D* in_poi GEOGRAPHIC_POINT in_gpoint; POINT3D in_point3d; - POSTGIS_DEBUGF(3, "tree1_type=%d, lwgeom2->type=%d", tree1_type, lwgeom2->type); + POSTGIS_DEBUGF(3, "tree1_type=%d", tree1_type); /* If the tree'ed argument is a polygon, do the P-i-P using the tree-based P-i-P */ if ( tree1_type == POLYGONTYPE || tree1_type == MULTIPOLYGONTYPE ) @@ -235,7 +235,7 @@ geography_dwithin_cache(FunctionCallInfoData* fcinfo, const GSERIALIZED* g1, con /* if ( LW_SUCCESS == geography_distance_cache_tolerance(fcinfo, g1, g2, s, tolerance, &distance) ) */ if ( LW_SUCCESS == geography_distance_cache_tolerance(fcinfo, g1, g2, s, FP_TOLERANCE, &distance) ) { - *dwithin = (distance <= tolerance ? LW_TRUE : LW_FALSE); + *dwithin = (distance <= (tolerance + FP_TOLERANCE) ? LW_TRUE : LW_FALSE); return LW_SUCCESS; } return LW_FAILURE; diff --git a/postgis/gserialized_estimate.c b/postgis/gserialized_estimate.c index 568580943..4c71306de 100644 --- a/postgis/gserialized_estimate.c +++ b/postgis/gserialized_estimate.c @@ -753,16 +753,18 @@ 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); POSTGIS_DEBUGF(3, " dimension %d: stddev = %.6g", d, sdev); POSTGIS_DEBUGF(3, " dimension %d: stddev_ratio = %.6g", d, sdev_ratio); +#endif + distribution[d] = range; } -- 2.50.1