diff options
author | Johan Dahlin <johan@gnome.org> | 2010-09-19 16:38:34 -0300 |
---|---|---|
committer | Johan Dahlin <johan@gnome.org> | 2010-09-19 23:47:36 -0300 |
commit | 3711dcabae155df924cf42cc7d1202843f8b5e64 (patch) | |
tree | 2a5f85fae1949328f5094a3a772c6eea0a3625cf | |
parent | 0d6db7114a176c2d24a19a2d6a570aab406608ac (diff) | |
download | gobject-introspection-3711dcabae155df924cf42cc7d1202843f8b5e64.tar.gz |
Include proper line number for scope warning
-rw-r--r-- | giscanner/maintransformer.py | 7 | ||||
-rw-r--r-- | tests/warn/callback-invalid-scope.h | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/giscanner/maintransformer.py b/giscanner/maintransformer.py index 2bf21027..e069a2e2 100644 --- a/giscanner/maintransformer.py +++ b/giscanner/maintransformer.py @@ -541,9 +541,10 @@ usage is void (*_gtk_reserved1)(void);""" if scope not in [ast.PARAM_SCOPE_CALL, ast.PARAM_SCOPE_ASYNC, ast.PARAM_SCOPE_NOTIFIED]: - message.warn_node( - parent, - "Invalid scope %r for parameter %r" % (scope, param.argname)) + message.warn( + "Invalid scope %r for parameter %r" % (scope, + param.argname), + [(tag.filename, tag.lineno, -1)]) else: param.scope = scope param.transfer = ast.PARAM_TRANSFER_NONE diff --git a/tests/warn/callback-invalid-scope.h b/tests/warn/callback-invalid-scope.h index 42f1dc31..f6cfd87b 100644 --- a/tests/warn/callback-invalid-scope.h +++ b/tests/warn/callback-invalid-scope.h @@ -7,5 +7,5 @@ */ void test_callback_invalid(GCallback *callback, gpointer user_data); -// EXPECT:8: Warning: Test: Invalid scope 'invalid' for parameter 'callback' +// EXPECT:5: Warning: Test: Invalid scope 'invalid' for parameter 'callback' // EXPECT:8: Warning: Test: test_callback_invalid: argument callback: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async) |