mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-25 16:46:52 +02:00
Bug 560241 - Out-arguments should not be marked as being pointers in all cases
svn path=/trunk/; revision=928
This commit is contained in:
parent
02020aeb20
commit
5a1f29d1c9
24
girparser.c
24
girparser.c
@ -1656,17 +1656,25 @@ start_type (GMarkupParseContext *context,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gboolean is_pointer;
|
int pointer_depth;
|
||||||
name = find_attribute ("name", attribute_names, attribute_values);
|
name = find_attribute ("name", attribute_names, attribute_values);
|
||||||
|
|
||||||
if (name == NULL)
|
if (name == NULL)
|
||||||
MISSING_ATTRIBUTE (context, error, element_name, "name");
|
MISSING_ATTRIBUTE (context, error, element_name, "name");
|
||||||
|
|
||||||
|
pointer_depth = 0;
|
||||||
ctype = find_attribute ("c:type", attribute_names, attribute_values);
|
ctype = find_attribute ("c:type", attribute_names, attribute_values);
|
||||||
if (ctype != NULL && strchr (ctype, '*'))
|
if (ctype != NULL)
|
||||||
is_pointer = TRUE;
|
{
|
||||||
else
|
const char *cp = ctype + strlen(ctype) - 1;
|
||||||
is_pointer = FALSE;
|
while (cp > ctype && *cp-- == '*')
|
||||||
|
pointer_depth++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ctx->current_typed->type == G_IR_NODE_PARAM &&
|
||||||
|
((GIrNodeParam *)ctx->current_typed)->out &&
|
||||||
|
pointer_depth > 0)
|
||||||
|
pointer_depth--;
|
||||||
|
|
||||||
typenode = parse_type (ctx, name);
|
typenode = parse_type (ctx, name);
|
||||||
|
|
||||||
@ -1675,10 +1683,10 @@ start_type (GMarkupParseContext *context,
|
|||||||
*/
|
*/
|
||||||
if (typenode->tag == GI_TYPE_TAG_INTERFACE &&
|
if (typenode->tag == GI_TYPE_TAG_INTERFACE &&
|
||||||
is_disguised_structure (ctx, typenode->interface))
|
is_disguised_structure (ctx, typenode->interface))
|
||||||
is_pointer = TRUE;
|
pointer_depth++;
|
||||||
|
|
||||||
if (is_pointer)
|
if (pointer_depth > 0)
|
||||||
typenode->is_pointer = is_pointer;
|
typenode->is_pointer = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx->type_parameters = g_list_append (ctx->type_parameters, typenode);
|
ctx->type_parameters = g_list_append (ctx->type_parameters, typenode);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user