jpeg pushed a commit to branch efl-1.20.

http://git.enlightenment.org/core/efl.git/commit/?id=521511b48f1c3c264c412dc6fdae28c42f54b2f4

commit 521511b48f1c3c264c412dc6fdae28c42f54b2f4
Author: Jean-Philippe Andre <jp.an...@samsung.com>
Date:   Thu Sep 28 12:25:19 2017 +0900

    eo: Fix unnecessary ERR logs with eo_debug
    
    efl_data_scope_safe_get() is often used to assert that an object is of a
    certain type, but assuming it may be NULL or not of the required type.
    This means that encountering an invalid type is an error handled by the
    caller (we return NULL), and shouldn't print out extra ERR() logs.
    
    This fixes issues with E run under eo_debug. E's code was safe as it's
    using evas_object_smart_data_get() and verifies whether the returned
    value is NULL (which is expected for a rectangle, for instance).
    
    @fix
---
 src/lib/eo/eo.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
index 55fbbbc962..26b6b6f899 100644
--- a/src/lib/eo/eo.c
+++ b/src/lib/eo/eo.c
@@ -2010,26 +2010,26 @@ err_klass:
 EAPI void *
 efl_data_scope_safe_get(const Eo *obj_id, const Efl_Class *klass_id)
 {
-#ifndef EO_DEBUG
    void *ret = NULL;
 
    if (!obj_id) return NULL;
    EO_OBJ_POINTER_RETURN_VAL(obj_id, obj, NULL);
    EO_CLASS_POINTER_GOTO(klass_id, klass, err_klass);
-   if (obj->destructed)
-     {
-        goto err_klass;
-     }
+   if (obj->destructed) goto err_klass;
 
    if (_eo_class_mro_has(obj->klass, klass))
-     ret = _efl_data_scope_safe_get(obj, klass);
+     {
+        ret = _efl_data_scope_safe_get(obj, klass);
+
+#ifdef EO_DEBUG
+        if (!ret && (klass->desc->data_size == 0))
+          ERR("Tried getting data of class '%s', but it has none.", 
klass->desc->name);
+#endif
+     }
 
 err_klass:
    EO_OBJ_DONE(obj_id);
    return ret;
-#else
-   return efl_data_scope_get(obj_id, klass_id);
-#endif
 }
 
 EAPI void *

-- 


Reply via email to