From 53f40c31c4916d94f2bf1d056484c29a30d32533 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 18 Jan 2012 12:17:16 -0500 Subject: [PATCH] Removed variables that current GCC builds warn on as set and never used. --- src/audio/SDL_wave.c | 4 ---- src/video/SDL_RLEaccel.c | 5 +---- src/video/SDL_bmp.c | 11 +++++++++++ src/video/SDL_stretch.c | 2 -- src/video/fbcon/SDL_fb3dfx.c | 2 -- src/video/x11/SDL_x11image.c | 2 -- 6 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/audio/SDL_wave.c b/src/audio/SDL_wave.c index b7abec35c..b4ad6c787 100644 --- a/src/audio/SDL_wave.c +++ b/src/audio/SDL_wave.c @@ -47,7 +47,6 @@ static struct MS_ADPCM_decoder { static int InitMS_ADPCM(WaveFMT *format) { Uint8 *rogue_feel; - Uint16 extra_info; int i; /* Set the rogue pointer to the MS_ADPCM specific data */ @@ -60,7 +59,6 @@ static int InitMS_ADPCM(WaveFMT *format) SDL_SwapLE16(format->bitspersample); rogue_feel = (Uint8 *)format+sizeof(*format); if ( sizeof(*format) == 16 ) { - extra_info = ((rogue_feel[1]<<8)|rogue_feel[0]); rogue_feel += sizeof(Uint16); } MS_ADPCM_state.wSamplesPerBlock = ((rogue_feel[1]<<8)|rogue_feel[0]); @@ -227,7 +225,6 @@ static struct IMA_ADPCM_decoder { static int InitIMA_ADPCM(WaveFMT *format) { Uint8 *rogue_feel; - Uint16 extra_info; /* Set the rogue pointer to the IMA_ADPCM specific data */ IMA_ADPCM_state.wavefmt.encoding = SDL_SwapLE16(format->encoding); @@ -239,7 +236,6 @@ static int InitIMA_ADPCM(WaveFMT *format) SDL_SwapLE16(format->bitspersample); rogue_feel = (Uint8 *)format+sizeof(*format); if ( sizeof(*format) == 16 ) { - extra_info = ((rogue_feel[1]<<8)|rogue_feel[0]); rogue_feel += sizeof(Uint16); } IMA_ADPCM_state.wSamplesPerBlock = ((rogue_feel[1]<<8)|rogue_feel[0]); diff --git a/src/video/SDL_RLEaccel.c b/src/video/SDL_RLEaccel.c index 535c120fc..d4b191c27 100644 --- a/src/video/SDL_RLEaccel.c +++ b/src/video/SDL_RLEaccel.c @@ -1645,9 +1645,8 @@ static int RLEColorkeySurface(SDL_Surface *surface) Uint8 *rlebuf, *dst; int maxn; int y; - Uint8 *srcbuf, *curbuf, *lastline; + Uint8 *srcbuf, *lastline; int maxsize = 0; - int skip, run; int bpp = surface->format->BytesPerPixel; getpix_func getpix; Uint32 ckey, rgbmask; @@ -1681,9 +1680,7 @@ static int RLEColorkeySurface(SDL_Surface *surface) /* Set up the conversion */ srcbuf = (Uint8 *)surface->pixels; - curbuf = srcbuf; maxn = bpp == 4 ? 65535 : 255; - skip = run = 0; dst = rlebuf; rgbmask = ~surface->format->Amask; ckey = surface->format->colorkey & rgbmask; diff --git a/src/video/SDL_bmp.c b/src/video/SDL_bmp.c index 4cf5a5458..d56cfd83a 100644 --- a/src/video/SDL_bmp.c +++ b/src/video/SDL_bmp.c @@ -132,6 +132,17 @@ SDL_Surface * SDL_LoadBMP_RW (SDL_RWops *src, int freesrc) biClrUsed = SDL_ReadLE32(src); biClrImportant = SDL_ReadLE32(src); } + + /* stop some compiler warnings. */ + (void) bfSize; + (void) bfReserved1; + (void) bfReserved2; + (void) biPlanes; + (void) biSizeImage; + (void) biXPelsPerMeter; + (void) biYPelsPerMeter; + (void) biClrImportant; + if (biHeight < 0) { topDown = SDL_TRUE; biHeight = -biHeight; diff --git a/src/video/SDL_stretch.c b/src/video/SDL_stretch.c index fb6ef759b..7ce401ff7 100644 --- a/src/video/SDL_stretch.c +++ b/src/video/SDL_stretch.c @@ -205,7 +205,6 @@ int SDL_SoftStretch(SDL_Surface *src, SDL_Rect *srcrect, int src_locked; int dst_locked; int pos, inc; - int dst_width; int dst_maxrow; int src_row, dst_row; Uint8 *srcp = NULL; @@ -282,7 +281,6 @@ int SDL_SoftStretch(SDL_Surface *src, SDL_Rect *srcrect, inc = (srcrect->h << 16) / dstrect->h; src_row = srcrect->y; dst_row = dstrect->y; - dst_width = dstrect->w*bpp; #ifdef USE_ASM_STRETCH /* Write the opcodes for this stretch */ diff --git a/src/video/fbcon/SDL_fb3dfx.c b/src/video/fbcon/SDL_fb3dfx.c index b1f3cc318..eb083b85a 100644 --- a/src/video/fbcon/SDL_fb3dfx.c +++ b/src/video/fbcon/SDL_fb3dfx.c @@ -96,7 +96,6 @@ static int HWAccelBlit(SDL_Surface *src, SDL_Rect *srcrect, SDL_VideoDevice *this = current_video; int bpp; Uint32 src_format; - Uint32 dst_format; Uint32 src_base; Uint32 dst_base; int srcX, srcY; @@ -118,7 +117,6 @@ static int HWAccelBlit(SDL_Surface *src, SDL_Rect *srcrect, src_format = src->pitch | ((bpp+((bpp==8) ? 0 : 8)) << 13); dst_base = ((char *)dst->pixels - mapped_mem); bpp = dst->format->BitsPerPixel; - dst_format = dst->pitch | ((bpp+((bpp==8) ? 0 : 8)) << 13); srcX = srcrect->x; srcY = srcrect->y; diff --git a/src/video/x11/SDL_x11image.c b/src/video/x11/SDL_x11image.c index dc88c43d7..464bc37ba 100644 --- a/src/video/x11/SDL_x11image.c +++ b/src/video/x11/SDL_x11image.c @@ -102,13 +102,11 @@ int X11_SetupImage(_THIS, SDL_Surface *screen) if(!use_mitshm) #endif /* not NO_SHARED_MEMORY */ { - int bpp; screen->pixels = SDL_malloc(screen->h*screen->pitch); if ( screen->pixels == NULL ) { SDL_OutOfMemory(); return -1; } - bpp = screen->format->BytesPerPixel; SDL_Ximage = XCreateImage(SDL_Display, SDL_Visual, this->hidden->depth, ZPixmap, 0, (char *)screen->pixels,