summaryrefslogtreecommitdiff
path: root/giscanner/girwriter.py
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2014-06-20 13:52:14 +0100
committerColin Walters <walters@verbum.org>2015-10-04 17:46:09 -0400
commit10cb665fee2cc378dd2f13bad16e6384836a8b16 (patch)
tree3d699aa40290c4902774233290ec89d277ff9dec /giscanner/girwriter.py
parent0a134a608f5b471c3a12739785e149ceaf90df27 (diff)
downloadgobject-introspection-10cb665fee2cc378dd2f13bad16e6384836a8b16.tar.gz
giscanner: Mark gpointer nodes as nullable by default
gpointer parameters and return types should be marked as nullable by default, unless: • also annotated with (type) and not with (nullable); or • explicitly annotated with (not nullable). This introduces the (not nullable) annotation as a direct opposite to (nullable). In future, (not) could be extended to invert other annotations. https://bugzilla.gnome.org/show_bug.cgi?id=729660
Diffstat (limited to 'giscanner/girwriter.py')
-rw-r--r--giscanner/girwriter.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/giscanner/girwriter.py b/giscanner/girwriter.py
index e73dcaca..f637376f 100644
--- a/giscanner/girwriter.py
+++ b/giscanner/girwriter.py
@@ -214,7 +214,7 @@ class GIRWriter(XMLWriter):
attrs.append(('transfer-ownership', return_.transfer))
if return_.skip:
attrs.append(('skip', '1'))
- if return_.nullable:
+ if return_.nullable and not return_.not_nullable:
attrs.append(('nullable', '1'))
with self.tagcontext('return-value', attrs):
self._write_generic(return_)
@@ -240,7 +240,7 @@ class GIRWriter(XMLWriter):
if parameter.transfer:
attrs.append(('transfer-ownership',
parameter.transfer))
- if parameter.nullable:
+ if parameter.nullable and not parameter.not_nullable:
attrs.append(('nullable', '1'))
if parameter.direction != ast.PARAM_DIRECTION_OUT:
attrs.append(('allow-none', '1'))