From: Gerhard Sittig Date: Wed, 25 Jan 2017 20:05:03 +0000 (+0100) Subject: runtc, pdtest: Fixup minor style nits X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=6688fad431faf47bcfd310af65a8c753204ad883;p=sigrok-test.git runtc, pdtest: Fixup minor style nits Address several minor style nits: Remove trailing empty lines in source files. Declare 'static' auto variables before non-static variables. Re-use the result of a division instead of running the calculation again. --- diff --git a/decoder/pdtest b/decoder/pdtest index 58b6eee..1c24e6c 100755 --- a/decoder/pdtest +++ b/decoder/pdtest @@ -591,4 +591,3 @@ except Exception as e: raise sys.exit(ret) - diff --git a/decoder/runtc.c b/decoder/runtc.c index 6d40c1f..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");