]> granicus.if.org Git - graphviz/commitdiff
use a C99 bool for ingraph’s heap flag
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 29 May 2021 18:03:13 +0000 (11:03 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 5 Jun 2021 00:01:14 +0000 (17:01 -0700)
The semantics of this flag were already a boolean value, so we can use the type
system to more obviously indicate this.

lib/ingraphs/ingraphs.c
lib/ingraphs/ingraphs.h

index f10ae53e21d43dccdfc622ba1e3e44123edeed19..10b0ad15df8b393733cb499271a509522ff70543 100644 (file)
@@ -13,6 +13,7 @@
  * Written by Emden Gansner
  */
 
+#include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
 
@@ -95,9 +96,9 @@ new_ing(ingraph_state * sp, char **files, Agraph_t** graphs, ingdisc * disc)
            fprintf(stderr, "ingraphs: out of memory\n");
            return 0;
        }
-       sp->heap = 1;
+       sp->heap = true;
     } else
-       sp->heap = 0;
+       sp->heap = false;
     if (graphs) {
        sp->ingraphs = 1;
        sp->u.Graphs = graphs;
index 22e48186ab8dea8514083875004a06879ff39817..4591db124ab7d2feed6f53c2b780e2470d907ca4 100644 (file)
@@ -15,6 +15,7 @@
  * of Agraph_t.
  */
 
+#include <stdbool.h>
 #include <stdio.h>
 
 #ifdef __cplusplus
@@ -39,7 +40,7 @@ extern "C" {
        int ingraphs;
        void *fp;
        ingdisc *fns;
-       char heap;
+       bool heap;
        unsigned errors;
     } ingraph_state;