Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Removed some unused variables that gcc 4.6.1 complains about.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Aug 9, 2012
1 parent ae4b2d8 commit ab4c4a3
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 68 deletions.
5 changes: 2 additions & 3 deletions src/SDL_hints.c
Expand Up @@ -57,7 +57,7 @@ SDL_SetHintWithPriority(const char *name, const char *value,
SDL_HintPriority priority)
{
const char *env;
SDL_Hint *prev, *hint;
SDL_Hint *hint;

if (!name || !value) {
return SDL_FALSE;
Expand All @@ -68,8 +68,7 @@ SDL_SetHintWithPriority(const char *name, const char *value,
return SDL_FALSE;
}

prev = NULL;
for (hint = SDL_hints; hint; prev = hint, hint = hint->next) {
for (hint = SDL_hints; hint; hint = hint->next) {
if (SDL_strcmp(name, hint->name) == 0) {
if (priority < hint->priority) {
return SDL_FALSE;
Expand Down
8 changes: 0 additions & 8 deletions src/audio/SDL_audio.c
Expand Up @@ -314,7 +314,6 @@ SDL_RunAudio(void *devicep)
int stream_len;
void *udata;
void (SDLCALL * fill) (void *userdata, Uint8 * stream, int len);
int silence;
Uint32 delay;
/* For streaming when the buffer sizes don't match up */
Uint8 *istream;
Expand All @@ -335,12 +334,6 @@ SDL_RunAudio(void *devicep)
device->use_streamer = 0;

if (device->convert.needed) {
if (device->convert.src_format == AUDIO_U8) {
silence = 0x80;
} else {
silence = 0;
}

#if 0 /* !!! FIXME: I took len_div out of the structure. Use rate_incr instead? */
/* If the result of the conversion alters the length, i.e. resampling is being used, use the streamer */
if (device->convert.len_mult != 1 || device->convert.len_div != 1) {
Expand All @@ -367,7 +360,6 @@ SDL_RunAudio(void *devicep)
/* stream_len = device->convert.len; */
stream_len = device->spec.size;
} else {
silence = device->spec.silence;
stream_len = device->spec.size;
}

Expand Down
6 changes: 2 additions & 4 deletions src/audio/SDL_wave.c
Expand Up @@ -49,7 +49,6 @@ 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 @@ -62,7 +61,7 @@ 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]);
/*const Uint16 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 @@ -233,7 +232,6 @@ 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 @@ -245,7 +243,7 @@ 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]);
/*const Uint16 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
3 changes: 1 addition & 2 deletions src/haptic/SDL_haptic.c
Expand Up @@ -766,7 +766,6 @@ SDL_HapticRumbleInit(SDL_Haptic * haptic)
int
SDL_HapticRumblePlay(SDL_Haptic * haptic, float strength, Uint32 length)
{
int ret;
SDL_HapticPeriodic *efx;

if (!ValidHaptic(haptic)) {
Expand All @@ -790,7 +789,7 @@ SDL_HapticRumblePlay(SDL_Haptic * haptic, float strength, Uint32 length)
efx = &haptic->rumble_effect.periodic;
efx->magnitude = (Sint16)(32767.0f*strength);
efx->length = length;
ret = SDL_HapticUpdateEffect(haptic, haptic->rumble_id, &haptic->rumble_effect);
SDL_HapticUpdateEffect(haptic, haptic->rumble_id, &haptic->rumble_effect);

return SDL_HapticRunEffect(haptic, haptic->rumble_id, 1);
}
Expand Down
3 changes: 1 addition & 2 deletions src/joystick/linux/SDL_sysjoystick.c
Expand Up @@ -582,7 +582,7 @@ JS_ConfigJoystick(SDL_Joystick * joystick, int fd)
{
SDL_bool handled;
unsigned char n;
int old_axes, tmp_naxes, tmp_nhats, tmp_nballs;
int tmp_naxes, tmp_nhats, tmp_nballs;
const char *name;
char *env, env_name[128];
int i;
Expand All @@ -602,7 +602,6 @@ JS_ConfigJoystick(SDL_Joystick * joystick, int fd)
}

name = SDL_SYS_JoystickName(joystick->index);
old_axes = joystick->naxes;

/* Generic analog joystick support */
if (SDL_strstr(name, "Analog") == name && SDL_strstr(name, "-hat")) {
Expand Down
12 changes: 1 addition & 11 deletions src/render/SDL_render.c
Expand Up @@ -546,11 +546,8 @@ int
SDL_GetTextureColorMod(SDL_Texture * texture, Uint8 * r, Uint8 * g,
Uint8 * b)
{
SDL_Renderer *renderer;

CHECK_TEXTURE_MAGIC(texture, -1);

renderer = texture->renderer;
if (r) {
*r = texture->r;
}
Expand Down Expand Up @@ -1173,7 +1170,6 @@ int
SDL_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
const SDL_Rect * srcrect, const SDL_Rect * dstrect)
{
SDL_Window *window;
SDL_Rect real_srcrect;
SDL_Rect real_dstrect;

Expand All @@ -1184,7 +1180,6 @@ SDL_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
SDL_SetError("Texture was not created with this renderer");
return -1;
}
window = renderer->window;

real_srcrect.x = 0;
real_srcrect.y = 0;
Expand Down Expand Up @@ -1237,7 +1232,6 @@ SDL_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture,
const SDL_Rect * srcrect, const SDL_Rect * dstrect,
const double angle, const SDL_Point *center, const SDL_RendererFlip flip)
{
SDL_Window *window;
SDL_Rect real_srcrect, real_dstrect;
SDL_Point real_center;

Expand All @@ -1253,8 +1247,6 @@ SDL_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture,
return -1;
}

window = renderer->window;

real_srcrect.x = 0;
real_srcrect.y = 0;
real_srcrect.w = texture->w;
Expand Down Expand Up @@ -1291,7 +1283,6 @@ int
SDL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
Uint32 format, void * pixels, int pitch)
{
SDL_Window *window;
SDL_Rect real_rect;

CHECK_RENDERER_MAGIC(renderer, -1);
Expand All @@ -1300,10 +1291,9 @@ SDL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
SDL_Unsupported();
return -1;
}
window = renderer->window;

if (!format) {
format = SDL_GetWindowPixelFormat(window);
format = SDL_GetWindowPixelFormat(renderer->window);
}

real_rect.x = renderer->viewport.x;
Expand Down
4 changes: 1 addition & 3 deletions src/render/software/SDL_rotate.c
Expand Up @@ -272,7 +272,7 @@ Assumes dst surface was allocated with the correct dimensions.
*/
void transformSurfaceY(SDL_Surface * src, SDL_Surface * dst, int cx, int cy, int isin, int icos, int flipx, int flipy)
{
int x, y, dx, dy, xd, yd, sdx, sdy, ax, ay, sw, sh;
int x, y, dx, dy, xd, yd, sdx, sdy, ax, ay;
tColorY *pc, *sp;
int gap;

Expand All @@ -283,8 +283,6 @@ void transformSurfaceY(SDL_Surface * src, SDL_Surface * dst, int cx, int cy, int
yd = ((src->h - dst->h) << 15);
ax = (cx << 16) - (icos * cx);
ay = (cy << 16) - (isin * cx);
sw = src->w - 1;
sh = src->h - 1;
pc = (tColorY*) dst->pixels;
gap = dst->pitch - dst->w;
/*
Expand Down
5 changes: 1 addition & 4 deletions src/video/SDL_RLEaccel.c
Expand Up @@ -1270,9 +1270,8 @@ 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 @@ -1306,9 +1305,7 @@ 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->map->info.colorkey & rgbmask;
Expand Down
53 changes: 24 additions & 29 deletions src/video/SDL_bmp.c
Expand Up @@ -67,23 +67,23 @@ SDL_LoadBMP_RW(SDL_RWops * src, int freesrc)

/* The Win32 BMP file header (14 bytes) */
char magic[2];
Uint32 bfSize;
Uint16 bfReserved1;
Uint16 bfReserved2;
Uint32 bfOffBits;
/*Uint32 bfSize = 0;*/
/*Uint16 bfReserved1 = 0;*/
/*Uint16 bfReserved2 = 0;*/
Uint32 bfOffBits = 0;

/* The Win32 BITMAPINFOHEADER struct (40 bytes) */
Uint32 biSize;
Sint32 biWidth;
Sint32 biHeight;
Uint16 biPlanes;
Uint16 biBitCount;
Uint32 biCompression;
Uint32 biSizeImage;
Sint32 biXPelsPerMeter;
Sint32 biYPelsPerMeter;
Uint32 biClrUsed;
Uint32 biClrImportant;
Uint32 biSize = 0;
Sint32 biWidth = 0;
Sint32 biHeight = 0;
/*Uint16 biPlanes = 0;*/
Uint16 biBitCount = 0;
Uint32 biCompression = 0;
/*Uint32 biSizeImage = 0;*/
/*Sint32 biXPelsPerMeter = 0;*/
/*Sint32 biYPelsPerMeter = 0;*/
Uint32 biClrUsed = 0;
/*Uint32 biClrImportant = 0;*/

/* Make sure we are passed a valid data source */
surface = NULL;
Expand All @@ -106,35 +106,30 @@ SDL_LoadBMP_RW(SDL_RWops * src, int freesrc)
was_error = SDL_TRUE;
goto done;
}
bfSize = SDL_ReadLE32(src);
bfReserved1 = SDL_ReadLE16(src);
bfReserved2 = SDL_ReadLE16(src);
/*bfSize =*/ SDL_ReadLE32(src);
/*bfReserved1 =*/ SDL_ReadLE16(src);
/*bfReserved2 =*/ SDL_ReadLE16(src);
bfOffBits = SDL_ReadLE32(src);

/* Read the Win32 BITMAPINFOHEADER */
biSize = SDL_ReadLE32(src);
if (biSize == 12) {
biWidth = (Uint32) SDL_ReadLE16(src);
biHeight = (Uint32) SDL_ReadLE16(src);
biPlanes = SDL_ReadLE16(src);
/*biPlanes =*/ SDL_ReadLE16(src);
biBitCount = SDL_ReadLE16(src);
biCompression = BI_RGB;
biSizeImage = 0;
biXPelsPerMeter = 0;
biYPelsPerMeter = 0;
biClrUsed = 0;
biClrImportant = 0;
} else {
biWidth = SDL_ReadLE32(src);
biHeight = SDL_ReadLE32(src);
biPlanes = SDL_ReadLE16(src);
/*biPlanes =*/ SDL_ReadLE16(src);
biBitCount = SDL_ReadLE16(src);
biCompression = SDL_ReadLE32(src);
biSizeImage = SDL_ReadLE32(src);
biXPelsPerMeter = SDL_ReadLE32(src);
biYPelsPerMeter = SDL_ReadLE32(src);
/*biSizeImage =*/ SDL_ReadLE32(src);
/*biXPelsPerMeter =*/ SDL_ReadLE32(src);
/*biYPelsPerMeter =*/ SDL_ReadLE32(src);
biClrUsed = SDL_ReadLE32(src);
biClrImportant = SDL_ReadLE32(src);
/*biClrImportant =*/ SDL_ReadLE32(src);
}
if (biHeight < 0) {
topDown = SDL_TRUE;
Expand Down
2 changes: 0 additions & 2 deletions src/video/SDL_stretch.c
Expand Up @@ -209,7 +209,6 @@ SDL_SoftStretch(SDL_Surface * src, const 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 @@ -286,7 +285,6 @@ SDL_SoftStretch(SDL_Surface * src, const 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

0 comments on commit ab4c4a3

Please sign in to comment.