summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2018-01-16 16:10:43 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2018-01-16 16:37:52 +0100
commitdd2e579fecbe6ec4d1e0e7d46c82daff39be03c5 (patch)
tree3de0f6b1e40b3d5477f87792f46e186312972d88
parentb70604d018366cf1e825668643916a2c3cc4a88b (diff)
eolian: do not require unit for expr eval APIs
The necessary information is now stored directly in the expr during database validation. Also enable expr validation for params.
-rw-r--r--src/bin/eolian/sources.c4
-rw-r--r--src/bin/eolian/types.c6
-rw-r--r--src/bindings/luajit/eolian.lua12
-rw-r--r--src/lib/efl/interfaces/efl_gfx_buffer.eo8
-rw-r--r--src/lib/eolian/Eolian.h6
-rw-r--r--src/lib/eolian/database_expr.c2
-rw-r--r--src/lib/eolian/database_expr_api.c10
-rw-r--r--src/lib/eolian/database_type.c4
-rw-r--r--src/lib/eolian/database_validate.c3
-rw-r--r--src/lib/eolian_cxx/grammar/klass_def.hpp2
-rw-r--r--src/lib/evas/canvas/efl_canvas_vg.eo4
-rw-r--r--src/scripts/elua/apps/docgen/doctree.lua6
-rw-r--r--src/tests/eolian/eolian_parsing.c28
13 files changed, 46 insertions, 49 deletions
diff --git a/src/bin/eolian/sources.c b/src/bin/eolian/sources.c
index e6dff01eb7..c430eb70df 100644
--- a/src/bin/eolian/sources.c
+++ b/src/bin/eolian/sources.c
@@ -108,7 +108,7 @@ _append_defval(const Eolian_Unit *src, Eina_Strbuf *buf,
108{ 108{
109 if (exp) 109 if (exp)
110 { 110 {
111 Eolian_Value val = eolian_expression_eval_type(src, exp, tp); 111 Eolian_Value val = eolian_expression_eval_type(exp, tp);
112 Eina_Stringshare *lit = eolian_expression_value_to_literal(&val); 112 Eina_Stringshare *lit = eolian_expression_value_to_literal(&val);
113 if (lit) 113 if (lit)
114 { 114 {
@@ -474,7 +474,7 @@ _gen_func(const Eolian_Unit *src, const Eolian_Class *cl,
474 } 474 }
475 else if ((ftype != EOLIAN_PROP_SET) && dfv) 475 else if ((ftype != EOLIAN_PROP_SET) && dfv)
476 { 476 {
477 Eolian_Value val = eolian_expression_eval(src, dfv, EOLIAN_MASK_ALL); 477 Eolian_Value val = eolian_expression_eval(dfv, EOLIAN_MASK_ALL);
478 if (val.type) 478 if (val.type)
479 { 479 {
480 Eina_Stringshare *vals = eolian_expression_value_to_literal(&val); 480 Eina_Stringshare *vals = eolian_expression_value_to_literal(&val);
diff --git a/src/bin/eolian/types.c b/src/bin/eolian/types.c
index d8285fbeb4..fc57ba0d37 100644
--- a/src/bin/eolian/types.c
+++ b/src/bin/eolian/types.c
@@ -87,7 +87,7 @@ _type_generate(const Eolian_Unit *src, const Eolian_Typedecl *tp,
87 else 87 else
88 { 88 {
89 Eolian_Value val = 89 Eolian_Value val =
90 eolian_expression_eval(src, vale, EOLIAN_MASK_INT); 90 eolian_expression_eval(vale, EOLIAN_MASK_INT);
91 const char *lit = eolian_expression_value_to_literal(&val); 91 const char *lit = eolian_expression_value_to_literal(&val);
92 eina_strbuf_append_printf(buf, " %s = %s", membn, lit); 92 eina_strbuf_append_printf(buf, " %s = %s", membn, lit);
93 const char *exp = eolian_expression_serialize(vale); 93 const char *exp = eolian_expression_serialize(vale);
@@ -183,7 +183,7 @@ _var_generate(const Eolian_Unit *src, const Eolian_Variable *vr, Eina_Bool legac
183 eina_strbuf_prepend_printf(buf, "#ifndef %s\n", fn); 183 eina_strbuf_prepend_printf(buf, "#ifndef %s\n", fn);
184 eina_strbuf_append_printf(buf, "#define %s ", fn); 184 eina_strbuf_append_printf(buf, "#define %s ", fn);
185 const Eolian_Expression *vv = eolian_variable_value_get(vr); 185 const Eolian_Expression *vv = eolian_variable_value_get(vr);
186 Eolian_Value val = eolian_expression_eval_type(src, vv, vt); 186 Eolian_Value val = eolian_expression_eval_type(vv, vt);
187 Eina_Stringshare *lit = eolian_expression_value_to_literal(&val); 187 Eina_Stringshare *lit = eolian_expression_value_to_literal(&val);
188 eina_strbuf_append(buf, lit); 188 eina_strbuf_append(buf, lit);
189 Eina_Stringshare *exp = eolian_expression_serialize(vv); 189 Eina_Stringshare *exp = eolian_expression_serialize(vv);
@@ -290,7 +290,7 @@ void eo_gen_types_source_gen(const Eolian_Unit *src,
290 eina_stringshare_del(ct); 290 eina_stringshare_del(ct);
291 free(fn); 291 free(fn);
292 292
293 Eolian_Value val = eolian_expression_eval_type(src, vv, vt); 293 Eolian_Value val = eolian_expression_eval_type(vv, vt);
294 Eina_Stringshare *lit = eolian_expression_value_to_literal(&val); 294 Eina_Stringshare *lit = eolian_expression_value_to_literal(&val);
295 eina_strbuf_append(buf, lit); 295 eina_strbuf_append(buf, lit);
296 eina_strbuf_append_char(buf, ';'); 296 eina_strbuf_append_char(buf, ';');
diff --git a/src/bindings/luajit/eolian.lua b/src/bindings/luajit/eolian.lua
index 1e0f0a8a8e..70a0763534 100644
--- a/src/bindings/luajit/eolian.lua
+++ b/src/bindings/luajit/eolian.lua
@@ -428,8 +428,8 @@ ffi.cdef [[
428 428
429 const Eolian_Function *eolian_typedecl_function_pointer_get(const Eolian_Typedecl *tp); 429 const Eolian_Function *eolian_typedecl_function_pointer_get(const Eolian_Typedecl *tp);
430 430
431 Eolian_Value_t eolian_expression_eval(const Eolian_Unit *unit, const Eolian_Expression *expr, Eolian_Expression_Mask m); 431 Eolian_Value_t eolian_expression_eval(const Eolian_Expression *expr, Eolian_Expression_Mask m);
432 Eolian_Value_t eolian_expression_eval_type(const Eolian_Unit *unit, const Eolian_Expression *expr, const Eolian_Type *type); 432 Eolian_Value_t eolian_expression_eval_type(const Eolian_Expression *expr, const Eolian_Type *type);
433 const char *eolian_expression_value_to_literal(const Eolian_Value *v); 433 const char *eolian_expression_value_to_literal(const Eolian_Value *v);
434 const char *eolian_expression_serialize(const Eolian_Expression *expr); 434 const char *eolian_expression_serialize(const Eolian_Expression *expr);
435 Eolian_Expression_Type eolian_expression_type_get(const Eolian_Expression *expr); 435 Eolian_Expression_Type eolian_expression_type_get(const Eolian_Expression *expr);
@@ -1476,15 +1476,15 @@ M.unary_operator = {
1476 1476
1477M.Expression = ffi.metatype("Eolian_Expression", { 1477M.Expression = ffi.metatype("Eolian_Expression", {
1478 __index = { 1478 __index = {
1479 eval = function(self, unit, mask) 1479 eval = function(self, mask)
1480 mask = mask or emask.ALL 1480 mask = mask or emask.ALL
1481 local v = eolian.eolian_expression_eval(unit, self, mask) 1481 local v = eolian.eolian_expression_eval(self, mask)
1482 if v == nil then return nil end 1482 if v == nil then return nil end
1483 return ffi.cast("Eolian_Value*", v) 1483 return ffi.cast("Eolian_Value*", v)
1484 end, 1484 end,
1485 1485
1486 eval_type = function(self, unit, tp) 1486 eval_type = function(self, tp)
1487 local v = eolian.eolian_expression_eval_type(unit, self, tp) 1487 local v = eolian.eolian_expression_eval_type(self, tp)
1488 if v == nil then return nil end 1488 if v == nil then return nil end
1489 return ffi.cast("Eolian_Value*", v) 1489 return ffi.cast("Eolian_Value*", v)
1490 end, 1490 end,
diff --git a/src/lib/efl/interfaces/efl_gfx_buffer.eo b/src/lib/efl/interfaces/efl_gfx_buffer.eo
index 5df340ba1c..b74384ca10 100644
--- a/src/lib/efl/interfaces/efl_gfx_buffer.eo
+++ b/src/lib/efl/interfaces/efl_gfx_buffer.eo
@@ -110,10 +110,10 @@ interface Efl.Gfx.Buffer ()
110 ]] 110 ]]
111 get {} 111 get {}
112 values { 112 values {
113 l: uint(0); [[Left border pixels, usually 0 or 1]] 113 l: uint(0U); [[Left border pixels, usually 0 or 1]]
114 r: uint(0); [[Right border pixels, usually 0 or 1]] 114 r: uint(0U); [[Right border pixels, usually 0 or 1]]
115 t: uint(0); [[Top border pixels, usually 0 or 1]] 115 t: uint(0U); [[Top border pixels, usually 0 or 1]]
116 b: uint(0); [[Bottom border pixels, usually 0 or 1]] 116 b: uint(0U); [[Bottom border pixels, usually 0 or 1]]
117 } 117 }
118 } 118 }
119 119
diff --git a/src/lib/eolian/Eolian.h b/src/lib/eolian/Eolian.h
index 0610ccb7ac..9c6f2de9fe 100644
--- a/src/lib/eolian/Eolian.h
+++ b/src/lib/eolian/Eolian.h
@@ -2086,7 +2086,6 @@ EAPI Eina_Stringshare *eolian_type_free_func_get(const Eolian_Type *tp);
2086/* 2086/*
2087 * @brief Evaluate an Eolian expression. 2087 * @brief Evaluate an Eolian expression.
2088 * 2088 *
2089 * @param[in] unit the unit to look in
2090 * @param[in] expr the expression. 2089 * @param[in] expr the expression.
2091 * @param[in] mask the mask of allowed values (can combine with bitwise OR). 2090 * @param[in] mask the mask of allowed values (can combine with bitwise OR).
2092 * @return the value, its type is set to EOLIAN_EXPR_UNKNOWN on error. 2091 * @return the value, its type is set to EOLIAN_EXPR_UNKNOWN on error.
@@ -2096,12 +2095,11 @@ EAPI Eina_Stringshare *eolian_type_free_func_get(const Eolian_Type *tp);
2096 * 2095 *
2097 * @ingroup Eolian 2096 * @ingroup Eolian
2098 */ 2097 */
2099EAPI Eolian_Value eolian_expression_eval(const Eolian_Unit *unit, const Eolian_Expression *expr, Eolian_Expression_Mask m); 2098EAPI Eolian_Value eolian_expression_eval(const Eolian_Expression *expr, Eolian_Expression_Mask m);
2100 2099
2101/* 2100/*
2102 * @brief Evaluate an Eolian expression given a type instead of a mask. 2101 * @brief Evaluate an Eolian expression given a type instead of a mask.
2103 * 2102 *
2104 * @param[in] unit the unit to look in
2105 * @param[in] expr the expression. 2103 * @param[in] expr the expression.
2106 * @param[in] type the type the expression is assigned to. 2104 * @param[in] type the type the expression is assigned to.
2107 * @return the value, its type is set to EOLIAN_EXPR_UNKNOWN on error. 2105 * @return the value, its type is set to EOLIAN_EXPR_UNKNOWN on error.
@@ -2111,7 +2109,7 @@ EAPI Eolian_Value eolian_expression_eval(const Eolian_Unit *unit, const Eolian_E
2111 * 2109 *
2112 * @ingroup Eolian 2110 * @ingroup Eolian
2113 */ 2111 */
2114EAPI Eolian_Value eolian_expression_eval_type(const Eolian_Unit *unit, const Eolian_Expression *expr, const Eolian_Type *type); 2112EAPI Eolian_Value eolian_expression_eval_type(const Eolian_Expression *expr, const Eolian_Type *type);
2115 2113
2116/* 2114/*
2117 * @brief Convert the result of expression evaluation to a literal as in how 2115 * @brief Convert the result of expression evaluation to a literal as in how
diff --git a/src/lib/eolian/database_expr.c b/src/lib/eolian/database_expr.c
index ffe96f511a..77322fab73 100644
--- a/src/lib/eolian/database_expr.c
+++ b/src/lib/eolian/database_expr.c
@@ -470,7 +470,7 @@ eval_exp(const Eolian_Unit *unit, Eolian_Expression *expr,
470 } 470 }
471 case EOLIAN_EXPR_STRING: 471 case EOLIAN_EXPR_STRING:
472 { 472 {
473 if (!(mask & EOLIAN_MASK_STRING)) 473 if (!(mask & EOLIAN_MASK_STRING) && !(mask & EOLIAN_MASK_NULL))
474 return expr_type_error(expr, EOLIAN_MASK_STRING, mask); 474 return expr_type_error(expr, EOLIAN_MASK_STRING, mask);
475 *out = *expr; 475 *out = *expr;
476 return EINA_TRUE; 476 return EINA_TRUE;
diff --git a/src/lib/eolian/database_expr_api.c b/src/lib/eolian/database_expr_api.c
index a8994cc50b..25d76776fe 100644
--- a/src/lib/eolian/database_expr_api.c
+++ b/src/lib/eolian/database_expr_api.c
@@ -7,24 +7,22 @@
7#include "eolian_database.h" 7#include "eolian_database.h"
8 8
9EAPI Eolian_Value 9EAPI Eolian_Value
10eolian_expression_eval(const Eolian_Unit *unit, const Eolian_Expression *expr, 10eolian_expression_eval(const Eolian_Expression *expr, Eolian_Expression_Mask m)
11 Eolian_Expression_Mask m)
12{ 11{
13 Eolian_Value err; 12 Eolian_Value err;
14 err.type = EOLIAN_EXPR_UNKNOWN; 13 err.type = EOLIAN_EXPR_UNKNOWN;
15 EINA_SAFETY_ON_NULL_RETURN_VAL(expr, err); 14 EINA_SAFETY_ON_NULL_RETURN_VAL(expr, err);
16 return database_expr_eval(unit, (Eolian_Expression *)expr, m); 15 return database_expr_eval(NULL, (Eolian_Expression *)expr, m);
17} 16}
18 17
19EAPI Eolian_Value 18EAPI Eolian_Value
20eolian_expression_eval_type(const Eolian_Unit *unit, 19eolian_expression_eval_type(const Eolian_Expression *expr,
21 const Eolian_Expression *expr,
22 const Eolian_Type *type) 20 const Eolian_Type *type)
23{ 21{
24 Eolian_Value err; 22 Eolian_Value err;
25 err.type = EOLIAN_EXPR_UNKNOWN; 23 err.type = EOLIAN_EXPR_UNKNOWN;
26 EINA_SAFETY_ON_NULL_RETURN_VAL(expr, err); 24 EINA_SAFETY_ON_NULL_RETURN_VAL(expr, err);
27 return database_expr_eval_type(unit, (Eolian_Expression *)expr, type); 25 return database_expr_eval_type(NULL, (Eolian_Expression *)expr, type);
28} 26}
29 27
30static void 28static void
diff --git a/src/lib/eolian/database_type.c b/src/lib/eolian/database_type.c
index 33be724c60..17651e6b39 100644
--- a/src/lib/eolian/database_type.c
+++ b/src/lib/eolian/database_type.c
@@ -197,8 +197,8 @@ _etype_to_str(const Eolian_Unit *src, const Eolian_Typedecl *tp,
197 eina_strbuf_append(buf, ef->name); 197 eina_strbuf_append(buf, ef->name);
198 if (ef->value) 198 if (ef->value)
199 { 199 {
200 Eolian_Value val = eolian_expression_eval(src, ef->value, 200 Eolian_Value val = eolian_expression_eval(ef->value,
201 EOLIAN_MASK_INT); 201 EOLIAN_MASK_INT);
202 const char *ret; 202 const char *ret;
203 eina_strbuf_append(buf, " = "); 203 eina_strbuf_append(buf, " = ");
204 ret = eolian_expression_value_to_literal(&val); 204 ret = eolian_expression_value_to_literal(&val);
diff --git a/src/lib/eolian/database_validate.c b/src/lib/eolian/database_validate.c
index 41ac2a206e..6b1058d5d1 100644
--- a/src/lib/eolian/database_validate.c
+++ b/src/lib/eolian/database_validate.c
@@ -308,6 +308,9 @@ _validate_param(const Eolian_Unit *src, Eolian_Function_Parameter *param)
308 if (!_validate_type(src, param->type)) 308 if (!_validate_type(src, param->type))
309 return EINA_FALSE; 309 return EINA_FALSE;
310 310
311 if (param->value && !_validate_expr(src, param->value, param->type, 0))
312 return EINA_FALSE;
313
311 if (!_validate_doc(src, param->doc)) 314 if (!_validate_doc(src, param->doc))
312 return EINA_FALSE; 315 return EINA_FALSE;
313 316
diff --git a/src/lib/eolian_cxx/grammar/klass_def.hpp b/src/lib/eolian_cxx/grammar/klass_def.hpp
index 3872feaf4a..c59b39af73 100644
--- a/src/lib/eolian_cxx/grammar/klass_def.hpp
+++ b/src/lib/eolian_cxx/grammar/klass_def.hpp
@@ -1077,7 +1077,7 @@ struct enum_value_def
1077 name = eolian_typedecl_enum_field_name_get(enum_field); 1077 name = eolian_typedecl_enum_field_name_get(enum_field);
1078 c_name = eolian_typedecl_enum_field_c_name_get(enum_field); 1078 c_name = eolian_typedecl_enum_field_c_name_get(enum_field);
1079 auto exp = eolian_typedecl_enum_field_value_get(enum_field, EINA_TRUE); 1079 auto exp = eolian_typedecl_enum_field_value_get(enum_field, EINA_TRUE);
1080 value = eolian_expression_eval(unit, exp, EOLIAN_MASK_INT); // FIXME hardcoded int 1080 value = eolian_expression_eval(exp, EOLIAN_MASK_INT); // FIXME hardcoded int
1081 documentation = eolian_typedecl_enum_field_documentation_get(enum_field); 1081 documentation = eolian_typedecl_enum_field_documentation_get(enum_field);
1082 } 1082 }
1083}; 1083};
diff --git a/src/lib/evas/canvas/efl_canvas_vg.eo b/src/lib/evas/canvas/efl_canvas_vg.eo
index 398dd6cf2c..32c5f112ea 100644
--- a/src/lib/evas/canvas/efl_canvas_vg.eo
+++ b/src/lib/evas/canvas/efl_canvas_vg.eo
@@ -47,8 +47,8 @@ class Efl.Canvas.Vg (Efl.Canvas.Object, Efl.File)
47 @property viewbox_align { 47 @property viewbox_align {
48 [[Control how the viewbox is positioned inside the viewport.]] 48 [[Control how the viewbox is positioned inside the viewport.]]
49 values { 49 values {
50 align_x: double(0); [[Alignment in the horizontal axis (0 <= align_x <= 1).]] 50 align_x: double(0.0); [[Alignment in the horizontal axis (0 <= align_x <= 1).]]
51 align_y: double(0); [[Alignment in the vertical axis (0 <= align_y <= 1).]] 51 align_y: double(0.0); [[Alignment in the vertical axis (0 <= align_y <= 1).]]
52 } 52 }
53 } 53 }
54 @property root_node { 54 @property root_node {
diff --git a/src/scripts/elua/apps/docgen/doctree.lua b/src/scripts/elua/apps/docgen/doctree.lua
index fbe684a488..fda2e12d50 100644
--- a/src/scripts/elua/apps/docgen/doctree.lua
+++ b/src/scripts/elua/apps/docgen/doctree.lua
@@ -1366,13 +1366,11 @@ M.Expression = Node:clone {
1366 end, 1366 end,
1367 1367
1368 eval_enum = function(self) 1368 eval_enum = function(self)
1369 -- FIXME: unit 1369 return self.expr:eval(eolian.expression_mask.INT)
1370 return self.expr:eval(eos:unit_get(), eolian.expression_mask.INT)
1371 end, 1370 end,
1372 1371
1373 eval_type = function(self, tp) 1372 eval_type = function(self, tp)
1374 -- FIXME: unit 1373 return self.expr:eval_type(tp.type)
1375 return self.expr:eval_type(eos:unit_get(), tp.type)
1376 end, 1374 end,
1377 1375
1378 serialize = function(self) 1376 serialize = function(self)
diff --git a/src/tests/eolian/eolian_parsing.c b/src/tests/eolian/eolian_parsing.c
index c30ce6e32e..8ec67560d3 100644
--- a/src/tests/eolian/eolian_parsing.c
+++ b/src/tests/eolian/eolian_parsing.c
@@ -587,7 +587,7 @@ START_TEST(eolian_simple_parsing)
587 fail_if(strcmp(eolian_type_name_get(tp), "bool")); 587 fail_if(strcmp(eolian_type_name_get(tp), "bool"));
588 expr = eolian_function_return_default_value_get(fid, EOLIAN_PROP_SET); 588 expr = eolian_function_return_default_value_get(fid, EOLIAN_PROP_SET);
589 fail_if(!expr); 589 fail_if(!expr);
590 v = eolian_expression_eval(unit, expr, EOLIAN_MASK_BOOL); 590 v = eolian_expression_eval(expr, EOLIAN_MASK_BOOL);
591 fail_if(v.type != EOLIAN_EXPR_BOOL); 591 fail_if(v.type != EOLIAN_EXPR_BOOL);
592 /* Get return */ 592 /* Get return */
593 tp = eolian_function_return_type_get(fid, EOLIAN_PROP_GET); 593 tp = eolian_function_return_type_get(fid, EOLIAN_PROP_GET);
@@ -603,7 +603,7 @@ START_TEST(eolian_simple_parsing)
603 fail_if(strcmp(eolian_parameter_name_get(param), "value")); 603 fail_if(strcmp(eolian_parameter_name_get(param), "value"));
604 expr = eolian_parameter_default_value_get(param); 604 expr = eolian_parameter_default_value_get(param);
605 fail_if(!expr); 605 fail_if(!expr);
606 v = eolian_expression_eval(unit, expr, EOLIAN_MASK_INT); 606 v = eolian_expression_eval(expr, EOLIAN_MASK_INT);
607 fail_if(v.type != EOLIAN_EXPR_INT); 607 fail_if(v.type != EOLIAN_EXPR_INT);
608 fail_if(v.value.i != 100); 608 fail_if(v.value.i != 100);
609 609
@@ -627,7 +627,7 @@ START_TEST(eolian_simple_parsing)
627 eina_stringshare_del(string); 627 eina_stringshare_del(string);
628 expr = eolian_function_return_default_value_get(fid, EOLIAN_METHOD); 628 expr = eolian_function_return_default_value_get(fid, EOLIAN_METHOD);
629 fail_if(!expr); 629 fail_if(!expr);
630 v = eolian_expression_eval(unit, expr, EOLIAN_MASK_NULL); 630 v = eolian_expression_eval(expr, EOLIAN_MASK_NULL);
631 fail_if(v.type != EOLIAN_EXPR_NULL); 631 fail_if(v.type != EOLIAN_EXPR_NULL);
632 fail_if(eolian_function_is_legacy_only(fid, EOLIAN_METHOD)); 632 fail_if(eolian_function_is_legacy_only(fid, EOLIAN_METHOD));
633 633
@@ -649,7 +649,7 @@ START_TEST(eolian_simple_parsing)
649 fail_if(strcmp(eolian_parameter_name_get(param), "c")); 649 fail_if(strcmp(eolian_parameter_name_get(param), "c"));
650 expr = eolian_parameter_default_value_get(param); 650 expr = eolian_parameter_default_value_get(param);
651 fail_if(!expr); 651 fail_if(!expr);
652 v = eolian_expression_eval(unit, expr, EOLIAN_MASK_FLOAT); 652 v = eolian_expression_eval(expr, EOLIAN_MASK_FLOAT);
653 fail_if(v.type != EOLIAN_EXPR_DOUBLE); 653 fail_if(v.type != EOLIAN_EXPR_DOUBLE);
654 fail_if(v.value.d != 1337.6); 654 fail_if(v.value.d != 1337.6);
655 fail_if(!(eina_iterator_next(iter, (void**)&param))); 655 fail_if(!(eina_iterator_next(iter, (void**)&param)));
@@ -811,7 +811,7 @@ START_TEST(eolian_var)
811 fail_if(!(name = eolian_type_name_get(type))); 811 fail_if(!(name = eolian_type_name_get(type)));
812 fail_if(strcmp(name, "int")); 812 fail_if(strcmp(name, "int"));
813 fail_if(!(exp = eolian_variable_value_get(var))); 813 fail_if(!(exp = eolian_variable_value_get(var)));
814 v = eolian_expression_eval_type(unit, exp, type); 814 v = eolian_expression_eval_type(exp, type);
815 fail_if(v.type != EOLIAN_EXPR_INT); 815 fail_if(v.type != EOLIAN_EXPR_INT);
816 fail_if(v.value.i != 5); 816 fail_if(v.value.i != 5);
817 817
@@ -823,7 +823,7 @@ START_TEST(eolian_var)
823 fail_if(!(name = eolian_type_name_get(type))); 823 fail_if(!(name = eolian_type_name_get(type)));
824 fail_if(strcmp(name, "float")); 824 fail_if(strcmp(name, "float"));
825 fail_if(!(exp = eolian_variable_value_get(var))); 825 fail_if(!(exp = eolian_variable_value_get(var)));
826 v = eolian_expression_eval_type(unit, exp, type); 826 v = eolian_expression_eval_type(exp, type);
827 fail_if(v.type != EOLIAN_EXPR_FLOAT); 827 fail_if(v.type != EOLIAN_EXPR_FLOAT);
828 fail_if(((int)v.value.f) != 10); 828 fail_if(((int)v.value.f) != 10);
829 829
@@ -878,7 +878,7 @@ START_TEST(eolian_enum)
878 878
879 fail_if(!(field = eolian_typedecl_enum_field_get(tdl, "first"))); 879 fail_if(!(field = eolian_typedecl_enum_field_get(tdl, "first")));
880 fail_if(!(exp = eolian_typedecl_enum_field_value_get(field, EINA_FALSE))); 880 fail_if(!(exp = eolian_typedecl_enum_field_value_get(field, EINA_FALSE)));
881 v = eolian_expression_eval(unit, exp, EOLIAN_MASK_ALL); 881 v = eolian_expression_eval(exp, EOLIAN_MASK_ALL);
882 fail_if(v.type != EOLIAN_EXPR_INT); 882 fail_if(v.type != EOLIAN_EXPR_INT);
883 fail_if(v.value.i != 0); 883 fail_if(v.value.i != 0);
884 884
@@ -887,7 +887,7 @@ START_TEST(eolian_enum)
887 887
888 fail_if(!(field = eolian_typedecl_enum_field_get(tdl, "baz"))); 888 fail_if(!(field = eolian_typedecl_enum_field_get(tdl, "baz")));
889 fail_if(!(exp = eolian_typedecl_enum_field_value_get(field, EINA_FALSE))); 889 fail_if(!(exp = eolian_typedecl_enum_field_value_get(field, EINA_FALSE)));
890 v = eolian_expression_eval(unit, exp, EOLIAN_MASK_ALL); 890 v = eolian_expression_eval(exp, EOLIAN_MASK_ALL);
891 fail_if(v.type != EOLIAN_EXPR_INT); 891 fail_if(v.type != EOLIAN_EXPR_INT);
892 fail_if(v.value.i != 15); 892 fail_if(v.value.i != 15);
893 893
@@ -896,7 +896,7 @@ START_TEST(eolian_enum)
896 896
897 fail_if(!(field = eolian_typedecl_enum_field_get(tdl, "foo"))); 897 fail_if(!(field = eolian_typedecl_enum_field_get(tdl, "foo")));
898 fail_if(!(exp = eolian_typedecl_enum_field_value_get(field, EINA_FALSE))); 898 fail_if(!(exp = eolian_typedecl_enum_field_value_get(field, EINA_FALSE)));
899 v = eolian_expression_eval(unit, exp, EOLIAN_MASK_ALL); 899 v = eolian_expression_eval(exp, EOLIAN_MASK_ALL);
900 fail_if(v.type != EOLIAN_EXPR_INT); 900 fail_if(v.type != EOLIAN_EXPR_INT);
901 fail_if(v.value.i != 15); 901 fail_if(v.value.i != 15);
902 902
@@ -908,19 +908,19 @@ START_TEST(eolian_enum)
908 908
909 fail_if(!(field = eolian_typedecl_enum_field_get(tdl, "flag1"))); 909 fail_if(!(field = eolian_typedecl_enum_field_get(tdl, "flag1")));
910 fail_if(!(exp = eolian_typedecl_enum_field_value_get(field, EINA_FALSE))); 910 fail_if(!(exp = eolian_typedecl_enum_field_value_get(field, EINA_FALSE)));
911 v = eolian_expression_eval(unit, exp, EOLIAN_MASK_ALL); 911 v = eolian_expression_eval(exp, EOLIAN_MASK_ALL);
912 fail_if(v.type != EOLIAN_EXPR_INT); 912 fail_if(v.type != EOLIAN_EXPR_INT);
913 fail_if(v.value.i != (1 << 0)); 913 fail_if(v.value.i != (1 << 0));
914 914
915 fail_if(!(field = eolian_typedecl_enum_field_get(tdl, "flag2"))); 915 fail_if(!(field = eolian_typedecl_enum_field_get(tdl, "flag2")));
916 fail_if(!(exp = eolian_typedecl_enum_field_value_get(field, EINA_FALSE))); 916 fail_if(!(exp = eolian_typedecl_enum_field_value_get(field, EINA_FALSE)));
917 v = eolian_expression_eval(unit, exp, EOLIAN_MASK_ALL); 917 v = eolian_expression_eval(exp, EOLIAN_MASK_ALL);
918 fail_if(v.type != EOLIAN_EXPR_INT); 918 fail_if(v.type != EOLIAN_EXPR_INT);
919 fail_if(v.value.i != (1 << 1)); 919 fail_if(v.value.i != (1 << 1));
920 920
921 fail_if(!(field = eolian_typedecl_enum_field_get(tdl, "flag3"))); 921 fail_if(!(field = eolian_typedecl_enum_field_get(tdl, "flag3")));
922 fail_if(!(exp = eolian_typedecl_enum_field_value_get(field, EINA_FALSE))); 922 fail_if(!(exp = eolian_typedecl_enum_field_value_get(field, EINA_FALSE)));
923 v = eolian_expression_eval(unit, exp, EOLIAN_MASK_ALL); 923 v = eolian_expression_eval(exp, EOLIAN_MASK_ALL);
924 fail_if(v.type != EOLIAN_EXPR_INT); 924 fail_if(v.type != EOLIAN_EXPR_INT);
925 fail_if(v.value.i != (1 << 2)); 925 fail_if(v.value.i != (1 << 2));
926 926
@@ -938,14 +938,14 @@ START_TEST(eolian_enum)
938 fail_if(!(name = eolian_type_name_get(type))); 938 fail_if(!(name = eolian_type_name_get(type)));
939 fail_if(strcmp(name, "Baz")); 939 fail_if(strcmp(name, "Baz"));
940 fail_if(!(exp = eolian_variable_value_get(var))); 940 fail_if(!(exp = eolian_variable_value_get(var)));
941 v = eolian_expression_eval(unit, exp, EOLIAN_MASK_ALL); 941 v = eolian_expression_eval(exp, EOLIAN_MASK_ALL);
942 fail_if(v.type != EOLIAN_EXPR_INT); 942 fail_if(v.type != EOLIAN_EXPR_INT);
943 fail_if(v.value.i != (1 << 0)); 943 fail_if(v.value.i != (1 << 0));
944 944
945 fail_if(!(var = eolian_variable_constant_get_by_name(unit, "Pants"))); 945 fail_if(!(var = eolian_variable_constant_get_by_name(unit, "Pants")));
946 fail_if(eolian_variable_type_get(var) != EOLIAN_VAR_CONSTANT); 946 fail_if(eolian_variable_type_get(var) != EOLIAN_VAR_CONSTANT);
947 fail_if(!(exp = eolian_variable_value_get(var))); 947 fail_if(!(exp = eolian_variable_value_get(var)));
948 v = eolian_expression_eval(unit, exp, EOLIAN_MASK_ALL); 948 v = eolian_expression_eval(exp, EOLIAN_MASK_ALL);
949 fail_if(v.type != EOLIAN_EXPR_INT); 949 fail_if(v.type != EOLIAN_EXPR_INT);
950 fail_if(v.value.i != 5); 950 fail_if(v.value.i != 5);
951 951