X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=blobdiff_plain;f=instance.c;h=4eca3f54b3ad990d9613d75d6bdc4e03bf6d9aeb;hp=bfe9142860d76829ce2f609ddbf1bd23fbe312f1;hb=ef3a66299ade1bc41090d0b6d24c21b6bcfad571;hpb=cda2d36cfeed3f921252ffa95377529d6bdc074b
diff --git a/instance.c b/instance.c
index bfe9142..4eca3f5 100644
--- a/instance.c
+++ b/instance.c
@@ -18,9 +18,9 @@
* along with this program. If not, see .
*/
+#include
#include "libsigrokdecode-internal.h" /* First, so we avoid a _POSIX_C_SOURCE warning. */
#include "libsigrokdecode.h"
-#include "config.h"
#include
#include
#include
@@ -546,14 +546,6 @@ SRD_PRIV int srd_inst_decode(const struct srd_decoder_inst *di,
PyObject *py_res;
srd_logic *logic;
- ((struct srd_decoder_inst *)di)->data_unitsize = unitsize;
-
- srd_dbg("Calling decode(), start sample %" PRIu64 ", end sample %"
- PRIu64 " (%" PRIu64 " samples, %" PRIu64 " bytes, unitsize = "
- "%d), instance %s.", start_samplenum, end_samplenum,
- end_samplenum - start_samplenum, inbuflen, di->data_unitsize,
- di->inst_id);
-
/* Return an error upon unusable input. */
if (!di) {
srd_dbg("empty decoder instance");
@@ -568,6 +560,14 @@ SRD_PRIV int srd_inst_decode(const struct srd_decoder_inst *di,
return SRD_ERR_ARG;
}
+ ((struct srd_decoder_inst *)di)->data_unitsize = unitsize;
+
+ srd_dbg("Calling decode(), start sample %" PRIu64 ", end sample %"
+ PRIu64 " (%" PRIu64 " samples, %" PRIu64 " bytes, unitsize = "
+ "%d), instance %s.", start_samplenum, end_samplenum,
+ end_samplenum - start_samplenum, inbuflen, di->data_unitsize,
+ di->inst_id);
+
/*
* Create new srd_logic object. Each iteration around the PD's loop
* will fill one sample into this object.