diff options
author | Ryuan Choi <ryuan.choi@gmail.com> | 2014-01-13 21:11:04 +0900 |
---|---|---|
committer | Ryuan Choi <ryuan.choi@gmail.com> | 2014-01-13 21:11:04 +0900 |
commit | 4c3e23de9e46fd89672ab657f5da153a3c26a029 (patch) | |
tree | 243fe4bd7a3d2c59f8bc3ae99c15066adda6656d | |
parent | db702e1e1fdddec6ffae762848cf64a75ac5bc8f (diff) | |
download | elementary-4c3e23de9e46fd89672ab657f5da153a3c26a029.tar.gz |
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.
-rw-r--r-- | src/lib/elm_widget.h | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/lib/elm_widget.h b/src/lib/elm_widget.h index f7170f6e1..ded37bc6c 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 /** |