[vala] dova: Prepare support for decimal floating point types



commit e7bb7cb6075e162766b90b4cb24f26f0f80b4046
Author: Jürg Billeter <j bitron ch>
Date:   Sat Jun 5 09:45:50 2010 +0200

    dova: Prepare support for decimal floating point types

 vala/valastruct.vala |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/vala/valastruct.vala b/vala/valastruct.vala
index addd2db..b7af767 100644
--- a/vala/valastruct.vala
+++ b/vala/valastruct.vala
@@ -41,6 +41,7 @@ public class Vala.Struct : TypeSymbol {
 	private bool boolean_type;
 	private bool integer_type;
 	private bool floating_type;
+	private bool decimal_floating_type;
 	private int rank;
 	private string marshaller_type_name;
 	private string get_value_function;
@@ -377,7 +378,17 @@ public class Vala.Struct : TypeSymbol {
 		}
 		return floating_type;
 	}
-	
+
+	public bool is_decimal_floating_type () {
+		if (base_type != null) {
+			var st = base_struct;
+			if (st != null && st.is_decimal_floating_type ()) {
+				return true;
+			}
+		}
+		return decimal_floating_type;
+	}
+
 	/**
 	 * Returns the rank of this integer or floating point type.
 	 *
@@ -463,6 +474,9 @@ public class Vala.Struct : TypeSymbol {
 		if (a.has_argument ("rank")) {
 			rank = a.get_integer ("rank");
 		}
+		if (a.has_argument ("decimal")) {
+			decimal_floating_type = a.get_bool ("decimal");
+		}
 		if (a.has_argument ("width")) {
 			width = a.get_integer ("width");
 		}



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