]> granicus.if.org Git - graphviz/commitdiff
bezier_clip: [nfc] take a C99 bool parameter instead of a boolean
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 19 Dec 2021 20:26:36 +0000 (12:26 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 20 Dec 2021 00:14:25 +0000 (16:14 -0800)
lib/common/arrows.c
lib/common/render.h
lib/common/shapes.c
lib/common/splines.c

index 90e60a127b2e59c8ce880e9a68fb288841323268..196228ba295daca22c50aa53b65df6b5aedb14f9 100644 (file)
@@ -11,6 +11,7 @@
 
 #include <common/render.h>
 #include <math.h>
+#include <stdbool.h>
 
 #define EPSILON .0001
 
@@ -282,7 +283,7 @@ int arrowEndClip(edge_t* e, pointf * ps, int startp,
 
     inside_context.a.p = &sp[0];
     inside_context.a.r = &elen2;
-    bezier_clip(&inside_context, inside, sp, TRUE);
+    bezier_clip(&inside_context, inside, sp, true);
 
     ps[endp] = sp[3];
     ps[endp + 1] = sp[2];
@@ -311,7 +312,7 @@ int arrowStartClip(edge_t* e, pointf * ps, int startp,
 
     inside_context.a.p = &sp[3];
     inside_context.a.r = &slen2;
-    bezier_clip(&inside_context, inside, sp, FALSE);
+    bezier_clip(&inside_context, inside, sp, false);
 
     ps[startp] = sp[3];
     ps[startp + 1] = sp[2];
index 1db1f6b19d746c78f41496428c4fe0efc4b5d126..3586ba3a54bbdd09e1ef22c4312541de865fecf3 100644 (file)
@@ -77,8 +77,7 @@ extern "C" {
     RENDER_API void beginpath(path *, Agedge_t *, int, pathend_t *, bool);
     RENDER_API void bezier_clip(inside_t * inside_context,
                            boolean(*insidefn) (inside_t * inside_context,
-                                               pointf p), pointf * sp,
-                           boolean left_inside);
+                                               pointf p), pointf * sp, bool left_inside);
     RENDER_API shape_desc *bind_shape(char *name, node_t *);
     RENDER_API void makeStraightEdge(graph_t * g, edge_t * e, int edgetype, splineInfo * info);
     RENDER_API void makeStraightEdges(graph_t* g, edge_t** edges, int e_cnt, int et, splineInfo* sinfo);
index 6898bbdb40ea91961afb690bb9cea7fcf46c4729..1af04af3b4c5c74c92b04609e4988647f19c2a3a 100644 (file)
@@ -2498,7 +2498,7 @@ static pointf compassPoint(inside_t * ictxt, double y, double x)
     curve[1] = curve[0];
     curve[3] = curve[2] = p;
 
-    bezier_clip(ictxt, ND_shape(n)->fns->insidefn, curve, 1);
+    bezier_clip(ictxt, ND_shape(n)->fns->insidefn, curve, true);
 
     if (rd)
        curve[0] = ccwrotatepf(curve[0], 90 * rd);
index dcac89bf4659181184f95905b2aad9797cbb881e..ea54dd74a93a43cd5cfd697d718ee5c86bd8e3ed 100644 (file)
@@ -103,7 +103,7 @@ arrow_clip(edge_t * fe, node_t * hn,
  */
 void bezier_clip(inside_t * inside_context,
                 boolean(*inside) (inside_t * inside_context, pointf p),
-                pointf * sp, boolean left_inside)
+                pointf * sp, bool left_inside)
 {
     pointf seg[4], best[4], pt, opt, *left, *right;
     double low, high, t, *idir, *odir;
@@ -168,7 +168,8 @@ shape_clip0(inside_t * inside_context, node_t * n, pointf curve[4],
        c[i].y = curve[i].y - ND_coord(n).y;
     }
 
-    bezier_clip(inside_context, ND_shape(n)->fns->insidefn, c, left_inside);
+    bezier_clip(inside_context, ND_shape(n)->fns->insidefn, c,
+                left_inside != FALSE);
 
     for (i = 0; i < 4; i++) {
        curve[i].x = c[i].x + ND_coord(n).x;