From 5bad69d26262f3752bbd75dd488514d46662d9de Mon Sep 17 00:00:00 2001 From: caro Date: Sun, 24 Apr 2011 17:14:34 +0000 Subject: [PATCH] Expedite: warnings-- git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/expedite@58872 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- configure.ac | 1 + m4/ac_attribute.m4 | 47 +++++++++++++++++++++++++++++ src/bin/about.c | 2 +- src/bin/engine_software_gdi.c | 3 +- src/bin/image_data_argb.c | 3 +- src/bin/image_data_argb_alpha.c | 3 +- src/bin/ui.c | 16 +++++----- src/bin/widgets_file_icons.c | 4 +-- src/bin/widgets_file_icons_2.c | 4 +-- src/bin/widgets_file_icons_2_grouped.c | 4 +-- src/bin/widgets_file_icons_2_same.c | 4 +-- src/bin/widgets_file_icons_2_same_grouped.c | 4 +-- src/bin/widgets_file_icons_3.c | 4 +-- src/bin/widgets_file_icons_4.c | 4 +-- src/bin/widgets_list_1.c | 4 +-- src/bin/widgets_list_1_grouped.c | 4 +-- src/bin/widgets_list_2.c | 4 +-- src/bin/widgets_list_2_grouped.c | 4 +-- src/bin/widgets_list_3.c | 4 +-- src/bin/widgets_list_3_grouped.c | 4 +-- src/bin/widgets_list_4.c | 4 +-- src/bin/widgets_list_4_grouped.c | 4 +-- 22 files changed, 75 insertions(+), 60 deletions(-) create mode 100644 m4/ac_attribute.m4 diff --git a/configure.ac b/configure.ac index ae3ad89..e5dc838 100644 --- a/configure.ac +++ b/configure.ac @@ -189,6 +189,7 @@ AM_PROG_CC_STDC AC_HEADER_STDC AC_C_CONST AM_PROG_CC_C_O +AC_C___ATTRIBUTE__ WIN32_CFLAGS="" case "$host_os" in diff --git a/m4/ac_attribute.m4 b/m4/ac_attribute.m4 new file mode 100644 index 0000000..23479a9 --- /dev/null +++ b/m4/ac_attribute.m4 @@ -0,0 +1,47 @@ +dnl Copyright (C) 2004-2008 Kim Woelders +dnl Copyright (C) 2008 Vincent Torri +dnl That code is public domain and can be freely used or copied. +dnl Originally snatched from somewhere... + +dnl Macro for checking if the compiler supports __attribute__ + +dnl Usage: AC_C___ATTRIBUTE__ +dnl call AC_DEFINE for HAVE___ATTRIBUTE__ and __UNUSED__ +dnl if the compiler supports __attribute__, HAVE___ATTRIBUTE__ is +dnl defined to 1 and __UNUSED__ is defined to __attribute__((unused)) +dnl otherwise, HAVE___ATTRIBUTE__ is not defined and __UNUSED__ is +dnl defined to nothing. + +AC_DEFUN([AC_C___ATTRIBUTE__], +[ + +AC_MSG_CHECKING([for __attribute__]) + +AC_CACHE_VAL([ac_cv___attribute__], + [AC_TRY_COMPILE( + [ +#include + +int func(int x); +int foo(int x __attribute__ ((unused))) +{ + exit(1); +} + ], + [], + [ac_cv___attribute__="yes"], + [ac_cv___attribute__="no"] + )]) + +AC_MSG_RESULT($ac_cv___attribute__) + +if test "x${ac_cv___attribute__}" = "xyes" ; then + AC_DEFINE([HAVE___ATTRIBUTE__], [1], [Define to 1 if your compiler has __attribute__]) + AC_DEFINE([__UNUSED__], [__attribute__((unused))], [Macro declaring a function argument to be unused]) + else + AC_DEFINE([__UNUSED__], [], [Macro declaring a function argument to be unused]) +fi + +]) + +dnl End of ac_attribute.m4 diff --git a/src/bin/about.c b/src/bin/about.c index deb6bbe..f36fdbc 100644 --- a/src/bin/about.c +++ b/src/bin/about.c @@ -56,7 +56,7 @@ _cleanup(void) } static void -_loop(double t, int f) +_loop(double t __UNUSED__, int f __UNUSED__) { } diff --git a/src/bin/engine_software_gdi.c b/src/bin/engine_software_gdi.c index 6832986..ecb2754 100644 --- a/src/bin/engine_software_gdi.c +++ b/src/bin/engine_software_gdi.c @@ -172,7 +172,7 @@ MainWndProc(HWND hwnd, } Eina_Bool -engine_software_gdi_args(const char *engine, int width, int height) +engine_software_gdi_args(const char *engine __UNUSED__, int width, int height) { WNDCLASS wc; RECT rect; @@ -181,7 +181,6 @@ engine_software_gdi_args(const char *engine, int width, int height) DWORD style; DWORD exstyle; int depth; - int i; instance = GetModuleHandle(NULL); if (!instance) return EINA_FALSE; diff --git a/src/bin/image_data_argb.c b/src/bin/image_data_argb.c index c063766..90f6779 100644 --- a/src/bin/image_data_argb.c +++ b/src/bin/image_data_argb.c @@ -52,7 +52,7 @@ static void _loop(double t, int f) for (i = 0; i < 1; i++) { unsigned int *data, *p; - int ff; + w = 640; h = 480; x = (win_w / 2) - (w / 2); @@ -63,7 +63,6 @@ static void _loop(double t, int f) data = evas_object_image_data_get(o_images[i], 1); st = evas_object_image_stride_get(o_images[i]) >> 2; p = data; - ff = (f ^ (f << 8) ^ (f << 16) ^ (f << 24)); for (y = 0; y < h; y++) { for (x = 0; x < w; x++) diff --git a/src/bin/image_data_argb_alpha.c b/src/bin/image_data_argb_alpha.c index 6c7fc33..1498fb7 100644 --- a/src/bin/image_data_argb_alpha.c +++ b/src/bin/image_data_argb_alpha.c @@ -52,7 +52,7 @@ static void _loop(double t, int f) for (i = 0; i < 1; i++) { unsigned int *data, *p; - int ff, a, r, g, b; + int a, r, g, b; w = 640; h = 480; x = (win_w / 2) - (w / 2); @@ -63,7 +63,6 @@ static void _loop(double t, int f) data = evas_object_image_data_get(o_images[i], 1); st = evas_object_image_stride_get(o_images[i]) >> 2; p = data; - ff = (f ^ (f << 8) ^ (f << 16) ^ (f << 24)); for (y = 0; y < h; y++) { for (x = 0; x < w; x++) diff --git a/src/bin/ui.c b/src/bin/ui.c index 9e1dad7..b5db731 100644 --- a/src/bin/ui.c +++ b/src/bin/ui.c @@ -194,7 +194,7 @@ _ui_all(void) double fps = 0.0; double wfps = 0.0; int t_count = 0; - int i; + unsigned int i; double avgw = 0.0; evas_object_hide(o_menu_logo); @@ -281,7 +281,7 @@ _ui_num(int n) double wfps = 0.0; int t_count = 0; Menu_Item *mi; - int i; + unsigned int i; double avgw = 0.0; evas_object_hide(o_menu_logo); @@ -359,7 +359,7 @@ _ui_select(void) } static void -_ui_key(void *data, Evas *e, Evas_Object *obj, void *event_info) +_ui_key(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) { Evas_Event_Key_Down *ev; @@ -380,7 +380,7 @@ _ui_key(void *data, Evas *e, Evas_Object *obj, void *event_info) if (!strcmp(ev->keyname, "Left")) menu_sel++; if (!strcmp(ev->keyname, "Right")) menu_sel--; if (menu_sel < 0) menu_sel = 0; - else if (menu_sel >= eina_list_count(menu)) menu_sel = eina_list_count(menu) - 1; + else if ((unsigned int)menu_sel >= eina_list_count(menu)) menu_sel = eina_list_count(menu) - 1; menu_anim_sel = menu_sel; if (!strcmp(ev->keyname, "Return")) _ui_select(); } @@ -391,7 +391,7 @@ static int down = 0; static int down_menu_sel = 0; static void -_ui_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info) +_ui_mouse_down(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) { Evas_Event_Mouse_Down *ev; @@ -410,7 +410,7 @@ _ui_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info) } static void -_ui_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info) +_ui_mouse_up(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) { Evas_Event_Mouse_Up *ev; @@ -435,7 +435,7 @@ _ui_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info) } static void -_ui_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_info) +_ui_mouse_move(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) { Evas_Event_Mouse_Move *ev; @@ -446,7 +446,7 @@ _ui_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_info) menu_sel = down_menu_sel + ((ev->cur.canvas.x - down_x) / 25); /* scroll */ if (menu_sel < 0) menu_sel = 0; - else if (menu_sel >= eina_list_count(menu)) menu_sel = eina_list_count(menu) - 1; + else if ((unsigned int)menu_sel >= eina_list_count(menu)) menu_sel = eina_list_count(menu) - 1; menu_anim_sel = menu_sel; } else diff --git a/src/bin/widgets_file_icons.c b/src/bin/widgets_file_icons.c index bf1e230..f603c57 100644 --- a/src/bin/widgets_file_icons.c +++ b/src/bin/widgets_file_icons.c @@ -77,11 +77,9 @@ static void _cleanup(void) static void _loop(double t, int f) { int i; - Evas_Coord x, y, w, h, tw, th, cent; + Evas_Coord x, y, tw, th, cent; x = 0; y = 0 - f; - w = ICON_SIZE; - h = ICON_SIZE; for (i = 0; i < NUM; i++) { evas_object_move(o_images[i], x + 8, y); diff --git a/src/bin/widgets_file_icons_2.c b/src/bin/widgets_file_icons_2.c index cf54f5b..8536d3b 100644 --- a/src/bin/widgets_file_icons_2.c +++ b/src/bin/widgets_file_icons_2.c @@ -75,11 +75,9 @@ static void _cleanup(void) static void _loop(double t, int f) { int i; - Evas_Coord x, y, w, h, tw, th, cent; + Evas_Coord x, y, tw, th, cent; x = 0; y = 0 - f; - w = ICON_SIZE; - h = ICON_SIZE; for (i = 0; i < NUM; i++) { evas_object_move(o_images[i], x + 8, y); diff --git a/src/bin/widgets_file_icons_2_grouped.c b/src/bin/widgets_file_icons_2_grouped.c index 87dc91c..31b6c1b 100644 --- a/src/bin/widgets_file_icons_2_grouped.c +++ b/src/bin/widgets_file_icons_2_grouped.c @@ -83,11 +83,9 @@ static void _cleanup(void) static void _loop(double t, int f) { int i; - Evas_Coord x, y, w, h, tw, th, cent; + Evas_Coord x, y, tw, th, cent; x = 0; y = 0 - f; - w = ICON_SIZE; - h = ICON_SIZE; for (i = 0; i < NUM; i++) { evas_object_move(o_images[i], x + 8, y); diff --git a/src/bin/widgets_file_icons_2_same.c b/src/bin/widgets_file_icons_2_same.c index 47b9b48..7dbf9ff 100644 --- a/src/bin/widgets_file_icons_2_same.c +++ b/src/bin/widgets_file_icons_2_same.c @@ -60,11 +60,9 @@ static void _cleanup(void) static void _loop(double t, int f) { int i; - Evas_Coord x, y, w, h, tw, th, cent; + Evas_Coord x, y, tw, th, cent; x = 0; y = 0 - f; - w = ICON_SIZE; - h = ICON_SIZE; for (i = 0; i < NUM; i++) { evas_object_move(o_images[i], x + 8, y); diff --git a/src/bin/widgets_file_icons_2_same_grouped.c b/src/bin/widgets_file_icons_2_same_grouped.c index 5a2e6a0..f5e8324 100644 --- a/src/bin/widgets_file_icons_2_same_grouped.c +++ b/src/bin/widgets_file_icons_2_same_grouped.c @@ -64,11 +64,9 @@ static void _cleanup(void) static void _loop(double t, int f) { int i; - Evas_Coord x, y, w, h, tw, th, cent; + Evas_Coord x, y, tw, th, cent; x = 0; y = 0 - f; - w = ICON_SIZE; - h = ICON_SIZE; for (i = 0; i < NUM; i++) { evas_object_move(o_images[i], x + 8, y); diff --git a/src/bin/widgets_file_icons_3.c b/src/bin/widgets_file_icons_3.c index afde3af..72e26ab 100644 --- a/src/bin/widgets_file_icons_3.c +++ b/src/bin/widgets_file_icons_3.c @@ -75,11 +75,9 @@ static void _cleanup(void) static void _loop(double t, int f) { int i; - Evas_Coord x, y, w, h, tw, th, cent; + Evas_Coord x, y, tw, th, cent; x = 0; y = 0 - f; - w = ICON_SIZE; - h = ICON_SIZE; for (i = 0; i < NUM; i++) { evas_object_move(o_images[i], x + 8, y); diff --git a/src/bin/widgets_file_icons_4.c b/src/bin/widgets_file_icons_4.c index 9ca6625..9955dca 100644 --- a/src/bin/widgets_file_icons_4.c +++ b/src/bin/widgets_file_icons_4.c @@ -75,11 +75,9 @@ static void _cleanup(void) static void _loop(double t, int f) { int i; - Evas_Coord x, y, w, h, tw, th, cent; + Evas_Coord x, y, tw, th, cent; x = 0; y = 0 - f; - w = ICON_SIZE; - h = ICON_SIZE; for (i = 0; i < NUM; i++) { evas_object_move(o_images[i], x + 8, y); diff --git a/src/bin/widgets_list_1.c b/src/bin/widgets_list_1.c index 64cd2a1..98a6296 100644 --- a/src/bin/widgets_list_1.c +++ b/src/bin/widgets_list_1.c @@ -91,11 +91,9 @@ static void _cleanup(void) static void _loop(double t, int f) { int i; - Evas_Coord x, y, w, h, tw, th, cent; + Evas_Coord x, y, tw, th, cent; x = 0; y = 0 - f; - w = win_w; - h = ICON_SIZE; for (i = 0; i < NUM; i++) { evas_object_move(o_images[i], x, y); diff --git a/src/bin/widgets_list_1_grouped.c b/src/bin/widgets_list_1_grouped.c index b327efb..8117dbd 100644 --- a/src/bin/widgets_list_1_grouped.c +++ b/src/bin/widgets_list_1_grouped.c @@ -99,11 +99,9 @@ static void _cleanup(void) static void _loop(double t, int f) { int i; - Evas_Coord x, y, w, h, tw, th, cent; + Evas_Coord x, y, tw, th, cent; x = 0; y = 0 - f; - w = win_w; - h = ICON_SIZE; for (i = 0; i < NUM; i++) { evas_object_move(o_images[i], x, y); diff --git a/src/bin/widgets_list_2.c b/src/bin/widgets_list_2.c index 56dff92..4cd84e5 100644 --- a/src/bin/widgets_list_2.c +++ b/src/bin/widgets_list_2.c @@ -91,11 +91,9 @@ static void _cleanup(void) static void _loop(double t, int f) { int i; - Evas_Coord x, y, w, h, tw, th, cent; + Evas_Coord x, y, tw, th, cent; x = 0; y = 0 - f; - w = win_w; - h = ICON_SIZE; for (i = 0; i < NUM; i++) { evas_object_move(o_images[i], x, y); diff --git a/src/bin/widgets_list_2_grouped.c b/src/bin/widgets_list_2_grouped.c index fae8011..ed3f0a0 100644 --- a/src/bin/widgets_list_2_grouped.c +++ b/src/bin/widgets_list_2_grouped.c @@ -99,11 +99,9 @@ static void _cleanup(void) static void _loop(double t, int f) { int i; - Evas_Coord x, y, w, h, tw, th, cent; + Evas_Coord x, y, tw, th, cent; x = 0; y = 0 - f; - w = win_w; - h = ICON_SIZE; for (i = 0; i < NUM; i++) { evas_object_move(o_images[i], x, y); diff --git a/src/bin/widgets_list_3.c b/src/bin/widgets_list_3.c index ae022cd..bc75d8f 100644 --- a/src/bin/widgets_list_3.c +++ b/src/bin/widgets_list_3.c @@ -120,11 +120,9 @@ static void _cleanup(void) static void _loop(double t, int f) { int i; - Evas_Coord x, y, w, h, tw, th, cent; + Evas_Coord x, y, tw, th, cent; x = 0; y = 0 - f; - w = win_w; - h = ICON_SIZE; for (i = 0; i < NUM; i++) { evas_object_move(o_images[i], x, y); diff --git a/src/bin/widgets_list_3_grouped.c b/src/bin/widgets_list_3_grouped.c index d545f0f..82ad974 100644 --- a/src/bin/widgets_list_3_grouped.c +++ b/src/bin/widgets_list_3_grouped.c @@ -136,11 +136,9 @@ static void _cleanup(void) static void _loop(double t, int f) { int i; - Evas_Coord x, y, w, h, tw, th, cent; + Evas_Coord x, y, tw, th, cent; x = 0; y = 0 - f; - w = win_w; - h = ICON_SIZE; for (i = 0; i < NUM; i++) { evas_object_move(o_images[i], x, y); diff --git a/src/bin/widgets_list_4.c b/src/bin/widgets_list_4.c index 4291b29..ca30a93 100644 --- a/src/bin/widgets_list_4.c +++ b/src/bin/widgets_list_4.c @@ -120,11 +120,9 @@ static void _cleanup(void) static void _loop(double t, int f) { int i; - Evas_Coord x, y, w, h, tw, th, cent; + Evas_Coord x, y, tw, th, cent; x = 0; y = 0 - f; - w = win_w; - h = ICON_SIZE; for (i = 0; i < NUM; i++) { evas_object_move(o_images[i], x, y); diff --git a/src/bin/widgets_list_4_grouped.c b/src/bin/widgets_list_4_grouped.c index 2cb9aae..42108a4 100644 --- a/src/bin/widgets_list_4_grouped.c +++ b/src/bin/widgets_list_4_grouped.c @@ -136,11 +136,9 @@ static void _cleanup(void) static void _loop(double t, int f) { int i; - Evas_Coord x, y, w, h, tw, th, cent; + Evas_Coord x, y, tw, th, cent; x = 0; y = 0 - f; - w = win_w; - h = ICON_SIZE; for (i = 0; i < NUM; i++) { evas_object_move(o_images[i], x, y); -- 2.7.4