summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Dahlin <johan@gnome.org>2010-09-19 16:38:34 -0300
committerJohan Dahlin <johan@gnome.org>2010-09-19 23:47:36 -0300
commit3711dcabae155df924cf42cc7d1202843f8b5e64 (patch)
tree2a5f85fae1949328f5094a3a772c6eea0a3625cf
parent0d6db7114a176c2d24a19a2d6a570aab406608ac (diff)
downloadgobject-introspection-3711dcabae155df924cf42cc7d1202843f8b5e64.tar.gz
Include proper line number for scope warning
-rw-r--r--giscanner/maintransformer.py7
-rw-r--r--tests/warn/callback-invalid-scope.h2
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)