From 058f9d8540e8e18a21105573d2dfe367430916b9 Mon Sep 17 00:00:00 2001 From: seoz Date: Fri, 17 Jun 2011 09:15:29 +0000 Subject: [PATCH] elm examples: Fixed 'unused parameter' warnings. Added __UNUSED__ macro when config is not defined. git-svn-id: https://svn.enlightenment.org/svn/e/trunk/elementary@60433 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/examples/actionslider_example_01.c | 2 ++ src/examples/anchorblock_example_01.c | 18 +++++++++++------- src/examples/animator_example_01.c | 5 +++++ src/examples/bg_example_01.c | 2 ++ src/examples/bg_example_02.c | 2 ++ src/examples/bg_example_03.c | 2 ++ 6 files changed, 24 insertions(+), 7 deletions(-) diff --git a/src/examples/actionslider_example_01.c b/src/examples/actionslider_example_01.c index aeac4eb..a996198 100644 --- a/src/examples/actionslider_example_01.c +++ b/src/examples/actionslider_example_01.c @@ -4,6 +4,8 @@ #include #ifdef HAVE_CONFIG_H # include "elementary_config.h" +#else +# define __UNUSED__ #endif static void _pos_selected_cb(void *data __UNUSED__, Evas_Object *obj, void *event_info) diff --git a/src/examples/anchorblock_example_01.c b/src/examples/anchorblock_example_01.c index fe69892..ecf7831 100644 --- a/src/examples/anchorblock_example_01.c +++ b/src/examples/anchorblock_example_01.c @@ -2,12 +2,17 @@ * gcc -o anchorblock_example_01 anchorblock_example_01.c `pkg-config --cflags --libs elementary` */ #include +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" +#else +# define __UNUSED__ +#endif static void _anchorblock_clicked_cb(void *data, Evas_Object *obj, void *ev); static void _anchorview_clicked_cb(void *data, Evas_Object *obj, void *ev); int -elm_main(int argc, char *argv[]) +elm_main(int argc __UNUSED__, char *argv[] __UNUSED__) { Evas_Object *win, *box, *o, *frame; const char *anchortext = @@ -83,26 +88,26 @@ ELM_MAIN(); static void _anchor_buttons_create(Evas_Object *ao, Elm_Entry_Anchorblock_Info *info, Evas_Smart_Cb btn_end_cb); static void -_btn_anchorblock_end_cb(void *data, Evas_Object *obj, void *event_info) +_btn_anchorblock_end_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { elm_anchorblock_hover_end((Evas_Object *)data); } static void -_anchorblock_clicked_cb(void *data, Evas_Object *obj, void *event_info) +_anchorblock_clicked_cb(void *data __UNUSED__, Evas_Object *obj, void *event_info) { Elm_Entry_Anchorblock_Info *info = event_info; _anchor_buttons_create(obj, info, _btn_anchorblock_end_cb); } static void -_btn_anchorview_end_cb(void *data, Evas_Object *obj, void *event_info) +_btn_anchorview_end_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { elm_anchorview_hover_end((Evas_Object *)data); } static void -_anchorview_clicked_cb(void *data, Evas_Object *obj, void *event_info) +_anchorview_clicked_cb(void *data __UNUSED__, Evas_Object *obj, void *event_info) { /* should be an Elm_Entry_Anchorview_Info, but since both of them are * the same, it simplifies code in this example to use one only */ @@ -111,7 +116,7 @@ _anchorview_clicked_cb(void *data, Evas_Object *obj, void *event_info) } static void -_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info) +_btn_clicked_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { const char *lbl = elm_button_label_get(obj); printf("%s: %s\n", lbl, (char *)data); @@ -191,7 +196,6 @@ _anchor_buttons_create(Evas_Object *ao, Elm_Entry_Anchorblock_Info *info, Evas_S } else if (!strncmp(info->name, "mailto:", 7)) { - Evas_Object *o; elm_button_label_set(btn, "Send E-Mail"); secondary = elm_button_add(ao); diff --git a/src/examples/animator_example_01.c b/src/examples/animator_example_01.c index eea2bb6..04272ed 100644 --- a/src/examples/animator_example_01.c +++ b/src/examples/animator_example_01.c @@ -3,6 +3,11 @@ #include #include +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" +#else +# define __UNUSED__ +#endif static void on_done(void *data, Evas_Object *obj, void *event_info) diff --git a/src/examples/bg_example_01.c b/src/examples/bg_example_01.c index d5de042..540e056 100644 --- a/src/examples/bg_example_01.c +++ b/src/examples/bg_example_01.c @@ -4,6 +4,8 @@ #include #ifdef HAVE_CONFIG_H # include "elementary_config.h" +#else +# define __UNUSED__ #endif static void diff --git a/src/examples/bg_example_02.c b/src/examples/bg_example_02.c index 7ace473..5b8c1ec 100644 --- a/src/examples/bg_example_02.c +++ b/src/examples/bg_example_02.c @@ -5,6 +5,8 @@ #include #ifdef HAVE_CONFIG_H # include "elementary_config.h" +#else +# define __UNUSED__ #endif static void diff --git a/src/examples/bg_example_03.c b/src/examples/bg_example_03.c index 905a41a..f02d319 100644 --- a/src/examples/bg_example_03.c +++ b/src/examples/bg_example_03.c @@ -5,6 +5,8 @@ #include #ifdef HAVE_CONFIG_H # include "elementary_config.h" +#else +# define __UNUSED__ #endif static void -- 2.7.4