From 2764fa2f87a46ef1a19093b2d6982428bbdcae05 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Mon, 4 Feb 2008 22:35:38 +0000 Subject: [PATCH] 2008-02-04 Emmanuele Bassi * clutter/clutter-actor.c: * clutter/clutter-shader.c: Small documentation and style fixes * tests/test-scale.c: Constify the gravities array. --- ChangeLog | 7 +++++++ clutter/clutter-actor.c | 16 +++++++--------- clutter/clutter-shader.c | 11 ++--------- tests/test-scale.c | 11 +++++++---- 4 files changed, 23 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6ddc9e805..2b7aa7634 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-02-04 Emmanuele Bassi + + * clutter/clutter-actor.c: + * clutter/clutter-shader.c: Small documentation and style fixes + + * tests/test-scale.c: Constify the gravities array. + 2008-02-04 Chris Lord * clutter/clutter-actor.c: (clutter_actor_transform_stage_point): diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index f1283b832..71eab171f 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -1218,9 +1218,9 @@ clutter_actor_set_property (GObject *object, static void clutter_actor_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) + guint prop_id, + GValue *value, + GParamSpec *pspec) { ClutterActor *actor; ClutterActorPrivate *priv; @@ -5033,11 +5033,11 @@ destroy_shader_data (ClutterActor *self) /** * clutter_actor_get_shader: * @self: a #ClutterActor - * @shader: a #ClutterShader or %NULL * * Queries the currently set #ClutterShader on @self. * - * Return value: The currently set #ClutterShader or NULL if no shader is set. + * Return value: The currently set #ClutterShader or %NULL if no + * shader is set. * * Since: 0.6 */ @@ -5053,9 +5053,8 @@ clutter_actor_get_shader (ClutterActor *self) shader_data = actor_priv->shader_data; if (!shader_data) - { - return NULL; - } + return NULL; + return shader_data->shader; } @@ -5109,7 +5108,6 @@ clutter_actor_set_shader (ClutterActor *self, shader_data->shader = g_object_ref (shader); } - clutter_actor_queue_redraw (self); return TRUE; diff --git a/clutter/clutter-shader.c b/clutter/clutter-shader.c index edcf2df03..3164314f9 100644 --- a/clutter/clutter-shader.c +++ b/clutter/clutter-shader.c @@ -340,10 +340,7 @@ clutter_shader_set_fragment_source (ClutterShader *shader, is_glsl = !g_str_has_prefix (data, "!!ARBfp"); - if (priv->fragment_source) - { - g_free (priv->fragment_source); - } + g_free (priv->fragment_source); CLUTTER_NOTE (SHADER, "setting fragment shader (GLSL:%s, len:%" G_GSSIZE_FORMAT ")", @@ -387,13 +384,9 @@ clutter_shader_set_vertex_source (ClutterShader *shader, if (clutter_shader_is_bound (shader)) clutter_shader_release (shader); - is_glsl = !g_str_has_prefix (data, "!!ARBvp"); - if (priv->vertex_source) - { - g_free (priv->vertex_source); - } + g_free (priv->vertex_source); CLUTTER_NOTE (SHADER, "setting vertex shader (GLSL:%s, len:%" G_GSSIZE_FORMAT ")", diff --git a/tests/test-scale.c b/tests/test-scale.c index daf404430..4ed38f780 100644 --- a/tests/test-scale.c +++ b/tests/test-scale.c @@ -1,7 +1,7 @@ #include #include -ClutterGravity gravities[] = { +static const ClutterGravity gravities[] = { CLUTTER_GRAVITY_NORTH_EAST, CLUTTER_GRAVITY_NORTH, CLUTTER_GRAVITY_NORTH_WEST, @@ -14,9 +14,9 @@ ClutterGravity gravities[] = { CLUTTER_GRAVITY_NONE }; -gint gindex = 0; +static gint gindex = 0; -void +static void on_timeline_completed (ClutterTimeline *cluttertimeline, gpointer data) { @@ -59,7 +59,7 @@ main (int argc, char *argv[]) clutter_group_add (CLUTTER_GROUP (stage), rect); - timeline = clutter_timeline_new (20, 30); + timeline = clutter_timeline_new_for_duration (750); alpha = clutter_alpha_new_full (timeline, CLUTTER_ALPHA_RAMP, NULL, NULL); @@ -79,5 +79,8 @@ main (int argc, char *argv[]) clutter_main(); + g_object_unref (timeline); + g_object_unref (behave); + return EXIT_SUCCESS; }