From 9f268a78b6f98f55fcb3406c1e935cbd34ed38dc Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sun, 19 Dec 2021 12:26:36 -0800 Subject: [PATCH] bezier_clip: [nfc] take a C99 bool parameter instead of a boolean --- lib/common/arrows.c | 5 +++-- lib/common/render.h | 3 +-- lib/common/shapes.c | 2 +- lib/common/splines.c | 5 +++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/common/arrows.c b/lib/common/arrows.c index 90e60a127..196228ba2 100644 --- a/lib/common/arrows.c +++ b/lib/common/arrows.c @@ -11,6 +11,7 @@ #include #include +#include #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]; diff --git a/lib/common/render.h b/lib/common/render.h index 1db1f6b19..3586ba3a5 100644 --- a/lib/common/render.h +++ b/lib/common/render.h @@ -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); diff --git a/lib/common/shapes.c b/lib/common/shapes.c index 6898bbdb4..1af04af3b 100644 --- a/lib/common/shapes.c +++ b/lib/common/shapes.c @@ -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); diff --git a/lib/common/splines.c b/lib/common/splines.c index dcac89bf4..ea54dd74a 100644 --- a/lib/common/splines.c +++ b/lib/common/splines.c @@ -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; -- 2.40.0