summaryrefslogtreecommitdiff
path: root/src/lib/eolian
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2019-09-18 19:46:58 +0200
committerDaniel Kolesa <d.kolesa@samsung.com>2019-09-18 21:09:15 +0200
commit1f19af77804b4193e3b9285817b92348b77811f3 (patch)
tree60f49c3b131e7db8f0cc2af801dc71af4dcb7b8e /src/lib/eolian
parente6878050749ad715be85f5b56672fd3c8848eafb (diff)
eolian: disallow void for out/inout for stable API
Diffstat (limited to 'src/lib/eolian')
-rw-r--r--src/lib/eolian/eo_parser.c33
1 files changed, 20 insertions, 13 deletions
diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c
index f7843b51c5..1f5a678215 100644
--- a/src/lib/eolian/eo_parser.c
+++ b/src/lib/eolian/eo_parser.c
@@ -1077,7 +1077,7 @@ end:
1077 1077
1078static void 1078static void
1079parse_param(Eo_Lexer *ls, Eina_List **params, Eina_Bool allow_inout, 1079parse_param(Eo_Lexer *ls, Eina_List **params, Eina_Bool allow_inout,
1080 Eina_Bool is_vals) 1080 Eina_Bool is_vals, const Eolian_Function *func)
1081{ 1081{
1082 Eina_Bool has_optional = EINA_FALSE, 1082 Eina_Bool has_optional = EINA_FALSE,
1083 has_owned = EINA_FALSE, 1083 has_owned = EINA_FALSE,
@@ -1107,10 +1107,17 @@ parse_param(Eo_Lexer *ls, Eina_List **params, Eina_Bool allow_inout,
1107 par->base.name = eina_stringshare_ref(ls->t.value.s); 1107 par->base.name = eina_stringshare_ref(ls->t.value.s);
1108 eo_lexer_get(ls); 1108 eo_lexer_get(ls);
1109 check_next(ls, ':'); 1109 check_next(ls, ':');
1110 if (par->param_dir == EOLIAN_OUT_PARAM || par->param_dir == EOLIAN_INOUT_PARAM) 1110 if ((ls->klass && ls->klass->base.is_beta) || func->base.is_beta)
1111 par->type = eo_lexer_type_release(ls, parse_type_void(ls, EINA_TRUE)); 1111 {
1112 else 1112 if (par->param_dir == EOLIAN_OUT_PARAM || par->param_dir == EOLIAN_INOUT_PARAM)
1113 par->type = eo_lexer_type_release(ls, parse_type(ls, EINA_TRUE)); 1113 {
1114 /* void is allowed for out/inout for beta-api for now to make a voidptr */
1115 par->type = eo_lexer_type_release(ls, parse_type_void(ls, EINA_TRUE));
1116 goto type_done;
1117 }
1118 }
1119 par->type = eo_lexer_type_release(ls, parse_type(ls, EINA_TRUE));
1120type_done:
1114 if ((is_vals || (par->param_dir == EOLIAN_OUT_PARAM)) && (ls->t.token == '(')) 1121 if ((is_vals || (par->param_dir == EOLIAN_OUT_PARAM)) && (ls->t.token == '('))
1115 { 1122 {
1116 int line = ls->line_number, col = ls->column; 1123 int line = ls->line_number, col = ls->column;
@@ -1148,14 +1155,14 @@ end:
1148 1155
1149static void 1156static void
1150parse_params(Eo_Lexer *ls, Eina_List **params, Eina_Bool allow_inout, 1157parse_params(Eo_Lexer *ls, Eina_List **params, Eina_Bool allow_inout,
1151 Eina_Bool is_vals) 1158 Eina_Bool is_vals, const Eolian_Function *func)
1152{ 1159{
1153 int line, col; 1160 int line, col;
1154 eo_lexer_get(ls); 1161 eo_lexer_get(ls);
1155 line = ls->line_number, col = ls->column; 1162 line = ls->line_number, col = ls->column;
1156 check_next(ls, '{'); 1163 check_next(ls, '{');
1157 while (ls->t.token != '}') 1164 while (ls->t.token != '}')
1158 parse_param(ls, params, allow_inout, is_vals); 1165 parse_param(ls, params, allow_inout, is_vals, func);
1159 check_match(ls, '}', '{', line, col); 1166 check_match(ls, '}', '{', line, col);
1160} 1167}
1161 1168
@@ -1268,7 +1275,7 @@ parse_accessor:
1268 Eina_List **stor; 1275 Eina_List **stor;
1269 CASE_LOCK(ls, keys, "keys definition") 1276 CASE_LOCK(ls, keys, "keys definition")
1270 stor = is_get ? &prop->prop_keys_get : &prop->prop_keys_set; 1277 stor = is_get ? &prop->prop_keys_get : &prop->prop_keys_set;
1271 parse_params(ls, stor, EINA_FALSE, EINA_FALSE); 1278 parse_params(ls, stor, EINA_FALSE, EINA_FALSE, prop);
1272 break; 1279 break;
1273 } 1280 }
1274 case KW_values: 1281 case KW_values:
@@ -1276,7 +1283,7 @@ parse_accessor:
1276 Eina_List **stor; 1283 Eina_List **stor;
1277 CASE_LOCK(ls, values, "values definition") 1284 CASE_LOCK(ls, values, "values definition")
1278 stor = is_get ? &prop->prop_values_get : &prop->prop_values_set; 1285 stor = is_get ? &prop->prop_values_get : &prop->prop_values_set;
1279 parse_params(ls, stor, EINA_FALSE, EINA_TRUE); 1286 parse_params(ls, stor, EINA_FALSE, EINA_TRUE, prop);
1280 break; 1287 break;
1281 } 1288 }
1282 default: 1289 default:
@@ -1377,11 +1384,11 @@ body:
1377 break; 1384 break;
1378 case KW_keys: 1385 case KW_keys:
1379 CASE_LOCK(ls, keys, "keys definition") 1386 CASE_LOCK(ls, keys, "keys definition")
1380 parse_params(ls, &prop->prop_keys, EINA_FALSE, EINA_FALSE); 1387 parse_params(ls, &prop->prop_keys, EINA_FALSE, EINA_FALSE, prop);
1381 break; 1388 break;
1382 case KW_values: 1389 case KW_values:
1383 CASE_LOCK(ls, values, "values definition") 1390 CASE_LOCK(ls, values, "values definition")
1384 parse_params(ls, &prop->prop_values, EINA_FALSE, EINA_TRUE); 1391 parse_params(ls, &prop->prop_values, EINA_FALSE, EINA_TRUE, prop);
1385 break; 1392 break;
1386 default: 1393 default:
1387 goto end; 1394 goto end;
@@ -1478,7 +1485,7 @@ tags_done:
1478 break; 1485 break;
1479 case KW_params: 1486 case KW_params:
1480 CASE_LOCK(ls, params, "params definition"); 1487 CASE_LOCK(ls, params, "params definition");
1481 parse_params(ls, &meth->params, EINA_TRUE, EINA_FALSE); 1488 parse_params(ls, &meth->params, EINA_TRUE, EINA_FALSE, meth);
1482 break; 1489 break;
1483 default: 1490 default:
1484 goto end; 1491 goto end;
@@ -1576,7 +1583,7 @@ body:
1576 break; 1583 break;
1577 case KW_params: 1584 case KW_params:
1578 CASE_LOCK(ls, params, "params definition") 1585 CASE_LOCK(ls, params, "params definition")
1579 parse_params(ls, &meth->params, EINA_TRUE, EINA_FALSE); 1586 parse_params(ls, &meth->params, EINA_TRUE, EINA_FALSE, meth);
1580 break; 1587 break;
1581 default: 1588 default:
1582 goto end; 1589 goto end;