fix _elm_widget_type_check() to return FALSE on failure.

SVN revision: 47497
This commit is contained in:
Gustavo Sverzut Barbieri 2010-03-27 01:19:44 +00:00
parent 5d36cbef7a
commit 86bf257913
2 changed files with 6 additions and 6 deletions

View File

@ -154,11 +154,11 @@ EAPI Evas_Object *elm_widget_parent_widget_get(const Evas_Object *obj);
EAPI Eina_List *_elm_stringlist_get(const char *str);
EAPI void _elm_stringlist_free(Eina_List *list);
Eina_Bool _elm_widget_type_check(Evas_Object *obj, const char *type);
Eina_Bool _elm_widget_type_check(const Evas_Object *obj, const char *type);
#define ELM_SET_WIDTYPE(widtype, type) if (!widtype) widtype = eina_stringshare_add(type)
//#define ELM_CHECK_WIDTYPE(obj, widtype) if (elm_widget_type_get(obj) != widtype) return
#define ELM_CHECK_WIDTYPE(obj, widtype) if (!_elm_widget_type_check((Evas_Object *)(obj), (const char *)(widtype))) return
#define ELM_CHECK_WIDTYPE(obj, widtype) if (!_elm_widget_type_check((obj), (widtype))) return
extern char *_elm_appname;
extern Elm_Config *_elm_config;

View File

@ -1105,12 +1105,12 @@ _elm_stringlist_free(Eina_List *list)
}
Eina_Bool
_elm_widget_type_check(Evas_Object *obj, const char *type)
_elm_widget_type_check(const Evas_Object *obj, const char *type)
{
const char *provided, *expected = "(unknown)";
static int abort_on_warn = -1;
provided = elm_widget_type_get(obj);
if (EINA_LIKELY(provided == type)) return 1;
if (EINA_LIKELY(provided == type)) return EINA_TRUE;
if (type) expected = type;
if ((!provided) || (provided[0] == 0))
{
@ -1125,7 +1125,7 @@ _elm_widget_type_check(Evas_Object *obj, const char *type)
else abort_on_warn = 0;
}
if (abort_on_warn == 1) abort();
return 1;
return EINA_FALSE;
}
static inline Eina_Bool