use pointer as default of type_id and marshaller_type_name for reference
authorJürg Billeter <j@bitron.ch>
Wed, 21 Mar 2007 15:15:46 +0000 (15:15 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Wed, 21 Mar 2007 15:15:46 +0000 (15:15 +0000)
2007-03-21  Jürg Billeter  <j@bitron.ch>

* 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
vala/vala/valapointer.vala
vala/vala/valastruct.vala

index a8025d1..484bb7b 100644 (file)
@@ -1,5 +1,11 @@
 2007-03-21  Jürg Billeter  <j@bitron.ch>
 
+       * 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  <j@bitron.ch>
+
        * 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
index dceb8c6..12b3afe 100644 (file)
@@ -71,7 +71,11 @@ public class Vala.Pointer : DataType {
        public override ref List<string> 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";
        }
index 3c0dfb7..383e04d 100644 (file)
@@ -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;
        }