From e1dff5792d98ca631c0cb18f4152f68f88fc65d6 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Tue, 2 Aug 2022 17:55:49 -0700 Subject: [PATCH] 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. --- lib/gvpr/compile.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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) -- 2.40.0