summaryrefslogtreecommitdiff
path: root/giscanner
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2009-12-15 17:39:00 -0500
committerColin Walters <walters@verbum.org>2010-02-11 17:43:00 -0500
commit55f286ca7898c8127ebc3018b621bf1e3b9ab0cb (patch)
treede0b68818ec9faeb0b70cc2b472c605644612702 /giscanner
parent0fb726196aeed6c4f29aa0dc4d2d6031fae3c985 (diff)
downloadgobject-introspection-55f286ca7898c8127ebc3018b621bf1e3b9ab0cb.tar.gz
Assume allow-none for GCancellable
All GCancellables are allow-none, this allows us to remove a lot of custom annotations. https://bugzilla.gnome.org/show_bug.cgi?id=604658
Diffstat (limited to 'giscanner')
-rw-r--r--giscanner/annotationparser.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/giscanner/annotationparser.py b/giscanner/annotationparser.py
index aa04ef44..fe5e721e 100644
--- a/giscanner/annotationparser.py
+++ b/giscanner/annotationparser.py
@@ -552,12 +552,14 @@ class AnnotationApplier(object):
if node.direction is None:
node.direction = self._guess_direction(node)
node.transfer = self._extract_transfer(parent, node, options)
- if OPT_ALLOW_NONE in options:
- node.allow_none = True
param_type = options.get(OPT_TYPE)
if param_type:
node.type = self._resolve(param_type.one(), node.type)
+ if (OPT_ALLOW_NONE in options or
+ node.type.ctype == 'GCancellable*'):
+ node.allow_none = True
+
assert node.transfer is not None
if tag is not None and tag.comment is not None:
node.doc = tag.comment