From 3f0d434f82d76945c647e732ee62ea4652e7afb1 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sun, 3 Mar 2024 19:24:03 -0500 Subject: [PATCH] Gtkwave: Update from upstream for warning cleanup (#4941) --- include/gtkwave/fstapi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/gtkwave/fstapi.c b/include/gtkwave/fstapi.c index 91c5401ee..d4adbdc0a 100644 --- a/include/gtkwave/fstapi.c +++ b/include/gtkwave/fstapi.c @@ -1646,7 +1646,11 @@ if(1) { if(vm4ip[2] != prev_alias) { - fpos += fstWriterSVarint(f, (((int64_t)((int32_t)(prev_alias = vm4ip[2]))) << 1) | 1); + int32_t t_i32 = ((int32_t)(prev_alias = vm4ip[2])); /* vm4ip is generic unsigned data */ + int64_t t_i64 = (int64_t)t_i32; /* convert to signed */ + uint64_t t_u64 = (uint64_t)t_i64; /* sign extend through 64b */ + + fpos += fstWriterSVarint(f, (int64_t)((t_u64 << 1) | 1)); /* all in this block was: fpos += fstWriterSVarint(f, (((int64_t)((int32_t)(prev_alias = vm4ip[2]))) << 1) | 1); */ } else {