]> sigrok.org Git - libsigrok.git/commitdiff
dmm/eev121gw: silence compiler warning (unused value)
authorGerhard Sittig <redacted>
Sun, 16 Jun 2019 08:42:36 +0000 (10:42 +0200)
committerGerhard Sittig <redacted>
Sun, 21 Aug 2022 15:45:11 +0000 (17:45 +0200)
Silence a compiler warning about not using an assigned value in later
instructions. This is about the EEVBlog 121GW meter's date and device
number in received serial packets, which are worth keeping around for
future versions of the driver.

../src/dmm/eev121gw.c:728:2: warning: Value stored to 'raw_serial' is never read
        raw_serial = RB32(&buf[OFF_SERIAL_3]);

src/dmm/eev121gw.c

index 7dfba8d0dfbec0078857600718b6fa4c8a3f8d11..ac7622078c2dafa55f6d233f6cd2edebb479bd79 100644 (file)
@@ -762,6 +762,8 @@ static int sr_eev121gw_parse(const uint8_t *buf, float *floatval,
                ser_mon = FIELD_NL(raw_serial, SERIAL_MONTH);
                ser_nr = FIELD_NL(raw_serial, SERIAL_NUMBER);
                sr_spew("Packet: Y-M %x-%x, nr %x.", ser_year, ser_mon, ser_nr);
+       } else {
+               (void)raw_serial;       /* Silence compiler warning. */
        }
 
        switch (display) {