]> granicus.if.org Git - graphviz/commitdiff
scan_num: use a C99 bool for 'saw_digit'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 16 Jan 2022 19:57:53 +0000 (11:57 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 20 Jan 2022 02:15:00 +0000 (18:15 -0800)
cmd/lefty/dot2l/dotlex.c

index 0fe70683c1d58b043f3907a1f9f79bd26cee9537..8028a1fe28631b95768a3fa76e14d51b63a0ab0a 100644 (file)
@@ -16,6 +16,7 @@ typedef void *Tobj;
 #include "dot2l.h"
 #include "leftyio.h"
 #include "triefa.c"
+#include <stdbool.h>
 #include <string.h>
 
 static int syntax_errors;
@@ -255,7 +256,7 @@ static char *scan_token (char *p) {
 static char *scan_num (char *p) {
     char *q, *z;
     int saw_rp = FALSE;
-    int saw_digit = FALSE;
+    bool saw_digit = false;
 
     z = p;
     q = lexbuf;
@@ -266,13 +267,13 @@ static char *scan_num (char *p) {
         *q++ = *z++;
     }
     while (isdigit (*z)) {
-        saw_digit = TRUE;
+        saw_digit = true;
         *q++ = *z++;
     }
     if (*z == '.' && !saw_rp) {
         *q++ = *z++;
         while (isdigit (*z)) {
-            saw_digit = TRUE;
+            saw_digit = true;
             *q++ = *z++;
         }
     }