From 75bb42c3385d201c7eaf20ba50da500fc8e9d909 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 15 Jan 2022 10:55:26 -0800 Subject: [PATCH] API BREAK: use a C99 bool for 'Agraphinfo.has_flat_edges' --- CHANGELOG.md | 5 +++-- lib/common/types.h | 2 +- lib/dotgen/fastgr.c | 4 ++-- lib/dotgen/mincross.c | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 23b62e9c8..de3a8f5a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/lib/common/types.h b/lib/common/types.h index 1050b7b85..4b95692e8 100644 --- a/lib/common/types.h +++ b/lib/common/types.h @@ -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; diff --git a/lib/dotgen/fastgr.c b/lib/dotgen/fastgr.c index 9177ea262..5608b5957 100644 --- a/lib/dotgen/fastgr.c +++ b/lib/dotgen/fastgr.c @@ -10,7 +10,7 @@ #include - +#include /* * 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) diff --git a/lib/dotgen/mincross.c b/lib/dotgen/mincross.c index 78f1cc68d..aec5198e2 100644 --- a/lib/dotgen/mincross.c +++ b/lib/dotgen/mincross.c @@ -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; -- 2.40.0