vala r1373 - in trunk: . gobject
- From: juergbi svn gnome org
- To: svn-commits-list gnome org
- Subject: vala r1373 - in trunk: . gobject
- Date: Mon, 12 May 2008 16:01:22 +0100 (BST)
Author: juergbi
Date: Mon May 12 15:01:22 2008
New Revision: 1373
URL: http://svn.gnome.org/viewvc/vala?rev=1373&view=rev
Log:
2008-05-12 Juerg Billeter <j bitron ch>
* gobject/valaccodegenerator.vala: add basic support for
instance_pos attribute to struct creation methods, fixes bug 530774
Modified:
trunk/ChangeLog
trunk/gobject/valaccodegenerator.vala
Modified: trunk/gobject/valaccodegenerator.vala
==============================================================================
--- trunk/gobject/valaccodegenerator.vala (original)
+++ trunk/gobject/valaccodegenerator.vala Mon May 12 15:01:22 2008
@@ -2942,7 +2942,7 @@
creation_call = new CCodeFunctionCall (new CCodeIdentifier (m.get_cname ()));
- if (expr.type_reference.data_type is Struct) {
+ if (expr.type_reference.data_type is Struct && !(m.cinstance_parameter_position < 0)) {
creation_call.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, instance));
} else if (expr.type_reference.data_type is Class) {
var cl = (Class) expr.type_reference.data_type;
@@ -3040,6 +3040,11 @@
i++;
}
+ if (expr.type_reference.data_type is Struct && m.cinstance_parameter_position < 0) {
+ // instance parameter is at the end in a struct creation method
+ creation_call.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, instance));
+ }
+
if (expr.can_fail) {
// method can fail
current_method_inner_error = true;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]