mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-13 15:56:23 +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
@ -631,7 +631,7 @@ g_param_value_set_default (GParamSpec *pspec,
|
|||||||
*/
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
g_param_value_defaults (GParamSpec *pspec,
|
g_param_value_defaults (GParamSpec *pspec,
|
||||||
GValue *value)
|
const GValue *value)
|
||||||
{
|
{
|
||||||
GValue dflt_value = G_VALUE_INIT;
|
GValue dflt_value = G_VALUE_INIT;
|
||||||
gboolean defaults;
|
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 (G_IS_VALUE (value), FALSE);
|
||||||
g_return_val_if_fail (PSPEC_APPLIES_TO_VALUE (pspec, 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);
|
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;
|
defaults = G_PARAM_SPEC_GET_CLASS (pspec)->values_cmp (pspec, value, &dflt_value) == 0;
|
||||||
g_value_unset (&dflt_value);
|
g_value_unset (&dflt_value);
|
||||||
|
@ -307,7 +307,7 @@ void g_param_value_set_default (GParamSpec *pspec,
|
|||||||
GValue *value);
|
GValue *value);
|
||||||
GLIB_AVAILABLE_IN_ALL
|
GLIB_AVAILABLE_IN_ALL
|
||||||
gboolean g_param_value_defaults (GParamSpec *pspec,
|
gboolean g_param_value_defaults (GParamSpec *pspec,
|
||||||
GValue *value);
|
const GValue *value);
|
||||||
GLIB_AVAILABLE_IN_ALL
|
GLIB_AVAILABLE_IN_ALL
|
||||||
gboolean g_param_value_validate (GParamSpec *pspec,
|
gboolean g_param_value_validate (GParamSpec *pspec,
|
||||||
GValue *value);
|
GValue *value);
|
||||||
|
Loading…
Reference in New Issue
Block a user