[vala] Arrays: Fix inline-allocated arrays
- From: Jürg Billeter <juergbi src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [vala] Arrays: Fix inline-allocated arrays
- Date: Thu, 30 Jul 2009 18:57:46 +0000 (UTC)
commit 1447a9874813ce3538ad5061b9475508f5a4f69a
Author: Jürg Billeter <j bitron ch>
Date: Thu Jul 30 20:40:36 2009 +0200
Arrays: Fix inline-allocated arrays
vala/valaarraytype.vala | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/vala/valaarraytype.vala b/vala/valaarraytype.vala
index 98f97c6..3c19f29 100644
--- a/vala/valaarraytype.vala
+++ b/vala/valaarraytype.vala
@@ -139,6 +139,7 @@ public class Vala.ArrayType : ReferenceType {
result.nullable = nullable;
result.floating_reference = floating_reference;
+ result.inline_allocated = inline_allocated;
if (fixed_length) {
result.fixed_length = true;
result.length = length;
@@ -148,8 +149,7 @@ public class Vala.ArrayType : ReferenceType {
}
public override string? get_cname () {
- // FIXME add support for [Immutable] or [Const] attribute to support arrays to const data
- if (fixed_length) {
+ if (inline_allocated) {
return element_type.get_cname ();
} else {
return element_type.get_cname () + "*";
@@ -159,6 +159,8 @@ public class Vala.ArrayType : ReferenceType {
public override string get_cdeclarator_suffix () {
if (fixed_length) {
return "[%d]".printf (length);
+ } else if (inline_allocated) {
+ return "[]";
} else {
return "";
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]