> Well, we didn't add the elementary_config.h in the examples to try to > keep them as simple as possible
Yeah, I agree with you. But I added that to void compiler warnings with "-W -Wall -Wextra" option. I think we can just decide whether to use it or not. > But if it's better to keep them, I > would suggest to also define __UNUSED__ to nothing Agreed. I added them. Thanks! Daniel Juyung Seo (SeoZ) On Fri, Jun 17, 2011 at 4:49 AM, Rafael Antognolli <[email protected]> wrote: > Hello Daniel, > > Well, we didn't add the elementary_config.h in the examples to try to > keep them as simple as possible. But if it's better to keep them, I > would suggest to also define __UNUSED__ to nothing, just in case > someone tries to compile the example manually, with the gcc line > commented inside its code. Something like: > > #include <Elementary.h> > #ifdef HAVE_CONFIG_H > # include "elementary_config.h" > #else > # define __UNUSED__ > #endif > > > On Thu, Jun 16, 2011 at 2:55 PM, Enlightenment SVN > <[email protected]> wrote: >> Log: >> elm examples: Fixed 'unused parameter' warnings. >> >> >> Author: seoz >> Date: 2011-06-16 10:55:31 -0700 (Thu, 16 Jun 2011) >> New Revision: 60404 >> Trac: http://trac.enlightenment.org/e/changeset/60404 >> >> Modified: >> trunk/elementary/src/examples/actionslider_example_01.c >> trunk/elementary/src/examples/bg_example_01.c >> trunk/elementary/src/examples/bg_example_02.c >> trunk/elementary/src/examples/bg_example_03.c >> >> Modified: trunk/elementary/src/examples/actionslider_example_01.c >> =================================================================== >> --- trunk/elementary/src/examples/actionslider_example_01.c 2011-06-16 >> 17:45:38 UTC (rev 60403) >> +++ trunk/elementary/src/examples/actionslider_example_01.c 2011-06-16 >> 17:55:31 UTC (rev 60404) >> @@ -2,15 +2,18 @@ >> //gcc -g `pkg-config --cflags --libs elementary` actionslider_example_01.c >> -o actionslider_example_01 >> >> #include <Elementary.h> >> +#ifdef HAVE_CONFIG_H >> +# include "elementary_config.h" >> +#endif >> >> -static void _pos_selected_cb(void *data, Evas_Object *obj, void *event_info) >> +static void _pos_selected_cb(void *data __UNUSED__, Evas_Object *obj, void >> *event_info) >> { >> printf("Selection: %s\n", (char *)event_info); >> printf("Label selected: %s\n", elm_actionslider_selected_label_get(obj)); >> } >> >> static void >> -_position_change_magnetic_cb(void *data, Evas_Object * obj, void >> *event_info) >> +_position_change_magnetic_cb(void *data __UNUSED__, Evas_Object * obj, void >> *event_info) >> { >> if (!strcmp((char *)event_info, "left")) >> elm_actionslider_magnet_pos_set(obj, ELM_ACTIONSLIDER_LEFT); >> @@ -19,7 +22,7 @@ >> } >> >> static void >> -_magnet_enable_disable_cb(void *data, Evas_Object *obj, void *event_info) >> +_magnet_enable_disable_cb(void *data __UNUSED__, Evas_Object *obj, void >> *event_info) >> { >> if (!strcmp((char *)event_info, "left")) >> elm_actionslider_magnet_pos_set(obj, ELM_ACTIONSLIDER_CENTER); >> @@ -28,13 +31,13 @@ >> } >> >> static void >> -on_done(void *data, Evas_Object *obj, void *event_info) >> +on_done(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void >> *event_info __UNUSED__) >> { >> elm_exit(); >> } >> >> EAPI int >> -elm_main(int argc, char **argv) >> +elm_main(int argc __UNUSED__, char **argv __UNUSED__) >> { >> Evas_Object *win, *bg, *bx, *as; >> >> >> Modified: trunk/elementary/src/examples/bg_example_01.c >> =================================================================== >> --- trunk/elementary/src/examples/bg_example_01.c 2011-06-16 17:45:38 >> UTC (rev 60403) >> +++ trunk/elementary/src/examples/bg_example_01.c 2011-06-16 17:55:31 >> UTC (rev 60404) >> @@ -2,16 +2,19 @@ >> //gcc -g `pkg-config --cflags --libs elementary` bg_example_03.c -o >> bg_example_03 >> >> #include <Elementary.h> >> +#ifdef HAVE_CONFIG_H >> +# include "elementary_config.h" >> +#endif >> >> static void >> -on_done(void *data, Evas_Object *obj, void *event_info) >> +on_done(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void >> *event_info __UNUSED__) >> { >> /* quit the mainloop (elm_run) */ >> elm_exit(); >> } >> >> int >> -elm_main(int argc, char **argv) >> +elm_main(int argc __UNUSED__, char **argv __UNUSED__) >> { >> Evas_Object *win, *bg; >> >> >> Modified: trunk/elementary/src/examples/bg_example_02.c >> =================================================================== >> --- trunk/elementary/src/examples/bg_example_02.c 2011-06-16 17:45:38 >> UTC (rev 60403) >> +++ trunk/elementary/src/examples/bg_example_02.c 2011-06-16 17:55:31 >> UTC (rev 60404) >> @@ -3,16 +3,19 @@ >> // where directory is the a path where images/plant_01.jpg can be found. >> >> #include <Elementary.h> >> +#ifdef HAVE_CONFIG_H >> +# include "elementary_config.h" >> +#endif >> >> static void >> -on_done(void *data, Evas_Object *obj, void *event_info) >> +on_done(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void >> *event_info __UNUSED__) >> { >> /* quit the mainloop (elm_run) */ >> elm_exit(); >> } >> >> int >> -elm_main(int argc, char **argv) >> +elm_main(int argc __UNUSED__, char **argv __UNUSED__) >> { >> Evas_Object *win, *bg; >> char buf[PATH_MAX]; >> >> Modified: trunk/elementary/src/examples/bg_example_03.c >> =================================================================== >> --- trunk/elementary/src/examples/bg_example_03.c 2011-06-16 17:45:38 >> UTC (rev 60403) >> +++ trunk/elementary/src/examples/bg_example_03.c 2011-06-16 17:55:31 >> UTC (rev 60404) >> @@ -3,16 +3,19 @@ >> // where directory is the a path where images/plant_01.jpg can be found. >> >> #include <Elementary.h> >> +#ifdef HAVE_CONFIG_H >> +# include "elementary_config.h" >> +#endif >> >> static void >> -on_done(void *data, Evas_Object *obj, void *event_info) >> +on_done(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void >> *event_info __UNUSED__) >> { >> /* quit the mainloop (elm_run) */ >> elm_exit(); >> } >> >> static void >> -_cb_radio_changed(void *data, Evas_Object *obj, void *event) >> +_cb_radio_changed(void *data, Evas_Object *obj, void *event __UNUSED__) >> { >> Evas_Object *o_bg = data; >> >> @@ -20,7 +23,7 @@ >> } >> >> static void >> -_cb_overlay_changed(void *data, Evas_Object *obj, void *event) >> +_cb_overlay_changed(void *data, Evas_Object *obj, void *event __UNUSED__) >> { >> Evas_Object *o_bg = data; >> >> @@ -40,7 +43,7 @@ >> } >> >> static void >> -_cb_color_changed(void *data, Evas_Object *obj, void *event) >> +_cb_color_changed(void *data, Evas_Object *obj, void *event __UNUSED__) >> { >> Evas_Object *o_bg = data; >> double val = 0.0; >> @@ -57,7 +60,7 @@ >> } >> >> int >> -elm_main(int argc, char **argv) >> +elm_main(int argc __UNUSED__, char **argv __UNUSED__) >> { >> Evas_Object *win, *bg; >> Evas_Object *box, *hbox, *o_bg; >> >> >> ------------------------------------------------------------------------------ >> EditLive Enterprise is the world's most technically advanced content >> authoring tool. Experience the power of Track Changes, Inline Image >> Editing and ensure content is compliant with Accessibility Checking. >> http://p.sf.net/sfu/ephox-dev2dev >> _______________________________________________ >> enlightenment-svn mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/enlightenment-svn >> > > > Regards, > -- > Rafael Antognolli > ProFUSION embedded systems > http://profusion.mobi > > ------------------------------------------------------------------------------ > EditLive Enterprise is the world's most technically advanced content > authoring tool. Experience the power of Track Changes, Inline Image > Editing and ensure content is compliant with Accessibility Checking. > http://p.sf.net/sfu/ephox-dev2dev > _______________________________________________ > enlightenment-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel > ------------------------------------------------------------------------------ EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev _______________________________________________ enlightenment-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
