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

@ -197,10 +197,10 @@ on_process(void *_data)
for (i = 0; i < data->size.height; i++) {
struct pixel *p = (struct pixel *) src;
for (j = 0; j < data->size.width; j++) {
dst[j * 4 + 0] = SPA_CLAMP(p[j].r * 255.0f, 0, 255);
dst[j * 4 + 1] = SPA_CLAMP(p[j].g * 255.0f, 0, 255);
dst[j * 4 + 2] = SPA_CLAMP(p[j].b * 255.0f, 0, 255);
dst[j * 4 + 3] = SPA_CLAMP(p[j].a * 255.0f, 0, 255);
dst[j * 4 + 0] = SPA_CLAMP((uint8_t)(p[j].r * 255.0f), 0u, 255u);
dst[j * 4 + 1] = SPA_CLAMP((uint8_t)(p[j].g * 255.0f), 0u, 255u);
dst[j * 4 + 2] = SPA_CLAMP((uint8_t)(p[j].b * 255.0f), 0u, 255u);
dst[j * 4 + 3] = SPA_CLAMP((uint8_t)(p[j].a * 255.0f), 0u, 255u);
}
src += sstride;
dst += dstride;