summaryrefslogtreecommitdiff
path: root/src/bin/eolian
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2014-08-18 13:12:08 +0100
committerDaniel Kolesa <d.kolesa@samsung.com>2014-08-21 09:26:05 +0100
commite6954d143d959fef5f9caec48fb2009f7a18a190 (patch)
tree6908361cdf8ef92668d8273ef14fee24bdd6163f /src/bin/eolian
parentdbf48c0eccfe70bbde6de5036947b3cc916b2d9f (diff)
eolian: drop Eina_Value
Because of Eina_Value being less than optimal in our usage, we're dropping it in Eolian. This simplifies the code and makes it easier to bind to other languages, which will aid new generators. Also, we're dropping long double support from eo files and expressions as it causes an ABI breakage in gcc 4.4.
Diffstat (limited to 'src/bin/eolian')
-rw-r--r--src/bin/eolian/eo_generator.c9
-rw-r--r--src/bin/eolian/legacy_generator.c9
-rw-r--r--src/bin/eolian/types_generator.c6
3 files changed, 10 insertions, 14 deletions
diff --git a/src/bin/eolian/eo_generator.c b/src/bin/eolian/eo_generator.c
index be294d35ec..5be19c806c 100644
--- a/src/bin/eolian/eo_generator.c
+++ b/src/bin/eolian/eo_generator.c
@@ -463,11 +463,10 @@ eo_bind_func_generate(const Eolian_Class *class, const Eolian_Function *funcid,
463 const char *val_str = NULL; 463 const char *val_str = NULL;
464 if (default_ret_val) 464 if (default_ret_val)
465 { 465 {
466 Eina_Value val; 466 Eolian_Value val = eolian_expression_eval_type
467 Eolian_Expression_Type etp = eolian_expression_eval_type 467 (default_ret_val, rettypet);
468 (default_ret_val, rettypet, &val); 468 if (val.type)
469 if (etp) 469 val_str = eolian_expression_value_to_literal(&val);
470 val_str = eolian_expression_value_to_literal(&val, etp);
471 } 470 }
472 eina_strbuf_append_printf(eo_func_decl, ", %s%s, %s", 471 eina_strbuf_append_printf(eo_func_decl, ", %s%s, %s",
473 ret_const ? "const " : "", rettype, 472 ret_const ? "const " : "", rettype,
diff --git a/src/bin/eolian/legacy_generator.c b/src/bin/eolian/legacy_generator.c
index fc323449a7..1047a41e82 100644
--- a/src/bin/eolian/legacy_generator.c
+++ b/src/bin/eolian/legacy_generator.c
@@ -323,11 +323,10 @@ _eapi_func_generate(const Eolian_Class *class, const Eolian_Function *funcid, Eo
323 const char *val_str = NULL; 323 const char *val_str = NULL;
324 if (default_ret_val) 324 if (default_ret_val)
325 { 325 {
326 Eina_Value val; 326 Eolian_Value val = eolian_expression_eval_type
327 Eolian_Expression_Type etp = eolian_expression_eval_type 327 (default_ret_val, rettypet);
328 (default_ret_val, rettypet, &val); 328 if (val.type)
329 if (etp) 329 val_str = eolian_expression_value_to_literal(&val);
330 val_str = eolian_expression_value_to_literal(&val, etp);
331 } 330 }
332 Eina_Bool had_star = !!strchr(rettype, '*'); 331 Eina_Bool had_star = !!strchr(rettype, '*');
333 sprintf (tmpstr, " %s%s%s%s = %s;\n", 332 sprintf (tmpstr, " %s%s%s%s = %s;\n",
diff --git a/src/bin/eolian/types_generator.c b/src/bin/eolian/types_generator.c
index 300bbdea1d..2f8a15df74 100644
--- a/src/bin/eolian/types_generator.c
+++ b/src/bin/eolian/types_generator.c
@@ -135,9 +135,8 @@ _type_generate(const Eolian_Type *tp, Eina_Bool in_typedef)
135 eina_strbuf_append_printf(buf, " %s", eina_strbuf_string_get(membuf)); 135 eina_strbuf_append_printf(buf, " %s", eina_strbuf_string_get(membuf));
136 else 136 else
137 { 137 {
138 Eina_Value v; 138 Eolian_Value val = eolian_expression_eval(member, EOLIAN_MASK_INT);
139 Eolian_Expression_Type et = eolian_expression_eval(member, EOLIAN_MASK_INT, &v); 139 const char *lit = eolian_expression_value_to_literal(&val);
140 const char *lit = eolian_expression_value_to_literal(&v, et);
141 eina_strbuf_append_printf(buf, " %s = %s", eina_strbuf_string_get(membuf), lit); 140 eina_strbuf_append_printf(buf, " %s = %s", eina_strbuf_string_get(membuf), lit);
142 const char *exp = eolian_expression_serialize(member); 141 const char *exp = eolian_expression_serialize(member);
143 if (exp && strcmp(lit, exp)) 142 if (exp && strcmp(lit, exp))
@@ -146,7 +145,6 @@ _type_generate(const Eolian_Type *tp, Eina_Bool in_typedef)
146 eina_stringshare_del(exp); 145 eina_stringshare_del(exp);
147 } 146 }
148 eina_stringshare_del(lit); 147 eina_stringshare_del(lit);
149 eina_value_flush(&v);
150 } 148 }
151 next = eina_iterator_next(members, (void**)&member_name); 149 next = eina_iterator_next(members, (void**)&member_name);
152 if (next) 150 if (next)