From: Joel Holdsworth Date: Mon, 7 May 2012 12:35:56 +0000 (+0100) Subject: sr: Made the dev_info_get return value const X-Git-Tag: dsupstream~933 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=b7f578bef53ff0e645ca0cae3f9781f577b7367a;p=libsigrok.git sr: Made the dev_info_get return value const --- diff --git a/hardware/alsa/alsa.c b/hardware/alsa/alsa.c index 119a46f2..7c77bfbc 100644 --- a/hardware/alsa/alsa.c +++ b/hardware/alsa/alsa.c @@ -168,7 +168,7 @@ 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; struct context *ctx; diff --git a/hardware/asix-sigma/asix-sigma.c b/hardware/asix-sigma/asix-sigma.c index e5bd5505..12d31244 100644 --- a/hardware/asix-sigma/asix-sigma.c +++ b/hardware/asix-sigma/asix-sigma.c @@ -753,11 +753,11 @@ static int hw_cleanup(void) return ret; } -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; struct context *ctx; - void *info = NULL; + const void *info = NULL; if (!(sdi = sr_dev_inst_get(dev_insts, dev_index))) { sr_err("sigma: %s: sdi was NULL", __func__); diff --git a/hardware/chronovu-la8/chronovu-la8.c b/hardware/chronovu-la8/chronovu-la8.c index a08b4b7f..38902908 100644 --- a/hardware/chronovu-la8/chronovu-la8.c +++ b/hardware/chronovu-la8/chronovu-la8.c @@ -681,11 +681,11 @@ static int hw_cleanup(void) return ret; } -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; struct context *ctx; - void *info; + const void *info; if (!(sdi = sr_dev_inst_get(dev_insts, dev_index))) { sr_err("la8: %s: sdi was NULL", __func__); diff --git a/hardware/demo/demo.c b/hardware/demo/demo.c index ca572af8..adf87304 100644 --- a/hardware/demo/demo.c +++ b/hardware/demo/demo.c @@ -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__); diff --git a/hardware/fx2lafw/fx2lafw.c b/hardware/fx2lafw/fx2lafw.c index ccaf7d0d..38f3d14d 100644 --- a/hardware/fx2lafw/fx2lafw.c +++ b/hardware/fx2lafw/fx2lafw.c @@ -546,7 +546,7 @@ static int hw_cleanup(void) return ret; } -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; struct context *ctx; diff --git a/hardware/link-mso19/link-mso19.c b/hardware/link-mso19/link-mso19.c index cce8d87c..30449e08 100644 --- a/hardware/link-mso19/link-mso19.c +++ b/hardware/link-mso19/link-mso19.c @@ -607,11 +607,11 @@ static int hw_dev_close(int dev_index) 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; struct context *ctx; - void *info = NULL; + const void *info = NULL; if (!(sdi = sr_dev_inst_get(dev_insts, dev_index))) return NULL; diff --git a/hardware/openbench-logic-sniffer/ols.c b/hardware/openbench-logic-sniffer/ols.c index ef7e3ebd..05e138e9 100644 --- a/hardware/openbench-logic-sniffer/ols.c +++ b/hardware/openbench-logic-sniffer/ols.c @@ -557,11 +557,11 @@ static int hw_cleanup(void) return ret; } -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; struct context *ctx; - void *info; + const void *info; if (!(sdi = sr_dev_inst_get(dev_insts, dev_index))) return NULL; diff --git a/hardware/zeroplus-logic-cube/zeroplus.c b/hardware/zeroplus-logic-cube/zeroplus.c index 1b779878..95033ccd 100644 --- a/hardware/zeroplus-logic-cube/zeroplus.c +++ b/hardware/zeroplus-logic-cube/zeroplus.c @@ -499,11 +499,11 @@ 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; struct context *ctx; - void *info; + const void *info; if (!(sdi = sr_dev_inst_get(dev_insts, dev_index))) { sr_err("zp: %s: sdi was NULL", __func__); diff --git a/sigrok.h.in b/sigrok.h.in index 04d58720..759565df 100644 --- a/sigrok.h.in +++ b/sigrok.h.in @@ -463,7 +463,7 @@ struct sr_dev_driver { /* Device-specific */ int (*dev_open) (int dev_index); int (*dev_close) (int dev_index); - void *(*dev_info_get) (int dev_index, int dev_info_id); + const void *(*dev_info_get) (int dev_index, int dev_info_id); int (*dev_status_get) (int dev_index); const int *(*hwcap_get_all) (void); int (*dev_config_set) (int dev_index, int hwcap, void *value); diff --git a/strutil.c b/strutil.c index 26296cea..f70a6f35 100644 --- a/strutil.c +++ b/strutil.c @@ -176,7 +176,8 @@ SR_API char **sr_parse_triggerstring(struct sr_dev *dev, GSList *l; struct sr_probe *probe; int max_probes, probenum, i; - char **tokens, **triggerlist, *trigger, *tc, *trigger_types; + char **tokens, **triggerlist, *trigger, *tc; + const char *trigger_types; gboolean error; max_probes = g_slist_length(dev->probes);