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
}
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 ());
valaobjectcreationexpression.vala \
valaparenthesizedexpression.vala \
valaparser.vala \
- valapointer.vala \
valapointerindirection.vala \
valapointertype.vala \
valapostfixexpression.vala \
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) {
/* 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) {
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) {
+++ /dev/null
-/* 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";
- }
-}
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");
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;
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.
*