Commit 924f55ee authored by Sam Lantinga's avatar Sam Lantinga

Fixed compiler warnings

parent 253835bd
...@@ -172,7 +172,7 @@ do { \ ...@@ -172,7 +172,7 @@ do { \
break; \ break; \
\ \
default: \ default: \
Pixel; /* stop gcc complaints */ \ Pixel = 0; /* stop gcc complaints */ \
break; \ break; \
} \ } \
} while (0) } while (0)
...@@ -186,6 +186,7 @@ do { \ ...@@ -186,6 +186,7 @@ do { \
break; \ break; \
\ \
case 3: { \ case 3: { \
Pixel = 0; \
if (SDL_BYTEORDER == SDL_LIL_ENDIAN) { \ if (SDL_BYTEORDER == SDL_LIL_ENDIAN) { \
r = *((buf)+fmt->Rshift/8); \ r = *((buf)+fmt->Rshift/8); \
g = *((buf)+fmt->Gshift/8); \ g = *((buf)+fmt->Gshift/8); \
...@@ -204,7 +205,9 @@ do { \ ...@@ -204,7 +205,9 @@ do { \
break; \ break; \
\ \
default: \ default: \
Pixel; /* stop gcc complaints */ \ /* stop gcc complaints */ \
Pixel = 0; \
r = g = b = 0; \
break; \ break; \
} \ } \
} while (0) } while (0)
...@@ -277,43 +280,6 @@ do { \ ...@@ -277,43 +280,6 @@ do { \
break; \ break; \
} \ } \
} }
#define ASSEMBLE_RGB_AMASK(buf, bpp, fmt, r, g, b, Amask) \
{ \
switch (bpp) { \
case 2: { \
Uint16 *bufp; \
Uint16 Pixel; \
\
bufp = (Uint16 *)buf; \
PIXEL_FROM_RGB(Pixel, fmt, r, g, b); \
*bufp = Pixel | (*bufp & Amask); \
} \
break; \
\
case 3: { \
if (SDL_BYTEORDER == SDL_LIL_ENDIAN) { \
*((buf)+fmt->Rshift/8) = r; \
*((buf)+fmt->Gshift/8) = g; \
*((buf)+fmt->Bshift/8) = b; \
} else { \
*((buf)+2-fmt->Rshift/8) = r; \
*((buf)+2-fmt->Gshift/8) = g; \
*((buf)+2-fmt->Bshift/8) = b; \
} \
} \
break; \
\
case 4: { \
Uint32 *bufp; \
Uint32 Pixel; \
\
bufp = (Uint32 *)buf; \
PIXEL_FROM_RGB(Pixel, fmt, r, g, b); \
*bufp = Pixel | (*bufp & Amask); \
} \
break; \
} \
}
/* FIXME: Should we rescale alpha into 0..255 here? */ /* FIXME: Should we rescale alpha into 0..255 here? */
#define RGBA_FROM_PIXEL(Pixel, fmt, r, g, b, a) \ #define RGBA_FROM_PIXEL(Pixel, fmt, r, g, b, a) \
...@@ -367,6 +333,7 @@ do { \ ...@@ -367,6 +333,7 @@ do { \
break; \ break; \
\ \
case 3: { \ case 3: { \
Pixel = 0; \
if (SDL_BYTEORDER == SDL_LIL_ENDIAN) { \ if (SDL_BYTEORDER == SDL_LIL_ENDIAN) { \
r = *((buf)+fmt->Rshift/8); \ r = *((buf)+fmt->Rshift/8); \
g = *((buf)+fmt->Gshift/8); \ g = *((buf)+fmt->Gshift/8); \
...@@ -386,7 +353,9 @@ do { \ ...@@ -386,7 +353,9 @@ do { \
break; \ break; \
\ \
default: \ default: \
Pixel; /* stop gcc complaints */ \ /* stop gcc complaints */ \
Pixel = 0; \
r = g = b = a = 0; \
break; \ break; \
} \ } \
} while (0) } while (0)
......
This diff is collapsed.
...@@ -54,7 +54,7 @@ SDL_Blit_Slow(SDL_BlitInfo * info) ...@@ -54,7 +54,7 @@ SDL_Blit_Slow(SDL_BlitInfo * info)
incx = (info->src_w << 16) / info->dst_w; incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) { while (info->dst_h--) {
Uint8 *src; Uint8 *src = 0;
Uint8 *dst = (Uint8 *) info->dst; Uint8 *dst = (Uint8 *) info->dst;
int n = info->dst_w; int n = info->dst_w;
srcx = -1; srcx = -1;
......
...@@ -274,8 +274,12 @@ sub output_copyfunc ...@@ -274,8 +274,12 @@ sub output_copyfunc
output_copyfuncname("static void", $src, $dst, $modulate, $blend, $scale, 1, "\n"); output_copyfuncname("static void", $src, $dst, $modulate, $blend, $scale, 1, "\n");
print FILE <<__EOF__; print FILE <<__EOF__;
{ {
__EOF__
if ( $modulate || $blend ) {
print FILE <<__EOF__;
const int flags = info->flags; const int flags = info->flags;
__EOF__ __EOF__
}
if ( $modulate ) { if ( $modulate ) {
print FILE <<__EOF__; print FILE <<__EOF__;
const Uint32 modulateR = info->r; const Uint32 modulateR = info->r;
...@@ -309,7 +313,7 @@ __EOF__ ...@@ -309,7 +313,7 @@ __EOF__
incx = (info->src_w << 16) / info->dst_w; incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) { while (info->dst_h--) {
$format_type{$src} *src; $format_type{$src} *src = 0;
$format_type{$dst} *dst = ($format_type{$dst} *)info->dst; $format_type{$dst} *dst = ($format_type{$dst} *)info->dst;
int n = info->dst_w; int n = info->dst_w;
srcx = -1; srcx = -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment