From 3768b69ac764ce52bf996d5964754498960ddaf3 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Thu, 21 Apr 2022 08:00:01 -0700 Subject: [PATCH] cgraph: use a C99 bool for 'maybe_num' This makes it slightly clearer what the intent and usage of this variable is. --- lib/cgraph/write.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/cgraph/write.c b/lib/cgraph/write.c index 3d6f3316f..e14f7d835 100644 --- a/lib/cgraph/write.c +++ b/lib/cgraph/write.c @@ -60,7 +60,7 @@ static char *_agstrcanon(char *arg, char *buf) char uc; int cnt = 0, dotcnt = 0; bool needs_quotes = false; - int maybe_num; + bool maybe_num; bool backslash_pending = false; static const char *tokenlist[] /* must agree with scan.l */ = { "node", "edge", "strict", "graph", "digraph", "subgraph", @@ -74,7 +74,7 @@ static char *_agstrcanon(char *arg, char *buf) p = buf; *p++ = '\"'; uc = *s++; - maybe_num = isdigit(uc) || uc == '.' || uc == '-'; + maybe_num = isdigit(uc) != 0 || uc == '.' || uc == '-'; while (uc) { if (uc == '\"') { *p++ = '\\'; @@ -83,18 +83,18 @@ static char *_agstrcanon(char *arg, char *buf) else if (maybe_num) { if (uc == '-') { if (cnt) { - maybe_num = FALSE; + maybe_num = false; needs_quotes = true; } } else if (uc == '.') { if (dotcnt++) { - maybe_num = FALSE; + maybe_num = false; needs_quotes = true; } } else if (!isdigit(uc)) { - maybe_num = FALSE; + maybe_num = false; needs_quotes = true; } } -- 2.40.0