]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
dova: Prepare support for decimal floating point types
authorJürg Billeter <j@bitron.ch>
Sat, 5 Jun 2010 07:45:50 +0000 (09:45 +0200)
committerJürg Billeter <j@bitron.ch>
Sat, 5 Jun 2010 08:12:10 +0000 (10:12 +0200)
vala/valastruct.vala

index addd2db0955af90d41d3252b5f28d54cd4413171..b7af767fc93636c045298dd240189b3412c42948 100644 (file)
@@ -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");
                }