From: Daniel Baston Date: Wed, 11 May 2016 14:27:52 +0000 (+0000) Subject: Fix compiler warning in ST_GeometricMedian X-Git-Tag: 2.3.0beta1~120 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d857ce24ff975c5bf1939ea9a31fccf84f2f7ae6;p=postgis Fix compiler warning in ST_GeometricMedian git-svn-id: http://svn.osgeo.org/postgis/trunk@14892 b70326c6-7e19-0410-871a-916f4a2858ee --- 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))