mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-20 07:38:54 +02:00
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:
@@ -152,8 +152,8 @@ param_int_init (GParamSpec *pspec)
|
|||||||
{
|
{
|
||||||
GParamSpecInt *ispec = G_PARAM_SPEC_INT (pspec);
|
GParamSpecInt *ispec = G_PARAM_SPEC_INT (pspec);
|
||||||
|
|
||||||
ispec->minimum = 0x7fffffff;
|
ispec->minimum = (int) 0x7fffffff;
|
||||||
ispec->maximum = 0x80000000;
|
ispec->maximum = (int) 0x80000000;
|
||||||
ispec->default_value = 0;
|
ispec->default_value = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -253,11 +253,11 @@ param_long_init (GParamSpec *pspec)
|
|||||||
GParamSpecLong *lspec = G_PARAM_SPEC_LONG (pspec);
|
GParamSpecLong *lspec = G_PARAM_SPEC_LONG (pspec);
|
||||||
|
|
||||||
#if SIZEOF_LONG == 4
|
#if SIZEOF_LONG == 4
|
||||||
lspec->minimum = 0x7fffffff;
|
lspec->minimum = (glong) 0x7fffffff;
|
||||||
lspec->maximum = 0x80000000;
|
lspec->maximum = (glong) 0x80000000;
|
||||||
#else /* SIZEOF_LONG != 4 (8) */
|
#else /* SIZEOF_LONG != 4 (8) */
|
||||||
lspec->minimum = 0x7fffffffffffffff;
|
lspec->minimum = (glong) 0x7fffffffffffffff;
|
||||||
lspec->maximum = 0x8000000000000000;
|
lspec->maximum = (glong) 0x8000000000000000;
|
||||||
#endif
|
#endif
|
||||||
lspec->default_value = 0;
|
lspec->default_value = 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user