summaryrefslogtreecommitdiff
path: root/instance.c
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2019-11-23 16:42:44 +0100
committerUwe Hermann <uwe@hermann-uwe.de>2019-11-23 17:08:21 +0100
commit733047eda1c19e34fc55cdd7724999974f56176e (patch)
treef892261245af64d629415c5c442c853f7bd7aff8 /instance.c
parent144a09700d242ceac48a739f9fcdb3649f4c72b8 (diff)
downloadlibsigrokdecode-733047eda1c19e34fc55cdd7724999974f56176e.tar.gz
libsigrokdecode-733047eda1c19e34fc55cdd7724999974f56176e.zip
Avoid using Py_IncRef/Py_DecRef for consistency.
We currently use a mix of Py_IncRef/Py_DecRef and Py_XINCREF/Py_XDECREF or Py_INCREF/Py_DECREF in the code-base. Only use the latter variants for the time being (for consistency).
Diffstat (limited to 'instance.c')
-rw-r--r--instance.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/instance.c b/instance.c
index fc03174..2859493 100644
--- a/instance.c
+++ b/instance.c
@@ -695,7 +695,7 @@ SRD_PRIV int srd_inst_start(struct srd_decoder_inst *di)
PyGILState_Release(gstate);
return SRD_ERR_PYTHON;
}
- Py_DecRef(py_res);
+ Py_DECREF(py_res);
/* Set self.samplenum to 0. */
py_samplenum = PyLong_FromLong(0);
@@ -1046,7 +1046,7 @@ static gpointer di_thread(gpointer data)
* Call self.decode(). Only returns if the PD throws an exception.
* "Regular" termination of the decode() method is not expected.
*/
- Py_IncRef(di->py_inst);
+ Py_INCREF(di->py_inst);
srd_dbg("%s: Calling decode().", di->inst_id);
py_res = PyObject_CallMethod(di->py_inst, "decode", NULL);
srd_dbg("%s: decode() terminated.", di->inst_id);
@@ -1102,7 +1102,7 @@ static gpointer di_thread(gpointer data)
* decode() will re-start another thread transparently.
*/
srd_dbg("%s: decode() terminated (req %d).", di->inst_id, wanted_term);
- Py_DecRef(py_res);
+ Py_DECREF(py_res);
PyErr_Clear();
PyGILState_Release(gstate);
@@ -1311,7 +1311,7 @@ SRD_PRIV void srd_inst_free(struct srd_decoder_inst *di)
srd_inst_reset_state(di);
gstate = PyGILState_Ensure();
- Py_DecRef(di->py_inst);
+ Py_DECREF(di->py_inst);
PyGILState_Release(gstate);
g_free(di->inst_id);