From: Uwe Hermann Date: Mon, 3 Jul 2017 06:40:30 +0000 (+0200) Subject: saleae-logic-pro: Fix two compiler warnings. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=fbbafc6909a4c3d75f77f1c770ef2e8aaab1b306;p=libsigrok.git saleae-logic-pro: Fix two compiler warnings. src/hardware/saleae-logic-pro/protocol.c:389:12: warning: 'set_led' defined but not used [-Wunused-function] static int set_led(const struct sr_dev_inst *sdi, uint8_t r, uint8_t g, uint8_t b) ^ CC src/hardware/saleae-logic-pro/api.lo src/hardware/saleae-logic-pro/api.c: In function 'dev_acquisition_handle': src/hardware/saleae-logic-pro/api.c:332:9: warning: missing initializer for field 'tv_sec' of 'struct timeval' [-Wmissing-field-initializers] struct timeval tv = {}; ^ In file included from /usr/include/x86_64-linux-gnu/sys/time.h:27:0, from include/libsigrok/libsigrok.h:24, from src/hardware/saleae-logic-pro/protocol.h:25, from src/hardware/saleae-logic-pro/api.c:23: /usr/include/x86_64-linux-gnu/bits/time.h:32:14: note: 'tv_sec' declared here __time_t tv_sec; /* Seconds. */ ^ --- diff --git a/src/hardware/saleae-logic-pro/api.c b/src/hardware/saleae-logic-pro/api.c index 74e3bbac..8be8fb50 100644 --- a/src/hardware/saleae-logic-pro/api.c +++ b/src/hardware/saleae-logic-pro/api.c @@ -329,7 +329,7 @@ static int dev_acquisition_handle(int fd, int revents, void *cb_data) { struct sr_dev_inst *sdi = cb_data; struct drv_context *drvc = sdi->driver->context; - struct timeval tv = {}; + struct timeval tv = ALL_ZERO; (void)fd; (void)revents; diff --git a/src/hardware/saleae-logic-pro/protocol.c b/src/hardware/saleae-logic-pro/protocol.c index 7118cd17..eb6d07d2 100644 --- a/src/hardware/saleae-logic-pro/protocol.c +++ b/src/hardware/saleae-logic-pro/protocol.c @@ -386,6 +386,7 @@ static int authenticate(const struct sr_dev_inst *sdi) return SR_OK; } +#if 0 static int set_led(const struct sr_dev_inst *sdi, uint8_t r, uint8_t g, uint8_t b) { uint8_t regs[][2] = { @@ -398,6 +399,7 @@ static int set_led(const struct sr_dev_inst *sdi, uint8_t r, uint8_t g, uint8_t return write_regs(sdi, regs, G_N_ELEMENTS(regs)); } +#endif static int configure_channels(const struct sr_dev_inst *sdi) {