From 5f26dc3af74c2da535c3737b362e5f818d4f7960 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Mon, 3 Oct 2005 08:38:28 +0000 Subject: [PATCH] Fixed some compiler warnings about "unreachable code" on Watcom C. --- src/video/SDL_RLEaccel.c | 9 +++++---- src/video/SDL_surface.c | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/video/SDL_RLEaccel.c b/src/video/SDL_RLEaccel.c index f6c38c71f..6e13f00ba 100644 --- a/src/video/SDL_RLEaccel.c +++ b/src/video/SDL_RLEaccel.c @@ -1632,10 +1632,11 @@ static Uint32 getpix_16(Uint8 *srcbuf) static Uint32 getpix_24(Uint8 *srcbuf) { - if(SDL_BYTEORDER == SDL_LIL_ENDIAN) - return srcbuf[0] + (srcbuf[1] << 8) + (srcbuf[2] << 16); - else - return (srcbuf[0] << 16) + (srcbuf[1] << 8) + srcbuf[2]; +#if SDL_BYTEORDER == SDL_LIL_ENDIAN + return srcbuf[0] + (srcbuf[1] << 8) + (srcbuf[2] << 16); +#else + return (srcbuf[0] << 16) + (srcbuf[1] << 8) + srcbuf[2]; +#endif } static Uint32 getpix_32(Uint8 *srcbuf) diff --git a/src/video/SDL_surface.c b/src/video/SDL_surface.c index cd818637f..50382cb3a 100644 --- a/src/video/SDL_surface.c +++ b/src/video/SDL_surface.c @@ -712,8 +712,9 @@ int SDL_FillRect(SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color) break; case 3: - if(SDL_BYTEORDER == SDL_BIG_ENDIAN) + #if SDL_BYTEORDER == SDL_BIG_ENDIAN color <<= 8; + #endif for ( y=dstrect->h; y; --y ) { Uint8 *pixels = row; for ( x=dstrect->w; x; --x ) {