diff options
author | Colin Walters <walters@src.gnome.org> | 2009-01-11 23:25:42 +0000 |
---|---|---|
committer | Colin Walters <walters@src.gnome.org> | 2009-01-11 23:25:42 +0000 |
commit | 2032fef987aa952aeec507217be384a215a2750a (patch) | |
tree | 6a6646face854e550f751f78c2207af8542b3174 | |
parent | 3f6dd727233c364396cf9adff2e2721942228c0b (diff) | |
download | gobject-introspection-2032fef987aa952aeec507217be384a215a2750a.tar.gz |
Transfer default fixups
Default to "NONE" for all IN parameters; this more closely matches
how we did transfer in the old system. However - we need to make
an exception for strings (utf8). For some reason those were
FULL, even though that has no meaning.
Also default to NONE for void to match the old system.
svn path=/branches/annotation/; revision=1011
-rw-r--r-- | giscanner/annotationparser.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/giscanner/annotationparser.py b/giscanner/annotationparser.py index b942ed38..b8d2a424 100644 --- a/giscanner/annotationparser.py +++ b/giscanner/annotationparser.py @@ -482,13 +482,15 @@ class AnnotationApplier(object): if node.direction in [PARAM_DIRECTION_INOUT, PARAM_DIRECTION_OUT]: return PARAM_TRANSFER_FULL - # Input basic types default to 'none' - elif node.type.canonical in BASIC_GIR_TYPES: - return PARAM_TRANSFER_NONE - else: + # This one is a hack for compatibility; the transfer + # for string parameters really has no defined meaning. + elif node.type.canonical == 'utf8': return PARAM_TRANSFER_FULL + else: + return PARAM_TRANSFER_NONE elif isinstance(node, Return): - if node.type.canonical in BASIC_GIR_TYPES: + if (node.type.canonical in BASIC_GIR_TYPES or + node.type.canonical in [TYPE_NONE, TYPE_ANY]): return PARAM_TRANSFER_NONE else: return PARAM_TRANSFER_FULL |