gscanner: Fix -Wshorten-64-to-32 warning when reading an integer token

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 <pwithnall@gnome.org>

Helps: #3527
This commit is contained in:
Philip Withnall 2024-11-07 13:25:24 +00:00
parent 45a1c0fdc1
commit 49d8185d03
No known key found for this signature in database
GPG Key ID: C5C42CFB268637CA

View File

@ -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;
}
}