Fix marshalling of GStrv.

* gir/gimarshallingtests.[hc]: Add a test for GStrv in function args and
as struct fields.

* girepository/giroffsets.c: Correctly compute the size of structs with
  array fields

* girepository/girparser.c: Set is_pointer to FALSE for arrays with
  fixed size that are inside structs.

* giscanner/glibtransformer.py: Special case GStrv as arrays of utf8.

* giscanner/annotationparser.py: Make full transfer the default for
arrays of char* returned by functions.

https://bugzilla.gnome.org/show_bug.cgi?id=620170
This commit is contained in:
Tomeu Vizoso 2010-06-02 19:36:59 +02:00
parent 6436e013c9
commit d531541b8a
2 changed files with 8 additions and 5 deletions

View File

@ -232,7 +232,11 @@ get_type_size_alignment (GIrNodeType *type,
{
ffi_type *type_ffi;
if (type->tag == GI_TYPE_TAG_ARRAY)
if (type->is_pointer)
{
type_ffi = &ffi_type_pointer;
}
else if (type->tag == GI_TYPE_TAG_ARRAY)
{
gint elt_size, elt_alignment;
@ -250,10 +254,6 @@ get_type_size_alignment (GIrNodeType *type,
return TRUE;
}
else if (type->is_pointer)
{
type_ffi = &ffi_type_pointer;
}
else
{
if (type->tag == GI_TYPE_TAG_INTERFACE)

View File

@ -1745,6 +1745,9 @@ start_type (GMarkupParseContext *context,
else
/* If neither zero-terminated nor length nor fixed-size is given, assume zero-terminated. */
typenode->zero_terminated = !(typenode->has_length || typenode->has_size);
if (typenode->has_size && ctx->current_typed->type == G_IR_NODE_FIELD)
typenode->is_pointer = FALSE;
} else {
typenode->zero_terminated = FALSE;
typenode->has_length = FALSE;