From: Daniel Kolesa Date: Fri, 1 Aug 2014 14:20:02 +0000 (+0100) Subject: eolian: use newly created implicit typedefs in legacy API X-Git-Tag: upstream/1.11.0+73+gfce1e61~62 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=520275c66b5ea2c2e8d94537ed81d1bac73974e2;p=platform%2Fupstream%2Fefl.git eolian: use newly created implicit typedefs in legacy API Also update tests accordingly. --- diff --git a/src/bin/eolian/legacy_generator.c b/src/bin/eolian/legacy_generator.c index 52303a5..8e0efbd 100644 --- a/src/bin/eolian/legacy_generator.c +++ b/src/bin/eolian/legacy_generator.c @@ -89,7 +89,7 @@ _eapi_decl_func_generate(const Eolian_Class *class, const Eolian_Function *funci { if (ftype == EOLIAN_PROP_GET || eolian_function_object_is_const(funcid)) eina_strbuf_append(fparam, "const "); - eina_strbuf_append(fparam, "Eo *obj"); + eina_strbuf_append_printf(fparam, "%s *obj", class_env.full_classname); } sprintf (tmpstr, "comment%s", suffix); const char *desc = eolian_function_description_get(funcid, tmpstr); @@ -263,8 +263,10 @@ _eapi_func_generate(const Eolian_Class *class, const Eolian_Function *funcid, Eo { if (ftype == EOLIAN_PROP_GET || eolian_function_object_is_const(funcid)) eina_strbuf_append(fparam, "const "); - eina_strbuf_append(fparam, "Eo *obj"); - eina_strbuf_replace_all(fbody, "@#eo_obj", "(Eo *)obj"); + eina_strbuf_append_printf(fparam, "%s *obj", class_env.full_classname); + char buf[256]; + snprintf(buf, sizeof(buf), "(%s *)obj", class_env.full_classname); + eina_strbuf_replace_all(fbody, "@#eo_obj", buf); } else { diff --git a/src/tests/eolian/data/struct_ref.c b/src/tests/eolian/data/struct_ref.c index 75e3a90..4dfb2d8 100644 --- a/src/tests/eolian/data/struct_ref.c +++ b/src/tests/eolian/data/struct_ref.c @@ -1,6 +1,13 @@ #ifndef _TYPES_OUTPUT_C_ #define _TYPES_OUTPUT_C_ +#ifndef _STRUCT_EO_CLASS_TYPE +#define _STRUCT_EO_CLASS_TYPE + +typedef Eo Struct; + +#endif + #ifndef _STRUCT_EO_TYPES #define _STRUCT_EO_TYPES diff --git a/src/tests/eolian/data/typedef_ref.c b/src/tests/eolian/data/typedef_ref.c index d7a8c86..2c0c1d3 100644 --- a/src/tests/eolian/data/typedef_ref.c +++ b/src/tests/eolian/data/typedef_ref.c @@ -1,6 +1,13 @@ #ifndef _TYPES_OUTPUT_C_ #define _TYPES_OUTPUT_C_ +#ifndef _TYPEDEF_EO_CLASS_TYPE +#define _TYPEDEF_EO_CLASS_TYPE + +typedef Eo Typedef; + +#endif + #ifndef _TYPEDEF_EO_TYPES #define _TYPEDEF_EO_TYPES