fix warning on shadowed global symbol

../../src/wsfb_driver.c: In function 'WsfbCopyRGB16ToYUY2':
../../src/wsfb_driver.c:1362:18: warning: declaration of 'rgb' shadows a global declaration [-Wshadow]
 1362 |   const uint16_t rgb = ((rgb0 >> 1) & ~0x8410) +
      |                  ^~~
In file included from /usr/local/X11/include/xorg/xf86.h:46,
                 from ../../src/wsfb_driver.c:52:
/usr/local/X11/include/xorg/xf86str.h:114:3: note: shadowed declaration is here
  114 | } rgb;
      |   ^~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-wsfb/-/merge_requests/10>
This commit is contained in:
Enrico Weigelt, metux IT consult
2024-06-18 12:18:18 +02:00
committed by Marge Bot
parent a7a04dd0af
commit eaf2d77c32

View File

@@ -1359,13 +1359,13 @@ WsfbCopyRGB16ToYUY2(void *dest, void *src, int len)
while (len > 0) {
const uint16_t rgb0 = src16[0];
const uint16_t rgb1 = src16[1];
const uint16_t rgb = ((rgb0 >> 1) & ~0x8410) +
const uint16_t rgbv = ((rgb0 >> 1) & ~0x8410) +
((rgb1 >> 1) & ~0x8410) +
((rgb0 & rgb1) & 0x0841);
const uint32_t y0 = mapRGB16ToY[rgb0];
const uint32_t y1 = mapRGB16ToY[rgb1];
const uint32_t u = mapRGB16ToU[rgb];
const uint32_t v = mapRGB16ToV[rgb];
const uint32_t u = mapRGB16ToU[rgbv];
const uint32_t v = mapRGB16ToV[rgbv];
*dest32 = (y0 << 24) | (u << 16) | (y1 << 8) | v;