From 49d8185d03e54360905baefbcedfecbfe96aa17c Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Thu, 7 Nov 2024 13:25:24 +0000 Subject: [PATCH] gscanner: Fix -Wshorten-64-to-32 warning when reading an integer token MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There’s already a documented explicit cast here, so let’s add the explicit cast in C to match that. Fixes a `-Wshorten-64-to-32` warning. Signed-off-by: Philip Withnall Helps: #3527 --- glib/gscanner.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/glib/gscanner.c b/glib/gscanner.c index d7b65be64..3c9aa2837 100644 --- a/glib/gscanner.c +++ b/glib/gscanner.c @@ -1694,12 +1694,12 @@ g_scanner_get_token_i (GScanner *scanner, * by copying between potentially-overlapping union members. */ if (scanner->config->store_int64) { - gint64 temp = value_p->v_int64; + guint64 temp = value_p->v_int64; value_p->v_float = temp; } else { - gint temp = value_p->v_int; + gulong temp = value_p->v_int; value_p->v_float = temp; } }