]> git.alsa-project.org Git - tinycompress.git/commitdiff
cplay: add parentheses around comparison in operand of ‘&’
authorVinod Koul <vkoul@kernel.org>
Thu, 13 Oct 2022 12:45:54 +0000 (18:15 +0530)
committerVinod Koul <3178504+vinodkoul@users.noreply.github.com>
Thu, 13 Oct 2022 15:34:19 +0000 (21:04 +0530)
We get a warning:
cplay.c: In function ‘find_adts_header’:
cplay.c:259:41: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses]
  259 |         if ((buf[0] != 0xff) || (buf[1] & 0xf0 != 0xf0))

Resolve by adding a parentheses around "&" case

Signed-off-by: Vinod Koul <vkoul@kernel.org>
src/utils/cplay.c

index 9b5af056e9de1eab0b616cf21feb9c82e8625f66..14f163d108c22b67e7d491366282d97b259c2ce7 100644 (file)
@@ -255,7 +255,7 @@ int find_adts_header(FILE *file, unsigned int *num_channels, unsigned int *sampl
        }
        fseek(file, 0, SEEK_SET);
 
-       if ((buf[0] != 0xff) || (buf[1] & 0xf0 != 0xf0))
+       if ((buf[0] != 0xff) || ((buf[1] & 0xf0) != 0xf0))
                return 0;
        /* mpeg id */
        switch (buf[1]>>3 & 0x1) {