]> granicus.if.org Git - graphviz/commitdiff
gvpr setval: use a local type that corresponds to the value being stored in it
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 3 Aug 2022 00:55:49 +0000 (17:55 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 6 Aug 2022 00:03:40 +0000 (17:03 -0700)
Squashes a -Wconversion warning. This has no effect on functionality because the
`validTVT` call is confirming the value is within the expected range.

lib/gvpr/compile.c

index 38aea632df87d5aa56397bba7c5a2dce76a4a991..b80333c329c4715962d96d027ccc68186b720994 100644 (file)
@@ -1602,7 +1602,6 @@ setval(Expr_t * pgm, Exnode_t * x, Exid_t * sym, Exref_t * ref,
     Gpr_t *state;
     Agobj_t *objp;
     Agnode_t *np;
-    int iv;
     int rv = 0;
 
     state = env;
@@ -1618,14 +1617,15 @@ setval(Expr_t * pgm, Exnode_t * x, Exid_t * sym, Exref_t * ref,
        case V_outgraph:
            state->outgraph = int2ptr(v.integer);
            break;
-       case V_travtype:
-           iv = v.integer;
+       case V_travtype: {
+           long long iv = v.integer;
            if (validTVT(v.integer))
                state->tvt = (trav_type) iv;
            else
-               error(1, "unexpected value %d assigned to %s : ignored",
+               error(1, "unexpected value %lld assigned to %s : ignored",
                      iv, typeName(pgm, T_tvtyp));
            break;
+       }
        case V_travroot:
            np = int2ptr(v.integer);
            if (!np || agroot(np) == state->curgraph)