From 42f73552054f4b013b5ba09da5400827f9c624f3 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sat, 6 May 2023 16:47:21 +0200 Subject: [PATCH] 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. --- mp3_afh.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) 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; } -- 2.39.2