From 3ced5a908644c3c92c8137af277fb9d5b94034d8 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Tue, 21 Oct 2008 18:50:44 +0000 Subject: [PATCH] 2008-10-21 Emmanuele Bassi * clutter/clutter-color.[ch] (clutter_value_set_color): Constify colors and values where needed. --- ChangeLog | 5 +++++ clutter/clutter-color.c | 6 +++--- clutter/clutter-color.h | 29 +++++++++++++++-------------- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1a9aec838..944d9bb83 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-10-21 Emmanuele Bassi + + * clutter/clutter-color.[ch] (clutter_value_set_color): Constify + colors and values where needed. + 2008-10-21 Emmanuele Bassi Bug 1197 - Missing const for clutter_init_with_args * diff --git a/clutter/clutter-color.c b/clutter/clutter-color.c index 3e307c485..45191f3d3 100644 --- a/clutter/clutter-color.c +++ b/clutter/clutter-color.c @@ -779,8 +779,8 @@ clutter_value_lcopy_color (const GValue *value, * Since: 1.0 */ void -clutter_value_set_color (GValue *value, - ClutterColor *color) +clutter_value_set_color (GValue *value, + const ClutterColor *color) { g_return_if_fail (CLUTTER_VALUE_HOLDS_COLOR (value)); @@ -797,7 +797,7 @@ clutter_value_set_color (GValue *value, * * Since: 1.0 */ -const ClutterColor * +G_CONST_RETURN ClutterColor * clutter_value_get_color (const GValue *value) { g_return_val_if_fail (CLUTTER_VALUE_HOLDS_COLOR (value), NULL); diff --git a/clutter/clutter-color.h b/clutter/clutter-color.h index bd98af8a5..e07d8faf0 100644 --- a/clutter/clutter-color.h +++ b/clutter/clutter-color.h @@ -107,13 +107,9 @@ guint32 clutter_color_to_pixel (const ClutterColor *src); void clutter_color_from_pixel (ClutterColor *dest, guint32 pixel); - - - #define CLUTTER_TYPE_PARAM_COLOR (clutter_param_color_get_type ()) #define CLUTTER_PARAM_SPEC_COLOR(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), CLUTTER_TYPE_PARAM_COLOR, ClutterParamSpecColor)) #define CLUTTER_IS_PARAM_SPEC_COLOR(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), CLUTTER_TYPE_PARAM_COLOR)) -#define CLUTTER_VALUE_HOLDS_COLOR(x) (G_VALUE_HOLDS ((x), CLUTTER_TYPE_COLOR)) /** * CLUTTER_VALUE_HOLDS_COLOR: @@ -123,12 +119,18 @@ void clutter_color_from_pixel (ClutterColor *dest, * * Since: 1.0 */ +#define CLUTTER_VALUE_HOLDS_COLOR(x) (G_VALUE_HOLDS ((x), CLUTTER_TYPE_COLOR)) typedef struct _ClutterParamSpecColor ClutterParamSpecColor; /** * ClutterParamSpecColor: * @default_value: default color value + * + * A #GParamSpec subclass for defining properties holding + * a #ClutterColor. + * + * Since: 1.0 */ struct _ClutterParamSpecColor { @@ -139,17 +141,16 @@ struct _ClutterParamSpecColor ClutterColor *default_value; }; -GType clutter_param_color_get_type (void) G_GNUC_CONST; +void clutter_value_set_color (GValue *value, + const ClutterColor *color); +G_CONST_RETURN ClutterColor *clutter_value_get_color (const GValue *value); -void clutter_value_set_color (GValue *value, - ClutterColor *color); -const ClutterColor *clutter_value_get_color (const GValue *value); - -GParamSpec *clutter_param_spec_color (const gchar *name, - const gchar *nick, - const gchar *blurb, - const ClutterColor *default_value, - GParamFlags flags); +GType clutter_param_color_get_type (void) G_GNUC_CONST; +GParamSpec *clutter_param_spec_color (const gchar *name, + const gchar *nick, + const gchar *blurb, + const ClutterColor *default_value, + GParamFlags flags); G_END_DECLS