grand: Add an explicit cast to silence a -Wshorten-64-to-32 warning

The seed is explicitly a `guint32`, so an implicit cast was already
happening. We don’t actually care if there’s a loss of precision here,
as it’s a pseudo-random seed value rather than an ordinal number, so add
an explicit cast to silence the warning.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3527
This commit is contained in:
Philip Withnall
2024-11-07 13:28:41 +00:00
parent b8e68db45b
commit 66f4a52bd6

View File

@@ -207,7 +207,7 @@ g_rand_new (void)
if (!dev_urandom_exists)
{
gint64 now_us = g_get_real_time ();
seed[0] = now_us / G_USEC_PER_SEC;
seed[0] = (guint32) (now_us / G_USEC_PER_SEC);
seed[1] = now_us % G_USEC_PER_SEC;
seed[2] = getpid ();
seed[3] = getppid ();