From: Juerg Billeter Date: Sat, 26 Apr 2008 07:56:21 +0000 (+0000) Subject: Fix `char' properties, fixes bug 529604 X-Git-Tag: VALA_0_3_2~65 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d24d442f9e0dc22eb38ea9db55d0c164c288d210;p=thirdparty%2Fvala.git Fix `char' properties, fixes bug 529604 2008-04-26 Juerg Billeter * gobject/valaccodegenerator.vala: * gobject/valaccodetypesymbolbinding.vala: Fix `char' properties, fixes bug 529604 svn path=/trunk/; revision=1318 --- diff --git a/ChangeLog b/ChangeLog index 1b189828e..08087f0d2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-04-26 Jürg Billeter + + * gobject/valaccodegenerator.vala: + * gobject/valaccodetypesymbolbinding.vala: + + Fix `char' properties, fixes bug 529604 + 2008-04-26 Jürg Billeter * gobject/valaccodeclassbinding.vala: diff --git a/gobject/valaccodegenerator.vala b/gobject/valaccodegenerator.vala index 3dc37979c..75addc59e 100644 --- a/gobject/valaccodegenerator.vala +++ b/gobject/valaccodegenerator.vala @@ -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")); diff --git a/gobject/valaccodetypesymbolbinding.vala b/gobject/valaccodetypesymbolbinding.vala index a7a399c22..3b0d4304b 100644 --- a/gobject/valaccodetypesymbolbinding.vala +++ b/gobject/valaccodetypesymbolbinding.vala @@ -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"));