summaryrefslogtreecommitdiff
path: root/type_decoder.c
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2018-05-18 00:27:57 +0200
committerUwe Hermann <uwe@hermann-uwe.de>2018-05-18 00:27:57 +0200
commitec31b9821dbfad0283a56c6d2b5e7d819c59ba51 (patch)
tree49484ffc8f4b2ff1149a9c280b03c9794ec2a9f6 /type_decoder.c
parent7b34c16345627644b6031fbef7fbdb99b58bfd49 (diff)
downloadlibsigrokdecode-ec31b9821dbfad0283a56c6d2b5e7d819c59ba51.tar.gz
libsigrokdecode-ec31b9821dbfad0283a56c6d2b5e7d819c59ba51.zip
convert_meta(): Use g_variant_type_equal().
Diffstat (limited to 'type_decoder.c')
-rw-r--r--type_decoder.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/type_decoder.c b/type_decoder.c
index 2f15ee6..f2ac87d 100644
--- a/type_decoder.c
+++ b/type_decoder.c
@@ -216,7 +216,7 @@ static int convert_meta(struct srd_proto_data *pdata, PyObject *obj)
gstate = PyGILState_Ensure();
- if (pdata->pdo->meta_type == G_VARIANT_TYPE_INT64) {
+ if (g_variant_type_equal(pdata->pdo->meta_type, G_VARIANT_TYPE_INT64)) {
if (!PyLong_Check(obj)) {
PyErr_Format(PyExc_TypeError, "This output was registered "
"as 'int', but something else was passed.");
@@ -226,7 +226,7 @@ static int convert_meta(struct srd_proto_data *pdata, PyObject *obj)
if (PyErr_Occurred())
goto err;
pdata->data = g_variant_new_int64(intvalue);
- } else if (pdata->pdo->meta_type == G_VARIANT_TYPE_DOUBLE) {
+ } else if (g_variant_type_equal(pdata->pdo->meta_type, G_VARIANT_TYPE_DOUBLE)) {
if (!PyFloat_Check(obj)) {
PyErr_Format(PyExc_TypeError, "This output was registered "
"as 'float', but something else was passed.");