SDL_blit_N.c (BlitNtoNKeyCopyAlpha): fix -Wshadow warnings by adding _ suffix to the temp Pixel local in the DUFFS_LOOP. SDL_blit.h (ASSEMBLE_RGB): add _ prefix to temp Pixel locals to avoid any possible shadowings. The warnings were like the following: In file included from src/video/SDL_blit_N.c:26:0: src/video/SDL_blit_N.c: In function 'BlitNtoNKeyCopyAlpha': src/video/SDL_blit_N.c:2421:24: warning: declaration of 'Pixel' shadows a previous local [-Wshadow] Uint32 Pixel = ((*src32 & rgbmask) == ckey) ? *dst32 : *src32; ^ src/video/SDL_blit.h:475:21: note: in definition of macro 'DUFFS_LOOP8' case 0: do { pixel_copy_increment; /* fallthrough */ \ ^ src/video/SDL_blit_N.c:2419:13: note: in expansion of macro 'DUFFS_LOOP' DUFFS_LOOP( ^ src/video/SDL_blit_N.c:2399:12: warning: shadowed declaration is here [-Wshadow] Uint32 Pixel; ^
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
diff --git a/src/video/SDL_blit.h b/src/video/SDL_blit.h
index ca10534..6c95aaf 100644
--- a/src/video/SDL_blit.h
+++ b/src/video/SDL_blit.h
@@ -126,7 +126,7 @@ extern SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface * surface);
b = SDL_expand_byte[fmt->Bloss][((Pixel&fmt->Bmask)>>fmt->Bshift)]; \
}
#define RGB_FROM_RGB565(Pixel, r, g, b) \
- { \
+{ \
r = SDL_expand_byte[3][((Pixel&0xF800)>>11)]; \
g = SDL_expand_byte[2][((Pixel&0x07E0)>>5)]; \
b = SDL_expand_byte[3][(Pixel&0x001F)]; \
@@ -262,18 +262,18 @@ do { \
{ \
switch (bpp) { \
case 1: { \
- Uint8 Pixel; \
+ Uint8 _Pixel; \
\
- PIXEL_FROM_RGB(Pixel, fmt, r, g, b); \
- *((Uint8 *)(buf)) = Pixel; \
+ PIXEL_FROM_RGB(_Pixel, fmt, r, g, b); \
+ *((Uint8 *)(buf)) = _Pixel; \
} \
break; \
\
case 2: { \
- Uint16 Pixel; \
+ Uint16 _Pixel; \
\
- PIXEL_FROM_RGB(Pixel, fmt, r, g, b); \
- *((Uint16 *)(buf)) = Pixel; \
+ PIXEL_FROM_RGB(_Pixel, fmt, r, g, b); \
+ *((Uint16 *)(buf)) = _Pixel; \
} \
break; \
\
@@ -291,10 +291,10 @@ do { \
break; \
\
case 4: { \
- Uint32 Pixel; \
+ Uint32 _Pixel; \
\
- PIXEL_FROM_RGB(Pixel, fmt, r, g, b); \
- *((Uint32 *)(buf)) = Pixel; \
+ PIXEL_FROM_RGB(_Pixel, fmt, r, g, b); \
+ *((Uint32 *)(buf)) = _Pixel; \
} \
break; \
} \
diff --git a/src/video/SDL_blit_N.c b/src/video/SDL_blit_N.c
index 5a7ba9d..de49516 100644
--- a/src/video/SDL_blit_N.c
+++ b/src/video/SDL_blit_N.c
@@ -2418,8 +2418,8 @@ BlitNtoNKeyCopyAlpha(SDL_BlitInfo * info)
/* *INDENT-OFF* */
DUFFS_LOOP(
{
- Uint32 Pixel = ((*src32 & rgbmask) == ckey) ? *dst32 : *src32;
- *dst32 = Pixel;
+ Uint32 Pixel_ = ((*src32 & rgbmask) == ckey) ? *dst32 : *src32;
+ *dst32 = Pixel_;
++src32;
++dst32;
},