summaryrefslogtreecommitdiff
path: root/giscanner/transformer.py
diff options
context:
space:
mode:
authorSimon Feltman <sfeltman@src.gnome.org>2014-01-03 16:16:35 -0800
committerSimon Feltman <sfeltman@src.gnome.org>2014-01-04 14:01:24 -0800
commite6fc4c1bcba459dfd56f2d2019e24bfbaf29a493 (patch)
treed929ce30f4212c4a8d38c41fa750a37ed0c63f71 /giscanner/transformer.py
parent17c160a8ee7dd6a3eaaaea1bda93e7d5e9912a64 (diff)
downloadgobject-introspection-e6fc4c1bcba459dfd56f2d2019e24bfbaf29a493.tar.gz
scanner: Replace GInitiallyUnowned field sharing with generic solution
Remove GInitiallyUnowned special case in gdumpparser where fields are copied from GObject. Add generic solution where anytime we have multiple typedef structs, the fields become shared: typedef struct _Foo Foo; typedef struct _Foo Bar; struct _Foo {...}; https://bugzilla.gnome.org/show_bug.cgi?id=581525
Diffstat (limited to 'giscanner/transformer.py')
-rw-r--r--giscanner/transformer.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/giscanner/transformer.py b/giscanner/transformer.py
index b540a8c1..80265dd8 100644
--- a/giscanner/transformer.py
+++ b/giscanner/transformer.py
@@ -752,14 +752,15 @@ raise ValueError."""
# prior typedef struct. If we get here it means this is another
# typedef of that struct. Instead of creating an alias to the
# primary typedef that has been promoted, we create a new Record
- # which is forced as a disguised struct. This handles the case
- # where we want to give GInitiallyUnowned its own Record:
+ # with shared fields. This handles the case where we want to
+ # give structs like GInitiallyUnowned its own Record:
# typedef struct _GObject GObject;
# typedef struct _GObject GInitiallyUnowned;
- # GInitiallyUnowned is also special cased in gdumpparser.py to
- # copy fields which may eventually be avoided by doing it here
- # generically.
- compound = compound_class(name, symbol.ident, disguised=True, tag_name=tag_name)
+ # See: http://bugzilla.gnome.org/show_bug.cgi?id=569408
+ new_compound = compound_class(name, symbol.ident, tag_name=tag_name)
+ new_compound.fields = compound.fields
+ new_compound.add_symbol_reference(symbol)
+ return new_compound
else:
# If the struct does not have its name set, it exists only in
# the tag namespace. Set it here and return it which will