vala r2436 - in trunk: . vala



Author: juergbi
Date: Thu Feb 12 16:23:29 2009
New Revision: 2436
URL: http://svn.gnome.org/viewvc/vala?rev=2436&view=rev

Log:
2009-02-12  JÃrg Billeter  <j bitron ch>

	* vala/valastruct.vala:
	* vala/valasymbolresolver.vala:

	Add base_struct property to Struct class, patch by Andreas Brauchli


Modified:
   trunk/ChangeLog
   trunk/vala/valastruct.vala
   trunk/vala/valasymbolresolver.vala

Modified: trunk/vala/valastruct.vala
==============================================================================
--- trunk/vala/valastruct.vala	(original)
+++ trunk/vala/valastruct.vala	Thu Feb 12 16:23:29 2009
@@ -51,7 +51,7 @@
 	private string destroy_function;
 
 	/**
-	 * Specifies the base struct.
+	 * Specifies the base type.
 	 */
 	public DataType? base_type {
 		get {
@@ -64,6 +64,18 @@
 	}
 
 	/**
+	 * Specifies the base Struct.
+	 */
+	public Struct? base_struct {
+		get {
+			if (_base_type != null) {
+				return _base_type.data_type as Struct;
+			}
+			return null;
+		}
+	}
+
+	/**
 	 * Specifies the default construction method.
 	 */
 	public Method default_construction_method { get; set; }
@@ -293,7 +305,7 @@
 	 */
 	public bool is_boolean_type () {
 		if (base_type != null) {
-			var st = base_type.data_type as Struct;
+			var st = base_struct;
 			if (st != null && st.is_boolean_type ()) {
 				return true;
 			}
@@ -308,7 +320,7 @@
 	 */
 	public bool is_integer_type () {
 		if (base_type != null) {
-			var st = base_type.data_type as Struct;
+			var st = base_struct;
 			if (st != null && st.is_integer_type ()) {
 				return true;
 			}
@@ -323,7 +335,7 @@
 	 */
 	public bool is_floating_type () {
 		if (base_type != null) {
-			var st = base_type.data_type as Struct;
+			var st = base_struct;
 			if (st != null && st.is_floating_type ()) {
 				return true;
 			}
@@ -421,7 +433,7 @@
 		if (type_id == null) {
 			if (!has_type_id) {
 				if (base_type != null) {
-					var st = base_type.data_type as Struct;
+					var st = base_struct;
 					if (st != null) {
 						return st.get_type_id ();
 					}
@@ -445,7 +457,7 @@
 	public override string? get_marshaller_type_name () {
 		if (marshaller_type_name == null) {
 			if (base_type != null) {
-				var st = base_type.data_type as Struct;
+				var st = base_struct;
 				if (st != null) {
 					return st.get_marshaller_type_name ();
 				}
@@ -468,7 +480,7 @@
 	public override string? get_get_value_function () {
 		if (get_value_function == null) {
 			if (base_type != null) {
-				var st = base_type.data_type as Struct;
+				var st = base_struct;
 				if (st != null) {
 					return st.get_get_value_function ();
 				}
@@ -489,7 +501,7 @@
 	public override string? get_set_value_function () {
 		if (set_value_function == null) {
 			if (base_type != null) {
-				var st = base_type.data_type as Struct;
+				var st = base_struct;
 				if (st != null) {
 					return st.get_set_value_function ();
 				}
@@ -522,7 +534,7 @@
 
 		// inherit default value from base type
 		if (base_type != null) {
-			var st = base_type.data_type as Struct;
+			var st = base_struct;
 			if (st != null) {
 				return st.get_default_value ();
 			}
@@ -553,7 +565,7 @@
 	 */
 	public bool is_simple_type () {
 		if (base_type != null) {
-			var st = base_type.data_type as Struct;
+			var st = base_struct;
 			if (st != null && st.is_simple_type ()) {
 				return true;
 			}

Modified: trunk/vala/valasymbolresolver.vala
==============================================================================
--- trunk/vala/valasymbolresolver.vala	(original)
+++ trunk/vala/valasymbolresolver.vala	Thu Feb 12 16:23:29 2009
@@ -84,7 +84,7 @@
 		st.accept_children (this);
 
 		if (st.base_type != null) {
-			var base_type = st.base_type.data_type as Struct;
+			var base_type = st.base_struct;
 			if (base_type != null) {
 				if (base_type.is_subtype_of (st)) {
 					st.error = true;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]