ryuan pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=4c3e23de9e46fd89672ab657f5da153a3c26a029

commit 4c3e23de9e46fd89672ab657f5da153a3c26a029
Author: Ryuan Choi <ryuan.c...@gmail.com>
Date:   Mon Jan 13 21:11:04 2014 +0900

    Widget: Removed !obj checks from ELM_WIDGET_DATA_GET_OR_RETURN and 
ELM_WIDGET_CHECK
    
    eo_data_scope_get and eo_isa returns NULL with complaint when NULL is 
passed.
    So, Removed unnecessary !obj check routine.
    
    In addition, adopt EINA_UNLIKELY for these macros and fix indentation.
---
 src/lib/elm_widget.h | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/src/lib/elm_widget.h b/src/lib/elm_widget.h
index f7170f6..ded37bc 100644
--- a/src/lib/elm_widget.h
+++ b/src/lib/elm_widget.h
@@ -801,19 +801,17 @@ EAPI void             elm_widget_tree_dump(const 
Evas_Object *top);
 EAPI void             elm_widget_tree_dot_dump(const Evas_Object *top, FILE 
*output);
 
 #define ELM_WIDGET_DATA_GET_OR_RETURN(o, ptr, ...)   \
-  Elm_Widget_Smart_Data *ptr;                       \
-  ptr = (o ?                                        \
-        eo_data_scope_get(o, ELM_OBJ_WIDGET_CLASS) :\
-        NULL);                                      \
-  if (!ptr)                                         \
+  Elm_Widget_Smart_Data *ptr;                        \
+  ptr = eo_data_scope_get(o, ELM_OBJ_WIDGET_CLASS);  \
+  if (EINA_UNLIKELY(!ptr))                           \
     {                                                \
-       CRI("no widget data for object %p (%s)", \
-                o, evas_object_type_get(o));        \
+       CRI("no widget data for object %p (%s)",      \
+           o, evas_object_type_get(o));              \
        return __VA_ARGS__;                           \
     }
 
-#define ELM_WIDGET_CHECK(obj)                       \
-  if (!obj || !eo_isa((obj), ELM_OBJ_WIDGET_CLASS)) \
+#define ELM_WIDGET_CHECK(obj)                              \
+  if (EINA_UNLIKELY(!eo_isa((obj), ELM_OBJ_WIDGET_CLASS))) \
     return
 
 /**

-- 


Reply via email to