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

@ -30,7 +30,7 @@ static void test_impl(void)
float min[2] = { 0.0f, 0.0f }, max[2] = { 0.0f, 0.0f }, absmax[2] = { 0.0f, 0.0f };
for (i = 0; i < SPA_N_ELEMENTS(vals); i++)
vals[i] = (drand48() - 0.5f) * 2.5f;
vals[i] = (float)((drand48() - 0.5f) * 2.5f);
peaks_min_max_c(&peaks, &vals[1], SPA_N_ELEMENTS(vals) - 1, &min[0], &max[0]);
printf("c peaks min:%f max:%f\n", min[0], max[0]);