summaryrefslogtreecommitdiff
path: root/gi/pygi-array.c
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2017-07-12 08:42:12 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2017-07-12 08:42:16 +0900
commit7db802a3275790915ed33b470f58786a362551c6 (patch)
treede7b66f2e6ded30942469c5173eb51241422aa48 /gi/pygi-array.c
parentfecadc1d4b1cd7bafc93313c1120a4b350e2bced (diff)
downloadpygobject2-7db802a3275790915ed33b470f58786a362551c6.tar.gz
pygobject2-7db802a3275790915ed33b470f58786a362551c6.tar.bz2
pygobject2-7db802a3275790915ed33b470f58786a362551c6.zip
Imported Upstream version 3.13.4
Change-Id: If8453fcd54aeed1d4cec58fcabaf92a68d0efbb5 Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'gi/pygi-array.c')
-rw-r--r--gi/pygi-array.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/gi/pygi-array.c b/gi/pygi-array.c
index fceffc6..4cfbd17 100644
--- a/gi/pygi-array.c
+++ b/gi/pygi-array.c
@@ -25,6 +25,7 @@
#include "pygi-array.h"
#include "pygi-private.h"
#include "pygi-marshal-cleanup.h"
+#include "pygi-basictype.h"
/* Needed for _pygi_marshal_cleanup_from_py_interface_struct_gvalue hack */
#include "pygi-struct-marshal.h"
@@ -761,10 +762,8 @@ pygi_arg_garray_len_arg_setup (PyGIArgCache *arg_cache,
seq_cache->len_arg_index = g_type_info_get_array_length (type_info);
/* offset by self arg for methods and vfuncs */
- if (seq_cache->len_arg_index >= 0 && callable_cache != NULL &&
- (callable_cache->function_type == PYGI_FUNCTION_TYPE_METHOD ||
- callable_cache->function_type == PYGI_FUNCTION_TYPE_VFUNC)) {
- seq_cache->len_arg_index += 1;
+ if (seq_cache->len_arg_index >= 0 && callable_cache != NULL) {
+ seq_cache->len_arg_index += callable_cache->args_offset;
}
}
@@ -802,8 +801,8 @@ pygi_arg_garray_len_arg_setup (PyGIArgCache *arg_cache,
child_cache->meta_type = PYGI_META_ARG_TYPE_CHILD;
child_cache->direction = direction;
- child_cache->to_py_marshaller = NULL;
- child_cache->from_py_marshaller = NULL;
+ child_cache->to_py_marshaller = _pygi_marshal_to_py_basic_type_cache_adapter;
+ child_cache->from_py_marshaller = _pygi_marshal_from_py_basic_type_cache_adapter;
/* ugly edge case code:
*
@@ -833,11 +832,12 @@ pygi_arg_garray_len_arg_setup (PyGIArgCache *arg_cache,
}
static gboolean
-pygi_arg_garray_setup (PyGIArgGArray *sc,
- GITypeInfo *type_info,
- GIArgInfo *arg_info, /* may be NULL for return arguments */
- GITransfer transfer,
- PyGIDirection direction)
+pygi_arg_garray_setup (PyGIArgGArray *sc,
+ GITypeInfo *type_info,
+ GIArgInfo *arg_info, /* may be NULL for return arguments */
+ GITransfer transfer,
+ PyGIDirection direction,
+ PyGICallableCache *callable_cache)
{
GITypeInfo *item_type_info;
PyGIArgCache *arg_cache = (PyGIArgCache *)sc;
@@ -846,7 +846,8 @@ pygi_arg_garray_setup (PyGIArgGArray *sc,
type_info,
arg_info,
transfer,
- direction)) {
+ direction,
+ callable_cache)) {
return FALSE;
}
@@ -877,7 +878,8 @@ PyGIArgCache *
pygi_arg_garray_new_from_info (GITypeInfo *type_info,
GIArgInfo *arg_info,
GITransfer transfer,
- PyGIDirection direction)
+ PyGIDirection direction,
+ PyGICallableCache *callable_cache)
{
PyGIArgGArray *array_cache = g_slice_new0 (PyGIArgGArray);
if (array_cache == NULL)
@@ -887,7 +889,8 @@ pygi_arg_garray_new_from_info (GITypeInfo *type_info,
type_info,
arg_info,
transfer,
- direction)) {
+ direction,
+ callable_cache)) {
pygi_arg_cache_free ( (PyGIArgCache *)array_cache);
return NULL;
}