summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2015-05-20 16:39:00 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2015-05-20 16:39:17 +0100
commita22ac701b6b705d07327ace41e9a05398ff3a466 (patch)
treed8420f3c5167c065dd182f1a2ff1b08f73e8e7c2 /src/bin
parent4dc0aba991f53088d7236c7f82ea2927a731bd17 (diff)
eolian: use eolian_property_values_get correctly
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/eolian/eo_generator.c12
-rw-r--r--src/bin/eolian/impl_generator.c5
-rw-r--r--src/bin/eolian/legacy_generator.c10
3 files changed, 16 insertions, 11 deletions
diff --git a/src/bin/eolian/eo_generator.c b/src/bin/eolian/eo_generator.c
index a9c1ae60cf..508eff9a4a 100644
--- a/src/bin/eolian/eo_generator.c
+++ b/src/bin/eolian/eo_generator.c
@@ -89,12 +89,13 @@ eo_fundef_generate(const Eolian_Class *class, const Eolian_Function *func, Eolia
89 const char *rettype = NULL; 89 const char *rettype = NULL;
90 Eina_Bool ret_const = EINA_FALSE; 90 Eina_Bool ret_const = EINA_FALSE;
91 Eolian_Object_Scope scope = eolian_function_scope_get(func); 91 Eolian_Object_Scope scope = eolian_function_scope_get(func);
92 Eina_Bool is_prop = (ftype == EOLIAN_PROP_GET || ftype == EOLIAN_PROP_SET);
92 93
93 _class_func_env_create(class, eolian_function_name_get(func), ftype, &func_env); 94 _class_func_env_create(class, eolian_function_name_get(func), ftype, &func_env);
94 rettypet = eolian_function_return_type_get(func, ftype); 95 rettypet = eolian_function_return_type_get(func, ftype);
95 if (ftype == EOLIAN_PROP_GET && !rettypet) 96 if (ftype == EOLIAN_PROP_GET && !rettypet)
96 { 97 {
97 itr = eolian_function_parameters_get(func); 98 itr = eolian_property_values_get(func);
98 /* We want to check if there is only one parameter */ 99 /* We want to check if there is only one parameter */
99 if (eina_iterator_next(itr, &data) && !eina_iterator_next(itr, &data2)) 100 if (eina_iterator_next(itr, &data) && !eina_iterator_next(itr, &data2))
100 { 101 {
@@ -164,7 +165,7 @@ eo_fundef_generate(const Eolian_Class *class, const Eolian_Function *func, Eolia
164 165
165 if (!var_as_ret) 166 if (!var_as_ret)
166 { 167 {
167 itr = eolian_function_parameters_get(func); 168 itr = is_prop ? eolian_property_values_get(func) : eolian_function_parameters_get(func);
168 EINA_ITERATOR_FOREACH(itr, data) 169 EINA_ITERATOR_FOREACH(itr, data)
169 { 170 {
170 Eolian_Function_Parameter *param = data; 171 Eolian_Function_Parameter *param = data;
@@ -366,6 +367,7 @@ eo_bind_func_generate(const Eolian_Class *class, const Eolian_Function *funcid,
366 Eina_Bool is_empty = impl ? eolian_implement_is_empty(impl) : eolian_function_is_empty(funcid, ftype); 367 Eina_Bool is_empty = impl ? eolian_implement_is_empty(impl) : eolian_function_is_empty(funcid, ftype);
367 Eina_Bool is_auto = impl ? eolian_implement_is_auto(impl) : eolian_function_is_auto(funcid, ftype); 368 Eina_Bool is_auto = impl ? eolian_implement_is_auto(impl) : eolian_function_is_auto(funcid, ftype);
368 if (ftype != EOLIAN_PROP_GET && ftype != EOLIAN_PROP_SET) ftype = eolian_function_type_get(funcid); 369 if (ftype != EOLIAN_PROP_GET && ftype != EOLIAN_PROP_SET) ftype = eolian_function_type_get(funcid);
370 Eina_Bool is_prop = (ftype == EOLIAN_PROP_GET || ftype == EOLIAN_PROP_SET);
369 371
370 Eina_Bool need_implementation = EINA_TRUE; 372 Eina_Bool need_implementation = EINA_TRUE;
371 if (!impl_env && eolian_function_is_virtual_pure(funcid, ftype)) need_implementation = EINA_FALSE; 373 if (!impl_env && eolian_function_is_virtual_pure(funcid, ftype)) need_implementation = EINA_FALSE;
@@ -388,7 +390,7 @@ eo_bind_func_generate(const Eolian_Class *class, const Eolian_Function *funcid,
388 add_star = EINA_TRUE; 390 add_star = EINA_TRUE;
389 if (!rettypet) 391 if (!rettypet)
390 { 392 {
391 itr = eolian_function_parameters_get(funcid); 393 itr = eolian_property_values_get(funcid);
392 /* We want to check if there is only one parameter */ 394 /* We want to check if there is only one parameter */
393 if (eina_iterator_next(itr, &data) && !eina_iterator_next(itr, &data2)) 395 if (eina_iterator_next(itr, &data) && !eina_iterator_next(itr, &data2))
394 { 396 {
@@ -424,7 +426,7 @@ eo_bind_func_generate(const Eolian_Class *class, const Eolian_Function *funcid,
424 eina_iterator_free(itr); 426 eina_iterator_free(itr);
425 if (!var_as_ret) 427 if (!var_as_ret)
426 { 428 {
427 itr = eolian_function_parameters_get(funcid); 429 itr = is_prop ? eolian_property_values_get(funcid) : eolian_function_parameters_get(funcid);
428 EINA_ITERATOR_FOREACH(itr, data) 430 EINA_ITERATOR_FOREACH(itr, data)
429 { 431 {
430 Eolian_Function_Parameter *param = data; 432 Eolian_Function_Parameter *param = data;
@@ -563,7 +565,7 @@ eo_bind_func_generate(const Eolian_Class *class, const Eolian_Function *funcid,
563 565
564 if (!has_params && !var_as_ret) 566 if (!has_params && !var_as_ret)
565 { 567 {
566 itr = eolian_function_parameters_get(funcid); 568 itr = is_prop ? eolian_property_values_get(funcid) : eolian_function_parameters_get(funcid);
567 has_params |= (eina_iterator_next(itr, &data)); 569 has_params |= (eina_iterator_next(itr, &data));
568 eina_iterator_free(itr); 570 eina_iterator_free(itr);
569 } 571 }
diff --git a/src/bin/eolian/impl_generator.c b/src/bin/eolian/impl_generator.c
index 75f1266044..490de91aec 100644
--- a/src/bin/eolian/impl_generator.c
+++ b/src/bin/eolian/impl_generator.c
@@ -16,6 +16,7 @@ _params_generate(const Eolian_Function *foo, Eolian_Function_Type ftype, Eina_Bo
16{ 16{
17 Eina_Iterator *itr; 17 Eina_Iterator *itr;
18 Eolian_Function_Parameter *param; 18 Eolian_Function_Parameter *param;
19 Eina_Bool is_prop = (ftype == EOLIAN_PROP_GET || ftype == EOLIAN_PROP_SET);
19 eina_strbuf_reset(params); 20 eina_strbuf_reset(params);
20 eina_strbuf_reset(short_params); 21 eina_strbuf_reset(short_params);
21 itr = eolian_property_keys_get(foo); 22 itr = eolian_property_keys_get(foo);
@@ -42,7 +43,7 @@ _params_generate(const Eolian_Function *foo, Eolian_Function_Type ftype, Eina_Bo
42 if (!var_as_ret) 43 if (!var_as_ret)
43 { 44 {
44 Eina_Bool add_star = (ftype == EOLIAN_PROP_GET); 45 Eina_Bool add_star = (ftype == EOLIAN_PROP_GET);
45 itr = eolian_function_parameters_get(foo); 46 itr = is_prop ? eolian_property_values_get(foo) : eolian_function_parameters_get(foo);
46 EINA_ITERATOR_FOREACH(itr, param) 47 EINA_ITERATOR_FOREACH(itr, param)
47 { 48 {
48 const Eolian_Type *ptypet = eolian_parameter_type_get(param); 49 const Eolian_Type *ptypet = eolian_parameter_type_get(param);
@@ -147,7 +148,7 @@ _prototype_generate(const Eolian_Function *foo, Eolian_Function_Type ftype, Eina
147 const Eolian_Type *rettypet = eolian_function_return_type_get(foo, ftype); 148 const Eolian_Type *rettypet = eolian_function_return_type_get(foo, ftype);
148 if (ftype == EOLIAN_PROP_GET && !rettypet) 149 if (ftype == EOLIAN_PROP_GET && !rettypet)
149 { 150 {
150 Eina_Iterator *itr = eolian_function_parameters_get(foo); 151 Eina_Iterator *itr = eolian_property_values_get(foo);
151 void *data, *data2; 152 void *data, *data2;
152 /* We want to check if there is only one parameter */ 153 /* We want to check if there is only one parameter */
153 if (eina_iterator_next(itr, &data) && !eina_iterator_next(itr, &data2)) 154 if (eina_iterator_next(itr, &data) && !eina_iterator_next(itr, &data2))
diff --git a/src/bin/eolian/legacy_generator.c b/src/bin/eolian/legacy_generator.c
index dc705bf4b1..20af6d5f0e 100644
--- a/src/bin/eolian/legacy_generator.c
+++ b/src/bin/eolian/legacy_generator.c
@@ -55,6 +55,7 @@ _eapi_decl_func_generate(const Eolian_Class *class, const Eolian_Function *funci
55 Eina_Bool var_as_ret = EINA_FALSE; 55 Eina_Bool var_as_ret = EINA_FALSE;
56 Eina_Bool add_star = EINA_FALSE; 56 Eina_Bool add_star = EINA_FALSE;
57 Eina_Bool ret_const = EINA_FALSE; 57 Eina_Bool ret_const = EINA_FALSE;
58 Eina_Bool is_prop = (ftype == EOLIAN_PROP_GET || ftype == EOLIAN_PROP_SET);
58 Eina_Iterator *itr; 59 Eina_Iterator *itr;
59 void *data, *data2; 60 void *data, *data2;
60 Eina_Strbuf *flags = NULL; 61 Eina_Strbuf *flags = NULL;
@@ -71,7 +72,7 @@ _eapi_decl_func_generate(const Eolian_Class *class, const Eolian_Function *funci
71 add_star = EINA_TRUE; 72 add_star = EINA_TRUE;
72 if (!rettypet) 73 if (!rettypet)
73 { 74 {
74 itr = eolian_function_parameters_get(funcid); 75 itr = eolian_property_values_get(funcid);
75 /* We want to check if there is only one parameter */ 76 /* We want to check if there is only one parameter */
76 if (eina_iterator_next(itr, &data) && !eina_iterator_next(itr, &data2)) 77 if (eina_iterator_next(itr, &data) && !eina_iterator_next(itr, &data2))
77 { 78 {
@@ -142,7 +143,7 @@ _eapi_decl_func_generate(const Eolian_Class *class, const Eolian_Function *funci
142 eina_iterator_free(itr); 143 eina_iterator_free(itr);
143 if (!var_as_ret) 144 if (!var_as_ret)
144 { 145 {
145 itr = eolian_function_parameters_get(funcid); 146 itr = is_prop ? eolian_property_values_get(funcid) : eolian_function_parameters_get(funcid);
146 EINA_ITERATOR_FOREACH(itr, data) 147 EINA_ITERATOR_FOREACH(itr, data)
147 { 148 {
148 Eolian_Function_Parameter *param = data; 149 Eolian_Function_Parameter *param = data;
@@ -222,6 +223,7 @@ _eapi_func_generate(const Eolian_Class *class, const Eolian_Function *funcid, Eo
222 Eina_Bool ret_const = EINA_FALSE; 223 Eina_Bool ret_const = EINA_FALSE;
223 Eina_Bool add_star = EINA_FALSE; 224 Eina_Bool add_star = EINA_FALSE;
224 Eina_Bool ret_is_void = EINA_FALSE; 225 Eina_Bool ret_is_void = EINA_FALSE;
226 Eina_Bool is_prop = (ftype == EOLIAN_PROP_GET || ftype == EOLIAN_PROP_SET);
225 227
226 Eina_Strbuf *fbody = eina_strbuf_new(); 228 Eina_Strbuf *fbody = eina_strbuf_new();
227 Eina_Strbuf *fparam = eina_strbuf_new(); 229 Eina_Strbuf *fparam = eina_strbuf_new();
@@ -240,7 +242,7 @@ _eapi_func_generate(const Eolian_Class *class, const Eolian_Function *funcid, Eo
240 add_star = EINA_TRUE; 242 add_star = EINA_TRUE;
241 if (!rettypet) 243 if (!rettypet)
242 { 244 {
243 itr = eolian_function_parameters_get(funcid); 245 itr = eolian_property_values_get(funcid);
244 /* We want to check if there is only one parameter */ 246 /* We want to check if there is only one parameter */
245 if (eina_iterator_next(itr, &data) && !eina_iterator_next(itr, &data2)) 247 if (eina_iterator_next(itr, &data) && !eina_iterator_next(itr, &data2))
246 { 248 {
@@ -302,7 +304,7 @@ _eapi_func_generate(const Eolian_Class *class, const Eolian_Function *funcid, Eo
302 eina_iterator_free(itr); 304 eina_iterator_free(itr);
303 if (!var_as_ret) 305 if (!var_as_ret)
304 { 306 {
305 itr = eolian_function_parameters_get(funcid); 307 itr = is_prop ? eolian_property_values_get(funcid) : eolian_function_parameters_get(funcid);
306 EINA_ITERATOR_FOREACH(itr, data) 308 EINA_ITERATOR_FOREACH(itr, data)
307 { 309 {
308 Eolian_Function_Parameter *param = data; 310 Eolian_Function_Parameter *param = data;