diff options
author | Garrett Regier <garrett.regier@riftio.com> | 2015-09-26 11:55:09 -0400 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2015-09-26 11:55:09 -0400 |
commit | 5ae7bd58b6266997b61d897ad6562118eeb59210 (patch) | |
tree | c68c962a7c690969471531369b07ea4dbef9a77a /giscanner/testcodegen.py | |
parent | b503f31c7cfa3329456de9bff5a2c816a607285e (diff) | |
download | gobject-introspection-5ae7bd58b6266997b61d897ad6562118eeb59210.tar.gz |
scanner: Warn and ignore on incorrect transfer annotations
This is an issue in various code bases and tends
to confuse newcomers.
https://bugzilla.gnome.org/show_bug.cgi?id=752047
Signed-off-by: Garrett Regier <garrett.regier@riftio.com>
Diffstat (limited to 'giscanner/testcodegen.py')
-rw-r--r-- | giscanner/testcodegen.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/giscanner/testcodegen.py b/giscanner/testcodegen.py index 32139e3b..5080ed1b 100644 --- a/giscanner/testcodegen.py +++ b/giscanner/testcodegen.py @@ -65,6 +65,9 @@ class EverythingCodeGenerator(object): include_last_src) def write(self): + types = [ast.TYPE_ANY] + types.extend(ast.INTROSPECTABLE_BASIC) + func = ast.Function('nullfunc', ast.Return(ast.TYPE_NONE, transfer=ast.PARAM_TRANSFER_NONE), [], False, self.gen.gen_symbol('nullfunc')) @@ -74,7 +77,7 @@ class EverythingCodeGenerator(object): # First pass, generate constant returns prefix = 'const return ' - for typeval in ast.INTROSPECTABLE_BASIC: + for typeval in types: name = prefix + uscore_from_type(typeval) sym = self.gen.gen_symbol(name) func = ast.Function(name, @@ -87,7 +90,7 @@ class EverythingCodeGenerator(object): # Void return, one parameter prefix = 'oneparam ' - for typeval in ast.INTROSPECTABLE_BASIC: + for typeval in types: if typeval is ast.TYPE_NONE: continue name = prefix + uscore_from_type(typeval) @@ -101,7 +104,7 @@ class EverythingCodeGenerator(object): # Void return, one (out) parameter prefix = 'one_outparam ' - for typeval in ast.INTROSPECTABLE_BASIC: + for typeval in types: if typeval is ast.TYPE_NONE: continue name = prefix + uscore_from_type(typeval) @@ -119,7 +122,7 @@ class EverythingCodeGenerator(object): # Passthrough one parameter prefix = 'passthrough_one ' - for typeval in ast.INTROSPECTABLE_BASIC: + for typeval in types: if typeval is ast.TYPE_NONE: continue name = prefix + uscore_from_type(typeval) |