From d857ce24ff975c5bf1939ea9a31fccf84f2f7ae6 Mon Sep 17 00:00:00 2001 From: Daniel Baston Date: Wed, 11 May 2016 14:27:52 +0000 Subject: [PATCH] Fix compiler warning in ST_GeometricMedian git-svn-id: http://svn.osgeo.org/postgis/trunk@14892 b70326c6-7e19-0410-871a-916f4a2858ee --- postgis/lwgeom_functions_analytic.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/postgis/lwgeom_functions_analytic.c b/postgis/lwgeom_functions_analytic.c index fb83a6a8a..6c9def87e 100644 --- a/postgis/lwgeom_functions_analytic.c +++ b/postgis/lwgeom_functions_analytic.c @@ -1155,7 +1155,8 @@ Datum ST_GeometricMedian(PG_FUNCTION_ARGS) GSERIALIZED* result; LWGEOM* input; LWPOINT* lwresult; - double tolerance; + static const double min_default_tolerance = 1e-8; + double tolerance = min_default_tolerance; bool compute_tolerance_from_box; bool fail_if_not_converged; int max_iter; @@ -1194,15 +1195,10 @@ Datum ST_GeometricMedian(PG_FUNCTION_ARGS) /* Compute a default tolerance based on the smallest dimension * of the geometry's bounding box. */ - static const double min_default_tolerance = 1e-8; static const double tolerance_coefficient = 1e-6; const GBOX* box = lwgeom_get_bbox(input); - if (!box) - { - tolerance = min_default_tolerance; - } - else + if (box) { double min_dim = FP_MIN(box->xmax - box->xmin, box->ymax - box->ymin); if (lwgeom_has_z(input)) -- 2.40.0