]> granicus.if.org Git - graphviz/commitdiff
check_control_points: remove a use of int as boolean
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 13 Mar 2022 20:36:30 +0000 (13:36 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 19 Mar 2022 05:28:30 +0000 (22:28 -0700)
lib/common/emit.c

index 079ce7f7c1ca2c6ed441bcfd99766c9cff8589c7..0e47c7bf1aa7968fca28ca8892fd5ac82bbc4ab5 100644 (file)
@@ -769,17 +769,14 @@ static pointf *pEllipse(double a, double b, int np)
 /* check_control_points:
  * check_control_points function checks the size of quadrilateral
  * formed by four control points
- * returns 1 if four points are in line (or close to line)
- * else return 0
+ * returns true if four points are in line (or close to line)
+ * else return false
  */
-static int check_control_points(pointf *cp)
+static bool check_control_points(pointf *cp)
 {
     double dis1 = ptToLine2 (cp[0], cp[3], cp[1]);
     double dis2 = ptToLine2 (cp[0], cp[3], cp[2]);
-    if (dis1 < HW*HW && dis2 < HW*HW)
-        return 1;
-    else
-        return 0;
+    return dis1 < HW * HW && dis2 < HW * HW;
 }
 
 /* update bounding box to contain a bezier segment */