mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-02 07:23:41 +02:00
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:
@@ -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 ();
|
||||
|
Reference in New Issue
Block a user