From: Uwe Hermann Date: Tue, 11 Nov 2014 15:33:45 +0000 (+0100) Subject: Use getters now that 'struct sr_dev_inst' is opaque. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=021922274c9a92b2f3a830956084185f0a7a4ed2;p=sigrok-test.git Use getters now that 'struct sr_dev_inst' is opaque. --- diff --git a/decoder/runtc.c b/decoder/runtc.c index 9249cfb..2193309 100644 --- a/decoder/runtc.c +++ b/decoder/runtc.c @@ -282,13 +282,16 @@ static void sr_cb(const struct sr_dev_inst *sdi, uint64_t samplerate; int num_samples; static int samplecnt = 0; + struct sr_dev_driver *driver; sess = cb_data; + driver = sr_dev_inst_driver_get(sdi); + switch (packet->type) { case SR_DF_HEADER: DBG("Received SR_DF_HEADER"); - if (sr_config_get(sdi->driver, sdi, NULL, SR_CONF_SAMPLERATE, + if (sr_config_get(driver, sdi, NULL, SR_CONF_SAMPLERATE, &gvar) != SR_OK) { ERR("Getting samplerate failed"); break; @@ -341,6 +344,7 @@ static int run_testcase(char *infile, GSList *pdlist, struct output *op) const char *s; struct sr_dev_inst *sdi; uint64_t unitsize; + struct sr_dev_driver *driver; if (op->outfile) { if ((op->outfd = open(op->outfile, O_CREAT|O_WRONLY, 0600)) == -1) { @@ -355,7 +359,8 @@ static int run_testcase(char *infile, GSList *pdlist, struct output *op) sr_session_dev_list(sr_sess, &devices); sdi = devices->data; - sr_config_get(sdi->driver, sdi, NULL, SR_CONF_CAPTURE_UNITSIZE, &gvar); + driver = sr_dev_inst_driver_get(sdi); + sr_config_get(driver, sdi, NULL, SR_CONF_CAPTURE_UNITSIZE, &gvar); unitsize = g_variant_get_uint64(gvar); g_variant_unref(gvar);