q66 pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=faa24705c8148806e33753a90e2130cd0afcf5f1
commit faa24705c8148806e33753a90e2130cd0afcf5f1 Author: Daniel Kolesa <d.kol...@samsung.com> Date: Wed Sep 10 15:22:04 2014 +0100 eolian: we can only have 2 accessors --- src/lib/eolian/database_fill.c | 11 +++++------ src/lib/eolian/eo_definitions.c | 7 ++++--- src/lib/eolian/eo_definitions.h | 3 ++- src/lib/eolian/eo_parser.c | 14 +++++--------- 4 files changed, 16 insertions(+), 19 deletions(-) diff --git a/src/lib/eolian/database_fill.c b/src/lib/eolian/database_fill.c index 00074ee..79b2178 100644 --- a/src/lib/eolian/database_fill.c +++ b/src/lib/eolian/database_fill.c @@ -68,11 +68,10 @@ static Eina_Bool _db_fill_accessors(Eolian_Function *foo_id, Eo_Class_Def *kls, Eo_Property_Def *prop) { - Eo_Accessor_Def *accessor; - Eina_List *l; - - EINA_LIST_FOREACH(prop->accessors, l, accessor) - if (!_db_fill_accessor(foo_id, kls, accessor)) return EINA_FALSE; + if (prop->get_accessor && !_db_fill_accessor(foo_id, kls, prop->get_accessor)) + return EINA_FALSE; + if (prop->set_accessor && !_db_fill_accessor(foo_id, kls, prop->set_accessor)) + return EINA_FALSE; return EINA_TRUE; } @@ -91,7 +90,7 @@ _db_fill_property(Eolian_Class *cl, Eo_Class_Def *kls, Eo_Property_Def *prop) foo_id->params = prop->values; prop->values = NULL; if (!_db_fill_accessors(foo_id, kls, prop)) goto failure; - if (!prop->accessors) + if (!prop->get_accessor && !prop->set_accessor) { foo_id->type = EOLIAN_PROPERTY; if (kls->type == EOLIAN_CLASS_INTERFACE) diff --git a/src/lib/eolian/eo_definitions.c b/src/lib/eolian/eo_definitions.c index 9548fa5..c8958b7 100644 --- a/src/lib/eolian/eo_definitions.c +++ b/src/lib/eolian/eo_definitions.c @@ -34,7 +34,6 @@ static void eo_definitions_property_def_free(Eo_Property_Def *prop) { Eolian_Function_Parameter *param; - Eo_Accessor_Def *accessor; if (prop->base.file) eina_stringshare_del(prop->base.file); @@ -48,8 +47,10 @@ eo_definitions_property_def_free(Eo_Property_Def *prop) EINA_LIST_FREE(prop->values, param) database_parameter_del(param); - EINA_LIST_FREE(prop->accessors, accessor) - eo_definitions_accessor_free(accessor); + if (prop->get_accessor) + eo_definitions_accessor_free(prop->get_accessor); + if (prop->set_accessor) + eo_definitions_accessor_free(prop->set_accessor); free(prop); } diff --git a/src/lib/eolian/eo_definitions.h b/src/lib/eolian/eo_definitions.h index 4050bb8..b2f3e11 100644 --- a/src/lib/eolian/eo_definitions.h +++ b/src/lib/eolian/eo_definitions.h @@ -42,7 +42,8 @@ typedef struct _Eo_Property_Def Eina_Stringshare *name; Eina_List *keys; Eina_List *values; - Eina_List *accessors; + Eo_Accessor_Def *get_accessor; + Eo_Accessor_Def *set_accessor; int scope; Eina_Bool is_class:1; } Eo_Property_Def; diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c index a4c3883..1e3f056 100644 --- a/src/lib/eolian/eo_parser.c +++ b/src/lib/eolian/eo_parser.c @@ -1215,7 +1215,7 @@ parse_legacy(Eo_Lexer *ls) check_next(ls, ';'); } -static void +static Eo_Accessor_Def * parse_accessor(Eo_Lexer *ls) { int line, col; @@ -1264,6 +1264,8 @@ parse_accessor(Eo_Lexer *ls) } end: check_match(ls, '}', '{', line, col); + ls->tmp.accessor = NULL; + return acc; } static void @@ -1322,17 +1324,11 @@ body: { case KW_get: CASE_LOCK(ls, get, "get definition") - parse_accessor(ls); - prop->accessors = eina_list_append(prop->accessors, - ls->tmp.accessor); - ls->tmp.accessor = NULL; + prop->get_accessor = parse_accessor(ls); break; case KW_set: CASE_LOCK(ls, set, "set definition") - parse_accessor(ls); - prop->accessors = eina_list_append(prop->accessors, - ls->tmp.accessor); - ls->tmp.accessor = NULL; + prop->set_accessor = parse_accessor(ls); break; case KW_keys: CASE_LOCK(ls, keys, "keys definition") --