/* Returns: whether modifying @value was necessary to ensure validity  */
gboolean g_param_value_validate(GParamSpec *pspec, GValue *value)
/* Returns: whether modifying @value was necessary to ensure validity  */
gboolean g_param_value_validate(GParamSpec *pspec, GValue *value)
{
  g_return_val_if_fail (G_IS_PARAM_SPEC (pspec), FALSE);
  g_return_val_if_fail (G_IS_VALUE (value), FALSE);
  g_return_val_if_fail (PSPEC_APPLIES_TO_VALUE (pspec, value), FALSE);
  if (G_PARAM_SPEC_GET_CLASS (pspec)->value_validate)
    {
      GValue oval = *value;
      if (G_PARAM_SPEC_GET_CLASS (pspec)->value_validate (pspec, value) ||
	  memcmp (&oval.data, &value->data, sizeof (oval.data)))
	return TRUE;
    }
  return FALSE;
}