[Vala] [PATCH] Properly use g_value_init for pointer types
- From: Mathias Hasselmann <mathias hasselmann gmx de>
- To: vala paldo org
- Subject: [Vala] [PATCH] Properly use g_value_init for pointer types
- Date: Wed, 21 Mar 2007 11:59:52 +0100
---
trunk/vala/vala/valacodegenerator.vala | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/trunk/vala/vala/valacodegenerator.vala b/trunk/vala/vala/valacodegenerator.vala
index 943c4e2..7348a75 100644
--- a/trunk/vala/vala/valacodegenerator.vala
+++ b/trunk/vala/vala/valacodegenerator.vala
@@ -3689,11 +3689,15 @@ public class Vala.CodeGenerator : CodeVisitor {
ccomma.append_expression (cnameassign);
var gvaluearg = new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, new
CCodeMemberAccess.pointer (cpointer, "value"));
+ var cvaluetype = prop.type_reference.data_type.get_type_id ();
+
+ if (null == cvaluetype)
+ cvaluetype = "G_TYPE_POINTER";
// initialize GValue in array for current parameter
var cvalueinit = new CCodeFunctionCall (new CCodeIdentifier ("g_value_init"));
cvalueinit.add_argument (gvaluearg);
- cvalueinit.add_argument (new CCodeIdentifier
(prop.type_reference.data_type.get_type_id ()));
+ cvalueinit.add_argument (new CCodeIdentifier (cvaluetype));
ccomma.append_expression (cvalueinit);
// set GValue for current parameter
--
1.4.4.2
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]