From: Jürg Billeter Date: Thu, 12 Jun 2008 16:50:57 +0000 (+0000) Subject: Use `const' in C for immutable classes where appropriate X-Git-Tag: VALA_0_3_4~80 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eb9247d0bedfa29ea0728f166fb218cc794b5f94;p=thirdparty%2Fvala.git Use `const' in C for immutable classes where appropriate 2008-06-12 Jürg Billeter * vala/valaclass.vala: Use `const' in C for immutable classes where appropriate svn path=/trunk/; revision=1573 --- diff --git a/ChangeLog b/ChangeLog index 6cdaab5c4..6acc3892e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-06-12 Jürg Billeter + + * vala/valaclass.vala: + + Use `const' in C for immutable classes where appropriate + 2008-06-12 Jürg Billeter * vala/valainterfacewriter.vala: diff --git a/vala/valaclass.vala b/vala/valaclass.vala index 136fbb10a..c7df296ba 100644 --- a/vala/valaclass.vala +++ b/vala/valaclass.vala @@ -448,8 +448,12 @@ public class Vala.Class : ObjectTypeSymbol { } public override string get_cname (bool const_type = false) { - if (const_type && const_cname != null) { - return const_cname; + if (const_type) { + if (const_cname != null) { + return const_cname; + } else if (is_immutable) { + return "const " + get_cname (false); + } } if (cname == null) {