]> granicus.if.org Git - graphviz/commitdiff
API BREAK: use C99 bools for 'layout_t' boolean fields
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 15 Jan 2022 18:50:01 +0000 (10:50 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 15 Jan 2022 23:03:24 +0000 (15:03 -0800)
CHANGELOG.md
lib/common/input.c
lib/common/types.h

index d5e12d21d39619473443d950ea568aba11b70c66..1a4c5ff71722cacd14213ec936bacc1fd21f9525 100644 (file)
@@ -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
index 46310d8290c3fa875c857e54af53a487b48a700c..a925d8891e75577febb7dfbbfeadb643d46c9da2 100644 (file)
@@ -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);
index 133ed65b5b24a4d7db45499b82f73e1a32e66583..b9b331c3ea8ed5e47637d9cf0467a4ab60f32929 100644 (file)
@@ -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;