X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=decoder%2Fruntc.c;h=bbeb40ef04ecc3929ce86707b73685f2c4eb5d02;hb=6688fad431faf47bcfd310af65a8c753204ad883;hp=49e6a61009d8eaa9eb34ef128921973bcbac245d;hpb=cb5b23ce1221332d20a4d0202c4e845935b8d440;p=sigrok-test.git diff --git a/decoder/runtc.c b/decoder/runtc.c index 49e6a61..bbeb40e 100644 --- a/decoder/runtc.c +++ b/decoder/runtc.c @@ -279,12 +279,12 @@ static void srd_cb_ann(struct srd_proto_data *pdata, void *cb_data) static void sr_cb(const struct sr_dev_inst *sdi, const struct sr_datafeed_packet *packet, void *cb_data) { + static int samplecnt = 0; const struct sr_datafeed_logic *logic; struct srd_session *sess; GVariant *gvar; uint64_t samplerate; int num_samples; - static int samplecnt = 0; struct sr_dev_driver *driver; sess = cb_data; @@ -318,7 +318,7 @@ static void sr_cb(const struct sr_dev_inst *sdi, logic->length, logic->unitsize); srd_session_send(sess, samplecnt, samplecnt + num_samples, logic->data, logic->length, logic->unitsize); - samplecnt += logic->length / logic->unitsize; + samplecnt += num_samples; break; case SR_DF_END: DBG("Received SR_DF_END"); @@ -349,7 +349,7 @@ static int run_testcase(const char *infile, GSList *pdlist, struct output *op) if (op->outfile) { if ((op->outfd = open(op->outfile, O_CREAT|O_WRONLY, 0600)) == -1) { ERR("Unable to open %s for writing: %s", op->outfile, - strerror(errno)); + g_strerror(errno)); return FALSE; } }