summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2019-07-17 20:14:46 +0200
committerDaniel Kolesa <d.kolesa@samsung.com>2019-07-17 20:15:35 +0200
commit65b4782682318055db57697064349ef8e4983064 (patch)
tree97ba806756e8e69044fa0f96db692de2fa33a712
parent499ee62980b523d032ca7abc29dec76ee686c93c (diff)
eolian: remove support for old free() syntax
Now freefuncs can only be specified on type declarations but not on types themselves. Also remove transitiveness of freefuncs.
-rw-r--r--src/lib/eolian/database_type.c1
-rw-r--r--src/lib/eolian/database_validate.c5
-rw-r--r--src/lib/eolian/eo_parser.c16
-rw-r--r--src/lib/eolian/eolian_database.h1
4 files changed, 1 insertions, 22 deletions
diff --git a/src/lib/eolian/database_type.c b/src/lib/eolian/database_type.c
index a0d9652f9d..66d8a97f62 100644
--- a/src/lib/eolian/database_type.c
+++ b/src/lib/eolian/database_type.c
@@ -14,7 +14,6 @@ database_type_del(Eolian_Type *tp)
14 eina_stringshare_del(tp->base.c_name); 14 eina_stringshare_del(tp->base.c_name);
15 database_type_del(tp->base_type); 15 database_type_del(tp->base_type);
16 database_type_del(tp->next_type); 16 database_type_del(tp->next_type);
17 if (tp->freefunc) eina_stringshare_del(tp->freefunc);
18 free(tp); 17 free(tp);
19} 18}
20 19
diff --git a/src/lib/eolian/database_validate.c b/src/lib/eolian/database_validate.c
index 79d8f7154c..8e14a95554 100644
--- a/src/lib/eolian/database_validate.c
+++ b/src/lib/eolian/database_validate.c
@@ -289,9 +289,6 @@ _validate_type(Validate_State *vals, Eolian_Type *tp)
289 default: 289 default:
290 break; 290 break;
291 } 291 }
292 /* FIXME: remove this after c++/c# has fixed their stuff */
293 if (tp->freefunc)
294 tp->ownable = EINA_TRUE;
295 return _validate_ownable(tp); 292 return _validate_ownable(tp);
296 } 293 }
297 /* user defined */ 294 /* user defined */
@@ -310,7 +307,7 @@ _validate_type(Validate_State *vals, Eolian_Type *tp)
310 } 307 }
311 if (!_validate_typedecl(vals, tp->tdecl)) 308 if (!_validate_typedecl(vals, tp->tdecl))
312 return EINA_FALSE; 309 return EINA_FALSE;
313 if (tp->tdecl->ownable || tp->freefunc) 310 if (tp->tdecl->ownable)
314 tp->ownable = EINA_TRUE; 311 tp->ownable = EINA_TRUE;
315 tp->base.c_name = eina_stringshare_ref(tp->tdecl->base.c_name); 312 tp->base.c_name = eina_stringshare_ref(tp->tdecl->base.c_name);
316 return _validate_ownable(tp); 313 return _validate_ownable(tp);
diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c
index 90920924b0..de6a9bc789 100644
--- a/src/lib/eolian/eo_parser.c
+++ b/src/lib/eolian/eo_parser.c
@@ -708,22 +708,6 @@ parse_type_void(Eo_Lexer *ls, Eina_Bool allow_ptr)
708 check_match(ls, ')', '(', pline, pcol); 708 check_match(ls, ')', '(', pline, pcol);
709 return def; 709 return def;
710 } 710 }
711 case KW_free:
712 {
713 int pline, pcolumn;
714 eo_lexer_get(ls);
715 pline = ls->line_number;
716 pcolumn = ls->column;
717 check_next(ls, '(');
718 def = parse_type_void(ls, allow_ptr);
719 check_next(ls, ',');
720 check(ls, TOK_VALUE);
721 def->freefunc = eina_stringshare_ref(ls->t.value.s);
722 eo_lexer_get(ls);
723 FILL_BASE(def->base, ls, line, col, TYPE);
724 check_match(ls, ')', '(', pline, pcolumn);
725 return def;
726 }
727 case KW_error: 711 case KW_error:
728 { 712 {
729 int pline, pcolumn; 713 int pline, pcolumn;
diff --git a/src/lib/eolian/eolian_database.h b/src/lib/eolian/eolian_database.h
index d1902655d1..4c08874ab8 100644
--- a/src/lib/eolian/eolian_database.h
+++ b/src/lib/eolian/eolian_database.h
@@ -264,7 +264,6 @@ struct _Eolian_Type
264 Eolian_Type_Builtin_Type btype; 264 Eolian_Type_Builtin_Type btype;
265 Eolian_Type *base_type; 265 Eolian_Type *base_type;
266 Eolian_Type *next_type; 266 Eolian_Type *next_type;
267 Eina_Stringshare *freefunc;
268 union 267 union
269 { 268 {
270 Eolian_Class *klass; 269 Eolian_Class *klass;