[pygobject] gi/pygi-argument: Squash critical warning when using array as hash value
- From: Christoph Reiter <creiter src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] gi/pygi-argument: Squash critical warning when using array as hash value
- Date: Fri, 18 May 2018 15:23:18 +0000 (UTC)
commit 806c5059f989ed1b8bc62e6aa1ef55123ac110de
Author: Philip Withnall <withnall endlessm com>
Date: Fri May 18 15:16:45 2018 +0100
gi/pygi-argument: Squash critical warning when using array as hash value
Using a GPtrArray as the value type of a GHashTable currently produces a
warning:
Unsupported type array
for example when calling a function whose return type is annotated as:
(transfer container) (element-type filename GPtrArray<SomeObject>)
Since we don’t treat objects (GI_TYPE_TAG_INTERFACE) specially when
marshalling to/from GHashTable, we shouldn’t need to treat arrays
specially either. Handle the case explicitly.
Signed-off-by: Philip Withnall <withnall endlessm com>
gi/pygi-argument.c | 2 ++
1 file changed, 2 insertions(+)
---
diff --git a/gi/pygi-argument.c b/gi/pygi-argument.c
index cbec0dd8..76ce8b4b 100644
--- a/gi/pygi-argument.c
+++ b/gi/pygi-argument.c
@@ -144,6 +144,7 @@ _pygi_hash_pointer_to_arg (GIArgument *arg,
case GI_TYPE_TAG_UTF8:
case GI_TYPE_TAG_FILENAME:
case GI_TYPE_TAG_INTERFACE:
+ case GI_TYPE_TAG_ARRAY:
break;
default:
g_critical ("Unsupported type %s", g_type_tag_to_string(type_tag));
@@ -174,6 +175,7 @@ _pygi_arg_to_hash_pointer (const GIArgument *arg,
case GI_TYPE_TAG_UTF8:
case GI_TYPE_TAG_FILENAME:
case GI_TYPE_TAG_INTERFACE:
+ case GI_TYPE_TAG_ARRAY:
return arg->v_pointer;
default:
g_critical ("Unsupported type %s", g_type_tag_to_string(type_tag));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]