fix _elm_widget_type_check() to return FALSE on failure.
authorGustavo Sverzut Barbieri <barbieri@gmail.com>
Sat, 27 Mar 2010 01:19:44 +0000 (01:19 +0000)
committerGustavo Sverzut Barbieri <barbieri@gmail.com>
Sat, 27 Mar 2010 01:19:44 +0000 (01:19 +0000)
SVN revision: 47497

src/lib/elm_priv.h
src/lib/elm_widget.c

index fa4bc05..53b3039 100644 (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;
index c6728cf..e142e59 100644 (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