q66 pushed a commit to branch master.

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

commit d2280f91a18bb430751e3db4fc06085da3cca509
Author: Daniel Kolesa <d.kol...@osg.samsung.com>
Date:   Fri May 26 15:09:49 2017 +0200

    eolian: use unit in typedecl c_type_get
---
 src/bin/eolian/types.c             | 2 +-
 src/bindings/luajit/eolian.lua     | 6 +++---
 src/lib/eolian/Eolian.h            | 3 ++-
 src/lib/eolian/database_type_api.c | 5 ++---
 src/tests/eolian/eolian_parsing.c  | 2 +-
 5 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/bin/eolian/types.c b/src/bin/eolian/types.c
index 8db220bd1d..c1d4e1fa94 100644
--- a/src/bin/eolian/types.c
+++ b/src/bin/eolian/types.c
@@ -18,7 +18,7 @@ _type_generate(const Eolian_Unit *src, const Eolian_Typedecl 
*tp,
      {
       case EOLIAN_TYPEDECL_ALIAS:
         {
-           Eina_Stringshare *tn = eolian_typedecl_c_type_get(tp);
+           Eina_Stringshare *tn = eolian_typedecl_c_type_get(src, tp);
            eina_strbuf_append(buf, tn);
            eina_stringshare_del(tn);
            break;
diff --git a/src/bindings/luajit/eolian.lua b/src/bindings/luajit/eolian.lua
index 473a587aec..056370695d 100644
--- a/src/bindings/luajit/eolian.lua
+++ b/src/bindings/luajit/eolian.lua
@@ -342,7 +342,7 @@ ffi.cdef [[
     Eina_Bool eolian_typedecl_is_extern(const Eolian_Typedecl *tp);
 
     const char *eolian_type_c_type_get(const Eolian_Type *tp);
-    const char *eolian_typedecl_c_type_get(const Eolian_Typedecl *tp);
+    const char *eolian_typedecl_c_type_get(const Eolian_Unit *unit, const 
Eolian_Typedecl *tp);
 
     const char *eolian_type_name_get(const Eolian_Type *tp);
     const char *eolian_typedecl_name_get(const Eolian_Typedecl *tp);
@@ -624,8 +624,8 @@ M.Typedecl = ffi.metatype("Eolian_Typedecl", {
             return eolian.eolian_typedecl_is_extern(self) ~= 0
         end,
 
-        c_type_get = function(self)
-            local v = eolian.eolian_typedecl_c_type_get(self)
+        c_type_get = function(self, unit)
+            local v = eolian.eolian_typedecl_c_type_get(unit, self)
             if v == nil then return nil end
             return ffi_stringshare(v)
         end,
diff --git a/src/lib/eolian/Eolian.h b/src/lib/eolian/Eolian.h
index dc8dfc3f9c..02ee4f9d91 100644
--- a/src/lib/eolian/Eolian.h
+++ b/src/lib/eolian/Eolian.h
@@ -1677,6 +1677,7 @@ EAPI Eina_Bool eolian_typedecl_is_extern(const 
Eolian_Typedecl *tp);
 /*
  * @brief Get the full C type name of the given type.
  *
+ * @param[in] unit the unit to look in
  * @param[in] tp the type declaration.
  * @return The C type name assuming @c tp is not NULL.
  *
@@ -1686,7 +1687,7 @@ EAPI Eina_Bool eolian_typedecl_is_extern(const 
Eolian_Typedecl *tp);
  *
  * @ingroup Eolian
  */
-EAPI Eina_Stringshare *eolian_typedecl_c_type_get(const Eolian_Typedecl *tp);
+EAPI Eina_Stringshare *eolian_typedecl_c_type_get(const Eolian_Unit *unit, 
const Eolian_Typedecl *tp);
 
 /*
  * @brief Get the name of the given type declaration. Keep in mind that the
diff --git a/src/lib/eolian/database_type_api.c 
b/src/lib/eolian/database_type_api.c
index d1dcc4fed0..22d95eecec 100644
--- a/src/lib/eolian/database_type_api.c
+++ b/src/lib/eolian/database_type_api.c
@@ -368,14 +368,13 @@ eolian_type_c_type_get(const Eolian_Type *tp)
 }
 
 EAPI Eina_Stringshare *
-eolian_typedecl_c_type_get(const Eolian_Typedecl *tp)
+eolian_typedecl_c_type_get(const Eolian_Unit *unit, const Eolian_Typedecl *tp)
 {
    Eina_Stringshare *ret;
    Eina_Strbuf *buf;
    EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
    buf = eina_strbuf_new();
-   /* FIXME: pass unit properly */
-   database_typedecl_to_str(NULL, tp, buf);
+   database_typedecl_to_str(unit, tp, buf);
    ret = eina_stringshare_add(eina_strbuf_string_get(buf));
    eina_strbuf_free(buf);
    return ret;
diff --git a/src/tests/eolian/eolian_parsing.c 
b/src/tests/eolian/eolian_parsing.c
index 16645ab198..33acd989f5 100644
--- a/src/tests/eolian/eolian_parsing.c
+++ b/src/tests/eolian/eolian_parsing.c
@@ -333,7 +333,7 @@ START_TEST(eolian_typedef)
    fail_if(eolian_typedecl_type_get(tdl) != EOLIAN_TYPEDECL_ALIAS);
    fail_if(!(type_name = eolian_typedecl_name_get(tdl)));
    fail_if(strcmp(type_name, "Coord"));
-   fail_if(!(type_name = eolian_typedecl_c_type_get(tdl)));
+   fail_if(!(type_name = eolian_typedecl_c_type_get(unit, tdl)));
    fail_if(strcmp(type_name, "typedef int Evas_Coord"));
    eina_stringshare_del(type_name);
    fail_if(!(type = eolian_typedecl_base_type_get(tdl)));

-- 


Reply via email to