]> granicus.if.org Git - graphviz/commitdiff
API BREAK: return a C99 bool from 'swapEnds instead of a boolean
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 15 Jan 2022 17:27:39 +0000 (09:27 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 15 Jan 2022 23:03:23 +0000 (15:03 -0800)
CHANGELOG.md
lib/common/splines.c
lib/common/types.h
lib/dotgen/dotsplines.c
lib/neatogen/multispline.c
lib/neatogen/neatosplines.c
lib/ortho/ortho.c

index be58dcaab61d2b65a07204a98b5784156d92b5fc..b0df30f6c679d0c1eb42db6101db9b2ad29935c9 100644 (file)
@@ -13,9 +13,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 - **Breaking**: The `insidefn` member of the `shape_functions` struct must now
   be a pointer to a function returning a C99 `bool` instead of a
   Graphviz-specific `boolean`.
-- **Breaking**: The `splineMerge` member of the `splineInfo` struct must now be
-  a pointer to a function returning a C99 `bool` instead of a Graphviz-specific
-  `boolean`.
+- **Breaking**: The `swapEnds` and `splineMerge` members of the `splineInfo`
+  struct must now be pointers to functions returning a C99 `bool`s instead of
+  Graphviz-specific `boolean`s.
 - **Breaking**: Graphviz headers no longer define the constant `MAXSHORT`. A
   drop-in replacement is `SHRT_MAX` in the C standard library’s limits.h.
 - **Breaking**: Graphviz headers no lnger define `NIL` macros. A drop-in
index 6774bc71f77df2f5162b5ef9c5f69b1bf5b80cf8..907c536c062c8d062e12dc60cc911d832c3af2da 100644 (file)
@@ -62,12 +62,13 @@ arrow_clip(edge_t * fe, node_t * hn,
           bezier * spl, splineInfo * info)
 {
     edge_t *e;
-    int i, j, sflag, eflag;
+    int i, sflag, eflag;
+    bool j;
 
     for (e = fe; ED_to_orig(e); e = ED_to_orig(e));
 
     if (info->ignoreSwap)
-       j = 0;
+       j = false;
     else
        j = info->swapEnds(e);
     arrow_flags(e, &sflag, &eflag);
index c6dc9b79f2d997d8857d04d9a31d27bab386ca58..c2a56b956d22274129e2e093b24821f8c1fe6b97 100644 (file)
@@ -77,7 +77,7 @@ extern "C" {
     } port;
 
     typedef struct {
-       boolean(*swapEnds) (edge_t * e);        /* Should head and tail be swapped? */
+       bool(*swapEnds) (edge_t * e);   /* Should head and tail be swapped? */
        bool(*splineMerge) (node_t * n);        /* Is n a node in the middle of an edge? */
        boolean ignoreSwap;                     /* Test for swapped edges if false */
        boolean isOrtho;                        /* Orthogonal routing used */
index 8d7db1567244d52eb000753d12cc886575474a82..16c498bba18f1468884152a3eadd9e76b49ad7b7 100644 (file)
@@ -153,17 +153,17 @@ static bool spline_merge(node_t * n)
            && (ND_in(n).size > 1 || ND_out(n).size > 1);
 }
 
-static boolean swap_ends_p(edge_t * e)
+static bool swap_ends_p(edge_t * e)
 {
     while (ED_to_orig(e))
        e = ED_to_orig(e);
     if (ND_rank(aghead(e)) > ND_rank(agtail(e)))
-       return FALSE;
+       return false;
     if (ND_rank(aghead(e)) < ND_rank(agtail(e)))
-       return TRUE;
+       return true;
     if (ND_order(aghead(e)) >= ND_order(agtail(e)))
-       return FALSE;
-    return TRUE;
+       return false;
+    return true;
 }
 
 static splineInfo sinfo = {.swapEnds = swap_ends_p,
index dc5d1489f67c96a5257141e2bdd05e5a609b0724..43e66ee88bbbdc29fadc099e14e9bddd1d0d20d1 100644 (file)
@@ -20,10 +20,10 @@ static bool spline_merge(node_t * n)
     return false;
 }
 
-static boolean swap_ends_p(edge_t * e)
+static bool swap_ends_p(edge_t * e)
 {
     (void)e;
-    return FALSE;
+    return false;
 }
 
 static splineInfo sinfo = {.swapEnds = swap_ends_p,
index b572283594f1b8fd0e575bb48f3f5cf71e830df6..53fa5c6082b1d38d70e438ba74891d63f723f4fe 100644 (file)
@@ -30,10 +30,10 @@ static bool spline_merge(node_t * n)
     return false;
 }
 
-static boolean swap_ends_p(edge_t * e)
+static bool swap_ends_p(edge_t * e)
 {
     (void)e;
-    return FALSE;
+    return false;
 }
 
 static splineInfo sinfo = {.swapEnds = swap_ends_p,
index 807a28d4d2853a1e87315e86610e87147d2546e4..3435e5b6cdcb35b6c6b8a920a5129ac7873e94ef 100644 (file)
@@ -1228,10 +1228,10 @@ static bool spline_merge(node_t * n)
     return false;
 }
 
-static boolean swap_ends_p(edge_t * e)
+static bool swap_ends_p(edge_t * e)
 {
     (void)e;
-    return FALSE;
+    return false;
 }
 
 static splineInfo sinfo = { swap_ends_p, spline_merge, 1, 1 };