]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
mp3_afh: Drop unused fields from struct mp3header.
authorAndre Noll <maan@tuebingen.mpg.de>
Sat, 6 May 2023 14:47:21 +0000 (16:47 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Tue, 9 May 2023 19:32:09 +0000 (21:32 +0200)
These are never initialized, but still checked in compare_headers(), so
gcc-12 is right when it complains about uninitialized use. Fix this by
simply removing the uninitialized fields and the comparisons. Fix also
a whitespace issue in the definition of compare_headers() while at it.

mp3_afh.c

index 728b25b81f94aa177a1e74ae01fca07419f7fe90..652aa70cda050ae3c58202e856921a02ac7c06cd 100644 (file)
--- a/mp3_afh.c
+++ b/mp3_afh.c
@@ -37,9 +37,6 @@ struct mp3header {
        unsigned int freq;
        unsigned int padding;
        unsigned int mode;
-       unsigned int copyright;
-       unsigned int original;
-       unsigned int emphasis;
 };
 
 static const int frequencies[3][4] = {
@@ -473,7 +470,7 @@ static int frame_length(struct mp3header *header)
                + header->padding;
 }
 
-static int compare_headers(struct mp3header *h1,struct mp3header *h2)
+static int compare_headers(struct mp3header *h1, struct mp3header *h2)
 {
        if ((*(unsigned int*)h1) == (*(unsigned int*)h2))
                return 1;
@@ -481,10 +478,7 @@ static int compare_headers(struct mp3header *h1,struct mp3header *h2)
                        (h1->layer == h2->layer) &&
                        (h1->crc == h2->crc) &&
                        (h1->freq == h2->freq) &&
-                       (h1->mode == h2->mode) &&
-                       (h1->copyright == h2->copyright) &&
-                       (h1->original == h2->original) &&
-                       (h1->emphasis == h2->emphasis))
+                       (h1->mode == h2->mode))
                return 1;
        return 0;
 }