[clutter-tutorial] Fix warnings, mostly by using G_GNUC_UNUSED.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter-tutorial] Fix warnings, mostly by using G_GNUC_UNUSED.
- Date: Mon, 2 Aug 2010 17:12:07 +0000 (UTC)
commit 521f639aac176b90d98764e28cbf25d878e1f61f
Author: Murray Cumming <murrayc murrayc com>
Date: Mon Aug 2 17:13:24 2010 +0200
Fix warnings, mostly by using G_GNUC_UNUSED.
* examples/animation/main.c (on_alpha):
* examples/behaviour/main.c (on_alpha):
* examples/custom_container/examplebox.c
(example_box_get_preferred_height), (example_box_allocate):
* examples/full_example/main.c (on_foreach_clear_list_items),
(on_timeline_moveup_completed), (on_timeline_rotation_completed),
(on_texture_button_press):
* examples/score/main.c (on_timeline_rotation_new_frame),
(on_timeline_move_new_frame):
* examples/scrolling/main.c (on_stage_button_press):
* examples/scrolling/scrollingcontainer.c
(example_scrolling_container_allocate):
* examples/stage/main.c (on_stage_button_press):
* examples/timeline/main.c (on_timeline_new_frame),
(on_timeline_marker_reached): Add G_GNUC_UNUSED
* examples/gtk_embed/main.c (on_button_clicked): : Add G_GNUC_UNUSED.
(on_stage_button_press): Use float instead of int with
clutter_event_get_coords().
ChangeLog | 23 +++++++++++++++++++++++
examples/animation/main.c | 2 +-
examples/behaviour/main.c | 2 +-
examples/custom_container/examplebox.c | 4 ++--
examples/full_example/main.c | 8 ++++----
examples/gtk_embed/main.c | 10 +++++-----
examples/score/main.c | 8 ++++----
examples/scrolling/main.c | 2 +-
examples/scrolling/scrollingcontainer.c | 2 +-
examples/stage/main.c | 2 +-
examples/timeline/main.c | 8 ++++----
11 files changed, 47 insertions(+), 24 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index c390e34..1840cee 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,26 @@
+2010-08-02 Murray Cumming <murrayc murrayc com>
+
+ Fix warnings, mostly by using G_GNUC_UNUSED.
+
+ * examples/animation/main.c (on_alpha):
+ * examples/behaviour/main.c (on_alpha):
+ * examples/custom_container/examplebox.c
+ (example_box_get_preferred_height), (example_box_allocate):
+ * examples/full_example/main.c (on_foreach_clear_list_items),
+ (on_timeline_moveup_completed), (on_timeline_rotation_completed),
+ (on_texture_button_press):
+ * examples/score/main.c (on_timeline_rotation_new_frame),
+ (on_timeline_move_new_frame):
+ * examples/scrolling/main.c (on_stage_button_press):
+ * examples/scrolling/scrollingcontainer.c
+ (example_scrolling_container_allocate):
+ * examples/stage/main.c (on_stage_button_press):
+ * examples/timeline/main.c (on_timeline_new_frame),
+ (on_timeline_marker_reached): Add G_GNUC_UNUSED
+ * examples/gtk_embed/main.c (on_button_clicked): : Add G_GNUC_UNUSED.
+ (on_stage_button_press): Use float instead of int with
+ clutter_event_get_coords().
+
2010-06-14 Murray Cumming <murrayc murrayc com>
Animation example: Don't unref the animation before even running main loop.
diff --git a/examples/animation/main.c b/examples/animation/main.c
index b44a183..76c1168 100644
--- a/examples/animation/main.c
+++ b/examples/animation/main.c
@@ -25,7 +25,7 @@ ClutterActor *rect = NULL;
*
*/
gdouble
-on_alpha (ClutterAlpha *alpha, gpointer data)
+on_alpha (ClutterAlpha *alpha, gpointer data G_GNUC_UNUSED)
{
/* Get the position in the timeline,
* so we can base our value upon it:
diff --git a/examples/behaviour/main.c b/examples/behaviour/main.c
index 6b770d8..960e7fe 100644
--- a/examples/behaviour/main.c
+++ b/examples/behaviour/main.c
@@ -24,7 +24,7 @@ ClutterActor *rect = NULL;
* clutter_timeline_new().
*/
gdouble
-on_alpha (ClutterAlpha *alpha, gpointer data)
+on_alpha (ClutterAlpha *alpha, gpointer data G_GNUC_UNUSED)
{
/* Get the position in the timeline,
* so we can base our value upon it:
diff --git a/examples/custom_container/examplebox.c b/examples/custom_container/examplebox.c
index 83b470c..c07fd44 100644
--- a/examples/custom_container/examplebox.c
+++ b/examples/custom_container/examplebox.c
@@ -231,7 +231,7 @@ example_box_get_preferred_width (ClutterActor *actor,
/* An implementation for the ClutterActor::get_preferred_height() vfunc: */
static void
example_box_get_preferred_height (ClutterActor *actor,
- float for_width,
+ float for_width G_GNUC_UNUSED,
float *min_height_p,
float *natural_height_p)
{
@@ -290,7 +290,7 @@ example_box_allocate (ClutterActor *actor,
/* Calculate the position and size that the child may actually have: */
/* Position the child just after the previous child, horizontally: */
- ClutterActorBox child_box = { 0, };
+ ClutterActorBox child_box = { 0, 0, 0, 0};
child_box.x1 = child_x;
child_box.x2 = child_x + child_width;
child_x = child_box.x2;
diff --git a/examples/full_example/main.c b/examples/full_example/main.c
index a0ca0ca..5500037 100644
--- a/examples/full_example/main.c
+++ b/examples/full_example/main.c
@@ -53,7 +53,7 @@ Item* item_at_front = NULL;
GSList *list_items = 0;
-void on_foreach_clear_list_items(gpointer data, gpointer user_data)
+void on_foreach_clear_list_items(gpointer data, gpointer user_data G_GNUC_UNUSED)
{
Item* item = (Item*)data;
@@ -183,7 +183,7 @@ gdouble angle_in_360(gdouble angle)
/* This signal handler is called when the item has finished
* moving up and increasing in size.
*/
-void on_timeline_moveup_completed(ClutterTimeline* timeline, gpointer user_data)
+void on_timeline_moveup_completed(ClutterTimeline* timeline G_GNUC_UNUSED, gpointer user_data G_GNUC_UNUSED)
{
/* Unref this timeline because we have now finished with it: */
g_object_unref (timeline_moveup);
@@ -202,7 +202,7 @@ void on_timeline_moveup_completed(ClutterTimeline* timeline, gpointer user_data)
/* This signal handler is called when the items have completely
* rotated around the ellipse.
*/
-void on_timeline_rotation_completed(ClutterTimeline* timeline, gpointer user_data)
+void on_timeline_rotation_completed(ClutterTimeline* timeline G_GNUC_UNUSED, gpointer user_data G_GNUC_UNUSED)
{
/* All the items have now been rotated so that the clicked item is at the
* front. Now we transform just this one item gradually some more, and
@@ -347,7 +347,7 @@ void rotate_all_until_item_is_at_front(Item *item)
}
static gboolean
-on_texture_button_press (ClutterActor *actor, ClutterEvent *event, gpointer user_data)
+on_texture_button_press (ClutterActor *actor G_GNUC_UNUSED, ClutterEvent *event G_GNUC_UNUSED, gpointer user_data G_GNUC_UNUSED)
{
/* Ignore the events if the timeline_rotation is running (meaning, if the objects are moving),
* to simplify things:
diff --git a/examples/gtk_embed/main.c b/examples/gtk_embed/main.c
index 96e27ad..a128312 100644
--- a/examples/gtk_embed/main.c
+++ b/examples/gtk_embed/main.c
@@ -22,7 +22,7 @@
ClutterActor *stage = NULL;
static gboolean
-on_button_clicked (GtkButton *button, gpointer user_data)
+on_button_clicked (GtkButton *button G_GNUC_UNUSED, gpointer user_data G_GNUC_UNUSED)
{
static gboolean already_changed = FALSE;
if(already_changed)
@@ -42,13 +42,13 @@ on_button_clicked (GtkButton *button, gpointer user_data)
}
static gboolean
-on_stage_button_press (ClutterStage *stage, ClutterEvent *event, gpointer user_data)
+on_stage_button_press (ClutterStage *stage G_GNUC_UNUSED, ClutterEvent *event, gpointer user_data G_GNUC_UNUSED)
{
- gint x = 0;
- gint y = 0;
+ gfloat x = 0;
+ gfloat y = 0;
clutter_event_get_coords (event, &x, &y);
- g_print ("Stage clicked at (%d, %d)\n", x, y);
+ g_print ("Stage clicked at (%f, %f)\n", x, y);
return TRUE; /* Stop further handling of this event. */
}
diff --git a/examples/score/main.c b/examples/score/main.c
index 61d06ed..89a9e18 100644
--- a/examples/score/main.c
+++ b/examples/score/main.c
@@ -24,8 +24,8 @@ gint color_change_count = 0;
/* Rotate the rectangle and alternate its color. */
void
-on_timeline_rotation_new_frame (ClutterTimeline *timeline,
- gint frame_num, gpointer data)
+on_timeline_rotation_new_frame (ClutterTimeline *timeline G_GNUC_UNUSED,
+ gint frame_num G_GNUC_UNUSED, gpointer data G_GNUC_UNUSED)
{
rotation_angle += 1;
if(rotation_angle >= 360)
@@ -56,8 +56,8 @@ on_timeline_rotation_new_frame (ClutterTimeline *timeline,
/* Move the rectangle. */
void
-on_timeline_move_new_frame (ClutterTimeline *timeline,
- gint frame_num, gpointer data)
+on_timeline_move_new_frame (ClutterTimeline *timeline G_GNUC_UNUSED,
+ gint frame_num G_GNUC_UNUSED, gpointer data G_GNUC_UNUSED)
{
gint x_position = clutter_actor_get_x (rect);
diff --git a/examples/scrolling/main.c b/examples/scrolling/main.c
index cb3bc49..2d8a660 100644
--- a/examples/scrolling/main.c
+++ b/examples/scrolling/main.c
@@ -22,7 +22,7 @@ ClutterActor *scrolling = NULL;
static gboolean
-on_stage_button_press (ClutterStage *stage, ClutterEvent *event, gpointer data)
+on_stage_button_press (ClutterStage *stage G_GNUC_UNUSED, ClutterEvent *event G_GNUC_UNUSED, gpointer data G_GNUC_UNUSED)
{
printf ("Scrolling\n");
diff --git a/examples/scrolling/scrollingcontainer.c b/examples/scrolling/scrollingcontainer.c
index a5f9ccb..85f163d 100644
--- a/examples/scrolling/scrollingcontainer.c
+++ b/examples/scrolling/scrollingcontainer.c
@@ -175,7 +175,7 @@ example_scrolling_container_allocate (ClutterActor *actor,
height = 0;
/* Arrange the group: */
- ClutterActorBox child_box = { 0, };
+ ClutterActorBox child_box = {0, 0, 0, 0};
child_box.x1 = 0;
child_box.x2 = width;
diff --git a/examples/stage/main.c b/examples/stage/main.c
index f37a764..bd34ae9 100644
--- a/examples/stage/main.c
+++ b/examples/stage/main.c
@@ -18,7 +18,7 @@
#include <stdlib.h>
static gboolean
-on_stage_button_press (ClutterStage *stage, ClutterEvent *event, gpointer data)
+on_stage_button_press (ClutterStage *stage G_GNUC_UNUSED, ClutterEvent *event, gpointer data G_GNUC_UNUSED)
{
float x = 0;
float y = 0;
diff --git a/examples/timeline/main.c b/examples/timeline/main.c
index 2b8b330..3193582 100644
--- a/examples/timeline/main.c
+++ b/examples/timeline/main.c
@@ -23,8 +23,8 @@ gint rotation_angle = 0;
gint color_change_count = 0;
void
-on_timeline_new_frame (ClutterTimeline *timeline,
- gint frame_num, gpointer data)
+on_timeline_new_frame (ClutterTimeline *timeline G_GNUC_UNUSED,
+ gint frame_num G_GNUC_UNUSED, gpointer data G_GNUC_UNUSED)
{
rotation_angle += 1;
if(rotation_angle >= 360)
@@ -54,10 +54,10 @@ on_timeline_new_frame (ClutterTimeline *timeline,
}
void
-on_timeline_marker_reached (ClutterTimeline* timeline,
+on_timeline_marker_reached (ClutterTimeline* timeline G_GNUC_UNUSED,
gchar* marker_name,
gint frame_num,
- gpointer user_data)
+ gpointer user_data G_GNUC_UNUSED)
{
printf ("Reached marker %s at frame %d.\n",
marker_name, frame_num);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]