mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-11 13:30:07 -05:00
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:
parent
50870aac57
commit
1ae4374ccf
71 changed files with 286 additions and 284 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue