Skip to content

Commit

Permalink
Removed variables that current GCC builds warn on as set and never used.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Jan 18, 2012
1 parent bf2f3a9 commit 53f40c3
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 14 deletions.
4 changes: 0 additions & 4 deletions src/audio/SDL_wave.c
Expand Up @@ -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 */
Expand All @@ -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]);
Expand Down Expand Up @@ -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);
Expand All @@ -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]);
Expand Down
5 changes: 1 addition & 4 deletions src/video/SDL_RLEaccel.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
11 changes: 11 additions & 0 deletions src/video/SDL_bmp.c
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions src/video/SDL_stretch.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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 */
Expand Down
2 changes: 0 additions & 2 deletions src/video/fbcon/SDL_fb3dfx.c
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions src/video/x11/SDL_x11image.c
Expand Up @@ -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,
Expand Down

0 comments on commit 53f40c3

Please sign in to comment.