From: Uwe Hermann Date: Fri, 27 May 2016 13:11:28 +0000 (+0200) Subject: Fix a few "variable set but not used" compiler warnings. X-Git-Tag: libsigrok-0.5.0~365 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=cd0de200b17820975637ddafba8a68902648344e;p=libsigrok.git Fix a few "variable set but not used" compiler warnings. ../src/hardware/appa-55ii/api.c: In function ‘scan’: ../src/hardware/appa-55ii/api.c:47:22: warning: variable ‘drvc’ set but not used [-Wunused-but-set-variable] struct drv_context *drvc; ^ ../src/hardware/arachnid-labs-re-load-pro/api.c: In function ‘scan’: ../src/hardware/arachnid-labs-re-load-pro/api.c:62:22: warning: variable ‘drvc’ set but not used [-Wunused-but-set-variable] struct drv_context *drvc; ^ ../src/hardware/atten-pps3xxx/api.c: In function ‘scan’: ../src/hardware/atten-pps3xxx/api.c:81:22: warning: variable ‘drvc’ set but not used [-Wunused-but-set-variable] struct drv_context *drvc; ^ ../src/hardware/brymen-dmm/api.c: In function ‘scan’: ../src/hardware/brymen-dmm/api.c:89:22: warning: variable ‘drvc’ set but not used [-Wunused-but-set-variable] struct drv_context *drvc; ^ ../src/hardware/cem-dt-885x/api.c: In function ‘scan’: ../src/hardware/cem-dt-885x/api.c:74:22: warning: variable ‘drvc’ set but not used [-Wunused-but-set-variable] struct drv_context *drvc; ^ ../src/hardware/conrad-digi-35-cpu/api.c: In function ‘scan’: ../src/hardware/conrad-digi-35-cpu/api.c:45:22: warning: variable ‘drvc’ set but not used [-Wunused-but-set-variable] struct drv_context *drvc; ^ ../src/hardware/demo/demo.c: In function ‘scan’: ../src/hardware/demo/demo.c:255:22: warning: variable ‘drvc’ set but not used [-Wunused-but-set-variable] struct drv_context *drvc; ^ ../src/hardware/fluke-dmm/api.c: In function ‘fluke_scan’: ../src/hardware/fluke-dmm/api.c:64:22: warning: variable ‘drvc’ set but not used [-Wunused-but-set-variable] struct drv_context *drvc; ^ ../src/hardware/gmc-mh-1x-2x/api.c: In function ‘scan_1x_2x_rs232’: ../src/hardware/gmc-mh-1x-2x/api.c:147:22: warning: variable ‘drvc’ set but not used [-Wunused-but-set-variable] struct drv_context *drvc; ^ ../src/hardware/gmc-mh-1x-2x/api.c: In function ‘scan_2x_bd232’: ../src/hardware/gmc-mh-1x-2x/api.c:234:22: warning: variable ‘drvc’ set but not used [-Wunused-but-set-variable] struct drv_context *drvc; ^ ../src/hardware/ikalogic-scanaplus/api.c: In function ‘scan’: ../src/hardware/ikalogic-scanaplus/api.c:69:22: warning: variable ‘drvc’ set but not used [-Wunused-but-set-variable] struct drv_context *drvc; ^ ../src/hardware/tondaj-sl-814/api.c: In function ‘scan’: ../src/hardware/tondaj-sl-814/api.c:44:22: warning: variable ‘drvc’ set but not used [-Wunused-but-set-variable] struct drv_context *drvc; ^ --- diff --git a/src/hardware/appa-55ii/api.c b/src/hardware/appa-55ii/api.c index d93644d5..960b8816 100644 --- a/src/hardware/appa-55ii/api.c +++ b/src/hardware/appa-55ii/api.c @@ -44,7 +44,6 @@ static const char *data_sources[] = { static GSList *scan(struct sr_dev_driver *di, GSList *options) { - struct drv_context *drvc; struct dev_context *devc; struct sr_serial_dev_inst *serial; struct sr_dev_inst *sdi; @@ -80,7 +79,6 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) sr_info("Probing serial port %s.", conn); - drvc = di->context; serial_flush(serial); /* Let's get a bit of data and see if we can find a packet. */ diff --git a/src/hardware/arachnid-labs-re-load-pro/api.c b/src/hardware/arachnid-labs-re-load-pro/api.c index 79fa4242..cf5f2750 100644 --- a/src/hardware/arachnid-labs-re-load-pro/api.c +++ b/src/hardware/arachnid-labs-re-load-pro/api.c @@ -59,7 +59,6 @@ static const uint32_t devopts_cg[] = { static GSList *scan(struct sr_dev_driver *di, GSList *options) { struct sr_dev_inst *sdi; - struct drv_context *drvc; struct dev_context *devc; struct sr_config *src; struct sr_serial_dev_inst *serial; @@ -72,8 +71,6 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) char *bufptr; double version; - drvc = di->context; - conn = serialcomm = NULL; for (l = options; l; l = l->next) { src = l->data; diff --git a/src/hardware/atten-pps3xxx/api.c b/src/hardware/atten-pps3xxx/api.c index 34a31cea..b1724550 100644 --- a/src/hardware/atten-pps3xxx/api.c +++ b/src/hardware/atten-pps3xxx/api.c @@ -78,7 +78,6 @@ static const struct pps_model models[] = { static GSList *scan(struct sr_dev_driver *di, GSList *options, int modelid) { struct sr_dev_inst *sdi; - struct drv_context *drvc; struct dev_context *devc; struct sr_config *src; struct sr_channel *ch; @@ -92,8 +91,6 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options, int modelid) const char *conn, *serialcomm; char channel[10]; - drvc = di->context; - conn = serialcomm = NULL; for (l = options; l; l = l->next) { src = l->data; diff --git a/src/hardware/brymen-dmm/api.c b/src/hardware/brymen-dmm/api.c index 54f15c51..c9f63b16 100644 --- a/src/hardware/brymen-dmm/api.c +++ b/src/hardware/brymen-dmm/api.c @@ -86,13 +86,11 @@ scan_cleanup: static GSList *scan(struct sr_dev_driver *di, GSList *options) { - struct drv_context *drvc; struct sr_config *src; GSList *devices, *l; const char *conn, *serialcomm; devices = NULL; - drvc = di->context; conn = serialcomm = NULL; for (l = options; l; l = l->next) { diff --git a/src/hardware/cem-dt-885x/api.c b/src/hardware/cem-dt-885x/api.c index 9ee036b6..03dc4f05 100644 --- a/src/hardware/cem-dt-885x/api.c +++ b/src/hardware/cem-dt-885x/api.c @@ -71,7 +71,6 @@ static const char *data_sources[] = { static GSList *scan(struct sr_dev_driver *di, GSList *options) { - struct drv_context *drvc; struct dev_context *devc; struct sr_config *src; struct sr_serial_dev_inst *serial; @@ -96,7 +95,6 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) return NULL; devices = NULL; - drvc = di->context; start = g_get_monotonic_time(); while (g_get_monotonic_time() - start < MAX_SCAN_TIME_US) { if (serial_read_nonblocking(serial, &c, 1) == 1 && c == 0xa5) { diff --git a/src/hardware/conrad-digi-35-cpu/api.c b/src/hardware/conrad-digi-35-cpu/api.c index 04b50bd3..d50b446e 100644 --- a/src/hardware/conrad-digi-35-cpu/api.c +++ b/src/hardware/conrad-digi-35-cpu/api.c @@ -42,13 +42,11 @@ static const uint32_t devopts[] = { static GSList *scan(struct sr_dev_driver *di, GSList *options) { struct sr_dev_inst *sdi; - struct drv_context *drvc; struct sr_config *src; struct sr_serial_dev_inst *serial; GSList *l; const char *conn, *serialcomm; - drvc = di->context; conn = serialcomm = NULL; for (l = options; l; l = l->next) { diff --git a/src/hardware/demo/demo.c b/src/hardware/demo/demo.c index fec9065a..bd9189d6 100644 --- a/src/hardware/demo/demo.c +++ b/src/hardware/demo/demo.c @@ -252,7 +252,6 @@ static void generate_analog_pattern(struct analog_gen *ag, uint64_t sample_rate) static GSList *scan(struct sr_dev_driver *di, GSList *options) { - struct drv_context *drvc; struct dev_context *devc; struct sr_dev_inst *sdi; struct sr_channel *ch; @@ -263,8 +262,6 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) int num_logic_channels, num_analog_channels, pattern, i; char channel_name[16]; - drvc = di->context; - num_logic_channels = DEFAULT_NUM_LOGIC_CHANNELS; num_analog_channels = DEFAULT_NUM_ANALOG_CHANNELS; for (l = options; l; l = l->next) { diff --git a/src/hardware/fluke-dmm/api.c b/src/hardware/fluke-dmm/api.c index 71bd79af..eba36c54 100644 --- a/src/hardware/fluke-dmm/api.c +++ b/src/hardware/fluke-dmm/api.c @@ -61,7 +61,6 @@ static GSList *fluke_scan(struct sr_dev_driver *di, const char *conn, const char *serialcomm) { struct sr_dev_inst *sdi; - struct drv_context *drvc; struct dev_context *devc; struct sr_serial_dev_inst *serial; GSList *devices; @@ -73,7 +72,6 @@ static GSList *fluke_scan(struct sr_dev_driver *di, const char *conn, if (serial_open(serial, SERIAL_RDWR) != SR_OK) return NULL; - drvc = di->context; b = buf; retry = 0; devices = NULL; diff --git a/src/hardware/gmc-mh-1x-2x/api.c b/src/hardware/gmc-mh-1x-2x/api.c index 3d18ebda..7b8e6321 100644 --- a/src/hardware/gmc-mh-1x-2x/api.c +++ b/src/hardware/gmc-mh-1x-2x/api.c @@ -144,7 +144,6 @@ static enum model scan_model_sm(struct sr_serial_dev_inst *serial) static GSList *scan_1x_2x_rs232(struct sr_dev_driver *di, GSList *options) { struct sr_dev_inst *sdi; - struct drv_context *drvc; struct dev_context *devc; struct sr_config *src; struct sr_serial_dev_inst *serial; @@ -154,7 +153,6 @@ static GSList *scan_1x_2x_rs232(struct sr_dev_driver *di, GSList *options) gboolean serialcomm_given; devices = NULL; - drvc = di->context; conn = serialcomm = NULL; serialcomm_given = FALSE; @@ -231,7 +229,6 @@ static GSList *scan_1x_2x_rs232(struct sr_dev_driver *di, GSList *options) static GSList *scan_2x_bd232(struct sr_dev_driver *di, GSList *options) { struct sr_dev_inst *sdi; - struct drv_context *drvc; struct dev_context *devc; struct sr_config *src; struct sr_serial_dev_inst *serial; @@ -245,8 +242,6 @@ static GSList *scan_2x_bd232(struct sr_dev_driver *di, GSList *options) conn = serialcomm = NULL; devices = NULL; - drvc = di->context; - sr_spew("scan_2x_bd232() called!"); for (l = options; l; l = l->next) { diff --git a/src/hardware/ikalogic-scanaplus/api.c b/src/hardware/ikalogic-scanaplus/api.c index 520bf6fe..fc54ae43 100644 --- a/src/hardware/ikalogic-scanaplus/api.c +++ b/src/hardware/ikalogic-scanaplus/api.c @@ -66,15 +66,12 @@ static int dev_clear(const struct sr_dev_driver *di) static GSList *scan(struct sr_dev_driver *di, GSList *options) { struct sr_dev_inst *sdi; - struct drv_context *drvc; struct dev_context *devc; unsigned int i; int ret; (void)options; - drvc = di->context; - /* Allocate memory for our private device context. */ devc = g_malloc0(sizeof(struct dev_context)); diff --git a/src/hardware/tondaj-sl-814/api.c b/src/hardware/tondaj-sl-814/api.c index e21d1b5c..0e1c680f 100644 --- a/src/hardware/tondaj-sl-814/api.c +++ b/src/hardware/tondaj-sl-814/api.c @@ -41,7 +41,6 @@ static const uint32_t devopts[] = { static GSList *scan(struct sr_dev_driver *di, GSList *options) { - struct drv_context *drvc; struct dev_context *devc; struct sr_dev_inst *sdi; struct sr_config *src; @@ -49,8 +48,6 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) const char *conn, *serialcomm; struct sr_serial_dev_inst *serial; - drvc = di->context; - conn = serialcomm = NULL; for (l = options; l; l = l->next) { if (!(src = l->data)) {