From eff907eb0a408c485c6e2210ebc7d26e8e22e000 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 15 Jan 2022 10:50:01 -0800 Subject: [PATCH] API BREAK: use C99 bools for 'layout_t' boolean fields --- CHANGELOG.md | 2 ++ lib/common/input.c | 7 +++---- lib/common/types.h | 6 +++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d5e12d21d..1a4c5ff71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 `bool` instead of a Graphviz-specific `boolean`. - **Breaking**: The `candidate` and `valid` fields of the `rank_t` struct are 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**: 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/input.c b/lib/common/input.c index 46310d829..a925d8891 100644 --- a/lib/common/input.c +++ b/lib/common/input.c @@ -707,18 +707,17 @@ void graph_init(graph_t * g, bool use_rankdir) GD_fontnames(g) = maptoken(p, fontnamenames, fontnamecodes); setRatio(g); - GD_drawing(g)->filled = - getdoubles2ptf(g, "size", &GD_drawing(g)->size) ? TRUE : FALSE; + GD_drawing(g)->filled = getdoubles2ptf(g, "size", &GD_drawing(g)->size); getdoubles2ptf(g, "page", &(GD_drawing(g)->page)); - GD_drawing(g)->centered = mapbool(agget(g, "center")) ? TRUE : FALSE; + GD_drawing(g)->centered = mapbool(agget(g, "center")); if ((p = agget(g, "rotate"))) GD_drawing(g)->landscape = atoi(p) == 90; else if ((p = agget(g, "orientation"))) GD_drawing(g)->landscape = p[0] == 'l' || p[0] == 'L'; else if ((p = agget(g, "landscape"))) - GD_drawing(g)->landscape = mapbool(p) ? TRUE : FALSE; + GD_drawing(g)->landscape = mapbool(p); p = agget(g, "clusterrank"); CL_type = maptoken(p, rankname, rankcode); diff --git a/lib/common/types.h b/lib/common/types.h index 133ed65b5..b9b331c3e 100644 --- a/lib/common/types.h +++ b/lib/common/types.h @@ -227,9 +227,9 @@ extern "C" { pointf margin; pointf page; pointf size; - boolean filled; - boolean landscape; - boolean centered; + bool filled; + bool landscape; + bool centered; ratio_t ratio_kind; void* xdots; char* id; -- 2.40.0