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 638943a190ad60a7
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
     1.1 --- a/src/SDL_hints.c	Wed Aug 08 13:44:58 2012 -0400
     1.2 +++ b/src/SDL_hints.c	Thu Aug 09 14:14:41 2012 -0400
     1.3 @@ -57,7 +57,7 @@
     1.4                          SDL_HintPriority priority)
     1.5  {
     1.6      const char *env;
     1.7 -    SDL_Hint *prev, *hint;
     1.8 +    SDL_Hint *hint;
     1.9  
    1.10      if (!name || !value) {
    1.11          return SDL_FALSE;
    1.12 @@ -68,8 +68,7 @@
    1.13          return SDL_FALSE;
    1.14      }
    1.15  
    1.16 -    prev = NULL;
    1.17 -    for (hint = SDL_hints; hint; prev = hint, hint = hint->next) {
    1.18 +    for (hint = SDL_hints; hint; hint = hint->next) {
    1.19          if (SDL_strcmp(name, hint->name) == 0) {
    1.20              if (priority < hint->priority) {
    1.21                  return SDL_FALSE;
     2.1 --- a/src/audio/SDL_audio.c	Wed Aug 08 13:44:58 2012 -0400
     2.2 +++ b/src/audio/SDL_audio.c	Thu Aug 09 14:14:41 2012 -0400
     2.3 @@ -314,7 +314,6 @@
     2.4      int stream_len;
     2.5      void *udata;
     2.6      void (SDLCALL * fill) (void *userdata, Uint8 * stream, int len);
     2.7 -    int silence;
     2.8      Uint32 delay;
     2.9      /* For streaming when the buffer sizes don't match up */
    2.10      Uint8 *istream;
    2.11 @@ -335,12 +334,6 @@
    2.12      device->use_streamer = 0;
    2.13  
    2.14      if (device->convert.needed) {
    2.15 -        if (device->convert.src_format == AUDIO_U8) {
    2.16 -            silence = 0x80;
    2.17 -        } else {
    2.18 -            silence = 0;
    2.19 -        }
    2.20 -
    2.21  #if 0                           /* !!! FIXME: I took len_div out of the structure. Use rate_incr instead? */
    2.22          /* If the result of the conversion alters the length, i.e. resampling is being used, use the streamer */
    2.23          if (device->convert.len_mult != 1 || device->convert.len_div != 1) {
    2.24 @@ -367,7 +360,6 @@
    2.25          /* stream_len = device->convert.len; */
    2.26          stream_len = device->spec.size;
    2.27      } else {
    2.28 -        silence = device->spec.silence;
    2.29          stream_len = device->spec.size;
    2.30      }
    2.31  
     3.1 --- a/src/audio/SDL_wave.c	Wed Aug 08 13:44:58 2012 -0400
     3.2 +++ b/src/audio/SDL_wave.c	Thu Aug 09 14:14:41 2012 -0400
     3.3 @@ -49,7 +49,6 @@
     3.4  InitMS_ADPCM(WaveFMT * format)
     3.5  {
     3.6      Uint8 *rogue_feel;
     3.7 -    Uint16 extra_info;
     3.8      int i;
     3.9  
    3.10      /* Set the rogue pointer to the MS_ADPCM specific data */
    3.11 @@ -62,7 +61,7 @@
    3.12          SDL_SwapLE16(format->bitspersample);
    3.13      rogue_feel = (Uint8 *) format + sizeof(*format);
    3.14      if (sizeof(*format) == 16) {
    3.15 -        extra_info = ((rogue_feel[1] << 8) | rogue_feel[0]);
    3.16 +        /*const Uint16 extra_info = ((rogue_feel[1] << 8) | rogue_feel[0]);*/
    3.17          rogue_feel += sizeof(Uint16);
    3.18      }
    3.19      MS_ADPCM_state.wSamplesPerBlock = ((rogue_feel[1] << 8) | rogue_feel[0]);
    3.20 @@ -233,7 +232,6 @@
    3.21  InitIMA_ADPCM(WaveFMT * format)
    3.22  {
    3.23      Uint8 *rogue_feel;
    3.24 -    Uint16 extra_info;
    3.25  
    3.26      /* Set the rogue pointer to the IMA_ADPCM specific data */
    3.27      IMA_ADPCM_state.wavefmt.encoding = SDL_SwapLE16(format->encoding);
    3.28 @@ -245,7 +243,7 @@
    3.29          SDL_SwapLE16(format->bitspersample);
    3.30      rogue_feel = (Uint8 *) format + sizeof(*format);
    3.31      if (sizeof(*format) == 16) {
    3.32 -        extra_info = ((rogue_feel[1] << 8) | rogue_feel[0]);
    3.33 +        /*const Uint16 extra_info = ((rogue_feel[1] << 8) | rogue_feel[0]);*/
    3.34          rogue_feel += sizeof(Uint16);
    3.35      }
    3.36      IMA_ADPCM_state.wSamplesPerBlock = ((rogue_feel[1] << 8) | rogue_feel[0]);
     4.1 --- a/src/haptic/SDL_haptic.c	Wed Aug 08 13:44:58 2012 -0400
     4.2 +++ b/src/haptic/SDL_haptic.c	Thu Aug 09 14:14:41 2012 -0400
     4.3 @@ -766,7 +766,6 @@
     4.4  int
     4.5  SDL_HapticRumblePlay(SDL_Haptic * haptic, float strength, Uint32 length)
     4.6  {
     4.7 -    int ret;
     4.8      SDL_HapticPeriodic *efx;
     4.9  
    4.10      if (!ValidHaptic(haptic)) {
    4.11 @@ -790,7 +789,7 @@
    4.12      efx = &haptic->rumble_effect.periodic;
    4.13      efx->magnitude = (Sint16)(32767.0f*strength);
    4.14      efx->length = length;
    4.15 -    ret = SDL_HapticUpdateEffect(haptic, haptic->rumble_id, &haptic->rumble_effect);
    4.16 +    SDL_HapticUpdateEffect(haptic, haptic->rumble_id, &haptic->rumble_effect);
    4.17  
    4.18      return SDL_HapticRunEffect(haptic, haptic->rumble_id, 1);
    4.19  }
     5.1 --- a/src/joystick/linux/SDL_sysjoystick.c	Wed Aug 08 13:44:58 2012 -0400
     5.2 +++ b/src/joystick/linux/SDL_sysjoystick.c	Thu Aug 09 14:14:41 2012 -0400
     5.3 @@ -582,7 +582,7 @@
     5.4  {
     5.5      SDL_bool handled;
     5.6      unsigned char n;
     5.7 -    int old_axes, tmp_naxes, tmp_nhats, tmp_nballs;
     5.8 +    int tmp_naxes, tmp_nhats, tmp_nballs;
     5.9      const char *name;
    5.10      char *env, env_name[128];
    5.11      int i;
    5.12 @@ -602,7 +602,6 @@
    5.13      }
    5.14  
    5.15      name = SDL_SYS_JoystickName(joystick->index);
    5.16 -    old_axes = joystick->naxes;
    5.17  
    5.18      /* Generic analog joystick support */
    5.19      if (SDL_strstr(name, "Analog") == name && SDL_strstr(name, "-hat")) {
     6.1 --- a/src/render/SDL_render.c	Wed Aug 08 13:44:58 2012 -0400
     6.2 +++ b/src/render/SDL_render.c	Thu Aug 09 14:14:41 2012 -0400
     6.3 @@ -546,11 +546,8 @@
     6.4  SDL_GetTextureColorMod(SDL_Texture * texture, Uint8 * r, Uint8 * g,
     6.5                         Uint8 * b)
     6.6  {
     6.7 -    SDL_Renderer *renderer;
     6.8 -
     6.9      CHECK_TEXTURE_MAGIC(texture, -1);
    6.10  
    6.11 -    renderer = texture->renderer;
    6.12      if (r) {
    6.13          *r = texture->r;
    6.14      }
    6.15 @@ -1173,7 +1170,6 @@
    6.16  SDL_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
    6.17                 const SDL_Rect * srcrect, const SDL_Rect * dstrect)
    6.18  {
    6.19 -    SDL_Window *window;
    6.20      SDL_Rect real_srcrect;
    6.21      SDL_Rect real_dstrect;
    6.22  
    6.23 @@ -1184,7 +1180,6 @@
    6.24          SDL_SetError("Texture was not created with this renderer");
    6.25          return -1;
    6.26      }
    6.27 -    window = renderer->window;
    6.28  
    6.29      real_srcrect.x = 0;
    6.30      real_srcrect.y = 0;
    6.31 @@ -1237,7 +1232,6 @@
    6.32                 const SDL_Rect * srcrect, const SDL_Rect * dstrect,
    6.33                 const double angle, const SDL_Point *center, const SDL_RendererFlip flip)
    6.34  {
    6.35 -    SDL_Window *window;
    6.36      SDL_Rect real_srcrect, real_dstrect;
    6.37      SDL_Point real_center;
    6.38  
    6.39 @@ -1253,8 +1247,6 @@
    6.40          return -1;
    6.41      }
    6.42      
    6.43 -    window = renderer->window;
    6.44 -
    6.45      real_srcrect.x = 0;
    6.46      real_srcrect.y = 0;
    6.47      real_srcrect.w = texture->w;
    6.48 @@ -1291,7 +1283,6 @@
    6.49  SDL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
    6.50                       Uint32 format, void * pixels, int pitch)
    6.51  {
    6.52 -    SDL_Window *window;
    6.53      SDL_Rect real_rect;
    6.54  
    6.55      CHECK_RENDERER_MAGIC(renderer, -1);
    6.56 @@ -1300,10 +1291,9 @@
    6.57          SDL_Unsupported();
    6.58          return -1;
    6.59      }
    6.60 -    window = renderer->window;
    6.61  
    6.62      if (!format) {
    6.63 -        format = SDL_GetWindowPixelFormat(window);
    6.64 +        format = SDL_GetWindowPixelFormat(renderer->window);
    6.65      }
    6.66  
    6.67      real_rect.x = renderer->viewport.x;
     7.1 --- a/src/render/software/SDL_rotate.c	Wed Aug 08 13:44:58 2012 -0400
     7.2 +++ b/src/render/software/SDL_rotate.c	Thu Aug 09 14:14:41 2012 -0400
     7.3 @@ -272,7 +272,7 @@
     7.4  */
     7.5  void transformSurfaceY(SDL_Surface * src, SDL_Surface * dst, int cx, int cy, int isin, int icos, int flipx, int flipy)
     7.6  {
     7.7 -    int x, y, dx, dy, xd, yd, sdx, sdy, ax, ay, sw, sh;
     7.8 +    int x, y, dx, dy, xd, yd, sdx, sdy, ax, ay;
     7.9      tColorY *pc, *sp;
    7.10      int gap;
    7.11  
    7.12 @@ -283,8 +283,6 @@
    7.13      yd = ((src->h - dst->h) << 15);
    7.14      ax = (cx << 16) - (icos * cx);
    7.15      ay = (cy << 16) - (isin * cx);
    7.16 -    sw = src->w - 1;
    7.17 -    sh = src->h - 1;
    7.18      pc = (tColorY*) dst->pixels;
    7.19      gap = dst->pitch - dst->w;
    7.20      /*
     8.1 --- a/src/video/SDL_RLEaccel.c	Wed Aug 08 13:44:58 2012 -0400
     8.2 +++ b/src/video/SDL_RLEaccel.c	Thu Aug 09 14:14:41 2012 -0400
     8.3 @@ -1270,9 +1270,8 @@
     8.4      Uint8 *rlebuf, *dst;
     8.5      int maxn;
     8.6      int y;
     8.7 -    Uint8 *srcbuf, *curbuf, *lastline;
     8.8 +    Uint8 *srcbuf, *lastline;
     8.9      int maxsize = 0;
    8.10 -    int skip, run;
    8.11      int bpp = surface->format->BytesPerPixel;
    8.12      getpix_func getpix;
    8.13      Uint32 ckey, rgbmask;
    8.14 @@ -1306,9 +1305,7 @@
    8.15  
    8.16      /* Set up the conversion */
    8.17      srcbuf = (Uint8 *) surface->pixels;
    8.18 -    curbuf = srcbuf;
    8.19      maxn = bpp == 4 ? 65535 : 255;
    8.20 -    skip = run = 0;
    8.21      dst = rlebuf;
    8.22      rgbmask = ~surface->format->Amask;
    8.23      ckey = surface->map->info.colorkey & rgbmask;
     9.1 --- a/src/video/SDL_bmp.c	Wed Aug 08 13:44:58 2012 -0400
     9.2 +++ b/src/video/SDL_bmp.c	Thu Aug 09 14:14:41 2012 -0400
     9.3 @@ -67,23 +67,23 @@
     9.4  
     9.5      /* The Win32 BMP file header (14 bytes) */
     9.6      char magic[2];
     9.7 -    Uint32 bfSize;
     9.8 -    Uint16 bfReserved1;
     9.9 -    Uint16 bfReserved2;
    9.10 -    Uint32 bfOffBits;
    9.11 +    /*Uint32 bfSize = 0;*/
    9.12 +    /*Uint16 bfReserved1 = 0;*/
    9.13 +    /*Uint16 bfReserved2 = 0;*/
    9.14 +    Uint32 bfOffBits = 0;
    9.15  
    9.16      /* The Win32 BITMAPINFOHEADER struct (40 bytes) */
    9.17 -    Uint32 biSize;
    9.18 -    Sint32 biWidth;
    9.19 -    Sint32 biHeight;
    9.20 -    Uint16 biPlanes;
    9.21 -    Uint16 biBitCount;
    9.22 -    Uint32 biCompression;
    9.23 -    Uint32 biSizeImage;
    9.24 -    Sint32 biXPelsPerMeter;
    9.25 -    Sint32 biYPelsPerMeter;
    9.26 -    Uint32 biClrUsed;
    9.27 -    Uint32 biClrImportant;
    9.28 +    Uint32 biSize = 0;
    9.29 +    Sint32 biWidth = 0;
    9.30 +    Sint32 biHeight = 0;
    9.31 +    /*Uint16 biPlanes = 0;*/
    9.32 +    Uint16 biBitCount = 0;
    9.33 +    Uint32 biCompression = 0;
    9.34 +    /*Uint32 biSizeImage = 0;*/
    9.35 +    /*Sint32 biXPelsPerMeter = 0;*/
    9.36 +    /*Sint32 biYPelsPerMeter = 0;*/
    9.37 +    Uint32 biClrUsed = 0;
    9.38 +    /*Uint32 biClrImportant = 0;*/
    9.39  
    9.40      /* Make sure we are passed a valid data source */
    9.41      surface = NULL;
    9.42 @@ -106,9 +106,9 @@
    9.43          was_error = SDL_TRUE;
    9.44          goto done;
    9.45      }
    9.46 -    bfSize = SDL_ReadLE32(src);
    9.47 -    bfReserved1 = SDL_ReadLE16(src);
    9.48 -    bfReserved2 = SDL_ReadLE16(src);
    9.49 +    /*bfSize =*/ SDL_ReadLE32(src);
    9.50 +    /*bfReserved1 =*/ SDL_ReadLE16(src);
    9.51 +    /*bfReserved2 =*/ SDL_ReadLE16(src);
    9.52      bfOffBits = SDL_ReadLE32(src);
    9.53  
    9.54      /* Read the Win32 BITMAPINFOHEADER */
    9.55 @@ -116,25 +116,20 @@
    9.56      if (biSize == 12) {
    9.57          biWidth = (Uint32) SDL_ReadLE16(src);
    9.58          biHeight = (Uint32) SDL_ReadLE16(src);
    9.59 -        biPlanes = SDL_ReadLE16(src);
    9.60 +        /*biPlanes =*/ SDL_ReadLE16(src);
    9.61          biBitCount = SDL_ReadLE16(src);
    9.62          biCompression = BI_RGB;
    9.63 -        biSizeImage = 0;
    9.64 -        biXPelsPerMeter = 0;
    9.65 -        biYPelsPerMeter = 0;
    9.66 -        biClrUsed = 0;
    9.67 -        biClrImportant = 0;
    9.68      } else {
    9.69          biWidth = SDL_ReadLE32(src);
    9.70          biHeight = SDL_ReadLE32(src);
    9.71 -        biPlanes = SDL_ReadLE16(src);
    9.72 +        /*biPlanes =*/ SDL_ReadLE16(src);
    9.73          biBitCount = SDL_ReadLE16(src);
    9.74          biCompression = SDL_ReadLE32(src);
    9.75 -        biSizeImage = SDL_ReadLE32(src);
    9.76 -        biXPelsPerMeter = SDL_ReadLE32(src);
    9.77 -        biYPelsPerMeter = SDL_ReadLE32(src);
    9.78 +        /*biSizeImage =*/ SDL_ReadLE32(src);
    9.79 +        /*biXPelsPerMeter =*/ SDL_ReadLE32(src);
    9.80 +        /*biYPelsPerMeter =*/ SDL_ReadLE32(src);
    9.81          biClrUsed = SDL_ReadLE32(src);
    9.82 -        biClrImportant = SDL_ReadLE32(src);
    9.83 +        /*biClrImportant =*/ SDL_ReadLE32(src);
    9.84      }
    9.85      if (biHeight < 0) {
    9.86          topDown = SDL_TRUE;
    10.1 --- a/src/video/SDL_stretch.c	Wed Aug 08 13:44:58 2012 -0400
    10.2 +++ b/src/video/SDL_stretch.c	Thu Aug 09 14:14:41 2012 -0400
    10.3 @@ -209,7 +209,6 @@
    10.4      int src_locked;
    10.5      int dst_locked;
    10.6      int pos, inc;
    10.7 -    int dst_width;
    10.8      int dst_maxrow;
    10.9      int src_row, dst_row;
   10.10      Uint8 *srcp = NULL;
   10.11 @@ -286,7 +285,6 @@
   10.12      inc = (srcrect->h << 16) / dstrect->h;
   10.13      src_row = srcrect->y;
   10.14      dst_row = dstrect->y;
   10.15 -    dst_width = dstrect->w * bpp;
   10.16  
   10.17  #ifdef USE_ASM_STRETCH
   10.18      /* Write the opcodes for this stretch */