summaryrefslogtreecommitdiff
path: root/girepository
diff options
context:
space:
mode:
Diffstat (limited to 'girepository')
-rw-r--r--girepository/gifieldinfo.c16
-rw-r--r--girepository/girnode.c4
-rw-r--r--girepository/gitypelib.c13
3 files changed, 10 insertions, 23 deletions
diff --git a/girepository/gifieldinfo.c b/girepository/gifieldinfo.c
index 106fc1ce..17491a80 100644
--- a/girepository/gifieldinfo.c
+++ b/girepository/gifieldinfo.c
@@ -193,14 +193,7 @@ g_field_info_get_field (GIFieldInfo *field_info,
if (g_type_info_is_pointer (type_info))
{
- if (g_type_info_get_array_type (type_info) == GI_ARRAY_TYPE_C &&
- g_type_info_get_array_fixed_size (type_info) >= 0)
- {
- /* Consider fixed-size arrays as embedded inside the struct */
- value->v_pointer = G_STRUCT_MEMBER_P ((mem), (offset));
- }
- else
- value->v_pointer = G_STRUCT_MEMBER (gpointer, mem, offset);
+ value->v_pointer = G_STRUCT_MEMBER (gpointer, mem, offset);
result = TRUE;
}
else
@@ -248,9 +241,14 @@ g_field_info_get_field (GIFieldInfo *field_info,
value->v_double = G_STRUCT_MEMBER (gdouble, mem, offset);
result = TRUE;
break;
+ case GI_TYPE_TAG_ARRAY:
+ /* We don't check the array type and that it is fixed-size,
+ we trust g-ir-compiler to do the right thing */
+ value->v_pointer = G_STRUCT_MEMBER_P (mem, offset);
+ result = TRUE;
+ break;
case GI_TYPE_TAG_UTF8:
case GI_TYPE_TAG_FILENAME:
- case GI_TYPE_TAG_ARRAY:
case GI_TYPE_TAG_GLIST:
case GI_TYPE_TAG_GSLIST:
case GI_TYPE_TAG_GHASH:
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;
diff --git a/girepository/gitypelib.c b/girepository/gitypelib.c
index 3ecfb16b..6d1333ba 100644
--- a/girepository/gitypelib.c
+++ b/girepository/gitypelib.c
@@ -523,19 +523,6 @@ validate_array_type_blob (GITypelib *typelib,
gboolean return_type,
GError **error)
{
- ArrayTypeBlob *blob;
-
- blob = (ArrayTypeBlob*)&typelib->data[offset];
-
- if (!blob->pointer)
- {
- g_set_error (error,
- G_TYPELIB_ERROR,
- G_TYPELIB_ERROR_INVALID_BLOB,
- "Pointer type exected for tag %d", blob->tag);
- return FALSE;
- }
-
/* FIXME validate length */
if (!validate_type_blob (typelib,