]> granicus.if.org Git - graphviz/commitdiff
use stronger types for comparators in lib/ortho/trapezoid.c
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 17 Apr 2021 23:21:18 +0000 (16:21 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 24 Apr 2021 01:35:43 +0000 (18:35 -0700)
This leads to more readable and obvious code.

lib/ortho/trapezoid.c

index 3ba0be286bee4588feb44551530867641232151c..1e63675182961c417c2e6eab662e27de879a7424 100644 (file)
@@ -13,6 +13,7 @@
 
 #include <string.h>
 #include <assert.h>
+#include <stdbool.h>
 #include <stdio.h>
 #include <math.h>
 #include <common/geom.h>
@@ -112,7 +113,7 @@ static void _min (pointf *yval, pointf *v0, pointf *v1)
     *yval = *v1;
 }
 
-static int _greater_than_equal_to (pointf *v0, pointf *v1)
+static bool _greater_than_equal_to (pointf *v0, pointf *v1)
 {
   if (v0->y > v1->y + C_EPS)
     return TRUE;
@@ -122,7 +123,7 @@ static int _greater_than_equal_to (pointf *v0, pointf *v1)
     return v0->x >= v1->x;
 }
 
-static int _less_than (pointf *v0, pointf *v1)
+static bool _less_than (pointf *v0, pointf *v1)
 {
   return !_greater_than_equal_to(v0, v1);
 }