From 2e190d3f2bbb59c27c5faebb8c48ecd363309ec8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrg=20Billeter?= Date: Wed, 21 Mar 2007 15:15:46 +0000 Subject: [PATCH] use pointer as default of type_id and marshaller_type_name for reference MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 2007-03-21 Jürg Billeter * vala/valastruct.vala: use pointer as default of type_id and marshaller_type_name for reference types * vala/valapointer.vala: implement get_type_id svn path=/trunk/; revision=253 --- vala/ChangeLog | 6 ++++++ vala/vala/valapointer.vala | 6 +++++- vala/vala/valastruct.vala | 14 +++++++++++--- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/vala/ChangeLog b/vala/ChangeLog index a8025d1..484bb7b 100644 --- a/vala/ChangeLog +++ b/vala/ChangeLog @@ -1,5 +1,11 @@ 2007-03-21 Jürg Billeter + * vala/valastruct.vala: use pointer as default of type_id and + marshaller_type_name for reference types + * vala/valapointer.vala: implement get_type_id + +2007-03-21 Jürg Billeter + * vala/valacodegenerator.vala: deep copy GLists if necessary, patch by Mathias Hasselmann * vapi/glib-2.0.vala: fix some printf format strings to work on ILP32 diff --git a/vala/vala/valapointer.vala b/vala/vala/valapointer.vala index dceb8c6..12b3afe 100644 --- a/vala/vala/valapointer.vala +++ b/vala/vala/valapointer.vala @@ -71,7 +71,11 @@ public class Vala.Pointer : DataType { public override ref List get_cheader_filenames () { return referent_type.get_cheader_filenames (); } - + + public override string get_type_id () { + return "G_TYPE_POINTER"; + } + public override string get_marshaller_type_name () { return "POINTER"; } diff --git a/vala/vala/valastruct.vala b/vala/vala/valastruct.vala index 3c0dfb7..383e04d 100644 --- a/vala/vala/valastruct.vala +++ b/vala/vala/valastruct.vala @@ -1,6 +1,6 @@ /* valastruct.vala * - * Copyright (C) 2006 Jürg Billeter + * Copyright (C) 2006-2007 Jürg Billeter * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -331,7 +331,11 @@ public class Vala.Struct : DataType { public override string get_type_id () { if (type_id == null) { - Report.error (source_reference, "The type `%s` doesn't declare a type id".printf (symbol.get_full_name ())); + if (is_reference_type ()) { + type_id = "G_TYPE_POINTER"; + } else { + Report.error (source_reference, "The type `%s` doesn't declare a type id".printf (symbol.get_full_name ())); + } } return type_id; } @@ -342,7 +346,11 @@ public class Vala.Struct : DataType { public override string get_marshaller_type_name () { if (marshaller_type_name == null) { - Report.error (source_reference, "The type `%s` doesn't declare a marshaller type name".printf (symbol.get_full_name ())); + if (is_reference_type ()) { + marshaller_type_name = "POINTER"; + } else { + Report.error (source_reference, "The type `%s` doesn't declare a marshaller type name".printf (symbol.get_full_name ())); + } } return marshaller_type_name; } -- 2.7.4