davemds pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=9afb74906b20b9604993b8becad8d033521585ab

commit 9afb74906b20b9604993b8becad8d033521585ab
Author: Dave Andreoli <d...@gurumeditation.it>
Date:   Wed Feb 25 21:44:31 2015 +0100

    Fix code to conform to recent Eo changes.
---
 efl/eo/efl.eo.pyx    | 20 +++++++++++---------
 include/efl.c_eo.pxd |  3 ++-
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/efl/eo/efl.eo.pyx b/efl/eo/efl.eo.pyx
index a20cdc6..2c419c0 100644
--- a/efl/eo/efl.eo.pyx
+++ b/efl/eo/efl.eo.pyx
@@ -36,7 +36,7 @@ from efl.eina cimport Eina_Bool, \
     Eina_Hash, eina_hash_string_superfast_new, eina_hash_add, eina_hash_del, \
     eina_hash_find, EINA_LOG_DOM_DBG, EINA_LOG_DOM_INFO
 from efl.c_eo cimport Eo as cEo, eo_init, eo_shutdown, eo_del, eo_do, \
-    eo_class_name_get, eo_class_get, eo_base_class_get,\
+    eo_do_ret, eo_class_name_get, eo_class_get, eo_base_class_get,\
     eo_key_data_set, eo_key_data_get, eo_key_data_del, \
     eo_event_callback_add, eo_event_callback_del, EO_EV_DEL, \
     eo_parent_get, eo_parent_set, Eo_Event_Description, \
@@ -66,9 +66,9 @@ def shutdown():
 init()
 
 def event_global_freeze_count_get():
-    cdef int fcount
-    fcount = <int>eo_do(<const cEo *>eo_base_class_get(),
-                        eo_event_global_freeze_count_get())
+    cdef int fcount = 0
+    fcount = <int>eo_do_ret(<const cEo *>eo_base_class_get(), fcount,
+                            eo_event_global_freeze_count_get())
     return fcount
 
 def event_global_freeze():
@@ -111,7 +111,7 @@ cdef void _object_mapping_unregister(char *name):
 cdef api object object_from_instance(cEo *obj):
     """ Create a python object from a C Eo object pointer. """
     cdef:
-        void *data
+        void *data = NULL
         Eo o
         const char *cls_name = eo_class_name_get(eo_class_get(obj))
         type cls
@@ -120,7 +120,7 @@ cdef api object object_from_instance(cEo *obj):
     if obj == NULL:
         return None
 
-    data = eo_do(obj, eo_key_data_get("python-eo"))
+    data = eo_do_ret(obj, data, eo_key_data_get("python-eo"))
     if data != NULL:
         EINA_LOG_DOM_DBG(PY_EFL_EO_LOG_DOMAIN,
             "Returning a Python object instance for Eo of type %s.", cls_name)
@@ -219,7 +219,7 @@ cdef class Eo(object):
     def __repr__(self):
         cdef cEo *parent = NULL
         if self.obj != NULL:
-            parent = <cEo *>eo_do(self.obj, eo_parent_get())
+            parent = <cEo *>eo_do_ret(self.obj, parent, eo_parent_get())
         return ("<%s object (Eo) at %#x (obj=%#x, parent=%#x, refcount=%d)>") 
% (
             type(self).__name__,
             <uintptr_t><void *>self,
@@ -283,7 +283,8 @@ cdef class Eo(object):
         :rtype: :class:`Eo`
 
         """
-        cdef cEo *parent = <cEo *>eo_do(self.obj, eo_parent_get())
+        cdef cEo *parent = NULL
+        parent = <cEo *>eo_do_ret(self.obj, parent, eo_parent_get())
         return object_from_instance(parent)
 
     def event_freeze(self):
@@ -301,5 +302,6 @@ cdef class Eo(object):
         :rtype: int
         
         """
-        cdef int fcount = <int>eo_do(self.obj, eo_event_freeze_count_get())
+        cdef int fcount = 0
+        fcount = <int>eo_do_ret(self.obj, fcount, eo_event_freeze_count_get())
         return fcount
diff --git a/include/efl.c_eo.pxd b/include/efl.c_eo.pxd
index e2a0393..ae39a5e 100644
--- a/include/efl.c_eo.pxd
+++ b/include/efl.c_eo.pxd
@@ -99,7 +99,8 @@ cdef extern from "Eo.h":
 
     void eo_wref_add(Eo **wref)
 
-    void *eo_do(Eo *obj, ...)
+    void eo_do(Eo *obj, ...)
+    void *eo_do_ret(Eo *obj, ...)
     const Eo_Class *eo_base_class_get()
 
     void  eo_key_data_set(const char *key, const void *data, 
eo_key_data_free_func free_func)

-- 


Reply via email to