vala r2087 - in trunk: . gobject vala
- From: juergbi svn gnome org
- To: svn-commits-list gnome org
- Subject: vala r2087 - in trunk: . gobject vala
- Date: Sat, 29 Nov 2008 19:06:56 +0000 (UTC)
Author: juergbi
Date: Sat Nov 29 19:06:56 2008
New Revision: 2087
URL: http://svn.gnome.org/viewvc/vala?rev=2087&view=rev
Log:
2008-11-29 JÃrg Billeter <j bitron ch>
* vala/valavoidtype.vala:
* gobject/valaccodebasemodule.vala:
Use G_TYPE_POINTER for pointers and G_TYPE_INVALID for
unsupported types in typeof expressions
Modified:
trunk/ChangeLog
trunk/gobject/valaccodebasemodule.vala
trunk/vala/valavoidtype.vala
Modified: trunk/gobject/valaccodebasemodule.vala
==============================================================================
--- trunk/gobject/valaccodebasemodule.vala (original)
+++ trunk/gobject/valaccodebasemodule.vala Sat Nov 29 19:06:56 2008
@@ -1450,13 +1450,15 @@
}
private CCodeExpression get_type_id_expression (DataType type) {
- if (type.data_type != null) {
- return new CCodeIdentifier (type.data_type.get_type_id ());
- } else if (type.type_parameter != null) {
+ if (type is GenericType) {
string var_name = "%s_type".printf (type.type_parameter.name.down ());
return new CCodeMemberAccess.pointer (new CCodeMemberAccess.pointer (new CCodeIdentifier ("self"), "priv"), var_name);
} else {
- return new CCodeIdentifier ("G_TYPE_NONE");
+ string type_id = type.get_type_id ();
+ if (type_id == null) {
+ type_id = "G_TYPE_INVALID";
+ }
+ return new CCodeIdentifier (type_id);
}
}
Modified: trunk/vala/valavoidtype.vala
==============================================================================
--- trunk/vala/valavoidtype.vala (original)
+++ trunk/vala/valavoidtype.vala Sat Nov 29 19:06:56 2008
@@ -44,4 +44,8 @@
public override DataType copy () {
return new VoidType ();
}
+
+ public override string? get_type_id () {
+ return "G_TYPE_NONE";
+ }
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]