remove Pointer class
authorJuerg Billeter <j@bitron.ch>
Sat, 15 Dec 2007 12:02:11 +0000 (12:02 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Sat, 15 Dec 2007 12:02:11 +0000 (12:02 +0000)
2007-12-15  Juerg Billeter  <j@bitron.ch>

* vala/Makefile.am, vala/valadatatype.vala, vala/valanulltype.vala,
  vala/valapointer.vala, vala/valasemanticanalyzer.vala,
  vala/valatypesymbol.vala, gobject/valaccodegeneratormethod.vala:
  remove Pointer class

svn path=/trunk/; revision=775

ChangeLog
gobject/valaccodegeneratormethod.vala
vala/Makefile.am
vala/valadatatype.vala
vala/valanulltype.vala
vala/valapointer.vala [deleted file]
vala/valasemanticanalyzer.vala
vala/valatypesymbol.vala

index 15c8da3..1edd235 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2007-12-15  Jürg Billeter  <j@bitron.ch>
 
+       * vala/Makefile.am, vala/valadatatype.vala, vala/valanulltype.vala,
+         vala/valapointer.vala, vala/valasemanticanalyzer.vala,
+         vala/valatypesymbol.vala, gobject/valaccodegeneratormethod.vala:
+         remove Pointer class
+
+2007-12-15  Jürg Billeter  <j@bitron.ch>
+
        * gee/hashmap.vala, gee/hashset.vala: update to be compatible with new
          pointer types
 
index 981d510..42f6fc5 100644 (file)
@@ -592,7 +592,7 @@ public class Vala.CCodeGenerator {
        }
 
        private CCodeExpression default_value_for_type (DataType! type) {
-               if ((type.data_type != null && type.data_type.is_reference_type ()) || type is PointerType || type.data_type is Pointer) {
+               if ((type.data_type != null && type.data_type.is_reference_type ()) || type is PointerType) {
                        return new CCodeConstant ("NULL");
                } else if (type.data_type != null && type.data_type.get_default_value () != null) {
                        return new CCodeConstant (type.data_type.get_default_value ());
index 8e78904..d88804b 100644 (file)
@@ -88,7 +88,6 @@ libvalacore_la_VALASOURCES = \
        valaobjectcreationexpression.vala \
        valaparenthesizedexpression.vala \
        valaparser.vala \
-       valapointer.vala \
        valapointerindirection.vala \
        valapointertype.vala \
        valapostfixexpression.vala \
index 3d1acf2..1260a77 100644 (file)
@@ -347,7 +347,6 @@ public class Vala.DataType : CodeNode {
                            target_type is PointerType ||
                            target_type.data_type.is_reference_type () ||
                            target_type.is_out ||
-                           target_type.data_type is Pointer ||
                            target_type.data_type is Array ||
                            target_type.data_type is Callback ||
                            target_type.data_type.get_attribute ("PointerType") != null) {
@@ -362,7 +361,6 @@ public class Vala.DataType : CodeNode {
                        /* any reference or array type or pointer type can be cast to a generic pointer */
                        if (type_parameter != null ||
                                data_type.is_reference_type () ||
-                               data_type is Pointer ||
                                data_type is Array ||
                                data_type is Callback ||
                                data_type.get_attribute ("PointerType") != null) {
index 3be0201..9f9d8df 100644 (file)
@@ -39,7 +39,6 @@ public class Vala.NullType : ReferenceType {
                    target_type is PointerType ||
                    target_type.data_type.is_reference_type () ||
                    target_type.is_out ||
-                   target_type.data_type is Pointer ||
                    target_type.data_type is Array ||
                    target_type.data_type is Callback ||
                    target_type.data_type.get_attribute ("PointerType") != null) {
diff --git a/vala/valapointer.vala b/vala/valapointer.vala
deleted file mode 100644 (file)
index 5d58cab..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/* valapointer.vala
- *
- * Copyright (C) 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
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
-
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
-
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
- *
- * Author:
- *     Jürg Billeter <j@bitron.ch>
- */
-
-using GLib;
-using Gee;
-
-/**
- * Represents a pointer-type.
- */
-public class Vala.Pointer : Typesymbol {
-       /**
-        * The type to which this pointer type points.
-        */
-       public weak Typesymbol! referent_type { get; set construct; }
-       
-       private string cname;
-       
-       public Pointer (construct Typesymbol! referent_type, construct SourceReference source_reference = null) {
-       }
-
-       construct {
-               name = referent_type.name + "*";
-       }
-
-       public override string get_cname (bool const_type = false) {
-               if (cname == null) {
-                       if (referent_type.is_reference_type ()) {
-                               cname = "%s**".printf (referent_type.get_cname ());
-                       } else {
-                               cname = "%s*".printf (referent_type.get_cname ());
-                       }
-               }
-
-               return cname;
-       }
-
-       public override bool is_reference_type () {
-               return false;
-       }
-       
-       public override string get_upper_case_cname (string infix) {
-               return null;
-       }
-
-       public override string get_lower_case_cname (string infix) {
-               return null;
-       }
-
-       public override string get_free_function () {
-               return null;
-       }
-       
-       public override Collection<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";
-       }
-
-       public override string get_get_value_function () {
-               return "g_value_get_pointer";
-       }
-       
-       public override string get_set_value_function () {
-               return "g_value_set_pointer";
-       }
-}
index 6baf0bc..1f80f51 100644 (file)
@@ -2081,12 +2081,6 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
                if (expr.inner.static_type is PointerType) {
                        var pointer_type = (PointerType) expr.inner.static_type;
                        expr.static_type = pointer_type.base_type;
-               } else if (expr.inner.static_type.data_type is Pointer) {
-                       var pointer = (Pointer) expr.inner.static_type.data_type;
-
-                       expr.static_type = new DataType ();
-                       expr.static_type.data_type = pointer.referent_type;
-                       expr.static_type.takes_ownership = expr.inner.static_type.takes_ownership;
                } else {
                        expr.error = true;
                        Report.error (expr.source_reference, "Pointer indirection not supported for this expression");
index a81d8a5..208900b 100644 (file)
@@ -31,8 +31,6 @@ using Gee;
 public abstract class Vala.Typesymbol : Symbol {
        private Gee.List<string> cheader_filenames = new ArrayList<string> ();
 
-       private Pointer pointer_type;
-
        /* holds the array types of this type; each rank is a separate one */
        private Map<int,Array> array_types;
 
@@ -195,25 +193,7 @@ public abstract class Vala.Typesymbol : Symbol {
        public void add_cheader_filename (string! filename) {
                cheader_filenames.add (filename);
        }
-       
-       /**
-        * Returns the pointer type of this data type.
-        *
-        * @return pointer-type for this data type
-        */
-       public Pointer! get_pointer () {
-               if (pointer_type == null) {
-                       pointer_type = new Pointer (this, source_reference);
-                       /* create a new Symbol */
-                       parent_symbol.scope.add (pointer_type.name, pointer_type);
 
-                       /* link the namespace */
-                       pointer_type.owner = parent_symbol.scope;
-               }
-
-               return pointer_type;
-       }
-       
        /**
         * Returns the array type for elements of this data type.
         *