diff options
author | Gerhard Sittig <gerhard.sittig@gmx.net> | 2017-01-25 21:05:03 +0100 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2017-02-02 11:08:10 +0100 |
commit | 6688fad431faf47bcfd310af65a8c753204ad883 (patch) | |
tree | d3ec3e0168056084d10ca76d68b83fda455890aa /decoder | |
parent | 1a5417590cebb5f168079993778b608a131088a3 (diff) | |
download | sigrok-test-6688fad431faf47bcfd310af65a8c753204ad883.tar.gz sigrok-test-6688fad431faf47bcfd310af65a8c753204ad883.zip |
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.
Diffstat (limited to 'decoder')
-rwxr-xr-x | decoder/pdtest | 1 | ||||
-rw-r--r-- | decoder/runtc.c | 4 |
2 files changed, 2 insertions, 3 deletions
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"); |