]> granicus.if.org Git - graphviz/commitdiff
sparse QuadTree_new_from_point_list: rephrase conditional assignment as 'fmax'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 26 Dec 2022 21:45:48 +0000 (13:45 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 31 Dec 2022 23:34:34 +0000 (15:34 -0800)
Avoids a -Wfloat-equal warning.

lib/sparse/QuadTree.c

index 4e16926528148f01035add3606097afa98e80214..1c5b160194c58386356c1da7e69a81c2ad4ae9ee 100644 (file)
@@ -370,7 +370,7 @@ QuadTree QuadTree_new_from_point_list(int dim, int n, int max_level, double *coo
     center[i] = (xmin[i] + xmax[i])*0.5;
     width = MAX(width, xmax[i] - xmin[i]);
   }
-  if (width == 0) width = 0.00001;/* if we only have one point, width = 0! */
+  width = fmax(width, 0.00001);/* if we only have one point, width = 0! */
   width *= 0.52;
   qt = QuadTree_new(dim, center, width, max_level);