From: Andre Noll Date: Sat, 6 May 2023 14:47:21 +0000 (+0200) Subject: mp3_afh: Drop unused fields from struct mp3header. X-Git-Tag: v0.7.3~23^2~2 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=42f73552054f4b013b5ba09da5400827f9c624f3;p=paraslash.git mp3_afh: Drop unused fields from struct mp3header. 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. --- diff --git a/mp3_afh.c b/mp3_afh.c index 728b25b8..652aa70c 100644 --- 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; }