From: Matthew Fernandez Date: Thu, 7 Oct 2021 03:48:36 +0000 (-0700) Subject: make_regular_edge: use a proper boolean for checking edge type is spline X-Git-Tag: 2.49.2~14^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ae4dc218b631f3431c5d00b83f6967503f1fa27e;p=graphviz make_regular_edge: use a proper boolean for checking edge type is spline This change also removes a -Wshadow compiler warning. --- diff --git a/lib/dotgen/dotsplines.c b/lib/dotgen/dotsplines.c index b85686e97..4245552e7 100644 --- a/lib/dotgen/dotsplines.c +++ b/lib/dotgen/dotsplines.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -1844,7 +1845,7 @@ make_regular_edge(graph_t* g, spline_info_t* sp, path * P, edge_t ** edges, int if ((et == ET_LINE) && (pointn = makeLineEdge (g, fe, pointfs, &hn))) { } else { - int splines = et == ET_SPLINE; + bool is_spline = et == ET_SPLINE; boxes_t boxes = {0}; pointn = 0; segfirst = e; @@ -1887,7 +1888,7 @@ make_regular_edge(graph_t* g, spline_info_t* sp, path * P, edge_t ** edges, int assert(boxes.size <= (size_t)INT_MAX && "integer overflow"); completeregularpath(P, segfirst, e, &tend, &hend, boxes.data, (int)boxes.size, 1); - if (splines) ps = routesplines(P, &pn); + if (is_spline) ps = routesplines(P, &pn); else { ps = routepolylines (P, &pn); if ((et == ET_LINE) && (pn > 4)) { @@ -1939,7 +1940,7 @@ make_regular_edge(graph_t* g, spline_info_t* sp, path * P, edge_t ** edges, int completeregularpath(P, segfirst, e, &tend, &hend, boxes.data, (int)boxes.size, longedge); boxes_free(&boxes); - if (splines) ps = routesplines(P, &pn); + if (is_spline) ps = routesplines(P, &pn); else ps = routepolylines (P, &pn); if (et == ET_LINE && pn > 4) { /* Here we have used the polyline case to handle