mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 15:06:14 +01:00
Constify g_param_value_defaults() argument
The GValue we pass in is supposed to not be modified by the GParamSpec.
This commit is contained in:
parent
47d558baa7
commit
6ad799ac67
@ -630,8 +630,8 @@ g_param_value_set_default (GParamSpec *pspec,
|
||||
* Returns: whether @value contains the canonical default for this @pspec
|
||||
*/
|
||||
gboolean
|
||||
g_param_value_defaults (GParamSpec *pspec,
|
||||
GValue *value)
|
||||
g_param_value_defaults (GParamSpec *pspec,
|
||||
const GValue *value)
|
||||
{
|
||||
GValue dflt_value = G_VALUE_INIT;
|
||||
gboolean defaults;
|
||||
@ -640,7 +640,6 @@ g_param_value_defaults (GParamSpec *pspec,
|
||||
g_return_val_if_fail (G_IS_VALUE (value), FALSE);
|
||||
g_return_val_if_fail (PSPEC_APPLIES_TO_VALUE (pspec, value), FALSE);
|
||||
|
||||
g_value_init (&dflt_value, G_PARAM_SPEC_VALUE_TYPE (pspec));
|
||||
G_PARAM_SPEC_GET_CLASS (pspec)->value_set_default (pspec, &dflt_value);
|
||||
defaults = G_PARAM_SPEC_GET_CLASS (pspec)->values_cmp (pspec, value, &dflt_value) == 0;
|
||||
g_value_unset (&dflt_value);
|
||||
|
@ -307,7 +307,7 @@ void g_param_value_set_default (GParamSpec *pspec,
|
||||
GValue *value);
|
||||
GLIB_AVAILABLE_IN_ALL
|
||||
gboolean g_param_value_defaults (GParamSpec *pspec,
|
||||
GValue *value);
|
||||
const GValue *value);
|
||||
GLIB_AVAILABLE_IN_ALL
|
||||
gboolean g_param_value_validate (GParamSpec *pspec,
|
||||
GValue *value);
|
||||
|
Loading…
Reference in New Issue
Block a user