summaryrefslogtreecommitdiff
path: root/girepository/girnode.c
diff options
context:
space:
mode:
authorGiovanni Campagna <gcampagna@src.gnome.org>2011-06-05 20:57:01 +0200
committerGiovanni Campagna <gcampagna@src.gnome.org>2011-06-08 17:45:13 +0200
commitaea1a55dff7f5cf7f3d87bbe515d94b66057b852 (patch)
tree62f4cd439fb25ae36a1def9709ea6e5642b62808 /girepository/girnode.c
parentc8c23d2db2ec6594b5c43bd01cc78db396c709f3 (diff)
downloadgobject-introspection-aea1a55dff7f5cf7f3d87bbe515d94b66057b852.tar.gz
Fix accessing structure fields that are arrays
We need to distinguish inline arrays inside structures, and arrays that are pointers and annotations, and we can do it with g_type_info_is_pointer(), setting it to FALSE for fixed size arrays. As a side effect, (array fixed-size=N) on a pointer type has no longer the expected result. https://bugzilla.gnome.org/show_bug.cgi?id=646635
Diffstat (limited to 'girepository/girnode.c')
-rw-r--r--girepository/girnode.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/girepository/girnode.c b/girepository/girnode.c
index 9998d8e5..a56471e5 100644
--- a/girepository/girnode.c
+++ b/girepository/girnode.c
@@ -1242,6 +1242,8 @@ serialize_type (GIrTypelibBuild *build,
node->has_length ? "," : "");
g_string_append (str, "]");
+ if (node->is_pointer)
+ g_string_append (str, "*");
}
else if (node->array_type == GI_ARRAY_TYPE_BYTE_ARRAY)
{
@@ -1476,7 +1478,7 @@ _g_ir_node_build_typelib (GIrNode *node,
ArrayTypeBlob *array = (ArrayTypeBlob *)&data[*offset2];
guint32 pos;
- array->pointer = 1;
+ array->pointer = type->is_pointer;
array->reserved = 0;
array->tag = type->tag;
array->zero_terminated = type->zero_terminated;