]> sigrok.org Git - libsigrok.git/commitdiff
saleae-logic-pro: Fix two compiler warnings.
authorUwe Hermann <redacted>
Mon, 3 Jul 2017 06:40:30 +0000 (08:40 +0200)
committerUwe Hermann <redacted>
Mon, 3 Jul 2017 09:57:02 +0000 (11:57 +0200)
  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.  */
                ^

src/hardware/saleae-logic-pro/api.c
src/hardware/saleae-logic-pro/protocol.c

index 74e3bbacc44b2fbfadcd8b45bfc5f0f4597b779b..8be8fb5066591a2c18857d8e16048ebfd669680f 100644 (file)
@@ -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;
index 7118cd17b5a4ba84c35de8f8e62ee7a6fafc1de5..eb6d07d2ca6d27d825df91af8df789d90cc9dfb5 100644 (file)
@@ -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)
 {