Fix compilation with -Werror=float-conversion

Better make the conversions explicit so that we don't get any surprises.

Fixes #4065
This commit is contained in:
Wim Taymans 2024-06-18 12:17:56 +02:00
parent 50870aac57
commit 1ae4374ccf
71 changed files with 286 additions and 284 deletions

View file

@ -63,7 +63,7 @@ static void on_process(void *userdata)
for (n = c; n < n_samples; n += n_channels)
max = fmaxf(max, fabsf(samples[n]));
peak = SPA_CLAMP(max * 30, 0, 39);
peak = (uint32_t)SPA_CLAMPF(max * 30, 0.f, 39.f);
fprintf(stdout, "channel %d: |%*s%*s| peak:%f\n",
c, peak+1, "*", 40 - peak, "", max);