From: Joel Holdsworth Date: Mon, 7 May 2012 14:07:06 +0000 (+0100) Subject: sr: Made sample rate lists const X-Git-Tag: dsupstream~931 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=a533743dd1680bb53f29b6a01cccbc5380027e77;p=libsigrok.git sr: Made sample rate lists const --- diff --git a/hardware/asix-sigma/asix-sigma.c b/hardware/asix-sigma/asix-sigma.c index 59faa6e2..c0a7aa42 100644 --- a/hardware/asix-sigma/asix-sigma.c +++ b/hardware/asix-sigma/asix-sigma.c @@ -42,7 +42,7 @@ static GSList *dev_insts = NULL; -static uint64_t supported_samplerates[] = { +static const uint64_t supported_samplerates[] = { SR_KHZ(200), SR_KHZ(250), SR_KHZ(500), @@ -81,7 +81,7 @@ static const char *probe_names[NUM_PROBES + 1] = { NULL, }; -static struct sr_samplerates samplerates = { +static const struct sr_samplerates samplerates = { 0, 0, 0, diff --git a/hardware/chronovu-la8/chronovu-la8.c b/hardware/chronovu-la8/chronovu-la8.c index ad3e7601..ba543d89 100644 --- a/hardware/chronovu-la8/chronovu-la8.c +++ b/hardware/chronovu-la8/chronovu-la8.c @@ -120,7 +120,7 @@ static uint64_t supported_samplerates[255 + 1] = { 0 }; * Min: 1 sample per 0.01us -> sample time is 0.084s, samplerate 100MHz * Max: 1 sample per 2.55us -> sample time is 21.391s, samplerate 392.15kHz */ -static struct sr_samplerates samplerates = { +static const struct sr_samplerates samplerates = { .low = 0, .high = 0, .step = 0, diff --git a/hardware/demo/demo.c b/hardware/demo/demo.c index c5a7719c..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), diff --git a/hardware/fx2lafw/fx2lafw.c b/hardware/fx2lafw/fx2lafw.c index 9897fb9e..a40a17ac 100644 --- a/hardware/fx2lafw/fx2lafw.c +++ b/hardware/fx2lafw/fx2lafw.c @@ -95,7 +95,7 @@ static const char *probe_names[] = { NULL, }; -static uint64_t supported_samplerates[] = { +static const uint64_t supported_samplerates[] = { SR_KHZ(20), SR_KHZ(25), SR_KHZ(50), @@ -115,7 +115,7 @@ static uint64_t supported_samplerates[] = { 0, }; -static struct sr_samplerates samplerates = { +static const struct sr_samplerates samplerates = { 0, 0, 0, diff --git a/hardware/link-mso19/link-mso19.c b/hardware/link-mso19/link-mso19.c index 19aa5225..abf1fb98 100644 --- a/hardware/link-mso19/link-mso19.c +++ b/hardware/link-mso19/link-mso19.c @@ -65,7 +65,7 @@ static const char *probe_names[NUM_PROBES + 1] = { NULL, }; -static uint64_t supported_samplerates[] = { +static const uint64_t supported_samplerates[] = { SR_HZ(100), SR_HZ(200), SR_HZ(500), @@ -89,7 +89,7 @@ static uint64_t supported_samplerates[] = { 0, }; -static struct sr_samplerates samplerates = { +static const struct sr_samplerates samplerates = { 0, 0, 0, diff --git a/hardware/openbench-logic-sniffer/ols.c b/hardware/openbench-logic-sniffer/ols.c index 7cdd77e6..275d25de 100644 --- a/hardware/openbench-logic-sniffer/ols.c +++ b/hardware/openbench-logic-sniffer/ols.c @@ -93,7 +93,7 @@ static const char *probe_names[NUM_PROBES + 1] = { }; /* default supported samplerates, can be overridden by device metadata */ -static struct sr_samplerates samplerates = { +static const struct sr_samplerates samplerates = { SR_HZ(10), SR_MHZ(200), SR_HZ(1), diff --git a/hardware/zeroplus-logic-cube/zeroplus.c b/hardware/zeroplus-logic-cube/zeroplus.c index 5066a9c8..808b7053 100644 --- a/hardware/zeroplus-logic-cube/zeroplus.c +++ b/hardware/zeroplus-logic-cube/zeroplus.c @@ -114,7 +114,7 @@ static libusb_context *usb_context = NULL; * TODO: We shouldn't support 150MHz and 200MHz on devices that don't go up * that high. */ -static uint64_t supported_samplerates[] = { +static const uint64_t supported_samplerates[] = { SR_HZ(100), SR_HZ(500), SR_KHZ(1), @@ -136,7 +136,7 @@ static uint64_t supported_samplerates[] = { 0, }; -static struct sr_samplerates samplerates = { +static const struct sr_samplerates samplerates = { 0, 0, 0, diff --git a/sigrok.h.in b/sigrok.h.in index 87749d60..5fc1e187 100644 --- a/sigrok.h.in +++ b/sigrok.h.in @@ -449,7 +449,7 @@ struct sr_samplerates { uint64_t low; uint64_t high; uint64_t step; - uint64_t *list; + const uint64_t *list; }; struct sr_dev_driver {