From: Matthew Fernandez Date: Wed, 3 Aug 2022 00:55:49 +0000 (-0700) Subject: gvpr setval: use a local type that corresponds to the value being stored in it X-Git-Tag: 5.0.1~20^2~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e1dff5792d98ca631c0cb18f4152f68f88fc65d6;p=graphviz gvpr setval: use a local type that corresponds to the value being stored in it Squashes a -Wconversion warning. This has no effect on functionality because the `validTVT` call is confirming the value is within the expected range. --- diff --git a/lib/gvpr/compile.c b/lib/gvpr/compile.c index 38aea632d..b80333c32 100644 --- a/lib/gvpr/compile.c +++ b/lib/gvpr/compile.c @@ -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)