Warn if we see annotations for unknown parameters
authorTommi Komulainen <tko@src.gnome.org>
Tue, 21 Oct 2008 16:58:20 +0000 (16:58 +0000)
committerTommi Komulainen <tko@src.gnome.org>
Tue, 21 Oct 2008 16:58:20 +0000 (16:58 +0000)
* giscanner/transformer.py (_create_parameters): Warn if we see
annotations for unknown parameters. If .h and .c files name
parameters differently, the annotations may be lost.

svn path=/trunk/; revision=771

giscanner/transformer.py

index 6a5a119..489a7c3 100644 (file)
@@ -291,6 +291,16 @@ class Transformer(object):
             dirs = {}
         else:
             dirs = directives
+
+        # warn if we see annotations for unknown parameters
+        param_names = set(child.ident for child in base_type.child_list)
+        dirs_for = set(dirs)
+        dirs_for = dirs_for.difference(param_names)
+        dirs_for.discard('return')
+        if dirs_for:
+            print 'Unexpected annotations for %s, parameters are %s' % (
+                list(dirs_for), list(param_names), )
+
         for child in base_type.child_list:
             yield self._create_parameter(
                 child, dirs.get(child.ident, {}))