]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Fix `char' properties, fixes bug 529604
authorJuerg Billeter <j@bitron.ch>
Sat, 26 Apr 2008 07:56:21 +0000 (07:56 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Sat, 26 Apr 2008 07:56:21 +0000 (07:56 +0000)
2008-04-26  Juerg Billeter  <j@bitron.ch>

* gobject/valaccodegenerator.vala:
* gobject/valaccodetypesymbolbinding.vala:

Fix `char' properties, fixes bug 529604

svn path=/trunk/; revision=1318

ChangeLog
gobject/valaccodegenerator.vala
gobject/valaccodetypesymbolbinding.vala

index 1b189828e5a62ad177b24872cc949cf4625ae0d3..08087f0d2d7b3c46a13575e92a4a52046199e710 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-04-26  Jürg Billeter  <j@bitron.ch>
+
+       * gobject/valaccodegenerator.vala:
+       * gobject/valaccodetypesymbolbinding.vala:
+
+       Fix `char' properties, fixes bug 529604
+
 2008-04-26  Jürg Billeter  <j@bitron.ch>
 
        * gobject/valaccodeclassbinding.vala:
index 3dc37979c5e742b7399af52ef4cf80f784b05577..75addc59e1b7bac893a14df0346c36db5a06c931 100644 (file)
@@ -93,6 +93,8 @@ public class Vala.CCodeGenerator : CodeGenerator {
        public DataType uint_type;
        public DataType long_type;
        public DataType ulong_type;
+       public DataType int8_type;
+       public DataType uint8_type;
        public DataType int64_type;
        public DataType uint64_type;
        public DataType string_type;
@@ -214,6 +216,8 @@ public class Vala.CCodeGenerator : CodeGenerator {
                uint_type = new ValueType ((Typesymbol) root_symbol.scope.lookup ("uint"));
                long_type = new ValueType ((Typesymbol) root_symbol.scope.lookup ("long"));
                ulong_type = new ValueType ((Typesymbol) root_symbol.scope.lookup ("ulong"));
+               int8_type = new ValueType ((Typesymbol) root_symbol.scope.lookup ("int8"));
+               uint8_type = new ValueType ((Typesymbol) root_symbol.scope.lookup ("uint8"));
                int64_type = new ValueType ((Typesymbol) root_symbol.scope.lookup ("int64"));
                uint64_type = new ValueType ((Typesymbol) root_symbol.scope.lookup ("uint64"));
                float_type = new ValueType ((Typesymbol) root_symbol.scope.lookup ("float"));
index a7a399c222e5174a39906dc45c2d1b18f87a166a..3b0d4304b65c6d5de5040ce1ff081884b686763c 100644 (file)
@@ -104,6 +104,16 @@ public abstract class Vala.CCodeTypesymbolBinding : CCodeBinding {
                        } else {
                                cspec.add_argument (new CCodeConstant ("FALSE"));
                        }
+               } else if (prop.type_reference.data_type == codegen.int8_type.data_type
+                          || prop.type_reference.data_type == codegen.char_type.data_type) {
+                       cspec.call = new CCodeIdentifier ("g_param_spec_char");
+                       cspec.add_argument (new CCodeConstant ("G_MININT8"));
+                       cspec.add_argument (new CCodeConstant ("G_MAXINT8"));
+                       if (prop.default_expression != null) {
+                               cspec.add_argument ((CCodeExpression) prop.default_expression.ccodenode);
+                       } else {
+                               cspec.add_argument (new CCodeConstant ("0"));
+                       }
                } else if (prop.type_reference.data_type == codegen.float_type.data_type) {
                        cspec.call = new CCodeIdentifier ("g_param_spec_float");
                        cspec.add_argument (new CCodeConstant ("-G_MAXFLOAT"));