gparamspecs: Fix -Wsign-conversion warnings for large constants

Not sure why these constants were chosen the way they were, but that’s
not a problem I’m going to investigate right now. This just makes the
implicit cast explicit to shut the compiler warning up.

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

Helps: #3405
This commit is contained in:
Philip Withnall
2025-04-11 15:10:13 +01:00
parent 633e49c8d1
commit 752c0787d6

View File

@@ -152,8 +152,8 @@ param_int_init (GParamSpec *pspec)
{
GParamSpecInt *ispec = G_PARAM_SPEC_INT (pspec);
ispec->minimum = 0x7fffffff;
ispec->maximum = 0x80000000;
ispec->minimum = (int) 0x7fffffff;
ispec->maximum = (int) 0x80000000;
ispec->default_value = 0;
}
@@ -253,11 +253,11 @@ param_long_init (GParamSpec *pspec)
GParamSpecLong *lspec = G_PARAM_SPEC_LONG (pspec);
#if SIZEOF_LONG == 4
lspec->minimum = 0x7fffffff;
lspec->maximum = 0x80000000;
lspec->minimum = (glong) 0x7fffffff;
lspec->maximum = (glong) 0x80000000;
#else /* SIZEOF_LONG != 4 (8) */
lspec->minimum = 0x7fffffffffffffff;
lspec->maximum = 0x8000000000000000;
lspec->minimum = (glong) 0x7fffffffffffffff;
lspec->maximum = (glong) 0x8000000000000000;
#endif
lspec->default_value = 0;
}