aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2018-03-09 15:25:11 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2018-03-09 15:25:36 +0100
commit342974977f4e0887248fdef9eb980f5c1e82ffb5 (patch)
tree0e208aba51e61e69f63646d2e94d4f61977a27b1
parenteolian: return Eolian_Object_Type from ref resolver (diff)
downloadefl-342974977f4e0887248fdef9eb980f5c1e82ffb5.tar.gz
eolian: resolve to Eolian_Objects instead of voids
-rw-r--r--src/bindings/luajit/eolian.lua4
-rw-r--r--src/lib/eolian/Eolian.h2
-rw-r--r--src/lib/eolian/eolian_database.c22
-rw-r--r--src/scripts/pyolian/eolian_lib.py2
4 files changed, 15 insertions, 15 deletions
diff --git a/src/bindings/luajit/eolian.lua b/src/bindings/luajit/eolian.lua
index ac8ad59b94..70d66cb5a9 100644
--- a/src/bindings/luajit/eolian.lua
+++ b/src/bindings/luajit/eolian.lua
@@ -481,7 +481,7 @@ ffi.cdef [[
void eolian_doc_token_init(Eolian_Doc_Token *tok);
Eolian_Doc_Token_Type eolian_doc_token_type_get(const Eolian_Doc_Token *tok);
char *eolian_doc_token_text_get(const Eolian_Doc_Token *tok);
- Eolian_Object_Type eolian_doc_token_ref_get(const Eolian_Unit *unit, const Eolian_Doc_Token *tok, const void **data, const void **data2);
+ Eolian_Object_Type eolian_doc_token_ref_get(const Eolian_Unit *unit, const Eolian_Doc_Token *tok, const Eolian_Object **data, const Eolian_Object **data2);
]]
local cutil = require("cutil")
@@ -1853,7 +1853,7 @@ M.Eolian_Doc_Token = ffi.metatype("Eolian_Doc_Token", {
end,
ref_get = function(self, unit)
- local stor = ffi.new("const void *[2]")
+ local stor = ffi.new("const Eolian_Object *[2]")
local tp = tonumber(eolian.eolian_doc_token_ref_get(unit, self, stor, stor + 1))
local reft = M.object_type
if tp == reft.CLASS then
diff --git a/src/lib/eolian/Eolian.h b/src/lib/eolian/Eolian.h
index 1d34e0df21..bde88caa05 100644
--- a/src/lib/eolian/Eolian.h
+++ b/src/lib/eolian/Eolian.h
@@ -2780,7 +2780,7 @@ EAPI char *eolian_doc_token_text_get(const Eolian_Doc_Token *tok);
* @param[out] data2 the secondary data
* @return the kind of reference this is
*/
-EAPI Eolian_Object_Type eolian_doc_token_ref_get(const Eolian_Unit *unit, const Eolian_Doc_Token *tok, const void **data, const void **data2);
+EAPI Eolian_Object_Type eolian_doc_token_ref_get(const Eolian_Unit *unit, const Eolian_Doc_Token *tok, const Eolian_Object **data, const Eolian_Object **data2);
#endif
diff --git a/src/lib/eolian/eolian_database.c b/src/lib/eolian/eolian_database.c
index bd4d22a35a..52125bf656 100644
--- a/src/lib/eolian/eolian_database.c
+++ b/src/lib/eolian/eolian_database.c
@@ -290,8 +290,8 @@ eolian_doc_token_text_get(const Eolian_Doc_Token *tok)
}
static Eolian_Object_Type
-_resolve_event(const Eolian_Unit *src, char *name, const void **data,
- const void **data2)
+_resolve_event(const Eolian_Unit *src, char *name, const Eolian_Object **data,
+ const Eolian_Object **data2)
{
/* never trust the user */
if (name[0] == ',')
@@ -310,14 +310,14 @@ _resolve_event(const Eolian_Unit *src, char *name, const void **data,
if (!ev)
return EOLIAN_OBJECT_UNKNOWN;
- if (data) *data = cl;
- if (data2) *data2 = ev;
+ if (data) *data = &cl->base;
+ if (data2) *data2 = &ev->base;
return EOLIAN_OBJECT_EVENT;
}
EAPI Eolian_Object_Type
eolian_doc_token_ref_get(const Eolian_Unit *unit, const Eolian_Doc_Token *tok,
- const void **data, const void **data2)
+ const Eolian_Object **data, const Eolian_Object **data2)
{
if (tok->type != EOLIAN_DOC_TOKEN_REF)
return EOLIAN_OBJECT_UNKNOWN;
@@ -374,8 +374,8 @@ eolian_doc_token_ref_get(const Eolian_Unit *unit, const Eolian_Doc_Token *tok,
/* field itself is invalid */
if (!fld)
return EOLIAN_OBJECT_UNKNOWN;
- if (data) *data = tpd;
- if (data2) *data2 = fld;
+ if (data) *data = &tpd->base;
+ if (data2) *data2 = &fld->base;
return EOLIAN_OBJECT_STRUCT_FIELD;
}
@@ -387,8 +387,8 @@ eolian_doc_token_ref_get(const Eolian_Unit *unit, const Eolian_Doc_Token *tok,
/* field itself is invalid */
if (!fld)
return EOLIAN_OBJECT_UNKNOWN;
- if (data) *data = tpd;
- if (data2) *data2 = fld;
+ if (data) *data = &tpd->base;
+ if (data2) *data2 = &fld->base;
return EOLIAN_OBJECT_ENUM_FIELD;
}
@@ -419,8 +419,8 @@ eolian_doc_token_ref_get(const Eolian_Unit *unit, const Eolian_Doc_Token *tok,
return EOLIAN_OBJECT_UNKNOWN;
/* got a func */
- if (data) *data = cl;
- if (data2) *data2 = fid;
+ if (data) *data = &cl->base;
+ if (data2) *data2 = &fid->base;
return EOLIAN_OBJECT_FUNCTION;
}
diff --git a/src/scripts/pyolian/eolian_lib.py b/src/scripts/pyolian/eolian_lib.py
index 30d124fc05..bf333b675d 100644
--- a/src/scripts/pyolian/eolian_lib.py
+++ b/src/scripts/pyolian/eolian_lib.py
@@ -831,7 +831,7 @@ lib.eolian_doc_token_type_get.restype = c_int
lib.eolian_doc_token_text_get.argtypes = [c_void_p,]
lib.eolian_doc_token_text_get.restype = c_void_p # char* TO BE FREED
-# EAPI Eolian_Object_Type eolian_doc_token_ref_get(const Eolian_Unit *unit, const Eolian_Doc_Token *tok, const void **data, const void **data2);
+# EAPI Eolian_Object_Type eolian_doc_token_ref_get(const Eolian_Unit *unit, const Eolian_Doc_Token *tok, const Eolian_Object **data, const Eolian_Object **data2);
# lib.eolian_doc_token_ref_get.argtypes = [c_void_p, c_void_p, ???, ???]
# lib.eolian_doc_token_ref_get.restype = c_int