summaryrefslogtreecommitdiff
path: root/codegen/valactype.vala
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2018-12-30 18:19:44 +0100
committerRico Tzschichholz <ricotz@ubuntu.com>2018-12-30 18:19:44 +0100
commit1746709f375c199c86809f4c725890387afdba62 (patch)
treec72a4234f6f48eca94cd7976fc22cd462fba50c4 /codegen/valactype.vala
parente7308eaba01ec6c478bb37e1c912a1b6d750bc2c (diff)
downloadvala-1746709f375c199c86809f4c725890387afdba62.tar.gz
codegen: Add default_value for CType to initialize variables if needed
Fixes https://gitlab.gnome.org/GNOME/vala/issues/724
Diffstat (limited to 'codegen/valactype.vala')
-rw-r--r--codegen/valactype.vala10
1 files changed, 8 insertions, 2 deletions
diff --git a/codegen/valactype.vala b/codegen/valactype.vala
index 1190299cb..88894069e 100644
--- a/codegen/valactype.vala
+++ b/codegen/valactype.vala
@@ -29,11 +29,17 @@ public class Vala.CType : DataType {
*/
public string ctype_name { get; set; }
- public CType (string ctype_name) {
+ /**
+ * The default value of the C type.
+ */
+ public string cdefault_value { get; set; }
+
+ public CType (string ctype_name, string cdefault_value) {
this.ctype_name = ctype_name;
+ this.cdefault_value = cdefault_value;
}
public override DataType copy () {
- return new CType (ctype_name);
+ return new CType (ctype_name, cdefault_value);
}
}