[gobject-introspection] Include proper line number for scope warning



commit 3711dcabae155df924cf42cc7d1202843f8b5e64
Author: Johan Dahlin <johan gnome org>
Date:   Sun Sep 19 16:38:34 2010 -0300

    Include proper line number for scope warning

 giscanner/maintransformer.py        |    7 ++++---
 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 2bf2102..e069a2e 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 42f1dc3..f6cfd87 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)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]