]> granicus.if.org Git - graphviz/commitdiff
more strongly type some boolean variables
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 22 Feb 2021 03:12:31 +0000 (19:12 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 28 Feb 2021 06:29:59 +0000 (22:29 -0800)
cmd/tools/unflatten.c

index 7b2a342c5161892ad339f43d40d94b9598776be7..c303ba28da53578ca7fc85a0fc01dfc37b80096a 100644 (file)
@@ -15,6 +15,7 @@
  */
 #include "config.h"
 
+#include    <stdbool.h>
 #include    <stdio.h>
 #include    <stdlib.h>
 #include    <string.h>
@@ -26,7 +27,7 @@
 
 #include <getopt.h>
 
-static int Do_fans = 0;
+static bool Do_fans = false;
 static int MaxMinlen = 0;
 static int ChainLimit = 0;
 static int ChainSize = 0;
@@ -51,12 +52,12 @@ static int myoutdegree(Agnode_t *n)
        return rv;
 }
 
-static int isleaf(Agnode_t * n)
+static bool isleaf(Agnode_t * n)
 {
     return myindegree(n) + myoutdegree(n) == 1;
 }
 
-static int ischainnode(Agnode_t * n)
+static bool ischainnode(Agnode_t * n)
 {
     return myindegree(n) == 1 && myoutdegree(n) == 1;
 }
@@ -171,7 +172,7 @@ static char **scanargs(int argc, char **argv)
     while ((c = getopt(argc, argv, ":fl:c:o:")) != -1) {
        switch (c) {
        case 'f':
-           Do_fans = 1;
+           Do_fans = true;
            break;
        case 'l':
            ival = atoi(optarg);