]> sigrok.org Git - sigrok-test.git/commitdiff
runtc, pdtest: Fixup minor style nits
authorGerhard Sittig <redacted>
Wed, 25 Jan 2017 20:05:03 +0000 (21:05 +0100)
committerUwe Hermann <redacted>
Thu, 2 Feb 2017 10:08:10 +0000 (11:08 +0100)
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.

decoder/pdtest
decoder/runtc.c

index 58b6eee19244353226938a35cf1c7cc27d24328e..1c24e6c21af9d65080bb6495843dac67e1e5542d 100755 (executable)
@@ -591,4 +591,3 @@ except Exception as e:
         raise
 
 sys.exit(ret)
-
index 6d40c1f8f46cb0037f8b82bd8a082e6aafafdd5e..bbeb40ef04ecc3929ce86707b73685f2c4eb5d02 100644 (file)
@@ -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");