Widget: Don't check if it's the correct class everywhere.
authorTom Hacohen <tom@stosb.com>
Mon, 6 Jan 2014 14:58:18 +0000 (14:58 +0000)
committerTom Hacohen <tom@stosb.com>
Mon, 6 Jan 2014 15:07:16 +0000 (15:07 +0000)
ELM_WIDGET_DATA_GET was checking it was the correct class. This is
stupid and wrong (and makes tools rightfully complain) because these
functions are implementations of that class anyway, so that would never
be false.
Functions that outside facing (that is, not called from eo_do) should
use API_ENTRY.

src/lib/elm_widget.c

index 543b8f452dae52c8db14760467600381a235ed27..8e2d034887c3fb069a313ab4f9383c3479c8dc99 100644 (file)
@@ -16,8 +16,7 @@ EAPI Eo_Op ELM_WIDGET_BASE_ID = EO_NOOP;
 #define MY_CLASS_NAME_LEGACY "elm_widget"
 
 #define ELM_WIDGET_DATA_GET(o, wd)                             \
-  Elm_Widget_Smart_Data *wd = NULL;                            \
-  if (eo_isa(o, MY_CLASS)) wd = eo_data_scope_get(o, MY_CLASS)
+  Elm_Widget_Smart_Data *wd = eo_data_scope_get(o, MY_CLASS)
 
 #define API_ENTRY                                    \
   ELM_WIDGET_DATA_GET(obj, sd);                      \