]> granicus.if.org Git - graphviz/commitdiff
expand_t.doAdd: [nfc] use a C99 bool instead of a boolean
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 5 Dec 2021 19:22:46 +0000 (11:22 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 11 Dec 2021 17:20:37 +0000 (09:20 -0800)
lib/neatogen/adjust.c
lib/neatogen/adjust.h

index be3729301ec653c346be9d9a118528ca7a03ce95..0af47f04a768a7f32159cf139deb24734dd11e57 100644 (file)
@@ -28,6 +28,7 @@
 #if ((defined(HAVE_GTS) || defined(HAVE_TRIANGLE)) && defined(SFDP))
 #include <neatogen/overlap.h>
 #endif
+#include <stdbool.h>
 #ifdef IPSEPCOLA
 #include <vpsc/csolve_VPSC.h>
 #include <neatogen/quad_prog_vpsc.h>
@@ -1201,9 +1202,9 @@ parseFactor (char* s, expand_t* pp, float sepfact, float dflt)
     while (isspace((int)*s)) s++;
     if (*s == '+') {
        s++;
-       pp->doAdd = 1;
+       pp->doAdd = true;
     }
-    else pp->doAdd = 0;
+    else pp->doAdd = false;
 
     if ((i = sscanf(s, "%f,%f", &x, &y))) {
        if (i == 1) y = x;
@@ -1244,7 +1245,7 @@ sepFactor(graph_t* g)
     }
     else { /* default */
        pmargin.x = pmargin.y = DFLT_MARGIN;
-       pmargin.doAdd = 1;
+       pmargin.doAdd = true;
     }
     if (Verbose)
        fprintf (stderr, "Node separation: add=%d (%f,%f)\n",
@@ -1270,7 +1271,7 @@ esepFactor(graph_t* g)
     }
     else {
        pmargin.x = pmargin.y = SEPFACT*DFLT_MARGIN;
-       pmargin.doAdd = 1;
+       pmargin.doAdd = true;
     }
     if (Verbose)
        fprintf (stderr, "Edge separation: add=%d (%f,%f)\n",
index 1efc7adcdaf3a25ddcb6abee7da05925af472fad..dfd706142a87fbe62a1a4914339f3a5d759204f6 100644 (file)
@@ -16,6 +16,7 @@ extern "C" {
 
 #include "geom.h"
 #include <sparse/SparseMatrix.h>
+#include <stdbool.h>
 
 #define DFLT_MARGIN     4   /* 4 points */
 
@@ -36,7 +37,7 @@ typedef struct {
 
 typedef struct {
     float x, y;
-    boolean doAdd;  /* if true, x and y are in points */
+    bool doAdd;  /* if true, x and y are in points */
 } expand_t;
 
     extern expand_t sepFactor(graph_t * G);