From 5151594a0e476a1f2117236bc3bffc7883a54151 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Mon, 26 Dec 2022 13:51:08 -0800 Subject: [PATCH] sparse QuadTree_get_nearest_internal: remove shadowing of 'point' global --- lib/sparse/QuadTree.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/sparse/QuadTree.c b/lib/sparse/QuadTree.c index d63a82f5f..bb3ea8807 100644 --- a/lib/sparse/QuadTree.c +++ b/lib/sparse/QuadTree.c @@ -663,7 +663,6 @@ static void QuadTree_get_nearest_internal(QuadTree qt, double *x, double *y, dou double *coord, dist; int dim, i, iq = -1; double qmin; - double *point = x; if (!qt) return; dim = qt->dim; @@ -671,7 +670,7 @@ static void QuadTree_get_nearest_internal(QuadTree qt, double *x, double *y, dou if (l){ while (l){ coord = node_data_get_coord(SingleLinkedList_get_data(l)); - dist = point_distance(point, coord, dim); + dist = point_distance(x, coord, dim); if(*min < 0 || dist < *min) { *min = dist; *imin = node_data_get_id(SingleLinkedList_get_data(l)); @@ -682,7 +681,7 @@ static void QuadTree_get_nearest_internal(QuadTree qt, double *x, double *y, dou } if (qt->qts){ - dist = point_distance(qt->center, point, dim); + dist = point_distance(qt->center, x, dim); if (*min >= 0 && (dist - sqrt((double) dim) * qt->width > *min)){ return; } else { @@ -690,7 +689,7 @@ static void QuadTree_get_nearest_internal(QuadTree qt, double *x, double *y, dou qmin = -1; for (i = 0; i < 1<qts[i]){ - dist = point_distance(qt->qts[i]->average, point, dim); + dist = point_distance(qt->qts[i]->average, x, dim); if (dist < qmin || qmin < 0){ qmin = dist; iq = i; } -- 2.40.0