diff options
author | Pavel Holejsovsky <pholejs@src.gnome.org> | 2011-01-09 16:12:46 +0100 |
---|---|---|
committer | Pavel Holejsovsky <pholejs@src.gnome.org> | 2011-01-13 16:28:05 +0100 |
commit | 8896eb04d9cb9f8792da34ae9814c7d7b97a9729 (patch) | |
tree | d8d49c81ed5961929ad88b0f17f045d89e818191 /giscanner/maintransformer.py | |
parent | f3f3cb62abec946f82fe44a8382a04b28d6c7313 (diff) | |
download | gobject-introspection-8896eb04d9cb9f8792da34ae9814c7d7b97a9729.tar.gz |
Make caller-allocates detection work for struct aliases
Scanner tries to detect caller-allocates attribute automatically if
not explicitly specified by checking that parameter is not double-referenced
and is struct or union. This patch adds resolving of aliases when
checking whether parameter is struct or union.
Also removes old incorrect method transformer.follow_aliases, which
was never used in current code.
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=639081
Diffstat (limited to 'giscanner/maintransformer.py')
-rw-r--r-- | giscanner/maintransformer.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/giscanner/maintransformer.py b/giscanner/maintransformer.py index 0868d785..345f0f0e 100644 --- a/giscanner/maintransformer.py +++ b/giscanner/maintransformer.py @@ -501,6 +501,7 @@ usage is void (*_gtk_reserved1)(void);""" if subtype in (None, ''): if node.type.target_giname and node.type.ctype: target = self._transformer.lookup_giname(node.type.target_giname) + target = self._transformer.resolve_aliases(target) has_double_indirection = '**' in node.type.ctype is_structure_or_union = isinstance(target, (ast.Record, ast.Union)) caller_allocates = (not has_double_indirection and is_structure_or_union) |