X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=hardware%2Fdemo%2Fdemo.c;h=0ecaeff6dea27d26cd211f20570ca5cbc57a9544;hb=68c12597efda33a30b6152cbac4b805604f3e671;hp=c1e1a90721aaf811d62220ec3a9fb2ed1e1976b4;hpb=d3b1b51cbef3edfeefbc5b9edfdd8423c6d5e8e0;p=libsigrok.git diff --git a/hardware/demo/demo.c b/hardware/demo/demo.c index c1e1a907..0ecaeff6 100644 --- a/hardware/demo/demo.c +++ b/hardware/demo/demo.c @@ -185,7 +185,6 @@ static int *hw_get_capabilities(void) static int hw_set_configuration(int device_index, int capability, void *value) { int ret; - uint64_t *tmp_u64; char *stropt; /* Avoid compiler warnings. */ @@ -195,20 +194,17 @@ static int hw_set_configuration(int device_index, int capability, void *value) /* Nothing to do, but must be supported */ ret = SR_OK; } else if (capability == SR_HWCAP_SAMPLERATE) { - tmp_u64 = value; - cur_samplerate = *tmp_u64; + cur_samplerate = *(uint64_t *)value; sr_dbg("demo: %s: setting samplerate to %" PRIu64, __func__, cur_samplerate); ret = SR_OK; } else if (capability == SR_HWCAP_LIMIT_SAMPLES) { - tmp_u64 = value; - limit_samples = *tmp_u64; + limit_samples = *(uint64_t *)value; sr_dbg("demo: %s: setting limit_samples to %" PRIu64, __func__, limit_samples); ret = SR_OK; } else if (capability == SR_HWCAP_LIMIT_MSEC) { - tmp_u64 = value; - limit_msec = *tmp_u64; + limit_msec = *(uint64_t *)value; sr_dbg("demo: %s: setting limit_msec to %" PRIu64, __func__, limit_msec); ret = SR_OK;