]> granicus.if.org Git - graphviz/commitdiff
API BREAK: use a C99 bool for 'Agraphinfo.has_flat_edges'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 15 Jan 2022 18:55:26 +0000 (10:55 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 15 Jan 2022 23:03:24 +0000 (15:03 -0800)
CHANGELOG.md
lib/common/types.h
lib/dotgen/fastgr.c
lib/dotgen/mincross.c

index 23b62e9c879a3ae53e6d66d8722a3abcc53e8d24..de3a8f5a363806af77c17092bb7eb11943e443cf 100644 (file)
@@ -28,8 +28,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
   now C99 `bool`s instead of Graphviz-specific `boolean`s.
 - **Breaking**: The `filled`, `landscape`, and `centered` fields of the
   `layout_t` struct are now C99 `bool`s instead of Graphviz-specific `boolean`s.
-- **Breaking**: The `has_images` field of the `Agraphinfo_t` struct is now a
-  C99 `bool` instead of a Graphviz-specific `boolean`.
+- **Breaking**: The `has_images` and `has_flat_edges` fields of the
+  `Agraphinfo_t` struct are now 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 1050b7b85b8b0c5e7ed5ed3f8844a1275c3ab7ee..4b95692e8b166ebec6d5e8c15fafd541dcf8e5a1 100644 (file)
@@ -322,7 +322,7 @@ typedef enum {NATIVEFONTS,PSFONTS,SVGFONTS} fontname_kind;
        int maxrank;
 
        /* various flags */
-       boolean has_flat_edges;
+       bool has_flat_edges;
        boolean has_sourcerank;
        boolean has_sinkrank;
        unsigned char   showboxes;
index 9177ea2622b1bcf4648208322e3fc5e89e5eb077..5608b5957a00acd90dff131059c0819665918515 100644 (file)
@@ -10,7 +10,7 @@
 
 
 #include <dotgen/dot.h>
-
+#include <stdbool.h>
 
 /*
  * operations on the fast internal graph.
@@ -263,7 +263,7 @@ void flat_edge(graph_t * g, edge_t * e)
 {
     elist_append(e, ND_flat_out(agtail(e)));
     elist_append(e, ND_flat_in(aghead(e)));
-    GD_has_flat_edges(dot_root(g)) = GD_has_flat_edges(g) = TRUE;
+    GD_has_flat_edges(dot_root(g)) = GD_has_flat_edges(g) = true;
 }
 
 void delete_flat_edge(edge_t * e)
index 78f1cc68dba9cde470bd12336ad3a832f0dc7e1d..aec5198e2c004992bead56791178f479b92f1aca 100644 (file)
@@ -1474,7 +1474,7 @@ static void flat_reorder(graph_t * g)
     node_t **temprank = NULL;
     edge_t *flat_e, *e;
 
-    if (GD_has_flat_edges(g) == FALSE)
+    if (!GD_has_flat_edges(g))
        return;
     for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
        if (GD_rank(g)[r].n == 0) continue;