]> granicus.if.org Git - graphviz/commitdiff
gvpr: make use of 'okay' clearer in 'evalEdge'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 2 Jul 2022 20:47:40 +0000 (13:47 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 4 Jul 2022 22:19:11 +0000 (15:19 -0700)
Squashes a -Wconversion warning.

lib/gvpr/gvpr.c

index 47c8f5a3d1567e527e8b95c1e170cd80312349cf..d026b8d1276cf1a6aad8721a2fbdeaaed904f014 100644 (file)
@@ -31,6 +31,7 @@
 #include <gvpr/actions.h>
 #include <ast/sfstr.h>
 #include <ast/error.h>
+#include <stdbool.h>
 #include <string.h>
 #include <ctype.h>
 #include <setjmp.h>
@@ -440,15 +441,15 @@ static Agobj_t* evalEdge(Gpr_t * state, Expr_t* prog, comp_block * xprog, Agedge
 {
     int i;
     case_stmt *cs;
-    int okay;
+    bool okay;
 
     state->curobj = (Agobj_t *) e;
     for (i = 0; i < xprog->n_estmts; i++) {
        cs = xprog->edge_stmts + i;
        if (cs->guard)
-           okay = (exeval(prog, cs->guard, state)).integer;
+           okay = exeval(prog, cs->guard, state).integer != 0;
        else
-           okay = 1;
+           okay = true;
        if (okay) {
            if (cs->action)
                exeval(prog, cs->action, state);