From: Jaroslav Kysela Date: Fri, 4 Dec 2026 09:27:20 +0000 (+0100) Subject: bat: Fix compilation warnings in analyze.c X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=43bbdb81ba9ad925be93391c38df84a9cfdb030a;p=alsa-utils.git bat: Fix compilation warnings in analyze.c Mark unused function parameters with ATTRIBUTE_UNUSED and fix a signed/unsigned comparison between the size_t result of fread() and bat->frames. Signed-off-by: Jaroslav Kysela --- diff --git a/bat/analyze.c b/bat/analyze.c index b8d0270..1fedd98 100644 --- a/bat/analyze.c +++ b/bat/analyze.c @@ -161,7 +161,8 @@ static int check(struct bat *bat, struct analyze *a, int channel) return err; } -static void calc_magnitude(struct bat *bat, struct analyze *a, int N) +static void calc_magnitude(struct bat *bat ATTRIBUTE_UNUSED, + struct analyze *a, int N) { float r2, i2; int i; @@ -227,9 +228,9 @@ out1: return err; } -static int calculate_noise_one_period(struct bat *bat, +static int calculate_noise_one_period(struct bat *bat ATTRIBUTE_UNUSED, struct noise_analyzer *na, float *src, - int length, int channel) + int length, int channel ATTRIBUTE_UNUSED) { int i, shift = 0; float tmp, rms, gain, residual; @@ -472,7 +473,7 @@ int analyze_capture(struct bat *bat) goto exit2; items = fread(bat->buf, bat->frame_size, bat->frames, bat->fp); - if (items != bat->frames) { + if (items != (size_t)bat->frames) { err = -EIO; goto exit2; }