X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Fdemo%2Fdemo.c;h=e511c0a6fac22340ee8a860cac571836ae0d0b22;hb=a533743dd1680bb53f29b6a01cccbc5380027e77;hp=ca572af8a009e6892e2a6b62446997722d86b02e;hpb=915f7cc87a8dce688ab99fc67005ef77e0d028a2;p=libsigrok.git diff --git a/hardware/demo/demo.c b/hardware/demo/demo.c index ca572af8..e511c0a6 100644 --- a/hardware/demo/demo.c +++ b/hardware/demo/demo.c @@ -86,7 +86,7 @@ static const int hwcaps[] = { SR_HWCAP_CONTINUOUS, }; -static struct sr_samplerates samplerates = { +static const struct sr_samplerates samplerates = { SR_HZ(1), SR_GHZ(1), SR_HZ(1), @@ -184,10 +184,10 @@ static int hw_cleanup(void) return SR_OK; } -static void *hw_dev_info_get(int dev_index, int dev_info_id) +static const void *hw_dev_info_get(int dev_index, int dev_info_id) { struct sr_dev_inst *sdi; - void *info = NULL; + const void *info = NULL; if (!(sdi = sr_dev_inst_get(dev_insts, dev_index))) { sr_err("demo: %s: sdi was NULL", __func__); @@ -231,10 +231,10 @@ static const int *hw_hwcap_get_all(void) return hwcaps; } -static int hw_dev_config_set(int dev_index, int hwcap, void *value) +static int hw_dev_config_set(int dev_index, int hwcap, const void *value) { int ret; - char *stropt; + const char *stropt; /* Avoid compiler warnings. */ (void)dev_index; @@ -243,17 +243,17 @@ static int hw_dev_config_set(int dev_index, int hwcap, void *value) /* Nothing to do, but must be supported */ ret = SR_OK; } else if (hwcap == SR_HWCAP_SAMPLERATE) { - cur_samplerate = *(uint64_t *)value; + cur_samplerate = *(const uint64_t *)value; sr_dbg("demo: %s: setting samplerate to %" PRIu64, __func__, cur_samplerate); ret = SR_OK; } else if (hwcap == SR_HWCAP_LIMIT_SAMPLES) { - limit_samples = *(uint64_t *)value; + limit_samples = *(const uint64_t *)value; sr_dbg("demo: %s: setting limit_samples to %" PRIu64, __func__, limit_samples); ret = SR_OK; } else if (hwcap == SR_HWCAP_LIMIT_MSEC) { - limit_msec = *(uint64_t *)value; + limit_msec = *(const uint64_t *)value; sr_dbg("demo: %s: setting limit_msec to %" PRIu64, __func__, limit_msec); ret = SR_OK;