From: Juerg Billeter Date: Tue, 18 Dec 2007 15:26:11 +0000 (+0000) Subject: support PointerType for parameters X-Git-Tag: VALA_0_1_6~88 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fe345b8c5fa1e4f3bfe227ea817179699f2807ac;p=platform%2Fupstream%2Fvala.git support PointerType for parameters 2007-12-18 Juerg Billeter * vala/parser.y: support PointerType for parameters svn path=/trunk/; revision=779 --- diff --git a/ChangeLog b/ChangeLog index c872487..c2a6a7b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2007-12-18 Jürg Billeter + + * vala/parser.y: support PointerType for parameters + 2007-12-16 Jürg Billeter * gobject/valaccodegeneratorclass.vala: avoid critical warning when diff --git a/vala/parser.y b/vala/parser.y index 6c4eb7c..a2311c8 100644 --- a/vala/parser.y +++ b/vala/parser.y @@ -3104,16 +3104,18 @@ fixed_parameter ValaSourceReference *src; src = src(@3); - if (!vala_unresolved_type_get_is_weak (VALA_UNRESOLVED_TYPE ($3))) { - vala_unresolved_type_set_takes_ownership (VALA_UNRESOLVED_TYPE ($3), TRUE); - } + if (VALA_IS_UNRESOLVED_TYPE ($3)) { + if (!vala_unresolved_type_get_is_weak (VALA_UNRESOLVED_TYPE ($3))) { + vala_unresolved_type_set_takes_ownership (VALA_UNRESOLVED_TYPE ($3), TRUE); + } - if (!vala_unresolved_type_get_is_ref (VALA_UNRESOLVED_TYPE ($3)) - && !vala_unresolved_type_get_is_out (VALA_UNRESOLVED_TYPE ($3)) - && !vala_unresolved_type_get_transfers_ownership (VALA_UNRESOLVED_TYPE ($3))) { - /* FIXME take_ownership for in parameters that don't transfer ownership is not supported yet - * this may require an additional local variable per parameter */ - vala_unresolved_type_set_takes_ownership (VALA_UNRESOLVED_TYPE ($3), FALSE); + if (!vala_unresolved_type_get_is_ref (VALA_UNRESOLVED_TYPE ($3)) + && !vala_unresolved_type_get_is_out (VALA_UNRESOLVED_TYPE ($3)) + && !vala_unresolved_type_get_transfers_ownership (VALA_UNRESOLVED_TYPE ($3))) { + /* FIXME take_ownership for in parameters that don't transfer ownership is not supported yet + * this may require an additional local variable per parameter */ + vala_unresolved_type_set_takes_ownership (VALA_UNRESOLVED_TYPE ($3), FALSE); + } } $$ = vala_code_context_create_formal_parameter (context, $4, $3, src); @@ -3127,16 +3129,18 @@ fixed_parameter ValaSourceReference *src; src = src(@3); - if (!vala_unresolved_type_get_is_weak (VALA_UNRESOLVED_TYPE ($3))) { - vala_unresolved_type_set_takes_ownership (VALA_UNRESOLVED_TYPE ($3), TRUE); - } + if (VALA_IS_UNRESOLVED_TYPE ($3)) { + if (!vala_unresolved_type_get_is_weak (VALA_UNRESOLVED_TYPE ($3))) { + vala_unresolved_type_set_takes_ownership (VALA_UNRESOLVED_TYPE ($3), TRUE); + } - if (!vala_unresolved_type_get_is_ref (VALA_UNRESOLVED_TYPE ($3)) - && !vala_unresolved_type_get_is_out (VALA_UNRESOLVED_TYPE ($3)) - && !vala_unresolved_type_get_transfers_ownership (VALA_UNRESOLVED_TYPE ($3))) { - /* FIXME take_ownership for in parameters that don't transfer ownership is not supported yet - * this may require an additional local variable per parameter */ - vala_unresolved_type_set_takes_ownership (VALA_UNRESOLVED_TYPE ($3), FALSE); + if (!vala_unresolved_type_get_is_ref (VALA_UNRESOLVED_TYPE ($3)) + && !vala_unresolved_type_get_is_out (VALA_UNRESOLVED_TYPE ($3)) + && !vala_unresolved_type_get_transfers_ownership (VALA_UNRESOLVED_TYPE ($3))) { + /* FIXME take_ownership for in parameters that don't transfer ownership is not supported yet + * this may require an additional local variable per parameter */ + vala_unresolved_type_set_takes_ownership (VALA_UNRESOLVED_TYPE ($3), FALSE); + } } $$ = vala_code_context_create_formal_parameter (context, $4, $3, src);