[gobject-introspection] scanner: Tweak "invalid transfer" warning to show type too
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection] scanner: Tweak "invalid transfer" warning to show type too
- Date: Sun, 27 Sep 2015 20:43:08 +0000 (UTC)
commit ea73b39cfc230e5cb8e5c56ffc83988c573a9513
Author: Colin Walters <walters verbum org>
Date: Sun Sep 27 16:02:26 2015 -0400
scanner: Tweak "invalid transfer" warning to show type too
Should help debugging.
giscanner/maintransformer.py | 12 ++++++------
tests/warn/invalid-transfer.h | 12 ++++++------
2 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/giscanner/maintransformer.py b/giscanner/maintransformer.py
index 6c0429d..8fb37f8 100644
--- a/giscanner/maintransformer.py
+++ b/giscanner/maintransformer.py
@@ -567,16 +567,16 @@ class MainTransformer(object):
transfer = OPT_TRANSFER_NONE
if not isinstance(target, (ast.Class, ast.Interface)):
- message.warn('invalid "transfer" annotation: '
- 'only valid for object and interface types',
+ message.warn('invalid "transfer" annotation for {0}: '
+ 'only valid for object and interface types'.format(target),
annotations.position)
return
elif transfer == OPT_TRANSFER_CONTAINER:
if (ANN_ARRAY not in annotations and
not isinstance(target, (ast.Array, ast.List, ast.Map))):
- message.warn('invalid "transfer" annotation: '
- 'only valid for container types',
+ message.warn('invalid "transfer" annotation for {0}: '
+ 'only valid for container types'.format(target),
annotations.position)
return
@@ -585,9 +585,9 @@ class MainTransformer(object):
not isinstance(target, (ast.Array, ast.List, ast.Map,
ast.Record, ast.Compound, ast.Boxed,
ast.Class, ast.Interface))):
- message.warn('invalid "transfer" annotation: '
+ message.warn('invalid "transfer" annotation for {0}: '
'only valid for array, struct, union, boxed, '
- 'object and interface types',
+ 'object and interface types'.format(target),
annotations.position)
return
diff --git a/tests/warn/invalid-transfer.h b/tests/warn/invalid-transfer.h
index 054bb76..09ef460 100644
--- a/tests/warn/invalid-transfer.h
+++ b/tests/warn/invalid-transfer.h
@@ -20,11 +20,11 @@ void test_transfer_invalid(GObject *param, GObject *param2, GObject *param3,
// EXPECT:7: Warning: Test: "transfer" annotation needs one option, none given
// EXPECT:8: Warning: Test: invalid "transfer" annotation option: "invalid"
// EXPECT:9: Warning: Test: "transfer" annotation needs one option, 2 given
-// EXPECT:10: Warning: Test: invalid "transfer" annotation: only valid for array, struct, union, boxed,
object and interface types
-// EXPECT:11: Warning: Test: invalid "transfer" annotation: only valid for array, struct, union, boxed,
object and interface types
-// EXPECT:12: Warning: Test: invalid "transfer" annotation: only valid for array, struct, union, boxed,
object and interface types
-// EXPECT:13: Warning: Test: invalid "transfer" annotation: only valid for container types
-// EXPECT:14: Warning: Test: invalid "transfer" annotation: only valid for object and interface types
+// EXPECT:10: Warning: Test: invalid "transfer" annotation for gchar: only valid for array, struct, union,
boxed, object and interface types
+// EXPECT:11: Warning: Test: invalid "transfer" annotation for gchar: only valid for array, struct, union,
boxed, object and interface types
+// EXPECT:12: Warning: Test: invalid "transfer" annotation for GType: only valid for array, struct, union,
boxed, object and interface types
+// EXPECT:13: Warning: Test: invalid "transfer" annotation for Class('Object'): only valid for container
types
+// EXPECT:14: Warning: Test: invalid "transfer" annotation for Record('DateTime'): only valid for object and
interface types
/**
* test_transfer_return_invalid:
@@ -33,4 +33,4 @@ void test_transfer_invalid(GObject *param, GObject *param2, GObject *param3,
*/
char test_transfer_return_invalid (void);
-// EXPECT:32: Warning: Test: invalid "transfer" annotation: only valid for array, struct, union, boxed,
object and interface types
+// EXPECT:32: Warning: Test: invalid "transfer" annotation for gchar: only valid for array, struct, union,
boxed, object and interface types
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]