]> sigrok.org Git - libsigrok.git/commitdiff
es51919: Fix a compiler warning.
authorUwe Hermann <redacted>
Mon, 29 Aug 2016 19:10:13 +0000 (21:10 +0200)
committerUwe Hermann <redacted>
Mon, 29 Aug 2016 19:51:28 +0000 (21:51 +0200)
  src/lcr/es51919.c:538:73: warning: comparison of unsigned enum expression \
< 0 is always false [-Wtautological-compare]
    if ((analog->meaning->mq = parse_mq(pkt, is_secondary, pkt[2] & 0x80)) < 0)

src/lcr/es51919.c

index 9412ff46e8ac8a09c469386ade2e7a4a236d23af..af0dced9125bd376df8ec4f151fb0e8739adf1b0 100644 (file)
@@ -535,7 +535,7 @@ static void parse_measurement(const uint8_t *pkt, float *floatval,
                        analog->meaning->mqflags |= SR_MQFLAG_RELATIVE;
        }
 
-       if ((analog->meaning->mq = parse_mq(pkt, is_secondary, pkt[2] & 0x80)) < 0)
+       if ((analog->meaning->mq = parse_mq(pkt, is_secondary, pkt[2] & 0x80)) == 0)
                return;
 
        if ((buf[3] >> 3) >= ARRAY_SIZE(units)) {