From 5b14a943a815303357148a2b9f0fcf9493d2277d Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 22 Oct 2016 11:01:55 -0700 Subject: [PATCH] Fixed bug 3466 - Can't build 2.0.5 on ppc64 /home/fedora/SDL2-2.0.5/src/video/SDL_blit_N.c: In function 'calc_swizzle32': /home/fedora/SDL2-2.0.5/src/video/SDL_blit_N.c:127:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] const vector unsigned char plus = VECUINT8_LITERAL(0x00, 0x00, 0x00, 0x00, ^ --- src/video/SDL_blit_N.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/video/SDL_blit_N.c b/src/video/SDL_blit_N.c index 94894a78c..351ab6c6f 100644 --- a/src/video/SDL_blit_N.c +++ b/src/video/SDL_blit_N.c @@ -118,12 +118,6 @@ calc_swizzle32(const SDL_PixelFormat * srcfmt, const SDL_PixelFormat * dstfmt) 16, 8, 0, 24, 0, NULL }; - if (!srcfmt) { - srcfmt = &default_pixel_format; - } - if (!dstfmt) { - dstfmt = &default_pixel_format; - } const vector unsigned char plus = VECUINT8_LITERAL(0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x04, 0x04, 0x08, 0x08, 0x08, 0x08, @@ -136,6 +130,14 @@ calc_swizzle32(const SDL_PixelFormat * srcfmt, const SDL_PixelFormat * dstfmt) Uint32 gmask = RESHIFT(srcfmt->Gshift) << (dstfmt->Gshift); Uint32 bmask = RESHIFT(srcfmt->Bshift) << (dstfmt->Bshift); Uint32 amask; + + if (!srcfmt) { + srcfmt = &default_pixel_format; + } + if (!dstfmt) { + dstfmt = &default_pixel_format; + } + /* Use zero for alpha if either surface doesn't have alpha */ if (dstfmt->Amask) { amask =