]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoder.c
Use uint8_t instead of unsigned char for raw byte data
[libsigrokdecode.git] / decoder.c
index 3bbc7f9936d3a7a08423d8a55ce49136b7154a35..0d266d4625618651deb38c73a4df4830b93f1e78 100644 (file)
--- a/decoder.c
+++ b/decoder.c
@@ -621,7 +621,7 @@ err_out:
 /* Convert logic_output_channels to GSList of 'struct srd_decoder_logic_output_channel'. */
 static int get_logic_output_channels(struct srd_decoder *dec)
 {
-       PyObject *py_logic_out_chs, *py_logic_out_ch, *py_samplerate, *py_item;
+       PyObject *py_logic_out_chs, *py_logic_out_ch, *py_item;
        GSList *logic_out_chs;
        struct srd_decoder_logic_output_channel *logic_out_ch;
        ssize_t i;
@@ -651,9 +651,9 @@ static int get_logic_output_channels(struct srd_decoder *dec)
                if (!py_logic_out_ch)
                        goto except_out;
 
-               if (!PyTuple_Check(py_logic_out_ch) || PyTuple_Size(py_logic_out_ch) != 3) {
+               if (!PyTuple_Check(py_logic_out_ch) || PyTuple_Size(py_logic_out_ch) != 2) {
                        srd_err("Protocol decoder %s logic_output_channels "
-                               "must contain only tuples of 3 elements.",
+                               "must contain only tuples of 2 elements.",
                                dec->name);
                        goto err_out;
                }
@@ -672,19 +672,6 @@ static int get_logic_output_channels(struct srd_decoder *dec)
                        goto except_out;
                if (py_str_as_str(py_item, &logic_out_ch->desc) != SRD_OK)
                        goto err_out;
-
-               py_samplerate = PyTuple_GetItem(py_logic_out_ch, 2);
-               if (!py_samplerate)
-                       goto except_out;
-
-               if (!PyLong_Check(py_samplerate)) {
-                       srd_err("Protocol decoder %s logic_output_channels tuples "
-                               "must have a number as 3rd element.",
-                               dec->name);
-                       goto err_out;
-               }
-
-               logic_out_ch->samplerate = PyLong_AsUnsignedLongLong(py_samplerate);
        }
        dec->logic_output_channels = logic_out_chs;
        Py_DECREF(py_logic_out_chs);