From: Jürg Billeter Date: Sat, 5 Jun 2010 07:45:50 +0000 (+0200) Subject: dova: Prepare support for decimal floating point types X-Git-Tag: 0.9.1~22 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e7bb7cb6075e162766b90b4cb24f26f0f80b4046;p=thirdparty%2Fvala.git dova: Prepare support for decimal floating point types --- diff --git a/vala/valastruct.vala b/vala/valastruct.vala index addd2db09..b7af767fc 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"); }