From f1d00f63bf621d2c0c9d320a2572cd63100d5520 Mon Sep 17 00:00:00 2001 From: barbieri Date: Mon, 21 Dec 2009 16:39:24 +0000 Subject: [PATCH] fix warnings introduced by external parameter stuff. Thanks to cedric by spotting those. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/edje@44633 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/Edje.h | 2 +- src/lib/edje_edit.c | 18 ++++++++++++++++++ src/lib/edje_external.c | 2 +- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/lib/Edje.h b/src/lib/Edje.h index 28af9d1..01f5902 100644 --- a/src/lib/Edje.h +++ b/src/lib/Edje.h @@ -527,7 +527,7 @@ extern "C" { EAPI Eina_Bool edje_external_param_int_get(const Eina_List *params, const char *key, int *ret); EAPI Eina_Bool edje_external_param_double_get(const Eina_List *params, const char *key, double *ret); EAPI Eina_Bool edje_external_param_string_get(const Eina_List *params, const char *key, const char **ret); - EAPI Eina_Bool edje_external_param_bool_get(const Eina_List *params, const char *key, const char **ret); + EAPI Eina_Bool edje_external_param_bool_get(const Eina_List *params, const char *key, Eina_Bool *ret); EAPI const Edje_External_Param_Info *edje_external_param_info_get(const char *type_name); /* edje_module.c */ diff --git a/src/lib/edje_edit.c b/src/lib/edje_edit.c index 3b213f4..abb801e 100644 --- a/src/lib/edje_edit.c +++ b/src/lib/edje_edit.c @@ -2467,6 +2467,7 @@ edje_edit_state_add(Evas_Object *obj, const char *part, const char *name) switch(p->type) { case EDJE_EXTERNAL_PARAM_TYPE_INT: + case EDJE_EXTERNAL_PARAM_TYPE_BOOL: p->i = pi->info.i.def; break; case EDJE_EXTERNAL_PARAM_TYPE_DOUBLE: @@ -2476,6 +2477,9 @@ edje_edit_state_add(Evas_Object *obj, const char *part, const char *name) if (pi->info.s.def) p->s = eina_stringshare_add(pi->info.s.def); break; + default: + printf("ERROR: unknown external parameter type '%d'\n", + p->type); } pd->external_params = eina_list_append(pd->external_params, p); pi++; @@ -3424,6 +3428,7 @@ edje_edit_state_external_param_get(Evas_Object *obj, const char *part, const cha switch (p->type) { case EDJE_EXTERNAL_PARAM_TYPE_INT: + case EDJE_EXTERNAL_PARAM_TYPE_BOOL: *value = &p->i; break; case EDJE_EXTERNAL_PARAM_TYPE_DOUBLE: @@ -3432,6 +3437,9 @@ edje_edit_state_external_param_get(Evas_Object *obj, const char *part, const cha case EDJE_EXTERNAL_PARAM_TYPE_STRING: *value = (void *)p->s; break; + default: + printf("ERROR: unknown external parameter type '%d'\n", + p->type); } return EINA_TRUE; } @@ -3499,6 +3507,13 @@ edje_edit_state_external_param_string_get(Evas_Object *obj, const char *part, co return EINA_FALSE; } +/** + * Arguments should have proper sized values matching their types: + * - EDJE_EXTERNAL_PARAM_TYPE_INT: int + * - EDJE_EXTERNAL_PARAM_TYPE_BOOL: int + * - EDJE_EXTERNAL_PARAM_TYPE_DOUBLE: double + * - EDJE_EXTERNAL_PARAM_TYPE_STRING: char* + */ EAPI Eina_Bool edje_edit_state_external_param_set(Evas_Object *obj, const char *part, const char *state, const char *param, Edje_External_Param_Type type, ...) { @@ -3541,6 +3556,7 @@ edje_edit_state_external_param_set(Evas_Object *obj, const char *part, const cha switch (type) { case EDJE_EXTERNAL_PARAM_TYPE_INT: + case EDJE_EXTERNAL_PARAM_TYPE_BOOL: p->i = (int)va_arg(ap, int); break; case EDJE_EXTERNAL_PARAM_TYPE_DOUBLE: @@ -3549,6 +3565,8 @@ edje_edit_state_external_param_set(Evas_Object *obj, const char *part, const cha case EDJE_EXTERNAL_PARAM_TYPE_STRING: p->s = eina_stringshare_add((const char *)va_arg(ap, char *)); break; + default: + printf("ERROR: unknown external parameter type '%d'\n", type); } va_end(ap); diff --git a/src/lib/edje_external.c b/src/lib/edje_external.c index 47d49dd..87af6a4 100644 --- a/src/lib/edje_external.c +++ b/src/lib/edje_external.c @@ -222,7 +222,7 @@ edje_external_param_string_get(const Eina_List *params, const char *key, const c } EAPI Eina_Bool -edje_external_param_bool_get(const Eina_List *params, const char *key, const char **ret) +edje_external_param_bool_get(const Eina_List *params, const char *key, Eina_Bool *ret) { Edje_External_Param *param; -- 2.7.4