diff options
author | Daniel Kolesa <d.kolesa@osg.samsung.com> | 2018-01-12 18:02:32 +0100 |
---|---|---|
committer | Daniel Kolesa <d.kolesa@osg.samsung.com> | 2018-01-12 18:05:13 +0100 |
commit | c6436337a466572b5d811234aca445f3e46650a8 (patch) | |
tree | b8960768bad6349ae77c4047417710d9825d11cd | |
parent | 19c16b671e3bafd1ea360fbd331b4952391f6ee9 (diff) | |
download | efl-c6436337a466572b5d811234aca445f3e46650a8.tar.gz |
eolian: aliased_base_get funcs don't need unit
-rw-r--r-- | src/bin/eolian/sources.c | 2 | ||||
-rw-r--r-- | src/bindings/luajit/eolian.lua | 12 | ||||
-rw-r--r-- | src/lib/eolian/Eolian.h | 6 | ||||
-rw-r--r-- | src/lib/eolian/database_type_api.c | 10 | ||||
-rw-r--r-- | src/scripts/elua/apps/docgen/doctree.lua | 9 | ||||
-rw-r--r-- | src/scripts/pyolian/eolian.py | 18 | ||||
-rw-r--r-- | src/scripts/pyolian/eolian_lib.py | 14 | ||||
-rw-r--r-- | src/tests/eolian/eolian_parsing.c | 2 |
8 files changed, 32 insertions, 41 deletions
diff --git a/src/bin/eolian/sources.c b/src/bin/eolian/sources.c index eb7f3853e2..e6dff01eb7 100644 --- a/src/bin/eolian/sources.c +++ b/src/bin/eolian/sources.c @@ -123,7 +123,7 @@ _append_defval(const Eolian_Unit *src, Eina_Strbuf *buf, else WRN("evaluation of default value failed"); } /* default value or fallback */ - const Eolian_Type *btp = eolian_type_aliased_base_get(src, tp); + const Eolian_Type *btp = eolian_type_aliased_base_get(tp); if (eolian_type_is_ptr(btp)) { eina_strbuf_append(buf, "NULL"); diff --git a/src/bindings/luajit/eolian.lua b/src/bindings/luajit/eolian.lua index 940ad8367d..1e0f0a8a8e 100644 --- a/src/bindings/luajit/eolian.lua +++ b/src/bindings/luajit/eolian.lua @@ -401,8 +401,8 @@ ffi.cdef [[ const Eolian_Type *eolian_typedecl_base_type_get(const Eolian_Typedecl *tp); const Eolian_Typedecl *eolian_type_typedecl_get(const Eolian_Type *tp); - const Eolian_Type *eolian_type_aliased_base_get(const Eolian_Unit *unit, const Eolian_Type *tp); - const Eolian_Type *eolian_typedecl_aliased_base_get(const Eolian_Unit *unit, const Eolian_Typedecl *tp); + const Eolian_Type *eolian_type_aliased_base_get(const Eolian_Type *tp); + const Eolian_Type *eolian_typedecl_aliased_base_get(const Eolian_Typedecl *tp); const Eolian_Class *eolian_type_class_get(const Eolian_Type *tp); Eina_Bool eolian_type_is_owned(const Eolian_Type *tp); @@ -766,8 +766,8 @@ M.Typedecl = ffi.metatype("Eolian_Typedecl", { return v end, - aliased_base_get = function(self, unit) - local v = eolian.eolian_typedecl_aliased_byse_get(unit, self) + aliased_base_get = function(self) + local v = eolian.eolian_typedecl_aliased_byse_get(self) if v == nil then return nil end return v end, @@ -847,8 +847,8 @@ M.Type = ffi.metatype("Eolian_Type", { return v end, - aliased_base_get = function(self, unit) - local v = eolian.eolian_type_aliased_byse_get(unit, self) + aliased_base_get = function(self) + local v = eolian.eolian_type_aliased_byse_get(self) if v == nil then return nil end return v end, diff --git a/src/lib/eolian/Eolian.h b/src/lib/eolian/Eolian.h index 34b47c5fca..0610ccb7ac 100644 --- a/src/lib/eolian/Eolian.h +++ b/src/lib/eolian/Eolian.h @@ -1807,13 +1807,12 @@ EAPI const Eolian_Type *eolian_typedecl_base_type_get(const Eolian_Typedecl *tp) * If the given typedecl is an alias, it returns the result of * eolian_type_aliased_base_get on its base type. Otherwise this returns NULL. * - * @param[in] unit the unit to look in * @param[in] tp the type declaration. * @return the lowest alias base or the given type. * * @ingroup Eolian */ -EAPI const Eolian_Type *eolian_typedecl_aliased_base_get(const Eolian_Unit *unit, const Eolian_Typedecl *tp); +EAPI const Eolian_Type *eolian_typedecl_aliased_base_get(const Eolian_Typedecl *tp); /* * @brief Check if a struct or alias type declaration is extern. @@ -1973,13 +1972,12 @@ EAPI const Eolian_Typedecl *eolian_type_typedecl_get(const Eolian_Type *tp); * type actually is while still having convenience. Keep in mind that this stops * if the found type is actually a pointer (has a ptr() on it). * - * @param[in] unit the unit to look in * @param[in] tp the type. * @return the lowest alias base or the given type. * * @ingroup Eolian */ -EAPI const Eolian_Type *eolian_type_aliased_base_get(const Eolian_Unit *unit, const Eolian_Type *tp); +EAPI const Eolian_Type *eolian_type_aliased_base_get(const Eolian_Type *tp); /* * @brief Get the class associated with an EOLIAN_TYPE_CLASS type. diff --git a/src/lib/eolian/database_type_api.c b/src/lib/eolian/database_type_api.c index eedb42a828..cb128910c7 100644 --- a/src/lib/eolian/database_type_api.c +++ b/src/lib/eolian/database_type_api.c @@ -282,22 +282,22 @@ eolian_typedecl_base_type_get(const Eolian_Typedecl *tp) } EAPI const Eolian_Type * -eolian_type_aliased_base_get(const Eolian_Unit *unit, const Eolian_Type *tp) +eolian_type_aliased_base_get(const Eolian_Type *tp) { if (!tp || tp->type != EOLIAN_TYPE_REGULAR || tp->is_ptr) return tp; - const Eolian_Typedecl *btp = database_type_decl_find(unit, tp); + const Eolian_Typedecl *btp = eolian_type_typedecl_get(tp); if (btp && (btp->type == EOLIAN_TYPEDECL_ALIAS)) - return eolian_typedecl_aliased_base_get(unit, btp); + return eolian_typedecl_aliased_base_get(btp); return tp; } EAPI const Eolian_Type * -eolian_typedecl_aliased_base_get(const Eolian_Unit *unit, const Eolian_Typedecl *tp) +eolian_typedecl_aliased_base_get(const Eolian_Typedecl *tp) { if (!tp || tp->type != EOLIAN_TYPEDECL_ALIAS) return NULL; - return eolian_type_aliased_base_get(unit, tp->base_type); + return eolian_type_aliased_base_get(tp->base_type); } EAPI const Eolian_Class * diff --git a/src/scripts/elua/apps/docgen/doctree.lua b/src/scripts/elua/apps/docgen/doctree.lua index 479303bdd1..fbe684a488 100644 --- a/src/scripts/elua/apps/docgen/doctree.lua +++ b/src/scripts/elua/apps/docgen/doctree.lua @@ -710,8 +710,7 @@ M.Type = Node:clone { end, typedecl_get = function(self) - -- FIXME: unit - local v = self.type:typedecl_get(eos:unit_get()) + local v = self.type:typedecl_get() if not v then return nil end @@ -719,8 +718,7 @@ M.Type = Node:clone { end, aliased_base_get = function(self) - -- FIXME: unit - local v = self.type:aliased_base_get(eos:unit_get()) + local v = self.type:aliased_base_get() if not v then return nil end @@ -896,8 +894,7 @@ M.Typedecl = Node:clone { end, aliased_base_get = function(self) - -- FIXME: unit - local v = self.typedecl:aliased_base_get(eos:unit_get()) + local v = self.typedecl:aliased_base_get() if not v then return nil end diff --git a/src/scripts/pyolian/eolian.py b/src/scripts/pyolian/eolian.py index 60bfdba0c1..cdb269ab80 100644 --- a/src/scripts/pyolian/eolian.py +++ b/src/scripts/pyolian/eolian.py @@ -1080,11 +1080,10 @@ class Type(EolianBaseObject): # OK (4 TODO Unit*) c_type = lib.eolian_type_next_type_get(self._obj) return Type(c_type) if c_type else None - # TODO FIXME STRANGE API (need Eolian_Unit*) - # @cached_property - # def aliased_base(self): - # c_type = lib.eolian_type_aliased_base_get(self._obj) - # return Type(c_type) if c_type else None + @cached_property + def aliased_base(self): + c_type = lib.eolian_type_aliased_base_get(self._obj) + return Type(c_type) if c_type else None @cached_property def class_(self): @@ -1172,11 +1171,10 @@ class Typedecl(EolianBaseObject): # OK (2 TODO Unit*) c_type = lib.eolian_typedecl_base_type_get(self._obj) return Type(c_type) if c_type else None - # TODO FIX THIS, need Eolian_Unit* param ??? - # @cached_property - # def aliased_base(self): - # c_type = lib.eolian_typedecl_aliased_base_get(self._obj) - # return Type(c_type) if c_type else None + @cached_property + def aliased_base(self): + c_type = lib.eolian_typedecl_aliased_base_get(self._obj) + return Type(c_type) if c_type else None @cached_property def documentation(self): diff --git a/src/scripts/pyolian/eolian_lib.py b/src/scripts/pyolian/eolian_lib.py index 2e67cb0563..bd17374d40 100644 --- a/src/scripts/pyolian/eolian_lib.py +++ b/src/scripts/pyolian/eolian_lib.py @@ -496,10 +496,9 @@ lib.eolian_typedecl_file_get.restype = c_char_p lib.eolian_typedecl_base_type_get.argtypes = [c_void_p,] lib.eolian_typedecl_base_type_get.restype = c_void_p -# TODO FIXME STRANGE API (need Eolian_Unit*) -# EAPI const Eolian_Type *eolian_typedecl_aliased_base_get(const Eolian_Unit *unit, const Eolian_Typedecl *tp); -# lib.eolian_typedecl_aliased_base_get.argtypes = [c_void_p, c_void_p,] -# lib.eolian_typedecl_aliased_base_get.restype = c_void_p +# EAPI const Eolian_Type *eolian_typedecl_aliased_base_get(const Eolian_Typedecl *tp); +lib.eolian_typedecl_aliased_base_get.argtypes = [c_void_p,] +lib.eolian_typedecl_aliased_base_get.restype = c_void_p # EAPI Eina_Bool eolian_typedecl_is_extern(const Eolian_Typedecl *tp); lib.eolian_typedecl_is_extern.argtypes = [c_void_p,] @@ -554,10 +553,9 @@ lib.eolian_type_next_type_get.restype = c_void_p lib.eolian_type_typedecl_get.argtypes = [c_void_p,] lib.eolian_type_typedecl_get.restype = c_void_p -# TODO FIXME STRANGE API (need Eolian_Unit*) -# EAPI const Eolian_Type *eolian_type_aliased_base_get(const Eolian_Unit *unit, const Eolian_Type *tp); -# lib.eolian_type_aliased_base_get.argtypes = [c_void_p,] -# lib.eolian_type_aliased_base_get.restype = c_void_p +# EAPI const Eolian_Type *eolian_type_aliased_base_get(const Eolian_Type *tp); +lib.eolian_type_aliased_base_get.argtypes = [c_void_p,] +lib.eolian_type_aliased_base_get.restype = c_void_p # EAPI const Eolian_Class *eolian_type_class_get(const Eolian_Type *tp); lib.eolian_type_class_get.argtypes = [c_void_p,] diff --git a/src/tests/eolian/eolian_parsing.c b/src/tests/eolian/eolian_parsing.c index 79f611ab41..c30ce6e32e 100644 --- a/src/tests/eolian/eolian_parsing.c +++ b/src/tests/eolian/eolian_parsing.c @@ -364,7 +364,7 @@ START_TEST(eolian_typedef) /* Lowest alias base */ fail_if(!(tdl = eolian_typedecl_alias_get_by_name(unit, "Evas.Coord3"))); - fail_if(!(type = eolian_typedecl_aliased_base_get(unit, tdl))); + fail_if(!(type = eolian_typedecl_aliased_base_get(tdl))); fail_if(strcmp(eolian_type_name_get(type), "int")); /* Complex type */ |