]> granicus.if.org Git - graphviz/commitdiff
more precise return type for isLeaf
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 29 Mar 2021 04:34:38 +0000 (21:34 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 4 Apr 2021 16:48:10 +0000 (09:48 -0700)
lib/twopigen/circle.c

index 18a0e7be94b6a3574b99df06ce9018b0fe4e4ae6..55878650c33171d9f3b4496bf4382a7e76516676 100644 (file)
@@ -8,11 +8,11 @@
  * Contributors: Details at https://graphviz.org
  *************************************************************************/
 
-
 #include    <twopigen/circle.h>
 #include    <ctype.h>
 #include    <inttypes.h>
 #include    <limits.h>
+#include    <stdbool.h>
 #include    <stdint.h>
 #include    <stdlib.h>
 #define DEF_RANKSEP 1.00
@@ -46,7 +46,7 @@ static void setNStepsToLeaf(Agraph_t * g, Agnode_t * n, Agnode_t * prev)
 /* isLeaf:
  * Return true if n is a leaf node.
  */
-static int isLeaf(Agraph_t * g, Agnode_t * n)
+static bool isLeaf(Agraph_t * g, Agnode_t * n)
 {
     Agedge_t *ep;
     Agnode_t *neighp = 0;
@@ -59,11 +59,11 @@ static int isLeaf(Agraph_t * g, Agnode_t * n)
            continue;           /* loop */
        if (neighp) {
            if (neighp != np)
-               return 0;       /* two different neighbors */
+               return false;   /* two different neighbors */
        } else
            neighp = np;
     }
-    return 1;
+    return true;
 }
 
 static void initLayout(Agraph_t * g)