Removed some unused variables that gcc 4.6.1 complains about.
authorRyan C. Gordon <icculus@icculus.org>
Thu, 09 Aug 2012 14:14:41 -0400
changeset 6389 43a190ad60a7
parent 6388 470bc1333b09
child 6390 3047baa4a5e0
Removed some unused variables that gcc 4.6.1 complains about.
src/SDL_hints.c
src/audio/SDL_audio.c
src/audio/SDL_wave.c
src/haptic/SDL_haptic.c
src/joystick/linux/SDL_sysjoystick.c
src/render/SDL_render.c
src/render/software/SDL_rotate.c
src/video/SDL_RLEaccel.c
src/video/SDL_bmp.c
src/video/SDL_stretch.c
--- a/src/SDL_hints.c	Wed Aug 08 13:44:58 2012 -0400
+++ b/src/SDL_hints.c	Thu Aug 09 14:14:41 2012 -0400
@@ -57,7 +57,7 @@
                         SDL_HintPriority priority)
 {
     const char *env;
-    SDL_Hint *prev, *hint;
+    SDL_Hint *hint;
 
     if (!name || !value) {
         return SDL_FALSE;
@@ -68,8 +68,7 @@
         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;
--- a/src/audio/SDL_audio.c	Wed Aug 08 13:44:58 2012 -0400
+++ b/src/audio/SDL_audio.c	Thu Aug 09 14:14:41 2012 -0400
@@ -314,7 +314,6 @@
     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;
@@ -335,12 +334,6 @@
     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) {
@@ -367,7 +360,6 @@
         /* stream_len = device->convert.len; */
         stream_len = device->spec.size;
     } else {
-        silence = device->spec.silence;
         stream_len = device->spec.size;
     }
 
--- a/src/audio/SDL_wave.c	Wed Aug 08 13:44:58 2012 -0400
+++ b/src/audio/SDL_wave.c	Thu Aug 09 14:14:41 2012 -0400
@@ -49,7 +49,6 @@
 InitMS_ADPCM(WaveFMT * format)
 {
     Uint8 *rogue_feel;
-    Uint16 extra_info;
     int i;
 
     /* Set the rogue pointer to the MS_ADPCM specific data */
@@ -62,7 +61,7 @@
         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]);
@@ -233,7 +232,6 @@
 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);
@@ -245,7 +243,7 @@
         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]);
--- a/src/haptic/SDL_haptic.c	Wed Aug 08 13:44:58 2012 -0400
+++ b/src/haptic/SDL_haptic.c	Thu Aug 09 14:14:41 2012 -0400
@@ -766,7 +766,6 @@
 int
 SDL_HapticRumblePlay(SDL_Haptic * haptic, float strength, Uint32 length)
 {
-    int ret;
     SDL_HapticPeriodic *efx;
 
     if (!ValidHaptic(haptic)) {
@@ -790,7 +789,7 @@
     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);
 }
--- a/src/joystick/linux/SDL_sysjoystick.c	Wed Aug 08 13:44:58 2012 -0400
+++ b/src/joystick/linux/SDL_sysjoystick.c	Thu Aug 09 14:14:41 2012 -0400
@@ -582,7 +582,7 @@
 {
     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;
@@ -602,7 +602,6 @@
     }
 
     name = SDL_SYS_JoystickName(joystick->index);
-    old_axes = joystick->naxes;
 
     /* Generic analog joystick support */
     if (SDL_strstr(name, "Analog") == name && SDL_strstr(name, "-hat")) {
--- a/src/render/SDL_render.c	Wed Aug 08 13:44:58 2012 -0400
+++ b/src/render/SDL_render.c	Thu Aug 09 14:14:41 2012 -0400
@@ -546,11 +546,8 @@
 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;
     }
@@ -1173,7 +1170,6 @@
 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;
 
@@ -1184,7 +1180,6 @@
         SDL_SetError("Texture was not created with this renderer");
         return -1;
     }
-    window = renderer->window;
 
     real_srcrect.x = 0;
     real_srcrect.y = 0;
@@ -1237,7 +1232,6 @@
                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;
 
@@ -1253,8 +1247,6 @@
         return -1;
     }
     
-    window = renderer->window;
-
     real_srcrect.x = 0;
     real_srcrect.y = 0;
     real_srcrect.w = texture->w;
@@ -1291,7 +1283,6 @@
 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);
@@ -1300,10 +1291,9 @@
         SDL_Unsupported();
         return -1;
     }
-    window = renderer->window;
 
     if (!format) {
-        format = SDL_GetWindowPixelFormat(window);
+        format = SDL_GetWindowPixelFormat(renderer->window);
     }
 
     real_rect.x = renderer->viewport.x;
--- a/src/render/software/SDL_rotate.c	Wed Aug 08 13:44:58 2012 -0400
+++ b/src/render/software/SDL_rotate.c	Thu Aug 09 14:14:41 2012 -0400
@@ -272,7 +272,7 @@
 */
 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;
 
@@ -283,8 +283,6 @@
     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;
     /*
--- a/src/video/SDL_RLEaccel.c	Wed Aug 08 13:44:58 2012 -0400
+++ b/src/video/SDL_RLEaccel.c	Thu Aug 09 14:14:41 2012 -0400
@@ -1270,9 +1270,8 @@
     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;
@@ -1306,9 +1305,7 @@
 
     /* 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;
--- a/src/video/SDL_bmp.c	Wed Aug 08 13:44:58 2012 -0400
+++ b/src/video/SDL_bmp.c	Thu Aug 09 14:14:41 2012 -0400
@@ -67,23 +67,23 @@
 
     /* 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;
@@ -106,9 +106,9 @@
         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 */
@@ -116,25 +116,20 @@
     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;
--- a/src/video/SDL_stretch.c	Wed Aug 08 13:44:58 2012 -0400
+++ b/src/video/SDL_stretch.c	Thu Aug 09 14:14:41 2012 -0400
@@ -209,7 +209,6 @@
     int src_locked;
     int dst_locked;
     int pos, inc;
-    int dst_width;
     int dst_maxrow;
     int src_row, dst_row;
     Uint8 *srcp = NULL;
@@ -286,7 +285,6 @@
     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 */