From 2032fef987aa952aeec507217be384a215a2750a Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Sun, 11 Jan 2009 23:25:42 +0000 Subject: 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 --- giscanner/annotationparser.py | 12 +++++++----- 1 file 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 -- cgit v1.2.1