summaryrefslogtreecommitdiff
path: root/gi/pygi-argument.c
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2017-07-12 08:38:46 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2017-07-12 08:38:49 +0900
commit44cf7615f8b29c5a41b4f8232f423683bebf2111 (patch)
treeece73f6c09298f08f4094605725943cfc481da81 /gi/pygi-argument.c
parent6261b351b73e062a1d9b5f8bddc73b093c6f02a3 (diff)
downloadpygobject2-44cf7615f8b29c5a41b4f8232f423683bebf2111.tar.gz
pygobject2-44cf7615f8b29c5a41b4f8232f423683bebf2111.tar.bz2
pygobject2-44cf7615f8b29c5a41b4f8232f423683bebf2111.zip
Imported Upstream version 3.1.92
Change-Id: I4e7700a820e7e7508b52bfc52cf5c9e8f440fee7 Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'gi/pygi-argument.c')
-rw-r--r--gi/pygi-argument.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/gi/pygi-argument.c b/gi/pygi-argument.c
index 4cfacfc..894f60b 100644
--- a/gi/pygi-argument.c
+++ b/gi/pygi-argument.c
@@ -722,15 +722,8 @@ _pygi_argument_from_object (PyObject *object,
arg.v_boolean = PyObject_IsTrue (object);
break;
}
- case GI_TYPE_TAG_UINT8:
- if (PYGLIB_PyBytes_Check(object)) {
- arg.v_long = (long)(PYGLIB_PyBytes_AsString(object)[0]);
- break;
- }
-
case GI_TYPE_TAG_INT8:
case GI_TYPE_TAG_INT16:
- case GI_TYPE_TAG_UINT16:
case GI_TYPE_TAG_INT32:
{
PyObject *int_;
@@ -740,12 +733,19 @@ _pygi_argument_from_object (PyObject *object,
break;
}
- arg.v_long = PYGLIB_PyLong_AsLong (int_);
+ if (type_tag == GI_TYPE_TAG_INT32)
+ arg.v_int32 = PYGLIB_PyLong_AsLong (int_);
+ else if (type_tag == GI_TYPE_TAG_INT8)
+ arg.v_int8 = PYGLIB_PyLong_AsLong (int_);
+ else if (type_tag == GI_TYPE_TAG_INT16)
+ arg.v_int16 = PYGLIB_PyLong_AsLong (int_);
Py_DECREF (int_);
break;
}
+ case GI_TYPE_TAG_UINT8:
+ case GI_TYPE_TAG_UINT16:
case GI_TYPE_TAG_UINT32:
case GI_TYPE_TAG_UINT64:
{
@@ -764,7 +764,14 @@ _pygi_argument_from_object (PyObject *object,
#endif
value = PyLong_AsUnsignedLongLong (number);
- arg.v_uint64 = value;
+ if (type_tag == GI_TYPE_TAG_UINT32)
+ arg.v_uint32 = value;
+ else if (type_tag == GI_TYPE_TAG_UINT64)
+ arg.v_uint64 = value;
+ else if (type_tag == GI_TYPE_TAG_UINT8)
+ arg.v_uint8 = value;
+ else if (type_tag == GI_TYPE_TAG_UINT16)
+ arg.v_uint16 = value;
Py_DECREF (number);