]> granicus.if.org Git - graphviz/commitdiff
use a stronger return type for rectIntersect
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 17 Apr 2021 23:39:02 +0000 (16:39 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 24 Apr 2021 01:35:44 +0000 (18:35 -0700)
lib/ortho/partition.c

index d2d682c4203905b329fc0137719fd5f8db9e0d90..fefce8a047fc1c03c16369bd00a1cd4948117970 100644 (file)
@@ -646,7 +646,7 @@ monotonate_trapezoids(int nsegs, segment_t*seg, trap_t* tr,
   return size;
 }
 
-static int 
+static bool
 rectIntersect (boxf *d, const boxf *r0, const boxf *r1)
 {
     double t = fmax(r0->LL.x, r1->LL.x);
@@ -657,10 +657,7 @@ rectIntersect (boxf *d, const boxf *r0, const boxf *r1)
     d->UR.y = fmin(r0->UR.y, r1->UR.y);
     d->LL.y = t;
 
-    if (d->LL.x >= d->UR.x || d->LL.y >= d->UR.y)
-    return 0;
-
-    return 1;
+    return !(d->LL.x >= d->UR.x || d->LL.y >= d->UR.y);
 }
 
 #if DEBUG > 1