Merged with Kees Bakker's repo at https://bitbucket.org/keestux/sdl ...
authorRyan C. Gordon <icculus@icculus.org>
Tue, 18 Oct 2011 00:58:22 -0400
changeset 60147a8b72b88d86
parent 6013 b253cc3c4276
parent 6000 3c980a9f983c
child 6015 9ac7135ac3fb
Merged with Kees Bakker's repo at https://bitbucket.org/keestux/sdl ...
src/video/uikit/SDL_uikitvideo.m
src/video/uikit/SDL_uikitwindow.m
     1.1 --- a/android-project/default.properties	Sun Oct 09 22:00:20 2011 +0200
     1.2 +++ b/android-project/default.properties	Tue Oct 18 00:58:22 2011 -0400
     1.3 @@ -8,4 +8,4 @@
     1.4  # project structure.
     1.5  
     1.6  # Project target.
     1.7 -target=android-4
     1.8 +target=android-5
     2.1 --- a/android-project/src/org/libsdl/app/SDLActivity.java	Sun Oct 09 22:00:20 2011 +0200
     2.2 +++ b/android-project/src/org/libsdl/app/SDLActivity.java	Tue Oct 18 00:58:22 2011 -0400
     2.3 @@ -1,6 +1,8 @@
     2.4  package org.libsdl.app;
     2.5  
     2.6 +import javax.microedition.khronos.egl.EGL10;
     2.7  import javax.microedition.khronos.egl.EGLConfig;
     2.8 +import javax.microedition.khronos.egl.EGLContext;
     2.9  import javax.microedition.khronos.opengles.GL10;
    2.10  import javax.microedition.khronos.egl.*;
    2.11  
    2.12 @@ -93,7 +95,8 @@
    2.13      public static native void onNativeResize(int x, int y, int format);
    2.14      public static native void onNativeKeyDown(int keycode);
    2.15      public static native void onNativeKeyUp(int keycode);
    2.16 -    public static native void onNativeTouch(int action, float x, 
    2.17 +    public static native void onNativeTouch(int touchDevId, int pointerFingerId,
    2.18 +                                            int action, float x, 
    2.19                                              float y, float p);
    2.20      public static native void onNativeAccel(float x, float y, float z);
    2.21      public static native void nativeRunAudioThread();
    2.22 @@ -387,7 +390,13 @@
    2.23              }
    2.24              EGLConfig config = configs[0];
    2.25  
    2.26 -            EGLContext ctx = egl.eglCreateContext(dpy, config, EGL10.EGL_NO_CONTEXT, null);
    2.27 +            int EGL_CONTEXT_CLIENT_VERSION=0x3098;
    2.28 +            int contextAttrs[] = new int[]
    2.29 +            {
    2.30 +                EGL_CONTEXT_CLIENT_VERSION, majorVersion,
    2.31 +                EGL10.EGL_NONE
    2.32 +            }; 
    2.33 +            EGLContext ctx = egl.eglCreateContext(dpy, config, EGL10.EGL_NO_CONTEXT, contextAttrs);
    2.34              if (ctx == EGL10.EGL_NO_CONTEXT) {
    2.35                  Log.e("SDL", "Couldn't create context");
    2.36                  return false;
    2.37 @@ -423,7 +432,7 @@
    2.38          try {
    2.39              EGL10 egl = (EGL10)EGLContext.getEGL();
    2.40  
    2.41 -            egl.eglWaitNative(EGL10.EGL_NATIVE_RENDERABLE, null);
    2.42 +            egl.eglWaitNative(EGL10.EGL_CORE_NATIVE_ENGINE, null);
    2.43  
    2.44              // drawing here
    2.45  
    2.46 @@ -459,16 +468,34 @@
    2.47  
    2.48      // Touch events
    2.49      public boolean onTouch(View v, MotionEvent event) {
    2.50 -    
    2.51 -        int action = event.getAction();
    2.52 -        float x = event.getX();
    2.53 -        float y = event.getY();
    2.54 -        float p = event.getPressure();
    2.55 +        {
    2.56 +             final int touchDevId = event.getDeviceId();
    2.57 +             final int pointerCount = event.getPointerCount();
    2.58 +             // touchId, pointerId, action, x, y, pressure
    2.59 +             int actionPointerIndex = event.getActionIndex();
    2.60 +             int pointerFingerId = event.getPointerId(actionPointerIndex);
    2.61 +             int action = event.getActionMasked();
    2.62 +
    2.63 +             float x = event.getX(actionPointerIndex);
    2.64 +             float y = event.getY(actionPointerIndex);
    2.65 +             float p = event.getPressure(actionPointerIndex);
    2.66  
    2.67 -        // TODO: Anything else we need to pass?        
    2.68 -        SDLActivity.onNativeTouch(action, x, y, p);
    2.69 -        return true;
    2.70 -    }
    2.71 +             if (action == MotionEvent.ACTION_MOVE && pointerCount > 1) {
    2.72 +                // TODO send motion to every pointer if its position has
    2.73 +                // changed since prev event.
    2.74 +                for (int i = 0; i < pointerCount; i++) {
    2.75 +                    pointerFingerId = event.getPointerId(i);
    2.76 +                    x = event.getX(i);
    2.77 +                    y = event.getY(i);
    2.78 +                    p = event.getPressure(i);
    2.79 +                    SDLActivity.onNativeTouch(touchDevId, pointerFingerId, action, x, y, p);
    2.80 +                }
    2.81 +             } else {
    2.82 +                SDLActivity.onNativeTouch(touchDevId, pointerFingerId, action, x, y, p);
    2.83 +             }
    2.84 +        }
    2.85 +      return true;
    2.86 +   } 
    2.87  
    2.88      // Sensor events
    2.89      public void enableSensor(int sensortype, boolean enabled) {
     3.1 --- a/configure.in	Sun Oct 09 22:00:20 2011 +0200
     3.2 +++ b/configure.in	Tue Oct 18 00:58:22 2011 -0400
     3.3 @@ -939,6 +939,41 @@
     3.4      fi
     3.5  }
     3.6  
     3.7 +dnl See if GCC's -Wall is supported.
     3.8 +CheckWarnAll()
     3.9 +{
    3.10 +    AC_MSG_CHECKING(for GCC -Wall option)
    3.11 +    have_gcc_Wall=no
    3.12 +
    3.13 +    save_CFLAGS="$CFLAGS"
    3.14 +    CFLAGS="$save_CFLAGS -Wall"
    3.15 +    AC_TRY_COMPILE([
    3.16 +    int x = 0;
    3.17 +    ],[
    3.18 +    ],[
    3.19 +    have_gcc_Wall=yes
    3.20 +    ])
    3.21 +    AC_MSG_RESULT($have_gcc_Wall)
    3.22 +    CFLAGS="$save_CFLAGS"
    3.23 +
    3.24 +    if test x$have_gcc_Wall = xyes; then
    3.25 +        EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
    3.26 +
    3.27 +        dnl Haiku headers use multicharacter constants all over the place. Ignore these warnings when using -Wall.
    3.28 +        AC_MSG_CHECKING(for necessary GCC -Wno-multichar option)
    3.29 +        need_gcc_Wno_multichar=no
    3.30 +        case "$host" in
    3.31 +            *-*-beos* | *-*-haiku*)
    3.32 +                need_gcc_Wno_multichar=yes
    3.33 +                ;;
    3.34 +        esac
    3.35 +        AC_MSG_RESULT($need_gcc_Wno_multichar)
    3.36 +        if test x$need_gcc_Wno_multichar = xyes; then
    3.37 +            EXTRA_CFLAGS="$EXTRA_CFLAGS -Wno-multichar"
    3.38 +        fi
    3.39 +    fi
    3.40 +}
    3.41 +
    3.42  
    3.43  dnl Find the X11 include and library directories
    3.44  CheckX11()
    3.45 @@ -2356,6 +2391,9 @@
    3.46          ;;
    3.47  esac
    3.48  
    3.49 +dnl Do this on all platforms, after everything else.
    3.50 +CheckWarnAll
    3.51 +
    3.52  # Verify that we have all the platform specific files we need
    3.53  
    3.54  if test x$have_joystick != xyes; then
     4.1 --- a/include/SDL_config_iphoneos.h	Sun Oct 09 22:00:20 2011 +0200
     4.2 +++ b/include/SDL_config_iphoneos.h	Tue Oct 18 00:58:22 2011 -0400
     4.3 @@ -140,6 +140,9 @@
     4.4  /* enable iPhone keyboard support */
     4.5  #define SDL_IPHONE_KEYBOARD 1
     4.6  
     4.7 +/* enable joystick subsystem */
     4.8 +#define SDL_JOYSTICK_DISABLED 0
     4.9 +
    4.10  /* Set max recognized G-force from accelerometer
    4.11     See src/joystick/uikit/SDLUIAccelerationDelegate.m for notes on why this is needed
    4.12   */
     5.1 --- a/include/SDL_rwops.h	Sun Oct 09 22:00:20 2011 +0200
     5.2 +++ b/include/SDL_rwops.h	Tue Oct 18 00:58:22 2011 -0400
     5.3 @@ -89,7 +89,6 @@
     5.4              void *fileNameRef;
     5.5              void *inputStream;
     5.6              void *inputStreamRef;
     5.7 -            void *skipMethod;
     5.8              void *readableByteChannel;
     5.9              void *readableByteChannelRef;
    5.10              void *readMethod;
     6.1 --- a/src/atomic/SDL_spinlock.c	Sun Oct 09 22:00:20 2011 +0200
     6.2 +++ b/src/atomic/SDL_spinlock.c	Tue Oct 18 00:58:22 2011 -0400
     6.3 @@ -60,7 +60,8 @@
     6.4  
     6.5  #elif defined(__GNUC__) && defined(__arm__) && \
     6.6          (defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__) || \
     6.7 -         defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5TE__))
     6.8 +         defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5TE__) || \
     6.9 +         defined(__ARM_ARCH_5TEJ__))
    6.10      int result;
    6.11      __asm__ __volatile__ (
    6.12          "swp %0, %1, [%2]\n"
    6.13 @@ -81,7 +82,7 @@
    6.14          : "=r" (result) : "r" (lock), "0" (1) : "cc", "memory");
    6.15  	return (result == 0);
    6.16  
    6.17 -#elif defined(__MACOSX__)
    6.18 +#elif defined(__MACOSX__) || defined(__IPHONEOS__)
    6.19      /* Maybe used for PowerPC, but the Intel asm or gcc atomics are favored. */
    6.20      return OSAtomicCompareAndSwap32Barrier(0, 1, lock);
    6.21  
     7.1 --- a/src/audio/SDL_audiotypecvt.c	Sun Oct 09 22:00:20 2011 +0200
     7.2 +++ b/src/audio/SDL_audiotypecvt.c	Tue Oct 18 00:58:22 2011 -0400
     7.3 @@ -7102,7 +7102,6 @@
     7.4      fprintf(stderr, "Upsample (x2) AUDIO_U8, 1 channels.\n");
     7.5  #endif
     7.6  
     7.7 -    const int srcsize = cvt->len_cvt;
     7.8      const int dstsize = cvt->len_cvt * 2;
     7.9      Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 1;
    7.10      const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
    7.11 @@ -7130,7 +7129,6 @@
    7.12      fprintf(stderr, "Downsample (x2) AUDIO_U8, 1 channels.\n");
    7.13  #endif
    7.14  
    7.15 -    const int srcsize = cvt->len_cvt;
    7.16      const int dstsize = cvt->len_cvt / 2;
    7.17      Uint8 *dst = (Uint8 *) cvt->buf;
    7.18      const Uint8 *src = (Uint8 *) cvt->buf;
    7.19 @@ -7157,7 +7155,6 @@
    7.20      fprintf(stderr, "Upsample (x4) AUDIO_U8, 1 channels.\n");
    7.21  #endif
    7.22  
    7.23 -    const int srcsize = cvt->len_cvt;
    7.24      const int dstsize = cvt->len_cvt * 4;
    7.25      Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 1;
    7.26      const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 1;
    7.27 @@ -7187,7 +7184,6 @@
    7.28      fprintf(stderr, "Downsample (x4) AUDIO_U8, 1 channels.\n");
    7.29  #endif
    7.30  
    7.31 -    const int srcsize = cvt->len_cvt;
    7.32      const int dstsize = cvt->len_cvt / 4;
    7.33      Uint8 *dst = (Uint8 *) cvt->buf;
    7.34      const Uint8 *src = (Uint8 *) cvt->buf;
    7.35 @@ -7214,7 +7210,6 @@
    7.36      fprintf(stderr, "Upsample (x2) AUDIO_U8, 2 channels.\n");
    7.37  #endif
    7.38  
    7.39 -    const int srcsize = cvt->len_cvt;
    7.40      const int dstsize = cvt->len_cvt * 2;
    7.41      Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 2;
    7.42      const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 2;
    7.43 @@ -7247,7 +7242,6 @@
    7.44      fprintf(stderr, "Downsample (x2) AUDIO_U8, 2 channels.\n");
    7.45  #endif
    7.46  
    7.47 -    const int srcsize = cvt->len_cvt;
    7.48      const int dstsize = cvt->len_cvt / 2;
    7.49      Uint8 *dst = (Uint8 *) cvt->buf;
    7.50      const Uint8 *src = (Uint8 *) cvt->buf;
    7.51 @@ -7278,7 +7272,6 @@
    7.52      fprintf(stderr, "Upsample (x4) AUDIO_U8, 2 channels.\n");
    7.53  #endif
    7.54  
    7.55 -    const int srcsize = cvt->len_cvt;
    7.56      const int dstsize = cvt->len_cvt * 4;
    7.57      Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 2;
    7.58      const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 2;
    7.59 @@ -7315,7 +7308,6 @@
    7.60      fprintf(stderr, "Downsample (x4) AUDIO_U8, 2 channels.\n");
    7.61  #endif
    7.62  
    7.63 -    const int srcsize = cvt->len_cvt;
    7.64      const int dstsize = cvt->len_cvt / 4;
    7.65      Uint8 *dst = (Uint8 *) cvt->buf;
    7.66      const Uint8 *src = (Uint8 *) cvt->buf;
    7.67 @@ -7346,7 +7338,6 @@
    7.68      fprintf(stderr, "Upsample (x2) AUDIO_U8, 4 channels.\n");
    7.69  #endif
    7.70  
    7.71 -    const int srcsize = cvt->len_cvt;
    7.72      const int dstsize = cvt->len_cvt * 2;
    7.73      Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 4;
    7.74      const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 4;
    7.75 @@ -7389,7 +7380,6 @@
    7.76      fprintf(stderr, "Downsample (x2) AUDIO_U8, 4 channels.\n");
    7.77  #endif
    7.78  
    7.79 -    const int srcsize = cvt->len_cvt;
    7.80      const int dstsize = cvt->len_cvt / 2;
    7.81      Uint8 *dst = (Uint8 *) cvt->buf;
    7.82      const Uint8 *src = (Uint8 *) cvt->buf;
    7.83 @@ -7428,7 +7418,6 @@
    7.84      fprintf(stderr, "Upsample (x4) AUDIO_U8, 4 channels.\n");
    7.85  #endif
    7.86  
    7.87 -    const int srcsize = cvt->len_cvt;
    7.88      const int dstsize = cvt->len_cvt * 4;
    7.89      Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 4;
    7.90      const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 4;
    7.91 @@ -7479,7 +7468,6 @@
    7.92      fprintf(stderr, "Downsample (x4) AUDIO_U8, 4 channels.\n");
    7.93  #endif
    7.94  
    7.95 -    const int srcsize = cvt->len_cvt;
    7.96      const int dstsize = cvt->len_cvt / 4;
    7.97      Uint8 *dst = (Uint8 *) cvt->buf;
    7.98      const Uint8 *src = (Uint8 *) cvt->buf;
    7.99 @@ -7518,7 +7506,6 @@
   7.100      fprintf(stderr, "Upsample (x2) AUDIO_U8, 6 channels.\n");
   7.101  #endif
   7.102  
   7.103 -    const int srcsize = cvt->len_cvt;
   7.104      const int dstsize = cvt->len_cvt * 2;
   7.105      Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 6;
   7.106      const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 6;
   7.107 @@ -7571,7 +7558,6 @@
   7.108      fprintf(stderr, "Downsample (x2) AUDIO_U8, 6 channels.\n");
   7.109  #endif
   7.110  
   7.111 -    const int srcsize = cvt->len_cvt;
   7.112      const int dstsize = cvt->len_cvt / 2;
   7.113      Uint8 *dst = (Uint8 *) cvt->buf;
   7.114      const Uint8 *src = (Uint8 *) cvt->buf;
   7.115 @@ -7618,7 +7604,6 @@
   7.116      fprintf(stderr, "Upsample (x4) AUDIO_U8, 6 channels.\n");
   7.117  #endif
   7.118  
   7.119 -    const int srcsize = cvt->len_cvt;
   7.120      const int dstsize = cvt->len_cvt * 4;
   7.121      Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 6;
   7.122      const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 6;
   7.123 @@ -7683,7 +7668,6 @@
   7.124      fprintf(stderr, "Downsample (x4) AUDIO_U8, 6 channels.\n");
   7.125  #endif
   7.126  
   7.127 -    const int srcsize = cvt->len_cvt;
   7.128      const int dstsize = cvt->len_cvt / 4;
   7.129      Uint8 *dst = (Uint8 *) cvt->buf;
   7.130      const Uint8 *src = (Uint8 *) cvt->buf;
   7.131 @@ -7730,7 +7714,6 @@
   7.132      fprintf(stderr, "Upsample (x2) AUDIO_U8, 8 channels.\n");
   7.133  #endif
   7.134  
   7.135 -    const int srcsize = cvt->len_cvt;
   7.136      const int dstsize = cvt->len_cvt * 2;
   7.137      Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 8;
   7.138      const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 8;
   7.139 @@ -7793,7 +7776,6 @@
   7.140      fprintf(stderr, "Downsample (x2) AUDIO_U8, 8 channels.\n");
   7.141  #endif
   7.142  
   7.143 -    const int srcsize = cvt->len_cvt;
   7.144      const int dstsize = cvt->len_cvt / 2;
   7.145      Uint8 *dst = (Uint8 *) cvt->buf;
   7.146      const Uint8 *src = (Uint8 *) cvt->buf;
   7.147 @@ -7848,7 +7830,6 @@
   7.148      fprintf(stderr, "Upsample (x4) AUDIO_U8, 8 channels.\n");
   7.149  #endif
   7.150  
   7.151 -    const int srcsize = cvt->len_cvt;
   7.152      const int dstsize = cvt->len_cvt * 4;
   7.153      Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 8;
   7.154      const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 8;
   7.155 @@ -7927,7 +7908,6 @@
   7.156      fprintf(stderr, "Downsample (x4) AUDIO_U8, 8 channels.\n");
   7.157  #endif
   7.158  
   7.159 -    const int srcsize = cvt->len_cvt;
   7.160      const int dstsize = cvt->len_cvt / 4;
   7.161      Uint8 *dst = (Uint8 *) cvt->buf;
   7.162      const Uint8 *src = (Uint8 *) cvt->buf;
   7.163 @@ -7982,7 +7962,6 @@
   7.164      fprintf(stderr, "Upsample (x2) AUDIO_S8, 1 channels.\n");
   7.165  #endif
   7.166  
   7.167 -    const int srcsize = cvt->len_cvt;
   7.168      const int dstsize = cvt->len_cvt * 2;
   7.169      Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 1;
   7.170      const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 1;
   7.171 @@ -8010,7 +7989,6 @@
   7.172      fprintf(stderr, "Downsample (x2) AUDIO_S8, 1 channels.\n");
   7.173  #endif
   7.174  
   7.175 -    const int srcsize = cvt->len_cvt;
   7.176      const int dstsize = cvt->len_cvt / 2;
   7.177      Sint8 *dst = (Sint8 *) cvt->buf;
   7.178      const Sint8 *src = (Sint8 *) cvt->buf;
   7.179 @@ -8037,7 +8015,6 @@
   7.180      fprintf(stderr, "Upsample (x4) AUDIO_S8, 1 channels.\n");
   7.181  #endif
   7.182  
   7.183 -    const int srcsize = cvt->len_cvt;
   7.184      const int dstsize = cvt->len_cvt * 4;
   7.185      Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 1;
   7.186      const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 1;
   7.187 @@ -8067,7 +8044,6 @@
   7.188      fprintf(stderr, "Downsample (x4) AUDIO_S8, 1 channels.\n");
   7.189  #endif
   7.190  
   7.191 -    const int srcsize = cvt->len_cvt;
   7.192      const int dstsize = cvt->len_cvt / 4;
   7.193      Sint8 *dst = (Sint8 *) cvt->buf;
   7.194      const Sint8 *src = (Sint8 *) cvt->buf;
   7.195 @@ -8094,7 +8070,6 @@
   7.196      fprintf(stderr, "Upsample (x2) AUDIO_S8, 2 channels.\n");
   7.197  #endif
   7.198  
   7.199 -    const int srcsize = cvt->len_cvt;
   7.200      const int dstsize = cvt->len_cvt * 2;
   7.201      Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 2;
   7.202      const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 2;
   7.203 @@ -8127,7 +8102,6 @@
   7.204      fprintf(stderr, "Downsample (x2) AUDIO_S8, 2 channels.\n");
   7.205  #endif
   7.206  
   7.207 -    const int srcsize = cvt->len_cvt;
   7.208      const int dstsize = cvt->len_cvt / 2;
   7.209      Sint8 *dst = (Sint8 *) cvt->buf;
   7.210      const Sint8 *src = (Sint8 *) cvt->buf;
   7.211 @@ -8158,7 +8132,6 @@
   7.212      fprintf(stderr, "Upsample (x4) AUDIO_S8, 2 channels.\n");
   7.213  #endif
   7.214  
   7.215 -    const int srcsize = cvt->len_cvt;
   7.216      const int dstsize = cvt->len_cvt * 4;
   7.217      Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 2;
   7.218      const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 2;
   7.219 @@ -8195,7 +8168,6 @@
   7.220      fprintf(stderr, "Downsample (x4) AUDIO_S8, 2 channels.\n");
   7.221  #endif
   7.222  
   7.223 -    const int srcsize = cvt->len_cvt;
   7.224      const int dstsize = cvt->len_cvt / 4;
   7.225      Sint8 *dst = (Sint8 *) cvt->buf;
   7.226      const Sint8 *src = (Sint8 *) cvt->buf;
   7.227 @@ -8226,7 +8198,6 @@
   7.228      fprintf(stderr, "Upsample (x2) AUDIO_S8, 4 channels.\n");
   7.229  #endif
   7.230  
   7.231 -    const int srcsize = cvt->len_cvt;
   7.232      const int dstsize = cvt->len_cvt * 2;
   7.233      Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 4;
   7.234      const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 4;
   7.235 @@ -8269,7 +8240,6 @@
   7.236      fprintf(stderr, "Downsample (x2) AUDIO_S8, 4 channels.\n");
   7.237  #endif
   7.238  
   7.239 -    const int srcsize = cvt->len_cvt;
   7.240      const int dstsize = cvt->len_cvt / 2;
   7.241      Sint8 *dst = (Sint8 *) cvt->buf;
   7.242      const Sint8 *src = (Sint8 *) cvt->buf;
   7.243 @@ -8308,7 +8278,6 @@
   7.244      fprintf(stderr, "Upsample (x4) AUDIO_S8, 4 channels.\n");
   7.245  #endif
   7.246  
   7.247 -    const int srcsize = cvt->len_cvt;
   7.248      const int dstsize = cvt->len_cvt * 4;
   7.249      Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 4;
   7.250      const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 4;
   7.251 @@ -8359,7 +8328,6 @@
   7.252      fprintf(stderr, "Downsample (x4) AUDIO_S8, 4 channels.\n");
   7.253  #endif
   7.254  
   7.255 -    const int srcsize = cvt->len_cvt;
   7.256      const int dstsize = cvt->len_cvt / 4;
   7.257      Sint8 *dst = (Sint8 *) cvt->buf;
   7.258      const Sint8 *src = (Sint8 *) cvt->buf;
   7.259 @@ -8398,7 +8366,6 @@
   7.260      fprintf(stderr, "Upsample (x2) AUDIO_S8, 6 channels.\n");
   7.261  #endif
   7.262  
   7.263 -    const int srcsize = cvt->len_cvt;
   7.264      const int dstsize = cvt->len_cvt * 2;
   7.265      Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 6;
   7.266      const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 6;
   7.267 @@ -8451,7 +8418,6 @@
   7.268      fprintf(stderr, "Downsample (x2) AUDIO_S8, 6 channels.\n");
   7.269  #endif
   7.270  
   7.271 -    const int srcsize = cvt->len_cvt;
   7.272      const int dstsize = cvt->len_cvt / 2;
   7.273      Sint8 *dst = (Sint8 *) cvt->buf;
   7.274      const Sint8 *src = (Sint8 *) cvt->buf;
   7.275 @@ -8498,7 +8464,6 @@
   7.276      fprintf(stderr, "Upsample (x4) AUDIO_S8, 6 channels.\n");
   7.277  #endif
   7.278  
   7.279 -    const int srcsize = cvt->len_cvt;
   7.280      const int dstsize = cvt->len_cvt * 4;
   7.281      Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 6;
   7.282      const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 6;
   7.283 @@ -8563,7 +8528,6 @@
   7.284      fprintf(stderr, "Downsample (x4) AUDIO_S8, 6 channels.\n");
   7.285  #endif
   7.286  
   7.287 -    const int srcsize = cvt->len_cvt;
   7.288      const int dstsize = cvt->len_cvt / 4;
   7.289      Sint8 *dst = (Sint8 *) cvt->buf;
   7.290      const Sint8 *src = (Sint8 *) cvt->buf;
   7.291 @@ -8610,7 +8574,6 @@
   7.292      fprintf(stderr, "Upsample (x2) AUDIO_S8, 8 channels.\n");
   7.293  #endif
   7.294  
   7.295 -    const int srcsize = cvt->len_cvt;
   7.296      const int dstsize = cvt->len_cvt * 2;
   7.297      Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 8;
   7.298      const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 8;
   7.299 @@ -8673,7 +8636,6 @@
   7.300      fprintf(stderr, "Downsample (x2) AUDIO_S8, 8 channels.\n");
   7.301  #endif
   7.302  
   7.303 -    const int srcsize = cvt->len_cvt;
   7.304      const int dstsize = cvt->len_cvt / 2;
   7.305      Sint8 *dst = (Sint8 *) cvt->buf;
   7.306      const Sint8 *src = (Sint8 *) cvt->buf;
   7.307 @@ -8728,7 +8690,6 @@
   7.308      fprintf(stderr, "Upsample (x4) AUDIO_S8, 8 channels.\n");
   7.309  #endif
   7.310  
   7.311 -    const int srcsize = cvt->len_cvt;
   7.312      const int dstsize = cvt->len_cvt * 4;
   7.313      Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 8;
   7.314      const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 8;
   7.315 @@ -8807,7 +8768,6 @@
   7.316      fprintf(stderr, "Downsample (x4) AUDIO_S8, 8 channels.\n");
   7.317  #endif
   7.318  
   7.319 -    const int srcsize = cvt->len_cvt;
   7.320      const int dstsize = cvt->len_cvt / 4;
   7.321      Sint8 *dst = (Sint8 *) cvt->buf;
   7.322      const Sint8 *src = (Sint8 *) cvt->buf;
   7.323 @@ -8862,7 +8822,6 @@
   7.324      fprintf(stderr, "Upsample (x2) AUDIO_U16LSB, 1 channels.\n");
   7.325  #endif
   7.326  
   7.327 -    const int srcsize = cvt->len_cvt;
   7.328      const int dstsize = cvt->len_cvt * 2;
   7.329      Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 1;
   7.330      const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
   7.331 @@ -8890,7 +8849,6 @@
   7.332      fprintf(stderr, "Downsample (x2) AUDIO_U16LSB, 1 channels.\n");
   7.333  #endif
   7.334  
   7.335 -    const int srcsize = cvt->len_cvt;
   7.336      const int dstsize = cvt->len_cvt / 2;
   7.337      Uint16 *dst = (Uint16 *) cvt->buf;
   7.338      const Uint16 *src = (Uint16 *) cvt->buf;
   7.339 @@ -8917,7 +8875,6 @@
   7.340      fprintf(stderr, "Upsample (x4) AUDIO_U16LSB, 1 channels.\n");
   7.341  #endif
   7.342  
   7.343 -    const int srcsize = cvt->len_cvt;
   7.344      const int dstsize = cvt->len_cvt * 4;
   7.345      Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 1;
   7.346      const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
   7.347 @@ -8947,7 +8904,6 @@
   7.348      fprintf(stderr, "Downsample (x4) AUDIO_U16LSB, 1 channels.\n");
   7.349  #endif
   7.350  
   7.351 -    const int srcsize = cvt->len_cvt;
   7.352      const int dstsize = cvt->len_cvt / 4;
   7.353      Uint16 *dst = (Uint16 *) cvt->buf;
   7.354      const Uint16 *src = (Uint16 *) cvt->buf;
   7.355 @@ -8974,7 +8930,6 @@
   7.356      fprintf(stderr, "Upsample (x2) AUDIO_U16LSB, 2 channels.\n");
   7.357  #endif
   7.358  
   7.359 -    const int srcsize = cvt->len_cvt;
   7.360      const int dstsize = cvt->len_cvt * 2;
   7.361      Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 2;
   7.362      const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 2;
   7.363 @@ -9007,7 +8962,6 @@
   7.364      fprintf(stderr, "Downsample (x2) AUDIO_U16LSB, 2 channels.\n");
   7.365  #endif
   7.366  
   7.367 -    const int srcsize = cvt->len_cvt;
   7.368      const int dstsize = cvt->len_cvt / 2;
   7.369      Uint16 *dst = (Uint16 *) cvt->buf;
   7.370      const Uint16 *src = (Uint16 *) cvt->buf;
   7.371 @@ -9038,7 +8992,6 @@
   7.372      fprintf(stderr, "Upsample (x4) AUDIO_U16LSB, 2 channels.\n");
   7.373  #endif
   7.374  
   7.375 -    const int srcsize = cvt->len_cvt;
   7.376      const int dstsize = cvt->len_cvt * 4;
   7.377      Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 2;
   7.378      const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 2;
   7.379 @@ -9075,7 +9028,6 @@
   7.380      fprintf(stderr, "Downsample (x4) AUDIO_U16LSB, 2 channels.\n");
   7.381  #endif
   7.382  
   7.383 -    const int srcsize = cvt->len_cvt;
   7.384      const int dstsize = cvt->len_cvt / 4;
   7.385      Uint16 *dst = (Uint16 *) cvt->buf;
   7.386      const Uint16 *src = (Uint16 *) cvt->buf;
   7.387 @@ -9106,7 +9058,6 @@
   7.388      fprintf(stderr, "Upsample (x2) AUDIO_U16LSB, 4 channels.\n");
   7.389  #endif
   7.390  
   7.391 -    const int srcsize = cvt->len_cvt;
   7.392      const int dstsize = cvt->len_cvt * 2;
   7.393      Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 4;
   7.394      const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 4;
   7.395 @@ -9149,7 +9100,6 @@
   7.396      fprintf(stderr, "Downsample (x2) AUDIO_U16LSB, 4 channels.\n");
   7.397  #endif
   7.398  
   7.399 -    const int srcsize = cvt->len_cvt;
   7.400      const int dstsize = cvt->len_cvt / 2;
   7.401      Uint16 *dst = (Uint16 *) cvt->buf;
   7.402      const Uint16 *src = (Uint16 *) cvt->buf;
   7.403 @@ -9188,7 +9138,6 @@
   7.404      fprintf(stderr, "Upsample (x4) AUDIO_U16LSB, 4 channels.\n");
   7.405  #endif
   7.406  
   7.407 -    const int srcsize = cvt->len_cvt;
   7.408      const int dstsize = cvt->len_cvt * 4;
   7.409      Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 4;
   7.410      const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 4;
   7.411 @@ -9239,7 +9188,6 @@
   7.412      fprintf(stderr, "Downsample (x4) AUDIO_U16LSB, 4 channels.\n");
   7.413  #endif
   7.414  
   7.415 -    const int srcsize = cvt->len_cvt;
   7.416      const int dstsize = cvt->len_cvt / 4;
   7.417      Uint16 *dst = (Uint16 *) cvt->buf;
   7.418      const Uint16 *src = (Uint16 *) cvt->buf;
   7.419 @@ -9278,7 +9226,6 @@
   7.420      fprintf(stderr, "Upsample (x2) AUDIO_U16LSB, 6 channels.\n");
   7.421  #endif
   7.422  
   7.423 -    const int srcsize = cvt->len_cvt;
   7.424      const int dstsize = cvt->len_cvt * 2;
   7.425      Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 6;
   7.426      const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 6;
   7.427 @@ -9331,7 +9278,6 @@
   7.428      fprintf(stderr, "Downsample (x2) AUDIO_U16LSB, 6 channels.\n");
   7.429  #endif
   7.430  
   7.431 -    const int srcsize = cvt->len_cvt;
   7.432      const int dstsize = cvt->len_cvt / 2;
   7.433      Uint16 *dst = (Uint16 *) cvt->buf;
   7.434      const Uint16 *src = (Uint16 *) cvt->buf;
   7.435 @@ -9378,7 +9324,6 @@
   7.436      fprintf(stderr, "Upsample (x4) AUDIO_U16LSB, 6 channels.\n");
   7.437  #endif
   7.438  
   7.439 -    const int srcsize = cvt->len_cvt;
   7.440      const int dstsize = cvt->len_cvt * 4;
   7.441      Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 6;
   7.442      const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 6;
   7.443 @@ -9443,7 +9388,6 @@
   7.444      fprintf(stderr, "Downsample (x4) AUDIO_U16LSB, 6 channels.\n");
   7.445  #endif
   7.446  
   7.447 -    const int srcsize = cvt->len_cvt;
   7.448      const int dstsize = cvt->len_cvt / 4;
   7.449      Uint16 *dst = (Uint16 *) cvt->buf;
   7.450      const Uint16 *src = (Uint16 *) cvt->buf;
   7.451 @@ -9490,7 +9434,6 @@
   7.452      fprintf(stderr, "Upsample (x2) AUDIO_U16LSB, 8 channels.\n");
   7.453  #endif
   7.454  
   7.455 -    const int srcsize = cvt->len_cvt;
   7.456      const int dstsize = cvt->len_cvt * 2;
   7.457      Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 8;
   7.458      const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 8;
   7.459 @@ -9553,7 +9496,6 @@
   7.460      fprintf(stderr, "Downsample (x2) AUDIO_U16LSB, 8 channels.\n");
   7.461  #endif
   7.462  
   7.463 -    const int srcsize = cvt->len_cvt;
   7.464      const int dstsize = cvt->len_cvt / 2;
   7.465      Uint16 *dst = (Uint16 *) cvt->buf;
   7.466      const Uint16 *src = (Uint16 *) cvt->buf;
   7.467 @@ -9608,7 +9550,6 @@
   7.468      fprintf(stderr, "Upsample (x4) AUDIO_U16LSB, 8 channels.\n");
   7.469  #endif
   7.470  
   7.471 -    const int srcsize = cvt->len_cvt;
   7.472      const int dstsize = cvt->len_cvt * 4;
   7.473      Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 8;
   7.474      const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 8;
   7.475 @@ -9687,7 +9628,6 @@
   7.476      fprintf(stderr, "Downsample (x4) AUDIO_U16LSB, 8 channels.\n");
   7.477  #endif
   7.478  
   7.479 -    const int srcsize = cvt->len_cvt;
   7.480      const int dstsize = cvt->len_cvt / 4;
   7.481      Uint16 *dst = (Uint16 *) cvt->buf;
   7.482      const Uint16 *src = (Uint16 *) cvt->buf;
   7.483 @@ -9742,7 +9682,6 @@
   7.484      fprintf(stderr, "Upsample (x2) AUDIO_S16LSB, 1 channels.\n");
   7.485  #endif
   7.486  
   7.487 -    const int srcsize = cvt->len_cvt;
   7.488      const int dstsize = cvt->len_cvt * 2;
   7.489      Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 1;
   7.490      const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1;
   7.491 @@ -9770,7 +9709,6 @@
   7.492      fprintf(stderr, "Downsample (x2) AUDIO_S16LSB, 1 channels.\n");
   7.493  #endif
   7.494  
   7.495 -    const int srcsize = cvt->len_cvt;
   7.496      const int dstsize = cvt->len_cvt / 2;
   7.497      Sint16 *dst = (Sint16 *) cvt->buf;
   7.498      const Sint16 *src = (Sint16 *) cvt->buf;
   7.499 @@ -9797,7 +9735,6 @@
   7.500      fprintf(stderr, "Upsample (x4) AUDIO_S16LSB, 1 channels.\n");
   7.501  #endif
   7.502  
   7.503 -    const int srcsize = cvt->len_cvt;
   7.504      const int dstsize = cvt->len_cvt * 4;
   7.505      Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 1;
   7.506      const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1;
   7.507 @@ -9827,7 +9764,6 @@
   7.508      fprintf(stderr, "Downsample (x4) AUDIO_S16LSB, 1 channels.\n");
   7.509  #endif
   7.510  
   7.511 -    const int srcsize = cvt->len_cvt;
   7.512      const int dstsize = cvt->len_cvt / 4;
   7.513      Sint16 *dst = (Sint16 *) cvt->buf;
   7.514      const Sint16 *src = (Sint16 *) cvt->buf;
   7.515 @@ -9854,7 +9790,6 @@
   7.516      fprintf(stderr, "Upsample (x2) AUDIO_S16LSB, 2 channels.\n");
   7.517  #endif
   7.518  
   7.519 -    const int srcsize = cvt->len_cvt;
   7.520      const int dstsize = cvt->len_cvt * 2;
   7.521      Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 2;
   7.522      const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 2;
   7.523 @@ -9887,7 +9822,6 @@
   7.524      fprintf(stderr, "Downsample (x2) AUDIO_S16LSB, 2 channels.\n");
   7.525  #endif
   7.526  
   7.527 -    const int srcsize = cvt->len_cvt;
   7.528      const int dstsize = cvt->len_cvt / 2;
   7.529      Sint16 *dst = (Sint16 *) cvt->buf;
   7.530      const Sint16 *src = (Sint16 *) cvt->buf;
   7.531 @@ -9918,7 +9852,6 @@
   7.532      fprintf(stderr, "Upsample (x4) AUDIO_S16LSB, 2 channels.\n");
   7.533  #endif
   7.534  
   7.535 -    const int srcsize = cvt->len_cvt;
   7.536      const int dstsize = cvt->len_cvt * 4;
   7.537      Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 2;
   7.538      const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 2;
   7.539 @@ -9955,7 +9888,6 @@
   7.540      fprintf(stderr, "Downsample (x4) AUDIO_S16LSB, 2 channels.\n");
   7.541  #endif
   7.542  
   7.543 -    const int srcsize = cvt->len_cvt;
   7.544      const int dstsize = cvt->len_cvt / 4;
   7.545      Sint16 *dst = (Sint16 *) cvt->buf;
   7.546      const Sint16 *src = (Sint16 *) cvt->buf;
   7.547 @@ -9986,7 +9918,6 @@
   7.548      fprintf(stderr, "Upsample (x2) AUDIO_S16LSB, 4 channels.\n");
   7.549  #endif
   7.550  
   7.551 -    const int srcsize = cvt->len_cvt;
   7.552      const int dstsize = cvt->len_cvt * 2;
   7.553      Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 4;
   7.554      const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 4;
   7.555 @@ -10029,7 +9960,6 @@
   7.556      fprintf(stderr, "Downsample (x2) AUDIO_S16LSB, 4 channels.\n");
   7.557  #endif
   7.558  
   7.559 -    const int srcsize = cvt->len_cvt;
   7.560      const int dstsize = cvt->len_cvt / 2;
   7.561      Sint16 *dst = (Sint16 *) cvt->buf;
   7.562      const Sint16 *src = (Sint16 *) cvt->buf;
   7.563 @@ -10068,7 +9998,6 @@
   7.564      fprintf(stderr, "Upsample (x4) AUDIO_S16LSB, 4 channels.\n");
   7.565  #endif
   7.566  
   7.567 -    const int srcsize = cvt->len_cvt;
   7.568      const int dstsize = cvt->len_cvt * 4;
   7.569      Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 4;
   7.570      const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 4;
   7.571 @@ -10119,7 +10048,6 @@
   7.572      fprintf(stderr, "Downsample (x4) AUDIO_S16LSB, 4 channels.\n");
   7.573  #endif
   7.574  
   7.575 -    const int srcsize = cvt->len_cvt;
   7.576      const int dstsize = cvt->len_cvt / 4;
   7.577      Sint16 *dst = (Sint16 *) cvt->buf;
   7.578      const Sint16 *src = (Sint16 *) cvt->buf;
   7.579 @@ -10158,7 +10086,6 @@
   7.580      fprintf(stderr, "Upsample (x2) AUDIO_S16LSB, 6 channels.\n");
   7.581  #endif
   7.582  
   7.583 -    const int srcsize = cvt->len_cvt;
   7.584      const int dstsize = cvt->len_cvt * 2;
   7.585      Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 6;
   7.586      const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 6;
   7.587 @@ -10211,7 +10138,6 @@
   7.588      fprintf(stderr, "Downsample (x2) AUDIO_S16LSB, 6 channels.\n");
   7.589  #endif
   7.590  
   7.591 -    const int srcsize = cvt->len_cvt;
   7.592      const int dstsize = cvt->len_cvt / 2;
   7.593      Sint16 *dst = (Sint16 *) cvt->buf;
   7.594      const Sint16 *src = (Sint16 *) cvt->buf;
   7.595 @@ -10258,7 +10184,6 @@
   7.596      fprintf(stderr, "Upsample (x4) AUDIO_S16LSB, 6 channels.\n");
   7.597  #endif
   7.598  
   7.599 -    const int srcsize = cvt->len_cvt;
   7.600      const int dstsize = cvt->len_cvt * 4;
   7.601      Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 6;
   7.602      const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 6;
   7.603 @@ -10323,7 +10248,6 @@
   7.604      fprintf(stderr, "Downsample (x4) AUDIO_S16LSB, 6 channels.\n");
   7.605  #endif
   7.606  
   7.607 -    const int srcsize = cvt->len_cvt;
   7.608      const int dstsize = cvt->len_cvt / 4;
   7.609      Sint16 *dst = (Sint16 *) cvt->buf;
   7.610      const Sint16 *src = (Sint16 *) cvt->buf;
   7.611 @@ -10370,7 +10294,6 @@
   7.612      fprintf(stderr, "Upsample (x2) AUDIO_S16LSB, 8 channels.\n");
   7.613  #endif
   7.614  
   7.615 -    const int srcsize = cvt->len_cvt;
   7.616      const int dstsize = cvt->len_cvt * 2;
   7.617      Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 8;
   7.618      const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 8;
   7.619 @@ -10433,7 +10356,6 @@
   7.620      fprintf(stderr, "Downsample (x2) AUDIO_S16LSB, 8 channels.\n");
   7.621  #endif
   7.622  
   7.623 -    const int srcsize = cvt->len_cvt;
   7.624      const int dstsize = cvt->len_cvt / 2;
   7.625      Sint16 *dst = (Sint16 *) cvt->buf;
   7.626      const Sint16 *src = (Sint16 *) cvt->buf;
   7.627 @@ -10488,7 +10410,6 @@
   7.628      fprintf(stderr, "Upsample (x4) AUDIO_S16LSB, 8 channels.\n");
   7.629  #endif
   7.630  
   7.631 -    const int srcsize = cvt->len_cvt;
   7.632      const int dstsize = cvt->len_cvt * 4;
   7.633      Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 8;
   7.634      const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 8;
   7.635 @@ -10567,7 +10488,6 @@
   7.636      fprintf(stderr, "Downsample (x4) AUDIO_S16LSB, 8 channels.\n");
   7.637  #endif
   7.638  
   7.639 -    const int srcsize = cvt->len_cvt;
   7.640      const int dstsize = cvt->len_cvt / 4;
   7.641      Sint16 *dst = (Sint16 *) cvt->buf;
   7.642      const Sint16 *src = (Sint16 *) cvt->buf;
   7.643 @@ -10622,7 +10542,6 @@
   7.644      fprintf(stderr, "Upsample (x2) AUDIO_U16MSB, 1 channels.\n");
   7.645  #endif
   7.646  
   7.647 -    const int srcsize = cvt->len_cvt;
   7.648      const int dstsize = cvt->len_cvt * 2;
   7.649      Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 1;
   7.650      const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
   7.651 @@ -10650,7 +10569,6 @@
   7.652      fprintf(stderr, "Downsample (x2) AUDIO_U16MSB, 1 channels.\n");
   7.653  #endif
   7.654  
   7.655 -    const int srcsize = cvt->len_cvt;
   7.656      const int dstsize = cvt->len_cvt / 2;
   7.657      Uint16 *dst = (Uint16 *) cvt->buf;
   7.658      const Uint16 *src = (Uint16 *) cvt->buf;
   7.659 @@ -10677,7 +10595,6 @@
   7.660      fprintf(stderr, "Upsample (x4) AUDIO_U16MSB, 1 channels.\n");
   7.661  #endif
   7.662  
   7.663 -    const int srcsize = cvt->len_cvt;
   7.664      const int dstsize = cvt->len_cvt * 4;
   7.665      Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 1;
   7.666      const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1;
   7.667 @@ -10707,7 +10624,6 @@
   7.668      fprintf(stderr, "Downsample (x4) AUDIO_U16MSB, 1 channels.\n");
   7.669  #endif
   7.670  
   7.671 -    const int srcsize = cvt->len_cvt;
   7.672      const int dstsize = cvt->len_cvt / 4;
   7.673      Uint16 *dst = (Uint16 *) cvt->buf;
   7.674      const Uint16 *src = (Uint16 *) cvt->buf;
   7.675 @@ -10734,7 +10650,6 @@
   7.676      fprintf(stderr, "Upsample (x2) AUDIO_U16MSB, 2 channels.\n");
   7.677  #endif
   7.678  
   7.679 -    const int srcsize = cvt->len_cvt;
   7.680      const int dstsize = cvt->len_cvt * 2;
   7.681      Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 2;
   7.682      const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 2;
   7.683 @@ -10767,7 +10682,6 @@
   7.684      fprintf(stderr, "Downsample (x2) AUDIO_U16MSB, 2 channels.\n");
   7.685  #endif
   7.686  
   7.687 -    const int srcsize = cvt->len_cvt;
   7.688      const int dstsize = cvt->len_cvt / 2;
   7.689      Uint16 *dst = (Uint16 *) cvt->buf;
   7.690      const Uint16 *src = (Uint16 *) cvt->buf;
   7.691 @@ -10798,7 +10712,6 @@
   7.692      fprintf(stderr, "Upsample (x4) AUDIO_U16MSB, 2 channels.\n");
   7.693  #endif
   7.694  
   7.695 -    const int srcsize = cvt->len_cvt;
   7.696      const int dstsize = cvt->len_cvt * 4;
   7.697      Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 2;
   7.698      const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 2;
   7.699 @@ -10835,7 +10748,6 @@
   7.700      fprintf(stderr, "Downsample (x4) AUDIO_U16MSB, 2 channels.\n");
   7.701  #endif
   7.702  
   7.703 -    const int srcsize = cvt->len_cvt;
   7.704      const int dstsize = cvt->len_cvt / 4;
   7.705      Uint16 *dst = (Uint16 *) cvt->buf;
   7.706      const Uint16 *src = (Uint16 *) cvt->buf;
   7.707 @@ -10866,7 +10778,6 @@
   7.708      fprintf(stderr, "Upsample (x2) AUDIO_U16MSB, 4 channels.\n");
   7.709  #endif
   7.710  
   7.711 -    const int srcsize = cvt->len_cvt;
   7.712      const int dstsize = cvt->len_cvt * 2;
   7.713      Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 4;
   7.714      const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 4;
   7.715 @@ -10909,7 +10820,6 @@
   7.716      fprintf(stderr, "Downsample (x2) AUDIO_U16MSB, 4 channels.\n");
   7.717  #endif
   7.718  
   7.719 -    const int srcsize = cvt->len_cvt;
   7.720      const int dstsize = cvt->len_cvt / 2;
   7.721      Uint16 *dst = (Uint16 *) cvt->buf;
   7.722      const Uint16 *src = (Uint16 *) cvt->buf;
   7.723 @@ -10948,7 +10858,6 @@
   7.724      fprintf(stderr, "Upsample (x4) AUDIO_U16MSB, 4 channels.\n");
   7.725  #endif
   7.726  
   7.727 -    const int srcsize = cvt->len_cvt;
   7.728      const int dstsize = cvt->len_cvt * 4;
   7.729      Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 4;
   7.730      const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 4;
   7.731 @@ -10999,7 +10908,6 @@
   7.732      fprintf(stderr, "Downsample (x4) AUDIO_U16MSB, 4 channels.\n");
   7.733  #endif
   7.734  
   7.735 -    const int srcsize = cvt->len_cvt;
   7.736      const int dstsize = cvt->len_cvt / 4;
   7.737      Uint16 *dst = (Uint16 *) cvt->buf;
   7.738      const Uint16 *src = (Uint16 *) cvt->buf;
   7.739 @@ -11038,7 +10946,6 @@
   7.740      fprintf(stderr, "Upsample (x2) AUDIO_U16MSB, 6 channels.\n");
   7.741  #endif
   7.742  
   7.743 -    const int srcsize = cvt->len_cvt;
   7.744      const int dstsize = cvt->len_cvt * 2;
   7.745      Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 6;
   7.746      const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 6;
   7.747 @@ -11091,7 +10998,6 @@
   7.748      fprintf(stderr, "Downsample (x2) AUDIO_U16MSB, 6 channels.\n");
   7.749  #endif
   7.750  
   7.751 -    const int srcsize = cvt->len_cvt;
   7.752      const int dstsize = cvt->len_cvt / 2;
   7.753      Uint16 *dst = (Uint16 *) cvt->buf;
   7.754      const Uint16 *src = (Uint16 *) cvt->buf;
   7.755 @@ -11138,7 +11044,6 @@
   7.756      fprintf(stderr, "Upsample (x4) AUDIO_U16MSB, 6 channels.\n");
   7.757  #endif
   7.758  
   7.759 -    const int srcsize = cvt->len_cvt;
   7.760      const int dstsize = cvt->len_cvt * 4;
   7.761      Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 6;
   7.762      const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 6;
   7.763 @@ -11203,7 +11108,6 @@
   7.764      fprintf(stderr, "Downsample (x4) AUDIO_U16MSB, 6 channels.\n");
   7.765  #endif
   7.766  
   7.767 -    const int srcsize = cvt->len_cvt;
   7.768      const int dstsize = cvt->len_cvt / 4;
   7.769      Uint16 *dst = (Uint16 *) cvt->buf;
   7.770      const Uint16 *src = (Uint16 *) cvt->buf;
   7.771 @@ -11250,7 +11154,6 @@
   7.772      fprintf(stderr, "Upsample (x2) AUDIO_U16MSB, 8 channels.\n");
   7.773  #endif
   7.774  
   7.775 -    const int srcsize = cvt->len_cvt;
   7.776      const int dstsize = cvt->len_cvt * 2;
   7.777      Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 8;
   7.778      const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 8;
   7.779 @@ -11313,7 +11216,6 @@
   7.780      fprintf(stderr, "Downsample (x2) AUDIO_U16MSB, 8 channels.\n");
   7.781  #endif
   7.782  
   7.783 -    const int srcsize = cvt->len_cvt;
   7.784      const int dstsize = cvt->len_cvt / 2;
   7.785      Uint16 *dst = (Uint16 *) cvt->buf;
   7.786      const Uint16 *src = (Uint16 *) cvt->buf;
   7.787 @@ -11368,7 +11270,6 @@
   7.788      fprintf(stderr, "Upsample (x4) AUDIO_U16MSB, 8 channels.\n");
   7.789  #endif
   7.790  
   7.791 -    const int srcsize = cvt->len_cvt;
   7.792      const int dstsize = cvt->len_cvt * 4;
   7.793      Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 8;
   7.794      const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 8;
   7.795 @@ -11447,7 +11348,6 @@
   7.796      fprintf(stderr, "Downsample (x4) AUDIO_U16MSB, 8 channels.\n");
   7.797  #endif
   7.798  
   7.799 -    const int srcsize = cvt->len_cvt;
   7.800      const int dstsize = cvt->len_cvt / 4;
   7.801      Uint16 *dst = (Uint16 *) cvt->buf;
   7.802      const Uint16 *src = (Uint16 *) cvt->buf;
   7.803 @@ -11502,7 +11402,6 @@
   7.804      fprintf(stderr, "Upsample (x2) AUDIO_S16MSB, 1 channels.\n");
   7.805  #endif
   7.806  
   7.807 -    const int srcsize = cvt->len_cvt;
   7.808      const int dstsize = cvt->len_cvt * 2;
   7.809      Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 1;
   7.810      const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1;
   7.811 @@ -11530,7 +11429,6 @@
   7.812      fprintf(stderr, "Downsample (x2) AUDIO_S16MSB, 1 channels.\n");
   7.813  #endif
   7.814  
   7.815 -    const int srcsize = cvt->len_cvt;
   7.816      const int dstsize = cvt->len_cvt / 2;
   7.817      Sint16 *dst = (Sint16 *) cvt->buf;
   7.818      const Sint16 *src = (Sint16 *) cvt->buf;
   7.819 @@ -11557,7 +11455,6 @@
   7.820      fprintf(stderr, "Upsample (x4) AUDIO_S16MSB, 1 channels.\n");
   7.821  #endif
   7.822  
   7.823 -    const int srcsize = cvt->len_cvt;
   7.824      const int dstsize = cvt->len_cvt * 4;
   7.825      Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 1;
   7.826      const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1;
   7.827 @@ -11587,7 +11484,6 @@
   7.828      fprintf(stderr, "Downsample (x4) AUDIO_S16MSB, 1 channels.\n");
   7.829  #endif
   7.830  
   7.831 -    const int srcsize = cvt->len_cvt;
   7.832      const int dstsize = cvt->len_cvt / 4;
   7.833      Sint16 *dst = (Sint16 *) cvt->buf;
   7.834      const Sint16 *src = (Sint16 *) cvt->buf;
   7.835 @@ -11614,7 +11510,6 @@
   7.836      fprintf(stderr, "Upsample (x2) AUDIO_S16MSB, 2 channels.\n");
   7.837  #endif
   7.838  
   7.839 -    const int srcsize = cvt->len_cvt;
   7.840      const int dstsize = cvt->len_cvt * 2;
   7.841      Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 2;
   7.842      const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 2;
   7.843 @@ -11647,7 +11542,6 @@
   7.844      fprintf(stderr, "Downsample (x2) AUDIO_S16MSB, 2 channels.\n");
   7.845  #endif
   7.846  
   7.847 -    const int srcsize = cvt->len_cvt;
   7.848      const int dstsize = cvt->len_cvt / 2;
   7.849      Sint16 *dst = (Sint16 *) cvt->buf;
   7.850      const Sint16 *src = (Sint16 *) cvt->buf;
   7.851 @@ -11678,7 +11572,6 @@
   7.852      fprintf(stderr, "Upsample (x4) AUDIO_S16MSB, 2 channels.\n");
   7.853  #endif
   7.854  
   7.855 -    const int srcsize = cvt->len_cvt;
   7.856      const int dstsize = cvt->len_cvt * 4;
   7.857      Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 2;
   7.858      const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 2;
   7.859 @@ -11715,7 +11608,6 @@
   7.860      fprintf(stderr, "Downsample (x4) AUDIO_S16MSB, 2 channels.\n");
   7.861  #endif
   7.862  
   7.863 -    const int srcsize = cvt->len_cvt;
   7.864      const int dstsize = cvt->len_cvt / 4;
   7.865      Sint16 *dst = (Sint16 *) cvt->buf;
   7.866      const Sint16 *src = (Sint16 *) cvt->buf;
   7.867 @@ -11746,7 +11638,6 @@
   7.868      fprintf(stderr, "Upsample (x2) AUDIO_S16MSB, 4 channels.\n");
   7.869  #endif
   7.870  
   7.871 -    const int srcsize = cvt->len_cvt;
   7.872      const int dstsize = cvt->len_cvt * 2;
   7.873      Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 4;
   7.874      const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 4;
   7.875 @@ -11789,7 +11680,6 @@
   7.876      fprintf(stderr, "Downsample (x2) AUDIO_S16MSB, 4 channels.\n");
   7.877  #endif
   7.878  
   7.879 -    const int srcsize = cvt->len_cvt;
   7.880      const int dstsize = cvt->len_cvt / 2;
   7.881      Sint16 *dst = (Sint16 *) cvt->buf;
   7.882      const Sint16 *src = (Sint16 *) cvt->buf;
   7.883 @@ -11828,7 +11718,6 @@
   7.884      fprintf(stderr, "Upsample (x4) AUDIO_S16MSB, 4 channels.\n");
   7.885  #endif
   7.886  
   7.887 -    const int srcsize = cvt->len_cvt;
   7.888      const int dstsize = cvt->len_cvt * 4;
   7.889      Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 4;
   7.890      const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 4;
   7.891 @@ -11879,7 +11768,6 @@
   7.892      fprintf(stderr, "Downsample (x4) AUDIO_S16MSB, 4 channels.\n");
   7.893  #endif
   7.894  
   7.895 -    const int srcsize = cvt->len_cvt;
   7.896      const int dstsize = cvt->len_cvt / 4;
   7.897      Sint16 *dst = (Sint16 *) cvt->buf;
   7.898      const Sint16 *src = (Sint16 *) cvt->buf;
   7.899 @@ -11918,7 +11806,6 @@
   7.900      fprintf(stderr, "Upsample (x2) AUDIO_S16MSB, 6 channels.\n");
   7.901  #endif
   7.902  
   7.903 -    const int srcsize = cvt->len_cvt;
   7.904      const int dstsize = cvt->len_cvt * 2;
   7.905      Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 6;
   7.906      const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 6;
   7.907 @@ -11971,7 +11858,6 @@
   7.908      fprintf(stderr, "Downsample (x2) AUDIO_S16MSB, 6 channels.\n");
   7.909  #endif
   7.910  
   7.911 -    const int srcsize = cvt->len_cvt;
   7.912      const int dstsize = cvt->len_cvt / 2;
   7.913      Sint16 *dst = (Sint16 *) cvt->buf;
   7.914      const Sint16 *src = (Sint16 *) cvt->buf;
   7.915 @@ -12018,7 +11904,6 @@
   7.916      fprintf(stderr, "Upsample (x4) AUDIO_S16MSB, 6 channels.\n");
   7.917  #endif
   7.918  
   7.919 -    const int srcsize = cvt->len_cvt;
   7.920      const int dstsize = cvt->len_cvt * 4;
   7.921      Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 6;
   7.922      const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 6;
   7.923 @@ -12083,7 +11968,6 @@
   7.924      fprintf(stderr, "Downsample (x4) AUDIO_S16MSB, 6 channels.\n");
   7.925  #endif
   7.926  
   7.927 -    const int srcsize = cvt->len_cvt;
   7.928      const int dstsize = cvt->len_cvt / 4;
   7.929      Sint16 *dst = (Sint16 *) cvt->buf;
   7.930      const Sint16 *src = (Sint16 *) cvt->buf;
   7.931 @@ -12130,7 +12014,6 @@
   7.932      fprintf(stderr, "Upsample (x2) AUDIO_S16MSB, 8 channels.\n");
   7.933  #endif
   7.934  
   7.935 -    const int srcsize = cvt->len_cvt;
   7.936      const int dstsize = cvt->len_cvt * 2;
   7.937      Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 8;
   7.938      const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 8;
   7.939 @@ -12193,7 +12076,6 @@
   7.940      fprintf(stderr, "Downsample (x2) AUDIO_S16MSB, 8 channels.\n");
   7.941  #endif
   7.942  
   7.943 -    const int srcsize = cvt->len_cvt;
   7.944      const int dstsize = cvt->len_cvt / 2;
   7.945      Sint16 *dst = (Sint16 *) cvt->buf;
   7.946      const Sint16 *src = (Sint16 *) cvt->buf;
   7.947 @@ -12248,7 +12130,6 @@
   7.948      fprintf(stderr, "Upsample (x4) AUDIO_S16MSB, 8 channels.\n");
   7.949  #endif
   7.950  
   7.951 -    const int srcsize = cvt->len_cvt;
   7.952      const int dstsize = cvt->len_cvt * 4;
   7.953      Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 8;
   7.954      const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 8;
   7.955 @@ -12327,7 +12208,6 @@
   7.956      fprintf(stderr, "Downsample (x4) AUDIO_S16MSB, 8 channels.\n");
   7.957  #endif
   7.958  
   7.959 -    const int srcsize = cvt->len_cvt;
   7.960      const int dstsize = cvt->len_cvt / 4;
   7.961      Sint16 *dst = (Sint16 *) cvt->buf;
   7.962      const Sint16 *src = (Sint16 *) cvt->buf;
   7.963 @@ -12382,7 +12262,6 @@
   7.964      fprintf(stderr, "Upsample (x2) AUDIO_S32LSB, 1 channels.\n");
   7.965  #endif
   7.966  
   7.967 -    const int srcsize = cvt->len_cvt;
   7.968      const int dstsize = cvt->len_cvt * 2;
   7.969      Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 1;
   7.970      const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1;
   7.971 @@ -12410,7 +12289,6 @@
   7.972      fprintf(stderr, "Downsample (x2) AUDIO_S32LSB, 1 channels.\n");
   7.973  #endif
   7.974  
   7.975 -    const int srcsize = cvt->len_cvt;
   7.976      const int dstsize = cvt->len_cvt / 2;
   7.977      Sint32 *dst = (Sint32 *) cvt->buf;
   7.978      const Sint32 *src = (Sint32 *) cvt->buf;
   7.979 @@ -12437,7 +12315,6 @@
   7.980      fprintf(stderr, "Upsample (x4) AUDIO_S32LSB, 1 channels.\n");
   7.981  #endif
   7.982  
   7.983 -    const int srcsize = cvt->len_cvt;
   7.984      const int dstsize = cvt->len_cvt * 4;
   7.985      Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 1;
   7.986      const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1;
   7.987 @@ -12467,7 +12344,6 @@
   7.988      fprintf(stderr, "Downsample (x4) AUDIO_S32LSB, 1 channels.\n");
   7.989  #endif
   7.990  
   7.991 -    const int srcsize = cvt->len_cvt;
   7.992      const int dstsize = cvt->len_cvt / 4;
   7.993      Sint32 *dst = (Sint32 *) cvt->buf;
   7.994      const Sint32 *src = (Sint32 *) cvt->buf;
   7.995 @@ -12494,7 +12370,6 @@
   7.996      fprintf(stderr, "Upsample (x2) AUDIO_S32LSB, 2 channels.\n");
   7.997  #endif
   7.998  
   7.999 -    const int srcsize = cvt->len_cvt;
  7.1000      const int dstsize = cvt->len_cvt * 2;
  7.1001      Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 2;
  7.1002      const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 2;
  7.1003 @@ -12527,7 +12402,6 @@
  7.1004      fprintf(stderr, "Downsample (x2) AUDIO_S32LSB, 2 channels.\n");
  7.1005  #endif
  7.1006  
  7.1007 -    const int srcsize = cvt->len_cvt;
  7.1008      const int dstsize = cvt->len_cvt / 2;
  7.1009      Sint32 *dst = (Sint32 *) cvt->buf;
  7.1010      const Sint32 *src = (Sint32 *) cvt->buf;
  7.1011 @@ -12558,7 +12432,6 @@
  7.1012      fprintf(stderr, "Upsample (x4) AUDIO_S32LSB, 2 channels.\n");
  7.1013  #endif
  7.1014  
  7.1015 -    const int srcsize = cvt->len_cvt;
  7.1016      const int dstsize = cvt->len_cvt * 4;
  7.1017      Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 2;
  7.1018      const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 2;
  7.1019 @@ -12595,7 +12468,6 @@
  7.1020      fprintf(stderr, "Downsample (x4) AUDIO_S32LSB, 2 channels.\n");
  7.1021  #endif
  7.1022  
  7.1023 -    const int srcsize = cvt->len_cvt;
  7.1024      const int dstsize = cvt->len_cvt / 4;
  7.1025      Sint32 *dst = (Sint32 *) cvt->buf;
  7.1026      const Sint32 *src = (Sint32 *) cvt->buf;
  7.1027 @@ -12626,7 +12498,6 @@
  7.1028      fprintf(stderr, "Upsample (x2) AUDIO_S32LSB, 4 channels.\n");
  7.1029  #endif
  7.1030  
  7.1031 -    const int srcsize = cvt->len_cvt;
  7.1032      const int dstsize = cvt->len_cvt * 2;
  7.1033      Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 4;
  7.1034      const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 4;
  7.1035 @@ -12669,7 +12540,6 @@
  7.1036      fprintf(stderr, "Downsample (x2) AUDIO_S32LSB, 4 channels.\n");
  7.1037  #endif
  7.1038  
  7.1039 -    const int srcsize = cvt->len_cvt;
  7.1040      const int dstsize = cvt->len_cvt / 2;
  7.1041      Sint32 *dst = (Sint32 *) cvt->buf;
  7.1042      const Sint32 *src = (Sint32 *) cvt->buf;
  7.1043 @@ -12708,7 +12578,6 @@
  7.1044      fprintf(stderr, "Upsample (x4) AUDIO_S32LSB, 4 channels.\n");
  7.1045  #endif
  7.1046  
  7.1047 -    const int srcsize = cvt->len_cvt;
  7.1048      const int dstsize = cvt->len_cvt * 4;
  7.1049      Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 4;
  7.1050      const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 4;
  7.1051 @@ -12759,7 +12628,6 @@
  7.1052      fprintf(stderr, "Downsample (x4) AUDIO_S32LSB, 4 channels.\n");
  7.1053  #endif
  7.1054  
  7.1055 -    const int srcsize = cvt->len_cvt;
  7.1056      const int dstsize = cvt->len_cvt / 4;
  7.1057      Sint32 *dst = (Sint32 *) cvt->buf;
  7.1058      const Sint32 *src = (Sint32 *) cvt->buf;
  7.1059 @@ -12798,7 +12666,6 @@
  7.1060      fprintf(stderr, "Upsample (x2) AUDIO_S32LSB, 6 channels.\n");
  7.1061  #endif
  7.1062  
  7.1063 -    const int srcsize = cvt->len_cvt;
  7.1064      const int dstsize = cvt->len_cvt * 2;
  7.1065      Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 6;
  7.1066      const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 6;
  7.1067 @@ -12851,7 +12718,6 @@
  7.1068      fprintf(stderr, "Downsample (x2) AUDIO_S32LSB, 6 channels.\n");
  7.1069  #endif
  7.1070  
  7.1071 -    const int srcsize = cvt->len_cvt;
  7.1072      const int dstsize = cvt->len_cvt / 2;
  7.1073      Sint32 *dst = (Sint32 *) cvt->buf;
  7.1074      const Sint32 *src = (Sint32 *) cvt->buf;
  7.1075 @@ -12898,7 +12764,6 @@
  7.1076      fprintf(stderr, "Upsample (x4) AUDIO_S32LSB, 6 channels.\n");
  7.1077  #endif
  7.1078  
  7.1079 -    const int srcsize = cvt->len_cvt;
  7.1080      const int dstsize = cvt->len_cvt * 4;
  7.1081      Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 6;
  7.1082      const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 6;
  7.1083 @@ -12963,7 +12828,6 @@
  7.1084      fprintf(stderr, "Downsample (x4) AUDIO_S32LSB, 6 channels.\n");
  7.1085  #endif
  7.1086  
  7.1087 -    const int srcsize = cvt->len_cvt;
  7.1088      const int dstsize = cvt->len_cvt / 4;
  7.1089      Sint32 *dst = (Sint32 *) cvt->buf;
  7.1090      const Sint32 *src = (Sint32 *) cvt->buf;
  7.1091 @@ -13010,7 +12874,6 @@
  7.1092      fprintf(stderr, "Upsample (x2) AUDIO_S32LSB, 8 channels.\n");
  7.1093  #endif
  7.1094  
  7.1095 -    const int srcsize = cvt->len_cvt;
  7.1096      const int dstsize = cvt->len_cvt * 2;
  7.1097      Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 8;
  7.1098      const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 8;
  7.1099 @@ -13073,7 +12936,6 @@
  7.1100      fprintf(stderr, "Downsample (x2) AUDIO_S32LSB, 8 channels.\n");
  7.1101  #endif
  7.1102  
  7.1103 -    const int srcsize = cvt->len_cvt;
  7.1104      const int dstsize = cvt->len_cvt / 2;
  7.1105      Sint32 *dst = (Sint32 *) cvt->buf;
  7.1106      const Sint32 *src = (Sint32 *) cvt->buf;
  7.1107 @@ -13128,7 +12990,6 @@
  7.1108      fprintf(stderr, "Upsample (x4) AUDIO_S32LSB, 8 channels.\n");
  7.1109  #endif
  7.1110  
  7.1111 -    const int srcsize = cvt->len_cvt;
  7.1112      const int dstsize = cvt->len_cvt * 4;
  7.1113      Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 8;
  7.1114      const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 8;
  7.1115 @@ -13207,7 +13068,6 @@
  7.1116      fprintf(stderr, "Downsample (x4) AUDIO_S32LSB, 8 channels.\n");
  7.1117  #endif
  7.1118  
  7.1119 -    const int srcsize = cvt->len_cvt;
  7.1120      const int dstsize = cvt->len_cvt / 4;
  7.1121      Sint32 *dst = (Sint32 *) cvt->buf;
  7.1122      const Sint32 *src = (Sint32 *) cvt->buf;
  7.1123 @@ -13262,7 +13122,6 @@
  7.1124      fprintf(stderr, "Upsample (x2) AUDIO_S32MSB, 1 channels.\n");
  7.1125  #endif
  7.1126  
  7.1127 -    const int srcsize = cvt->len_cvt;
  7.1128      const int dstsize = cvt->len_cvt * 2;
  7.1129      Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 1;
  7.1130      const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1;
  7.1131 @@ -13290,7 +13149,6 @@
  7.1132      fprintf(stderr, "Downsample (x2) AUDIO_S32MSB, 1 channels.\n");
  7.1133  #endif
  7.1134  
  7.1135 -    const int srcsize = cvt->len_cvt;
  7.1136      const int dstsize = cvt->len_cvt / 2;
  7.1137      Sint32 *dst = (Sint32 *) cvt->buf;
  7.1138      const Sint32 *src = (Sint32 *) cvt->buf;
  7.1139 @@ -13317,7 +13175,6 @@
  7.1140      fprintf(stderr, "Upsample (x4) AUDIO_S32MSB, 1 channels.\n");
  7.1141  #endif
  7.1142  
  7.1143 -    const int srcsize = cvt->len_cvt;
  7.1144      const int dstsize = cvt->len_cvt * 4;
  7.1145      Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 1;
  7.1146      const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1;
  7.1147 @@ -13347,7 +13204,6 @@
  7.1148      fprintf(stderr, "Downsample (x4) AUDIO_S32MSB, 1 channels.\n");
  7.1149  #endif
  7.1150  
  7.1151 -    const int srcsize = cvt->len_cvt;
  7.1152      const int dstsize = cvt->len_cvt / 4;
  7.1153      Sint32 *dst = (Sint32 *) cvt->buf;
  7.1154      const Sint32 *src = (Sint32 *) cvt->buf;
  7.1155 @@ -13374,7 +13230,6 @@
  7.1156      fprintf(stderr, "Upsample (x2) AUDIO_S32MSB, 2 channels.\n");
  7.1157  #endif
  7.1158  
  7.1159 -    const int srcsize = cvt->len_cvt;
  7.1160      const int dstsize = cvt->len_cvt * 2;
  7.1161      Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 2;
  7.1162      const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 2;
  7.1163 @@ -13407,7 +13262,6 @@
  7.1164      fprintf(stderr, "Downsample (x2) AUDIO_S32MSB, 2 channels.\n");
  7.1165  #endif
  7.1166  
  7.1167 -    const int srcsize = cvt->len_cvt;
  7.1168      const int dstsize = cvt->len_cvt / 2;
  7.1169      Sint32 *dst = (Sint32 *) cvt->buf;
  7.1170      const Sint32 *src = (Sint32 *) cvt->buf;
  7.1171 @@ -13438,7 +13292,6 @@
  7.1172      fprintf(stderr, "Upsample (x4) AUDIO_S32MSB, 2 channels.\n");
  7.1173  #endif
  7.1174  
  7.1175 -    const int srcsize = cvt->len_cvt;
  7.1176      const int dstsize = cvt->len_cvt * 4;
  7.1177      Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 2;
  7.1178      const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 2;
  7.1179 @@ -13475,7 +13328,6 @@
  7.1180      fprintf(stderr, "Downsample (x4) AUDIO_S32MSB, 2 channels.\n");
  7.1181  #endif
  7.1182  
  7.1183 -    const int srcsize = cvt->len_cvt;
  7.1184      const int dstsize = cvt->len_cvt / 4;
  7.1185      Sint32 *dst = (Sint32 *) cvt->buf;
  7.1186      const Sint32 *src = (Sint32 *) cvt->buf;
  7.1187 @@ -13506,7 +13358,6 @@
  7.1188      fprintf(stderr, "Upsample (x2) AUDIO_S32MSB, 4 channels.\n");
  7.1189  #endif
  7.1190  
  7.1191 -    const int srcsize = cvt->len_cvt;
  7.1192      const int dstsize = cvt->len_cvt * 2;
  7.1193      Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 4;
  7.1194      const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 4;
  7.1195 @@ -13549,7 +13400,6 @@
  7.1196      fprintf(stderr, "Downsample (x2) AUDIO_S32MSB, 4 channels.\n");
  7.1197  #endif
  7.1198  
  7.1199 -    const int srcsize = cvt->len_cvt;
  7.1200      const int dstsize = cvt->len_cvt / 2;
  7.1201      Sint32 *dst = (Sint32 *) cvt->buf;
  7.1202      const Sint32 *src = (Sint32 *) cvt->buf;
  7.1203 @@ -13588,7 +13438,6 @@
  7.1204      fprintf(stderr, "Upsample (x4) AUDIO_S32MSB, 4 channels.\n");
  7.1205  #endif
  7.1206  
  7.1207 -    const int srcsize = cvt->len_cvt;
  7.1208      const int dstsize = cvt->len_cvt * 4;
  7.1209      Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 4;
  7.1210      const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 4;
  7.1211 @@ -13639,7 +13488,6 @@
  7.1212      fprintf(stderr, "Downsample (x4) AUDIO_S32MSB, 4 channels.\n");
  7.1213  #endif
  7.1214  
  7.1215 -    const int srcsize = cvt->len_cvt;
  7.1216      const int dstsize = cvt->len_cvt / 4;
  7.1217      Sint32 *dst = (Sint32 *) cvt->buf;
  7.1218      const Sint32 *src = (Sint32 *) cvt->buf;
  7.1219 @@ -13678,7 +13526,6 @@
  7.1220      fprintf(stderr, "Upsample (x2) AUDIO_S32MSB, 6 channels.\n");
  7.1221  #endif
  7.1222  
  7.1223 -    const int srcsize = cvt->len_cvt;
  7.1224      const int dstsize = cvt->len_cvt * 2;
  7.1225      Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 6;
  7.1226      const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 6;
  7.1227 @@ -13731,7 +13578,6 @@
  7.1228      fprintf(stderr, "Downsample (x2) AUDIO_S32MSB, 6 channels.\n");
  7.1229  #endif
  7.1230  
  7.1231 -    const int srcsize = cvt->len_cvt;
  7.1232      const int dstsize = cvt->len_cvt / 2;
  7.1233      Sint32 *dst = (Sint32 *) cvt->buf;
  7.1234      const Sint32 *src = (Sint32 *) cvt->buf;
  7.1235 @@ -13778,7 +13624,6 @@
  7.1236      fprintf(stderr, "Upsample (x4) AUDIO_S32MSB, 6 channels.\n");
  7.1237  #endif
  7.1238  
  7.1239 -    const int srcsize = cvt->len_cvt;
  7.1240      const int dstsize = cvt->len_cvt * 4;
  7.1241      Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 6;
  7.1242      const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 6;
  7.1243 @@ -13843,7 +13688,6 @@
  7.1244      fprintf(stderr, "Downsample (x4) AUDIO_S32MSB, 6 channels.\n");
  7.1245  #endif
  7.1246  
  7.1247 -    const int srcsize = cvt->len_cvt;
  7.1248      const int dstsize = cvt->len_cvt / 4;
  7.1249      Sint32 *dst = (Sint32 *) cvt->buf;
  7.1250      const Sint32 *src = (Sint32 *) cvt->buf;
  7.1251 @@ -13890,7 +13734,6 @@
  7.1252      fprintf(stderr, "Upsample (x2) AUDIO_S32MSB, 8 channels.\n");
  7.1253  #endif
  7.1254  
  7.1255 -    const int srcsize = cvt->len_cvt;
  7.1256      const int dstsize = cvt->len_cvt * 2;
  7.1257      Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 8;
  7.1258      const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 8;
  7.1259 @@ -13953,7 +13796,6 @@
  7.1260      fprintf(stderr, "Downsample (x2) AUDIO_S32MSB, 8 channels.\n");
  7.1261  #endif
  7.1262  
  7.1263 -    const int srcsize = cvt->len_cvt;
  7.1264      const int dstsize = cvt->len_cvt / 2;
  7.1265      Sint32 *dst = (Sint32 *) cvt->buf;
  7.1266      const Sint32 *src = (Sint32 *) cvt->buf;
  7.1267 @@ -14008,7 +13850,6 @@
  7.1268      fprintf(stderr, "Upsample (x4) AUDIO_S32MSB, 8 channels.\n");
  7.1269  #endif
  7.1270  
  7.1271 -    const int srcsize = cvt->len_cvt;
  7.1272      const int dstsize = cvt->len_cvt * 4;
  7.1273      Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 8;
  7.1274      const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 8;
  7.1275 @@ -14087,7 +13928,6 @@
  7.1276      fprintf(stderr, "Downsample (x4) AUDIO_S32MSB, 8 channels.\n");
  7.1277  #endif
  7.1278  
  7.1279 -    const int srcsize = cvt->len_cvt;
  7.1280      const int dstsize = cvt->len_cvt / 4;
  7.1281      Sint32 *dst = (Sint32 *) cvt->buf;
  7.1282      const Sint32 *src = (Sint32 *) cvt->buf;
  7.1283 @@ -14142,7 +13982,6 @@
  7.1284      fprintf(stderr, "Upsample (x2) AUDIO_F32LSB, 1 channels.\n");
  7.1285  #endif
  7.1286  
  7.1287 -    const int srcsize = cvt->len_cvt;
  7.1288      const int dstsize = cvt->len_cvt * 2;
  7.1289      float *dst = ((float *) (cvt->buf + dstsize)) - 1;
  7.1290      const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1;
  7.1291 @@ -14170,7 +14009,6 @@
  7.1292      fprintf(stderr, "Downsample (x2) AUDIO_F32LSB, 1 channels.\n");
  7.1293  #endif
  7.1294  
  7.1295 -    const int srcsize = cvt->len_cvt;
  7.1296      const int dstsize = cvt->len_cvt / 2;
  7.1297      float *dst = (float *) cvt->buf;
  7.1298      const float *src = (float *) cvt->buf;
  7.1299 @@ -14197,7 +14035,6 @@
  7.1300      fprintf(stderr, "Upsample (x4) AUDIO_F32LSB, 1 channels.\n");
  7.1301  #endif
  7.1302  
  7.1303 -    const int srcsize = cvt->len_cvt;
  7.1304      const int dstsize = cvt->len_cvt * 4;
  7.1305      float *dst = ((float *) (cvt->buf + dstsize)) - 1;
  7.1306      const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1;
  7.1307 @@ -14227,7 +14064,6 @@
  7.1308      fprintf(stderr, "Downsample (x4) AUDIO_F32LSB, 1 channels.\n");
  7.1309  #endif
  7.1310  
  7.1311 -    const int srcsize = cvt->len_cvt;
  7.1312      const int dstsize = cvt->len_cvt / 4;
  7.1313      float *dst = (float *) cvt->buf;
  7.1314      const float *src = (float *) cvt->buf;
  7.1315 @@ -14254,7 +14090,6 @@
  7.1316      fprintf(stderr, "Upsample (x2) AUDIO_F32LSB, 2 channels.\n");
  7.1317  #endif
  7.1318  
  7.1319 -    const int srcsize = cvt->len_cvt;
  7.1320      const int dstsize = cvt->len_cvt * 2;
  7.1321      float *dst = ((float *) (cvt->buf + dstsize)) - 2;
  7.1322      const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 2;
  7.1323 @@ -14287,7 +14122,6 @@
  7.1324      fprintf(stderr, "Downsample (x2) AUDIO_F32LSB, 2 channels.\n");
  7.1325  #endif
  7.1326  
  7.1327 -    const int srcsize = cvt->len_cvt;
  7.1328      const int dstsize = cvt->len_cvt / 2;
  7.1329      float *dst = (float *) cvt->buf;
  7.1330      const float *src = (float *) cvt->buf;
  7.1331 @@ -14318,7 +14152,6 @@
  7.1332      fprintf(stderr, "Upsample (x4) AUDIO_F32LSB, 2 channels.\n");
  7.1333  #endif
  7.1334  
  7.1335 -    const int srcsize = cvt->len_cvt;
  7.1336      const int dstsize = cvt->len_cvt * 4;
  7.1337      float *dst = ((float *) (cvt->buf + dstsize)) - 2;
  7.1338      const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 2;
  7.1339 @@ -14355,7 +14188,6 @@
  7.1340      fprintf(stderr, "Downsample (x4) AUDIO_F32LSB, 2 channels.\n");
  7.1341  #endif
  7.1342  
  7.1343 -    const int srcsize = cvt->len_cvt;
  7.1344      const int dstsize = cvt->len_cvt / 4;
  7.1345      float *dst = (float *) cvt->buf;
  7.1346      const float *src = (float *) cvt->buf;
  7.1347 @@ -14386,7 +14218,6 @@
  7.1348      fprintf(stderr, "Upsample (x2) AUDIO_F32LSB, 4 channels.\n");
  7.1349  #endif
  7.1350  
  7.1351 -    const int srcsize = cvt->len_cvt;
  7.1352      const int dstsize = cvt->len_cvt * 2;
  7.1353      float *dst = ((float *) (cvt->buf + dstsize)) - 4;
  7.1354      const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 4;
  7.1355 @@ -14429,7 +14260,6 @@
  7.1356      fprintf(stderr, "Downsample (x2) AUDIO_F32LSB, 4 channels.\n");
  7.1357  #endif
  7.1358  
  7.1359 -    const int srcsize = cvt->len_cvt;
  7.1360      const int dstsize = cvt->len_cvt / 2;
  7.1361      float *dst = (float *) cvt->buf;
  7.1362      const float *src = (float *) cvt->buf;
  7.1363 @@ -14468,7 +14298,6 @@
  7.1364      fprintf(stderr, "Upsample (x4) AUDIO_F32LSB, 4 channels.\n");
  7.1365  #endif
  7.1366  
  7.1367 -    const int srcsize = cvt->len_cvt;
  7.1368      const int dstsize = cvt->len_cvt * 4;
  7.1369      float *dst = ((float *) (cvt->buf + dstsize)) - 4;
  7.1370      const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 4;
  7.1371 @@ -14519,7 +14348,6 @@
  7.1372      fprintf(stderr, "Downsample (x4) AUDIO_F32LSB, 4 channels.\n");
  7.1373  #endif
  7.1374  
  7.1375 -    const int srcsize = cvt->len_cvt;
  7.1376      const int dstsize = cvt->len_cvt / 4;
  7.1377      float *dst = (float *) cvt->buf;
  7.1378      const float *src = (float *) cvt->buf;
  7.1379 @@ -14558,7 +14386,6 @@
  7.1380      fprintf(stderr, "Upsample (x2) AUDIO_F32LSB, 6 channels.\n");
  7.1381  #endif
  7.1382  
  7.1383 -    const int srcsize = cvt->len_cvt;
  7.1384      const int dstsize = cvt->len_cvt * 2;
  7.1385      float *dst = ((float *) (cvt->buf + dstsize)) - 6;
  7.1386      const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 6;
  7.1387 @@ -14611,7 +14438,6 @@
  7.1388      fprintf(stderr, "Downsample (x2) AUDIO_F32LSB, 6 channels.\n");
  7.1389  #endif
  7.1390  
  7.1391 -    const int srcsize = cvt->len_cvt;
  7.1392      const int dstsize = cvt->len_cvt / 2;
  7.1393      float *dst = (float *) cvt->buf;
  7.1394      const float *src = (float *) cvt->buf;
  7.1395 @@ -14658,7 +14484,6 @@
  7.1396      fprintf(stderr, "Upsample (x4) AUDIO_F32LSB, 6 channels.\n");
  7.1397  #endif
  7.1398  
  7.1399 -    const int srcsize = cvt->len_cvt;
  7.1400      const int dstsize = cvt->len_cvt * 4;
  7.1401      float *dst = ((float *) (cvt->buf + dstsize)) - 6;
  7.1402      const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 6;
  7.1403 @@ -14723,7 +14548,6 @@
  7.1404      fprintf(stderr, "Downsample (x4) AUDIO_F32LSB, 6 channels.\n");
  7.1405  #endif
  7.1406  
  7.1407 -    const int srcsize = cvt->len_cvt;
  7.1408      const int dstsize = cvt->len_cvt / 4;
  7.1409      float *dst = (float *) cvt->buf;
  7.1410      const float *src = (float *) cvt->buf;
  7.1411 @@ -14770,7 +14594,6 @@
  7.1412      fprintf(stderr, "Upsample (x2) AUDIO_F32LSB, 8 channels.\n");
  7.1413  #endif
  7.1414  
  7.1415 -    const int srcsize = cvt->len_cvt;
  7.1416      const int dstsize = cvt->len_cvt * 2;
  7.1417      float *dst = ((float *) (cvt->buf + dstsize)) - 8;
  7.1418      const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 8;
  7.1419 @@ -14833,7 +14656,6 @@
  7.1420      fprintf(stderr, "Downsample (x2) AUDIO_F32LSB, 8 channels.\n");
  7.1421  #endif
  7.1422  
  7.1423 -    const int srcsize = cvt->len_cvt;
  7.1424      const int dstsize = cvt->len_cvt / 2;
  7.1425      float *dst = (float *) cvt->buf;
  7.1426      const float *src = (float *) cvt->buf;
  7.1427 @@ -14888,7 +14710,6 @@
  7.1428      fprintf(stderr, "Upsample (x4) AUDIO_F32LSB, 8 channels.\n");
  7.1429  #endif
  7.1430  
  7.1431 -    const int srcsize = cvt->len_cvt;
  7.1432      const int dstsize = cvt->len_cvt * 4;
  7.1433      float *dst = ((float *) (cvt->buf + dstsize)) - 8;
  7.1434      const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 8;
  7.1435 @@ -14967,7 +14788,6 @@
  7.1436      fprintf(stderr, "Downsample (x4) AUDIO_F32LSB, 8 channels.\n");
  7.1437  #endif
  7.1438  
  7.1439 -    const int srcsize = cvt->len_cvt;
  7.1440      const int dstsize = cvt->len_cvt / 4;
  7.1441      float *dst = (float *) cvt->buf;
  7.1442      const float *src = (float *) cvt->buf;
  7.1443 @@ -15022,7 +14842,6 @@
  7.1444      fprintf(stderr, "Upsample (x2) AUDIO_F32MSB, 1 channels.\n");
  7.1445  #endif
  7.1446  
  7.1447 -    const int srcsize = cvt->len_cvt;
  7.1448      const int dstsize = cvt->len_cvt * 2;
  7.1449      float *dst = ((float *) (cvt->buf + dstsize)) - 1;
  7.1450      const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1;
  7.1451 @@ -15050,7 +14869,6 @@
  7.1452      fprintf(stderr, "Downsample (x2) AUDIO_F32MSB, 1 channels.\n");
  7.1453  #endif
  7.1454  
  7.1455 -    const int srcsize = cvt->len_cvt;
  7.1456      const int dstsize = cvt->len_cvt / 2;
  7.1457      float *dst = (float *) cvt->buf;
  7.1458      const float *src = (float *) cvt->buf;
  7.1459 @@ -15077,7 +14895,6 @@
  7.1460      fprintf(stderr, "Upsample (x4) AUDIO_F32MSB, 1 channels.\n");
  7.1461  #endif
  7.1462  
  7.1463 -    const int srcsize = cvt->len_cvt;
  7.1464      const int dstsize = cvt->len_cvt * 4;
  7.1465      float *dst = ((float *) (cvt->buf + dstsize)) - 1;
  7.1466      const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1;
  7.1467 @@ -15107,7 +14924,6 @@
  7.1468      fprintf(stderr, "Downsample (x4) AUDIO_F32MSB, 1 channels.\n");
  7.1469  #endif
  7.1470  
  7.1471 -    const int srcsize = cvt->len_cvt;
  7.1472      const int dstsize = cvt->len_cvt / 4;
  7.1473      float *dst = (float *) cvt->buf;
  7.1474      const float *src = (float *) cvt->buf;
  7.1475 @@ -15134,7 +14950,6 @@
  7.1476      fprintf(stderr, "Upsample (x2) AUDIO_F32MSB, 2 channels.\n");
  7.1477  #endif
  7.1478  
  7.1479 -    const int srcsize = cvt->len_cvt;
  7.1480      const int dstsize = cvt->len_cvt * 2;
  7.1481      float *dst = ((float *) (cvt->buf + dstsize)) - 2;
  7.1482      const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 2;
  7.1483 @@ -15167,7 +14982,6 @@
  7.1484      fprintf(stderr, "Downsample (x2) AUDIO_F32MSB, 2 channels.\n");
  7.1485  #endif
  7.1486  
  7.1487 -    const int srcsize = cvt->len_cvt;
  7.1488      const int dstsize = cvt->len_cvt / 2;
  7.1489      float *dst = (float *) cvt->buf;
  7.1490      const float *src = (float *) cvt->buf;
  7.1491 @@ -15198,7 +15012,6 @@
  7.1492      fprintf(stderr, "Upsample (x4) AUDIO_F32MSB, 2 channels.\n");
  7.1493  #endif
  7.1494  
  7.1495 -    const int srcsize = cvt->len_cvt;
  7.1496      const int dstsize = cvt->len_cvt * 4;
  7.1497      float *dst = ((float *) (cvt->buf + dstsize)) - 2;
  7.1498      const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 2;
  7.1499 @@ -15235,7 +15048,6 @@
  7.1500      fprintf(stderr, "Downsample (x4) AUDIO_F32MSB, 2 channels.\n");
  7.1501  #endif
  7.1502  
  7.1503 -    const int srcsize = cvt->len_cvt;
  7.1504      const int dstsize = cvt->len_cvt / 4;
  7.1505      float *dst = (float *) cvt->buf;
  7.1506      const float *src = (float *) cvt->buf;
  7.1507 @@ -15266,7 +15078,6 @@
  7.1508      fprintf(stderr, "Upsample (x2) AUDIO_F32MSB, 4 channels.\n");
  7.1509  #endif
  7.1510  
  7.1511 -    const int srcsize = cvt->len_cvt;
  7.1512      const int dstsize = cvt->len_cvt * 2;
  7.1513      float *dst = ((float *) (cvt->buf + dstsize)) - 4;
  7.1514      const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 4;
  7.1515 @@ -15309,7 +15120,6 @@
  7.1516      fprintf(stderr, "Downsample (x2) AUDIO_F32MSB, 4 channels.\n");
  7.1517  #endif
  7.1518  
  7.1519 -    const int srcsize = cvt->len_cvt;
  7.1520      const int dstsize = cvt->len_cvt / 2;
  7.1521      float *dst = (float *) cvt->buf;
  7.1522      const float *src = (float *) cvt->buf;
  7.1523 @@ -15348,7 +15158,6 @@
  7.1524      fprintf(stderr, "Upsample (x4) AUDIO_F32MSB, 4 channels.\n");
  7.1525  #endif
  7.1526  
  7.1527 -    const int srcsize = cvt->len_cvt;
  7.1528      const int dstsize = cvt->len_cvt * 4;
  7.1529      float *dst = ((float *) (cvt->buf + dstsize)) - 4;
  7.1530      const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 4;
  7.1531 @@ -15399,7 +15208,6 @@
  7.1532      fprintf(stderr, "Downsample (x4) AUDIO_F32MSB, 4 channels.\n");
  7.1533  #endif
  7.1534  
  7.1535 -    const int srcsize = cvt->len_cvt;
  7.1536      const int dstsize = cvt->len_cvt / 4;
  7.1537      float *dst = (float *) cvt->buf;
  7.1538      const float *src = (float *) cvt->buf;
  7.1539 @@ -15438,7 +15246,6 @@
  7.1540      fprintf(stderr, "Upsample (x2) AUDIO_F32MSB, 6 channels.\n");
  7.1541  #endif
  7.1542  
  7.1543 -    const int srcsize = cvt->len_cvt;
  7.1544      const int dstsize = cvt->len_cvt * 2;
  7.1545      float *dst = ((float *) (cvt->buf + dstsize)) - 6;
  7.1546      const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 6;
  7.1547 @@ -15491,7 +15298,6 @@
  7.1548      fprintf(stderr, "Downsample (x2) AUDIO_F32MSB, 6 channels.\n");
  7.1549  #endif
  7.1550  
  7.1551 -    const int srcsize = cvt->len_cvt;
  7.1552      const int dstsize = cvt->len_cvt / 2;
  7.1553      float *dst = (float *) cvt->buf;
  7.1554      const float *src = (float *) cvt->buf;
  7.1555 @@ -15538,7 +15344,6 @@
  7.1556      fprintf(stderr, "Upsample (x4) AUDIO_F32MSB, 6 channels.\n");
  7.1557  #endif
  7.1558  
  7.1559 -    const int srcsize = cvt->len_cvt;
  7.1560      const int dstsize = cvt->len_cvt * 4;
  7.1561      float *dst = ((float *) (cvt->buf + dstsize)) - 6;
  7.1562      const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 6;
  7.1563 @@ -15603,7 +15408,6 @@
  7.1564      fprintf(stderr, "Downsample (x4) AUDIO_F32MSB, 6 channels.\n");
  7.1565  #endif
  7.1566  
  7.1567 -    const int srcsize = cvt->len_cvt;
  7.1568      const int dstsize = cvt->len_cvt / 4;
  7.1569      float *dst = (float *) cvt->buf;
  7.1570      const float *src = (float *) cvt->buf;
  7.1571 @@ -15650,7 +15454,6 @@
  7.1572      fprintf(stderr, "Upsample (x2) AUDIO_F32MSB, 8 channels.\n");
  7.1573  #endif
  7.1574  
  7.1575 -    const int srcsize = cvt->len_cvt;
  7.1576      const int dstsize = cvt->len_cvt * 2;
  7.1577      float *dst = ((float *) (cvt->buf + dstsize)) - 8;
  7.1578      const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 8;
  7.1579 @@ -15713,7 +15516,6 @@
  7.1580      fprintf(stderr, "Downsample (x2) AUDIO_F32MSB, 8 channels.\n");
  7.1581  #endif
  7.1582  
  7.1583 -    const int srcsize = cvt->len_cvt;
  7.1584      const int dstsize = cvt->len_cvt / 2;
  7.1585      float *dst = (float *) cvt->buf;
  7.1586      const float *src = (float *) cvt->buf;
  7.1587 @@ -15768,7 +15570,6 @@
  7.1588      fprintf(stderr, "Upsample (x4) AUDIO_F32MSB, 8 channels.\n");
  7.1589  #endif
  7.1590  
  7.1591 -    const int srcsize = cvt->len_cvt;
  7.1592      const int dstsize = cvt->len_cvt * 4;
  7.1593      float *dst = ((float *) (cvt->buf + dstsize)) - 8;
  7.1594      const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 8;
  7.1595 @@ -15847,7 +15648,6 @@
  7.1596      fprintf(stderr, "Downsample (x4) AUDIO_F32MSB, 8 channels.\n");
  7.1597  #endif
  7.1598  
  7.1599 -    const int srcsize = cvt->len_cvt;
  7.1600      const int dstsize = cvt->len_cvt / 4;
  7.1601      float *dst = (float *) cvt->buf;
  7.1602      const float *src = (float *) cvt->buf;
     8.1 --- a/src/audio/sdlgenaudiocvt.pl	Sun Oct 09 22:00:20 2011 +0200
     8.2 +++ b/src/audio/sdlgenaudiocvt.pl	Tue Oct 18 00:58:22 2011 -0400
     8.3 @@ -38,7 +38,7 @@
     8.4  /* DO NOT EDIT!  This file is generated by sdlgenaudiocvt.pl */
     8.5  /*
     8.6    Simple DirectMedia Layer
     8.7 -  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
     8.8 +  Copyright (C) 1997-2011 Sam Lantinga <slouken\@libsdl.org>
     8.9  
    8.10    This software is provided 'as-is', without any express or implied
    8.11    warranty.  In no event will the authors be held liable for any damages
    8.12 @@ -536,7 +536,6 @@
    8.13      fprintf(stderr, "$resample (x${multiple}) AUDIO_${from}, ${channels} channels.\\n");
    8.14  #endif
    8.15  
    8.16 -    const int srcsize = cvt->len_cvt;
    8.17      const int dstsize = cvt->len_cvt $lencvtop $multiple;
    8.18  EOF
    8.19  
     9.1 --- a/src/core/android/SDL_android.cpp	Sun Oct 09 22:00:20 2011 +0200
     9.2 +++ b/src/core/android/SDL_android.cpp	Tue Oct 18 00:58:22 2011 -0400
     9.3 @@ -29,6 +29,14 @@
     9.4  #include "../../video/android/SDL_androidtouch.h"
     9.5  #include "../../video/android/SDL_androidvideo.h"
     9.6  
     9.7 +#include <android/log.h>
     9.8 +#define LOG_TAG "SDL_android"
     9.9 +//#define LOGI(...)  __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)
    9.10 +//#define LOGE(...)  __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__)
    9.11 +#define LOGI(...) do {} while (false)
    9.12 +#define LOGE(...) do {} while (false)
    9.13 +
    9.14 +
    9.15  /* Impelemented in audio/android/SDL_androidaudio.c */
    9.16  extern void Android_RunAudioThread();
    9.17  } // C
    9.18 @@ -45,6 +53,7 @@
    9.19  *******************************************************************************/
    9.20  static JNIEnv* mEnv = NULL;
    9.21  static JNIEnv* mAudioEnv = NULL;
    9.22 +static JavaVM* mJavaVM;
    9.23  
    9.24  // Main activity
    9.25  static jclass mActivityClass;
    9.26 @@ -68,6 +77,14 @@
    9.27  // Library init
    9.28  extern "C" jint JNI_OnLoad(JavaVM* vm, void* reserved)
    9.29  {
    9.30 +    JNIEnv *env;
    9.31 +    mJavaVM = vm;
    9.32 +    LOGI("JNI_OnLoad called");
    9.33 +    if (mJavaVM->GetEnv((void**) &env, JNI_VERSION_1_4) != JNI_OK) {
    9.34 +        LOGE("Failed to get the environment using GetEnv()");
    9.35 +        return -1;
    9.36 +    }
    9.37 +
    9.38      return JNI_VERSION_1_4;
    9.39  }
    9.40  
    9.41 @@ -96,6 +113,7 @@
    9.42         !midAudioWriteShortBuffer || !midAudioWriteByteBuffer || !midAudioQuit) {
    9.43          __android_log_print(ANDROID_LOG_WARN, "SDL", "SDL: Couldn't locate Java callbacks, check that they're named and typed correctly");
    9.44      }
    9.45 +    __android_log_print(ANDROID_LOG_INFO, "SDL", "SDL_Android_Init() finished!");
    9.46  }
    9.47  
    9.48  // Resize
    9.49 @@ -123,9 +141,10 @@
    9.50  // Touch
    9.51  extern "C" void Java_org_libsdl_app_SDLActivity_onNativeTouch(
    9.52                                      JNIEnv* env, jclass jcls,
    9.53 +                                    jint touch_device_id_in, jint pointer_finger_id_in,
    9.54                                      jint action, jfloat x, jfloat y, jfloat p)
    9.55  {
    9.56 -    Android_OnTouch(action, x, y, p);
    9.57 +    Android_OnTouch(touch_device_id_in, pointer_finger_id_in, action, x, y, p);
    9.58  }
    9.59  
    9.60  // Accelerometer
    9.61 @@ -203,29 +222,48 @@
    9.62  {
    9.63      int audioBufferFrames;
    9.64  
    9.65 +    int status;
    9.66 +    JNIEnv *env;
    9.67 +    static bool isAttached = false;    
    9.68 +    status = mJavaVM->GetEnv((void **) &env, JNI_VERSION_1_4);
    9.69 +    if(status < 0) {
    9.70 +        LOGE("callback_handler: failed to get JNI environment, assuming native thread");
    9.71 +        status = mJavaVM->AttachCurrentThread(&env, NULL);
    9.72 +        if(status < 0) {
    9.73 +            LOGE("callback_handler: failed to attach current thread");
    9.74 +            return 0;
    9.75 +        }
    9.76 +        isAttached = true;
    9.77 +    }
    9.78 +
    9.79 +    
    9.80      __android_log_print(ANDROID_LOG_VERBOSE, "SDL", "SDL audio: opening device");
    9.81      audioBuffer16Bit = is16Bit;
    9.82      audioBufferStereo = channelCount > 1;
    9.83  
    9.84 -    audioBuffer = mEnv->CallStaticObjectMethod(mActivityClass, midAudioInit, sampleRate, audioBuffer16Bit, audioBufferStereo, desiredBufferFrames);
    9.85 +    audioBuffer = env->CallStaticObjectMethod(mActivityClass, midAudioInit, sampleRate, audioBuffer16Bit, audioBufferStereo, desiredBufferFrames);
    9.86  
    9.87      if (audioBuffer == NULL) {
    9.88          __android_log_print(ANDROID_LOG_WARN, "SDL", "SDL audio: didn't get back a good audio buffer!");
    9.89          return 0;
    9.90      }
    9.91 -    audioBuffer = mEnv->NewGlobalRef(audioBuffer);
    9.92 +    audioBuffer = env->NewGlobalRef(audioBuffer);
    9.93  
    9.94      jboolean isCopy = JNI_FALSE;
    9.95      if (audioBuffer16Bit) {
    9.96 -        audioBufferPinned = mEnv->GetShortArrayElements((jshortArray)audioBuffer, &isCopy);
    9.97 -        audioBufferFrames = mEnv->GetArrayLength((jshortArray)audioBuffer);
    9.98 +        audioBufferPinned = env->GetShortArrayElements((jshortArray)audioBuffer, &isCopy);
    9.99 +        audioBufferFrames = env->GetArrayLength((jshortArray)audioBuffer);
   9.100      } else {
   9.101 -        audioBufferPinned = mEnv->GetByteArrayElements((jbyteArray)audioBuffer, &isCopy);
   9.102 -        audioBufferFrames = mEnv->GetArrayLength((jbyteArray)audioBuffer);
   9.103 +        audioBufferPinned = env->GetByteArrayElements((jbyteArray)audioBuffer, &isCopy);
   9.104 +        audioBufferFrames = env->GetArrayLength((jbyteArray)audioBuffer);
   9.105      }
   9.106      if (audioBufferStereo) {
   9.107          audioBufferFrames /= 2;
   9.108      }
   9.109 + 
   9.110 +    if (isAttached) {
   9.111 +        mJavaVM->DetachCurrentThread();
   9.112 +    }
   9.113  
   9.114      return audioBufferFrames;
   9.115  }
   9.116 @@ -250,13 +288,31 @@
   9.117  
   9.118  extern "C" void Android_JNI_CloseAudioDevice()
   9.119  {
   9.120 -    mEnv->CallStaticVoidMethod(mActivityClass, midAudioQuit); 
   9.121 +    int status;
   9.122 +    JNIEnv *env;
   9.123 +    static bool isAttached = false;    
   9.124 +    status = mJavaVM->GetEnv((void **) &env, JNI_VERSION_1_4);
   9.125 +    if(status < 0) {
   9.126 +        LOGE("callback_handler: failed to get JNI environment, assuming native thread");
   9.127 +        status = mJavaVM->AttachCurrentThread(&env, NULL);
   9.128 +        if(status < 0) {
   9.129 +            LOGE("callback_handler: failed to attach current thread");
   9.130 +            return;
   9.131 +        }
   9.132 +        isAttached = true;
   9.133 +    }
   9.134 +
   9.135 +    env->CallStaticVoidMethod(mActivityClass, midAudioQuit); 
   9.136  
   9.137      if (audioBuffer) {
   9.138 -        mEnv->DeleteGlobalRef(audioBuffer);
   9.139 +        env->DeleteGlobalRef(audioBuffer);
   9.140          audioBuffer = NULL;
   9.141          audioBufferPinned = NULL;
   9.142      }
   9.143 +
   9.144 +    if (isAttached) {
   9.145 +        mJavaVM->DetachCurrentThread();
   9.146 +    }
   9.147  }
   9.148  
   9.149  // Test for an exception and call SDL_SetError with its detail if one occurs
   9.150 @@ -345,11 +401,6 @@
   9.151      ctx->hidden.androidio.inputStream = inputStream;
   9.152      ctx->hidden.androidio.inputStreamRef = mEnv->NewGlobalRef(inputStream);
   9.153  
   9.154 -    // Store .skip id for seeking purposes
   9.155 -    mid = mEnv->GetMethodID(mEnv->GetObjectClass(inputStream),
   9.156 -            "skip", "(J)J");
   9.157 -    ctx->hidden.androidio.skipMethod = mid;
   9.158 -
   9.159      // Despite all the visible documentation on [Asset]InputStream claiming
   9.160      // that the .available() method is not guaranteed to return the entire file
   9.161      // size, comments in <sdk>/samples/<ver>/ApiDemos/src/com/example/ ...
   9.162 @@ -517,16 +568,24 @@
   9.163  
   9.164      long movement = newPosition - ctx->hidden.androidio.position;
   9.165      jobject inputStream = (jobject)ctx->hidden.androidio.inputStream;
   9.166 -    jmethodID skipMethod = (jmethodID)ctx->hidden.androidio.skipMethod;
   9.167  
   9.168      if (movement > 0) {
   9.169 +        unsigned char buffer[1024];
   9.170 +
   9.171          // The easy case where we're seeking forwards
   9.172          while (movement > 0) {
   9.173 -            // inputStream.skip(...);
   9.174 -            movement -= mEnv->CallLongMethod(inputStream, skipMethod, movement);
   9.175 -            if (Android_JNI_ExceptionOccurred()) {
   9.176 +            long amount = (long) sizeof (buffer);
   9.177 +            if (amount > movement) {
   9.178 +                amount = movement;
   9.179 +            }
   9.180 +            size_t result = Android_JNI_FileRead(ctx, buffer, 1, amount);
   9.181 +
   9.182 +            if (result <= 0) {
   9.183 +                // Failed to read/skip the required amount, so fail
   9.184                  return -1;
   9.185              }
   9.186 +
   9.187 +            movement -= result;
   9.188          }
   9.189      } else if (movement < 0) {
   9.190          // We can't seek backwards so we have to reopen the file and seek
    10.1 --- a/src/cpuinfo/SDL_cpuinfo.c	Sun Oct 09 22:00:20 2011 +0200
    10.2 +++ b/src/cpuinfo/SDL_cpuinfo.c	Tue Oct 18 00:58:22 2011 -0400
    10.3 @@ -384,6 +384,8 @@
    10.4      return SDL_CPUType;
    10.5  }
    10.6  
    10.7 +
    10.8 +#ifdef TEST_MAIN  /* !!! FIXME: only used for test at the moment. */
    10.9  static const char *
   10.10  SDL_GetCPUName(void)
   10.11  {
   10.12 @@ -455,6 +457,7 @@
   10.13      }
   10.14      return SDL_CPUName;
   10.15  }
   10.16 +#endif
   10.17  
   10.18  int
   10.19  SDL_GetCPUCacheLineSize(void)
    11.1 --- a/src/events/SDL_gesture.c	Sun Oct 09 22:00:20 2011 +0200
    11.2 +++ b/src/events/SDL_gesture.c	Tue Oct 18 00:58:22 2011 -0400
    11.3 @@ -390,10 +390,11 @@
    11.4  float dollarRecognize(const SDL_DollarPath *path,int *bestTempl,SDL_GestureTouch* touch) {
    11.5          
    11.6          SDL_FloatPoint points[DOLLARNPOINTS];
    11.7 -        int numPoints = dollarNormalize(path,points);
    11.8          int i;
    11.9          float bestDiff = 10000;
   11.10  
   11.11 +        dollarNormalize(path,points);
   11.12 +
   11.13          //PrintPath(points);
   11.14          *bestTempl = -1;
   11.15          for(i = 0;i < touch->numDollarTemplates;i++) {
    12.1 --- a/src/events/SDL_mouse.c	Sun Oct 09 22:00:20 2011 +0200
    12.2 +++ b/src/events/SDL_mouse.c	Tue Oct 18 00:58:22 2011 -0400
    12.3 @@ -349,7 +349,6 @@
    12.4  SDL_CreateCursor(const Uint8 * data, const Uint8 * mask,
    12.5                   int w, int h, int hot_x, int hot_y)
    12.6  {
    12.7 -    SDL_Mouse *mouse = SDL_GetMouse();
    12.8      SDL_Surface *surface;
    12.9      SDL_Cursor *cursor;
   12.10      int x, y;
    13.1 --- a/src/power/linux/SDL_syspower.c	Sun Oct 09 22:00:20 2011 +0200
    13.2 +++ b/src/power/linux/SDL_syspower.c	Tue Oct 18 00:58:22 2011 -0400
    13.3 @@ -128,7 +128,6 @@
    13.4      char *val = NULL;
    13.5      SDL_bool charge = SDL_FALSE;
    13.6      SDL_bool choose = SDL_FALSE;
    13.7 -    SDL_bool is_ac = SDL_FALSE;
    13.8      int maximum = -1;
    13.9      int remaining = -1;
   13.10      int secs = -1;
   13.11 @@ -214,13 +213,6 @@
   13.12      char *ptr = NULL;
   13.13      char *key = NULL;
   13.14      char *val = NULL;
   13.15 -    SDL_bool charge = SDL_FALSE;
   13.16 -    SDL_bool choose = SDL_FALSE;
   13.17 -    SDL_bool is_ac = SDL_FALSE;
   13.18 -    int maximum = -1;
   13.19 -    int remaining = -1;
   13.20 -    int secs = -1;
   13.21 -    int pct = -1;
   13.22  
   13.23      if (!load_acpi_file(base, node, "state", state, sizeof (state))) {
   13.24          return;
    14.1 --- a/src/render/opengl/SDL_render_gl.c	Sun Oct 09 22:00:20 2011 +0200
    14.2 +++ b/src/render/opengl/SDL_render_gl.c	Tue Oct 18 00:58:22 2011 -0400
    14.3 @@ -348,8 +348,6 @@
    14.4  static void
    14.5  GL_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event)
    14.6  {
    14.7 -    GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
    14.8 -
    14.9      if (event->event == SDL_WINDOWEVENT_SIZE_CHANGED) {
   14.10          /* Rebind the context to the window area and update matrices */
   14.11          SDL_CurrentContext = NULL;
    15.1 --- a/src/render/software/SDL_blendline.c	Sun Oct 09 22:00:20 2011 +0200
    15.2 +++ b/src/render/software/SDL_blendline.c	Tue Oct 18 00:58:22 2011 -0400
    15.3 @@ -124,7 +124,6 @@
    15.4                       SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a,
    15.5                       SDL_bool draw_end)
    15.6  {
    15.7 -    const SDL_PixelFormat *fmt = dst->format;
    15.8      unsigned r, g, b, a, inva;
    15.9  
   15.10      if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) {
   15.11 @@ -216,7 +215,6 @@
   15.12                       SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a,
   15.13                       SDL_bool draw_end)
   15.14  {
   15.15 -    const SDL_PixelFormat *fmt = dst->format;
   15.16      unsigned r, g, b, a, inva;
   15.17  
   15.18      if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) {
   15.19 @@ -492,7 +490,6 @@
   15.20                       SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a,
   15.21                       SDL_bool draw_end)
   15.22  {
   15.23 -    const SDL_PixelFormat *fmt = dst->format;
   15.24      unsigned r, g, b, a, inva;
   15.25  
   15.26      if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) {
   15.27 @@ -584,7 +581,6 @@
   15.28                         SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a,
   15.29                         SDL_bool draw_end)
   15.30  {
   15.31 -    const SDL_PixelFormat *fmt = dst->format;
   15.32      unsigned r, g, b, a, inva;
   15.33  
   15.34      if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) {
    16.1 --- a/src/render/software/SDL_draw.h	Sun Oct 09 22:00:20 2011 +0200
    16.2 +++ b/src/render/software/SDL_draw.h	Tue Oct 18 00:58:22 2011 -0400
    16.3 @@ -45,13 +45,13 @@
    16.4  
    16.5  #define DRAW_SETPIXEL(setpixel) \
    16.6  do { \
    16.7 -    unsigned sr = r, sg = g, sb = b, sa = a; \
    16.8 +    unsigned sr = r, sg = g, sb = b, sa = a; (void) sa; \
    16.9      setpixel; \
   16.10  } while (0)
   16.11  
   16.12  #define DRAW_SETPIXEL_BLEND(getpixel, setpixel) \
   16.13  do { \
   16.14 -    unsigned sr, sg, sb, sa; sa; \
   16.15 +    unsigned sr, sg, sb, sa; (void) sa; \
   16.16      getpixel; \
   16.17      sr = DRAW_MUL(inva, sr) + r; \
   16.18      sg = DRAW_MUL(inva, sg) + g; \
   16.19 @@ -61,7 +61,7 @@
   16.20  
   16.21  #define DRAW_SETPIXEL_ADD(getpixel, setpixel) \
   16.22  do { \
   16.23 -    unsigned sr, sg, sb, sa; sa; \
   16.24 +    unsigned sr, sg, sb, sa; (void) sa; \
   16.25      getpixel; \
   16.26      sr += r; if (sr > 0xff) sr = 0xff; \
   16.27      sg += g; if (sg > 0xff) sg = 0xff; \
   16.28 @@ -71,7 +71,7 @@
   16.29  
   16.30  #define DRAW_SETPIXEL_MOD(getpixel, setpixel) \
   16.31  do { \
   16.32 -    unsigned sr, sg, sb, sa; sa; \
   16.33 +    unsigned sr, sg, sb, sa; (void) sa; \
   16.34      getpixel; \
   16.35      sr = DRAW_MUL(sr, r); \
   16.36      sg = DRAW_MUL(sg, g); \
    17.1 --- a/src/thread/beos/SDL_systhread.c	Sun Oct 09 22:00:20 2011 +0200
    17.2 +++ b/src/thread/beos/SDL_systhread.c	Tue Oct 18 00:58:22 2011 -0400
    17.3 @@ -66,8 +66,9 @@
    17.4  SDL_SYS_CreateThread(SDL_Thread * thread, void *args)
    17.5  {
    17.6      /* The docs say the thread name can't be longer than B_OS_NAME_LENGTH. */
    17.7 +    const char *threadname = thread->name ? thread->name : "SDL Thread";
    17.8      char name[B_OS_NAME_LENGTH];
    17.9 -    SDL_snprintf(name, sizeof (name), "%s", thread->name);
   17.10 +    SDL_snprintf(name, sizeof (name), "%s", threadname);
   17.11      name[sizeof (name) - 1] = '\0';
   17.12  
   17.13      /* Create the thread and go! */
    18.1 --- a/src/thread/pthread/SDL_syssem.c	Sun Oct 09 22:00:20 2011 +0200
    18.2 +++ b/src/thread/pthread/SDL_syssem.c	Tue Oct 18 00:58:22 2011 -0400
    18.3 @@ -23,6 +23,7 @@
    18.4  #include <errno.h>
    18.5  #include <pthread.h>
    18.6  #include <semaphore.h>
    18.7 +#include <sys/time.h>
    18.8  
    18.9  #include "SDL_thread.h"
   18.10  #include "SDL_timer.h"
    19.1 --- a/src/thread/pthread/SDL_systhread.c	Sun Oct 09 22:00:20 2011 +0200
    19.2 +++ b/src/thread/pthread/SDL_systhread.c	Tue Oct 18 00:58:22 2011 -0400
    19.3 @@ -18,6 +18,7 @@
    19.4       misrepresented as being the original software.
    19.5    3. This notice may not be removed or altered from any source distribution.
    19.6  */
    19.7 +
    19.8  #include "SDL_config.h"
    19.9  
   19.10  #include <pthread.h>
   19.11 @@ -31,6 +32,8 @@
   19.12  #include <sys/time.h>
   19.13  #include <sys/resource.h>
   19.14  #include <sys/syscall.h>
   19.15 +#include <unistd.h>
   19.16 +extern int pthread_setname_np (pthread_t __target_thread, __const char *__name) __THROW __nonnull ((2));
   19.17  #endif
   19.18  
   19.19  #include "SDL_platform.h"
   19.20 @@ -79,14 +82,16 @@
   19.21      int i;
   19.22      sigset_t mask;
   19.23  
   19.24 +    if (name != NULL) {
   19.25  #if ( (__MACOSX__ && (MAC_OS_X_VERSION_MAX_ALLOWED >= 1060)) || \
   19.26        (__IPHONEOS__ && (__IPHONE_OS_VERSION_MAX_ALLOWED >= 30200)) )
   19.27 -    if (pthread_setname_np != NULL) { pthread_setname_np(name); }
   19.28 +        if (pthread_setname_np != NULL) { pthread_setname_np(name); }
   19.29  #elif HAVE_PTHREAD_SETNAME_NP
   19.30 -    pthread_setname_np(pthread_self(), name);
   19.31 +        pthread_setname_np(pthread_self(), name);
   19.32  #elif HAVE_PTHREAD_SET_NAME_NP
   19.33 -    pthread_set_name_np(pthread_self(), name);
   19.34 +        pthread_set_name_np(pthread_self(), name);
   19.35  #endif
   19.36 +    }
   19.37  
   19.38      /* Mask asynchronous signals for this thread */
   19.39      sigemptyset(&mask);
    20.1 --- a/src/thread/windows/SDL_systhread.c	Sun Oct 09 22:00:20 2011 +0200
    20.2 +++ b/src/thread/windows/SDL_systhread.c	Tue Oct 18 00:58:22 2011 -0400
    20.3 @@ -161,25 +161,27 @@
    20.4  void
    20.5  SDL_SYS_SetupThread(const char *name)
    20.6  {
    20.7 -#if 0  /* !!! FIXME: __except needs C runtime, which we don't link against. */
    20.8 -#ifdef _MSC_VER  /* !!! FIXME: can we do SEH on other compilers yet? */
    20.9 -    /* This magic tells the debugger to name a thread if it's listening. */
   20.10 -    THREADNAME_INFO inf;
   20.11 -    inf.dwType = 0x1000;
   20.12 -    inf.szName = name;
   20.13 -    inf.dwThreadID = (DWORD) -1;
   20.14 -    inf.dwFlags = 0;
   20.15 +    if (name != NULL) {
   20.16 +        #if 0  /* !!! FIXME: __except needs C runtime, which we don't link against. */
   20.17 +        #ifdef _MSC_VER  /* !!! FIXME: can we do SEH on other compilers yet? */
   20.18 +        /* This magic tells the debugger to name a thread if it's listening. */
   20.19 +        THREADNAME_INFO inf;
   20.20 +        inf.dwType = 0x1000;
   20.21 +        inf.szName = name;
   20.22 +        inf.dwThreadID = (DWORD) -1;
   20.23 +        inf.dwFlags = 0;
   20.24  
   20.25 -    __try
   20.26 -    {
   20.27 -        RaiseException(0x406D1388, 0, sizeof(inf)/sizeof(DWORD), (DWORD*)&inf);
   20.28 +        __try
   20.29 +        {
   20.30 +            RaiseException(0x406D1388, 0, sizeof(inf)/sizeof(DWORD), (DWORD*)&inf);
   20.31 +        }
   20.32 +        __except(EXCEPTION_CONTINUE_EXECUTION)
   20.33 +        {
   20.34 +            /* The program itself should ignore this bogus exception. */
   20.35 +        }
   20.36 +        #endif
   20.37 +        #endif
   20.38      }
   20.39 -    __except(EXCEPTION_CONTINUE_EXECUTION)
   20.40 -    {
   20.41 -        /* The program itself should ignore this bogus exception. */
   20.42 -    }
   20.43 -#endif
   20.44 -#endif
   20.45  }
   20.46  
   20.47  SDL_threadID
    21.1 --- a/src/video/android/SDL_androidgl.c	Sun Oct 09 22:00:20 2011 +0200
    21.2 +++ b/src/video/android/SDL_androidgl.c	Tue Oct 18 00:58:22 2011 -0400
    21.3 @@ -29,26 +29,43 @@
    21.4  
    21.5  #include <android/log.h>
    21.6  
    21.7 +#include <dlfcn.h>
    21.8 +
    21.9 +static void* Android_GLHandle = NULL;
   21.10  
   21.11  /* GL functions */
   21.12  int
   21.13  Android_GL_LoadLibrary(_THIS, const char *path)
   21.14  {
   21.15 -    __android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_LoadLibrary\n");
   21.16 +    if (!Android_GLHandle) {
   21.17 +        Android_GLHandle = dlopen("libGLESv1_CM.so",RTLD_GLOBAL);
   21.18 +        if (!Android_GLHandle) {
   21.19 +            SDL_SetError("Could not initialize GL ES library\n");
   21.20 +            return -1;
   21.21 +        }
   21.22 +    }
   21.23      return 0;
   21.24  }
   21.25  
   21.26  void *
   21.27  Android_GL_GetProcAddress(_THIS, const char *proc)
   21.28  {
   21.29 -    __android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_GetProcAddress\n");
   21.30 -    return 0;
   21.31 +    /*
   21.32 +       !!! FIXME: this _should_ use eglGetProcAddress(), but it appears to be
   21.33 +       !!! FIXME:  busted on Android at the moment...
   21.34 +       !!! FIXME:  http://code.google.com/p/android/issues/detail?id=7681
   21.35 +       !!! FIXME: ...so revisit this later.  --ryan.
   21.36 +    */
   21.37 +    return dlsym(Android_GLHandle, proc);
   21.38  }
   21.39  
   21.40  void
   21.41  Android_GL_UnloadLibrary(_THIS)
   21.42  {
   21.43 -    __android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_UnloadLibrary\n");
   21.44 +    if(Android_GLHandle) {
   21.45 +        dlclose(Android_GLHandle);
   21.46 +        Android_GLHandle = NULL;
   21.47 +    }
   21.48  }
   21.49  
   21.50  SDL_GLContext
    22.1 --- a/src/video/android/SDL_androidtouch.c	Sun Oct 09 22:00:20 2011 +0200
    22.2 +++ b/src/video/android/SDL_androidtouch.c	Tue Oct 18 00:58:22 2011 -0400
    22.3 @@ -24,6 +24,7 @@
    22.4  
    22.5  #include "SDL_events.h"
    22.6  #include "../../events/SDL_mouse_c.h"
    22.7 +#include "../../events/SDL_touch_c.h"
    22.8  
    22.9  #include "SDL_androidtouch.h"
   22.10  
   22.11 @@ -33,27 +34,55 @@
   22.12  #define ACTION_MOVE 2
   22.13  #define ACTION_CANCEL 3
   22.14  #define ACTION_OUTSIDE 4
   22.15 +// The following two are deprecated but it seems they are still emitted (instead the corresponding ACTION_UP/DOWN) as of Android 3.2
   22.16 +#define ACTION_POINTER_1_DOWN 5
   22.17 +#define ACTION_POINTER_1_UP 6
   22.18  
   22.19 -void Android_OnTouch(int action, float x, float y, float p)
   22.20 +void Android_OnTouch(int touch_device_id_in, int pointer_finger_id_in, int action, float x, float y, float p) 
   22.21  {
   22.22 +    SDL_TouchID touchDeviceId = 0;
   22.23 +    SDL_FingerID fingerId = 0;
   22.24 +    
   22.25      if (!Android_Window) {
   22.26          return;
   22.27      }
   22.28 +    
   22.29 +    touchDeviceId = (SDL_TouchID)touch_device_id_in;
   22.30 +    if (!SDL_GetTouch(touchDeviceId)) {
   22.31 +        SDL_Touch touch;
   22.32 +        memset( &touch, 0, sizeof(touch) );
   22.33 +        touch.id = touchDeviceId;
   22.34 +        touch.x_min = 0.0f;
   22.35 +        touch.x_max = (float)Android_ScreenWidth;
   22.36 +        touch.native_xres = touch.x_max - touch.x_min;
   22.37 +        touch.y_min = 0.0f;
   22.38 +        touch.y_max = (float)Android_ScreenHeight;
   22.39 +        touch.native_yres = touch.y_max - touch.y_min;
   22.40 +        touch.pressure_min = 0.0f;
   22.41 +        touch.pressure_max = 1.0f;
   22.42 +        touch.native_pressureres = touch.pressure_max - touch.pressure_min;
   22.43 +        if (SDL_AddTouch(&touch, "") < 0) {
   22.44 +             SDL_Log("error: can't add touch %s, %d", __FILE__, __LINE__);
   22.45 +        }
   22.46 +    }
   22.47  
   22.48 -    if ((action != ACTION_CANCEL) && (action != ACTION_OUTSIDE)) {
   22.49 -        SDL_SetMouseFocus(Android_Window);
   22.50 -        SDL_SendMouseMotion(Android_Window, 0, (int)x, (int)y);
   22.51 -        switch(action) {
   22.52 +    
   22.53 +    fingerId = (SDL_FingerID)pointer_finger_id_in;
   22.54 +    switch (action) {
   22.55          case ACTION_DOWN:
   22.56 -            SDL_SendMouseButton(Android_Window, SDL_PRESSED, SDL_BUTTON_LEFT);
   22.57 +        case ACTION_POINTER_1_DOWN:
   22.58 +            SDL_SendFingerDown(touchDeviceId, fingerId, SDL_TRUE, x, y, p);
   22.59 +            break;
   22.60 +        case ACTION_MOVE:
   22.61 +            SDL_SendTouchMotion(touchDeviceId, fingerId, SDL_FALSE, x, y, p);
   22.62              break;
   22.63          case ACTION_UP:
   22.64 -            SDL_SendMouseButton(Android_Window, SDL_RELEASED, SDL_BUTTON_LEFT);
   22.65 +        case ACTION_POINTER_1_UP:
   22.66 +            SDL_SendFingerDown(touchDeviceId, fingerId, SDL_FALSE, x, y, p);
   22.67              break;
   22.68 -        }
   22.69 -    } else {
   22.70 -        SDL_SetMouseFocus(NULL);
   22.71 -    }
   22.72 +        default:
   22.73 +            break;
   22.74 +    } 
   22.75  }
   22.76  
   22.77  /* vi: set ts=4 sw=4 expandtab: */
    23.1 --- a/src/video/android/SDL_androidtouch.h	Sun Oct 09 22:00:20 2011 +0200
    23.2 +++ b/src/video/android/SDL_androidtouch.h	Tue Oct 18 00:58:22 2011 -0400
    23.3 @@ -22,6 +22,6 @@
    23.4  
    23.5  #include "SDL_androidvideo.h"
    23.6  
    23.7 -extern void Android_OnTouch(int action, float x, float y, float p);
    23.8 +extern void Android_OnTouch( int touch_device_id_in, int pointer_finger_id_in, int action, float x, float y, float p);
    23.9  
   23.10  /* vi: set ts=4 sw=4 expandtab: */
    24.1 --- a/src/video/uikit/SDL_uikitvideo.m	Sun Oct 09 22:00:20 2011 +0200
    24.2 +++ b/src/video/uikit/SDL_uikitvideo.m	Tue Oct 18 00:58:22 2011 -0400
    24.3 @@ -176,7 +176,8 @@
    24.4      mode.h = h;
    24.5      mode.refresh_rate = 0;
    24.6  
    24.7 -    [uimode retain];
    24.8 +    [uimode retain];  // once for the desktop_mode
    24.9 +    [uimode retain];  // once for the current_mode
   24.10      mode.driverdata = uimode;
   24.11  
   24.12      SDL_zero(display);
   24.13 @@ -248,13 +249,14 @@
   24.14          UIScreen *uiscreen = (UIScreen *) display->driverdata;
   24.15          [uiscreen release];
   24.16          display->driverdata = NULL;
   24.17 +        [((UIScreenMode *) display->desktop_mode.driverdata) release];
   24.18 +        display->desktop_mode.driverdata = NULL;
   24.19 +        [((UIScreenMode *) display->current_mode.driverdata) release];
   24.20 +        display->current_mode.driverdata = NULL;
   24.21          for (j = 0; j < display->num_display_modes; j++) {
   24.22              SDL_DisplayMode *mode = &display->display_modes[j];
   24.23 -            UIScreenMode *uimode = (UIScreenMode *) mode->driverdata;
   24.24 -            if (uimode) {
   24.25 -                [uimode release];
   24.26 -                mode->driverdata = NULL;
   24.27 -            }
   24.28 +            [((UIScreenMode *) mode->driverdata) release];
   24.29 +            mode->driverdata = NULL;
   24.30          }
   24.31      }
   24.32  }
    25.1 --- a/src/video/uikit/SDL_uikitwindow.m	Sun Oct 09 22:00:20 2011 +0200
    25.2 +++ b/src/video/uikit/SDL_uikitwindow.m	Tue Oct 18 00:58:22 2011 -0400
    25.3 @@ -151,8 +151,13 @@
    25.4              if (bestmode) {
    25.5                  UIScreenMode *uimode = (UIScreenMode *) bestmode->driverdata;
    25.6                  [uiscreen setCurrentMode:uimode];
    25.7 -                display->desktop_mode = *bestmode;
    25.8 +
    25.9 +                // desktop_mode doesn't change here (the higher level will
   25.10 +                //  use it to set all the screens back to their defaults
   25.11 +                //  upon window destruction, SDL_Quit(), etc.
   25.12 +                [((UIScreenMode *) display->current_mode.driverdata) release];
   25.13                  display->current_mode = *bestmode;
   25.14 +                [((UIScreenMode *) display->current_mode.driverdata) retain];
   25.15              }
   25.16          }
   25.17      }
    26.1 --- a/src/video/windows/SDL_windowswindow.c	Sun Oct 09 22:00:20 2011 +0200
    26.2 +++ b/src/video/windows/SDL_windowswindow.c	Tue Oct 18 00:58:22 2011 -0400
    26.3 @@ -88,6 +88,8 @@
    26.4      data->mouse_pressed = SDL_FALSE;
    26.5      data->videodata = videodata;
    26.6  
    26.7 +    window->driverdata = data;
    26.8 +
    26.9      /* Associate the data with the window */
   26.10      if (!SetProp(hwnd, TEXT("SDL_WindowData"), data)) {
   26.11          ReleaseDC(hwnd, data->hdc);
   26.12 @@ -183,7 +185,6 @@
   26.13      }
   26.14  
   26.15      /* All done! */
   26.16 -    window->driverdata = data;
   26.17      return 0;
   26.18  }
   26.19  
    27.1 --- a/src/video/x11/SDL_x11events.c	Sun Oct 09 22:00:20 2011 +0200
    27.2 +++ b/src/video/x11/SDL_x11events.c	Tue Oct 18 00:58:22 2011 -0400
    27.3 @@ -234,7 +234,6 @@
    27.4      case KeyPress:{
    27.5              KeyCode keycode = xevent.xkey.keycode;
    27.6              KeySym keysym = NoSymbol;
    27.7 -            SDL_Scancode scancode;
    27.8              char text[SDL_TEXTINPUTEVENT_TEXT_SIZE];
    27.9              Status status = 0;
   27.10  
   27.11 @@ -243,7 +242,7 @@
   27.12  #endif
   27.13              SDL_SendKeyboardKey(SDL_PRESSED, videodata->key_layout[keycode]);
   27.14  #if 1
   27.15 -            if (videodata->key_layout[keycode] == SDLK_UNKNOWN) {
   27.16 +            if (videodata->key_layout[keycode] == SDL_SCANCODE_UNKNOWN) {
   27.17                  int min_keycode, max_keycode;
   27.18                  XDisplayKeycodes(display, &min_keycode, &max_keycode);
   27.19                  keysym = XKeycodeToKeysym(display, keycode, 0);
   27.20 @@ -522,6 +521,11 @@
   27.21      return (0);
   27.22  }
   27.23  
   27.24 +
   27.25 +/* !!! FIXME: this should be exposed in a header, or something. */
   27.26 +int SDL_GetNumTouch(void);
   27.27 +
   27.28 +
   27.29  void
   27.30  X11_PumpEvents(_THIS)
   27.31  {
   27.32 @@ -545,7 +549,6 @@
   27.33  #ifdef SDL_INPUT_LINUXEV
   27.34      /* Process Touch events - TODO When X gets touch support, use that instead*/
   27.35      int i = 0,rd;
   27.36 -    char name[256];
   27.37      struct input_event ev[64];
   27.38      int size = sizeof (struct input_event);
   27.39  
    28.1 --- a/src/video/x11/SDL_x11framebuffer.c	Sun Oct 09 22:00:20 2011 +0200
    28.2 +++ b/src/video/x11/SDL_x11framebuffer.c	Tue Oct 18 00:58:22 2011 -0400
    28.3 @@ -183,7 +183,10 @@
    28.4                    rect->x, rect->y, rect->w, rect->h);
    28.5          }
    28.6      }
    28.7 +
    28.8      XSync(display, False);
    28.9 +
   28.10 +    return 0;
   28.11  }
   28.12  
   28.13  void
    29.1 --- a/src/video/x11/SDL_x11mouse.c	Sun Oct 09 22:00:20 2011 +0200
    29.2 +++ b/src/video/x11/SDL_x11mouse.c	Tue Oct 18 00:58:22 2011 -0400
    29.3 @@ -136,7 +136,7 @@
    29.4      /* Code below assumes ARGB pixel format */
    29.5      SDL_assert(surface->format->format == SDL_PIXELFORMAT_ARGB8888);
    29.6  
    29.7 -    rfg = gfg = bfg = rbg = gbg = bbg = fgBits = 0;
    29.8 +    rfg = gfg = bfg = rbg = gbg = bbg = fgBits = bgBits = 0;
    29.9      for (y = 0; y < surface->h; ++y) {
   29.10          ptr = (Uint32 *)((Uint8 *)surface->pixels + y * surface->pitch);
   29.11          for (x = 0; x < surface->w; ++x) {
    30.1 --- a/src/video/x11/SDL_x11opengl.c	Sun Oct 09 22:00:20 2011 +0200
    30.2 +++ b/src/video/x11/SDL_x11opengl.c	Tue Oct 18 00:58:22 2011 -0400
    30.3 @@ -19,8 +19,8 @@
    30.4    3. This notice may not be removed or altered from any source distribution.
    30.5  */
    30.6  #include "SDL_config.h"
    30.7 -
    30.8  #include "SDL_x11video.h"
    30.9 +#include "SDL_assert.h"
   30.10  
   30.11  /* GLX implementation of SDL OpenGL support */
   30.12  
   30.13 @@ -388,8 +388,10 @@
   30.14      XVisualInfo *vinfo;
   30.15  
   30.16      /* 64 seems nice. */
   30.17 -    int attribs[64];
   30.18 -    int i = X11_GL_GetAttributes(_this,display,screen,attribs,64);
   30.19 +    const int max_attrs = 64;
   30.20 +    int attribs[max_attrs];
   30.21 +    const int i = X11_GL_GetAttributes(_this,display,screen,attribs,max_attrs);
   30.22 +    SDL_assert(i <= max_attrs);
   30.23  
   30.24      vinfo = _this->gl_data->glXChooseVisual(display, screen, attribs);
   30.25      if (!vinfo) {
    31.1 --- a/src/video/x11/SDL_x11shape.c	Sun Oct 09 22:00:20 2011 +0200
    31.2 +++ b/src/video/x11/SDL_x11shape.c	Tue Oct 18 00:58:22 2011 -0400
    31.3 @@ -26,6 +26,7 @@
    31.4  #include "SDL_x11video.h"
    31.5  #include "SDL_x11shape.h"
    31.6  #include "SDL_x11window.h"
    31.7 +#include "../SDL_shape_internals.h"
    31.8  
    31.9  SDL_Window*
   31.10  X11_CreateShapedWindow(const char *title,unsigned int x,unsigned int y,unsigned int w,unsigned int h,Uint32 flags) {
    32.1 --- a/src/video/x11/SDL_x11sym.h	Sun Oct 09 22:00:20 2011 +0200
    32.2 +++ b/src/video/x11/SDL_x11sym.h	Tue Oct 18 00:58:22 2011 -0400
    32.3 @@ -178,17 +178,17 @@
    32.4  /* XCursor support */
    32.5  #if SDL_VIDEO_DRIVER_X11_XCURSOR
    32.6  SDL_X11_MODULE(XCURSOR)
    32.7 -SDL_X11_SYM(XcursorImage*,XcursorImageCreate,(int a,int b),(a,b),)
    32.8 +SDL_X11_SYM(XcursorImage*,XcursorImageCreate,(int a,int b),(a,b),return)
    32.9  SDL_X11_SYM(void,XcursorImageDestroy,(XcursorImage *a),(a),)
   32.10 -SDL_X11_SYM(Cursor,XcursorImageLoadCursor,(Display *a,const XcursorImage *b),(a,b),)
   32.11 +SDL_X11_SYM(Cursor,XcursorImageLoadCursor,(Display *a,const XcursorImage *b),(a,b),return)
   32.12  #endif
   32.13  
   32.14  /* Xinerama support */
   32.15  #if SDL_VIDEO_DRIVER_X11_XINERAMA
   32.16  SDL_X11_MODULE(XINERAMA)
   32.17 -SDL_X11_SYM(Bool,XineramaIsActive,(Display *a),(a),)
   32.18 -SDL_X11_SYM(Bool,XineramaQueryExtension,(Display *a,int *b,int *c),(a,b,c),)
   32.19 -SDL_X11_SYM(XineramaScreenInfo*,XineramaQueryScreens,(Display *a, int *b),(a,b),)
   32.20 +SDL_X11_SYM(Bool,XineramaIsActive,(Display *a),(a),return)
   32.21 +SDL_X11_SYM(Bool,XineramaQueryExtension,(Display *a,int *b,int *c),(a,b,c),return)
   32.22 +SDL_X11_SYM(XineramaScreenInfo*,XineramaQueryScreens,(Display *a, int *b),(a,b),return)
   32.23  #endif
   32.24  
   32.25  /* XInput support for multiple mice, tablets, etc. */
   32.26 @@ -229,12 +229,12 @@
   32.27  
   32.28  #if SDL_VIDEO_DRIVER_X11_XVIDMODE
   32.29  SDL_X11_MODULE(XVIDMODE)
   32.30 -SDL_X11_SYM(Bool,XF86VidModeGetAllModeLines,(Display *a,int b,int *c,XF86VidModeModeInfo ***d),(a,b,c,d),)
   32.31 -SDL_X11_SYM(Bool,XF86VidModeGetModeLine,(Display *a,int b,int *c,XF86VidModeModeLine *d),(a,b,c,d),)
   32.32 -SDL_X11_SYM(Bool,XF86VidModeGetViewPort,(Display *a,int b,int *c,int *d),(a,b,c,d),)
   32.33 -SDL_X11_SYM(Bool,XF86VidModeQueryExtension,(Display *a,int *b,int *c),(a,b,c),)
   32.34 -SDL_X11_SYM(Bool,XF86VidModeQueryVersion,(Display *a,int *b,int *c),(a,b,c),)
   32.35 -SDL_X11_SYM(Bool,XF86VidModeSwitchToMode,(Display *a,int b,XF86VidModeModeInfo *c),(a,b,c),)
   32.36 +SDL_X11_SYM(Bool,XF86VidModeGetAllModeLines,(Display *a,int b,int *c,XF86VidModeModeInfo ***d),(a,b,c,d),return)
   32.37 +SDL_X11_SYM(Bool,XF86VidModeGetModeLine,(Display *a,int b,int *c,XF86VidModeModeLine *d),(a,b,c,d),return)
   32.38 +SDL_X11_SYM(Bool,XF86VidModeGetViewPort,(Display *a,int b,int *c,int *d),(a,b,c,d),return)
   32.39 +SDL_X11_SYM(Bool,XF86VidModeQueryExtension,(Display *a,int *b,int *c),(a,b,c),return)
   32.40 +SDL_X11_SYM(Bool,XF86VidModeQueryVersion,(Display *a,int *b,int *c),(a,b,c),return)
   32.41 +SDL_X11_SYM(Bool,XF86VidModeSwitchToMode,(Display *a,int b,XF86VidModeModeInfo *c),(a,b,c),return)
   32.42  #endif
   32.43  
   32.44  /* *INDENT-ON* */
    33.1 --- a/src/video/x11/SDL_x11touch.c	Sun Oct 09 22:00:20 2011 +0200
    33.2 +++ b/src/video/x11/SDL_x11touch.c	Tue Oct 18 00:58:22 2011 -0400
    33.3 @@ -39,7 +39,6 @@
    33.4    FILE *fd;
    33.5    fd = fopen("/proc/bus/input/devices","r");
    33.6  
    33.7 -  char c;
    33.8    int i = 0;
    33.9    int tsfd;
   33.10    char line[256];
   33.11 @@ -111,7 +110,7 @@
   33.12      }
   33.13    }
   33.14  
   33.15 -  close(fd);
   33.16 +  fclose(fd);
   33.17  #endif
   33.18  }
   33.19  
    34.1 --- a/src/video/x11/SDL_x11window.c	Sun Oct 09 22:00:20 2011 +0200
    34.2 +++ b/src/video/x11/SDL_x11window.c	Tue Oct 18 00:58:22 2011 -0400
    34.3 @@ -86,31 +86,6 @@
    34.4      return count;
    34.5  }
    34.6  
    34.7 -static void
    34.8 -X11_GetDisplaySize(_THIS, SDL_Window * window, int *w, int *h)
    34.9 -{
   34.10 -    SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
   34.11 -    SDL_DisplayData *displaydata =
   34.12 -        (SDL_DisplayData *) SDL_GetDisplayForWindow(window)->driverdata;
   34.13 -    XWindowAttributes attr;
   34.14 -
   34.15 -    XGetWindowAttributes(data->display, RootWindow(data->display, displaydata->screen), &attr);
   34.16 -    if (window->flags & SDL_WINDOW_FULLSCREEN) {
   34.17 -        /* The bounds when this window is visible is the fullscreen mode */
   34.18 -        SDL_DisplayMode fullscreen_mode;
   34.19 -        if (SDL_GetWindowDisplayMode(window, &fullscreen_mode) == 0) {
   34.20 -            attr.width = fullscreen_mode.w;
   34.21 -            attr.height = fullscreen_mode.h;
   34.22 -        }
   34.23 -    }
   34.24 -    if (w) {
   34.25 -        *w = attr.width;
   34.26 -    }
   34.27 -    if (h) {
   34.28 -        *h = attr.height;
   34.29 -    }
   34.30 -}
   34.31 -
   34.32  static int
   34.33  SetupWindowData(_THIS, SDL_Window * window, Window w, BOOL created)
   34.34  {
   34.35 @@ -320,7 +295,6 @@
   34.36      xattr.border_pixel = 0;
   34.37  
   34.38      if (visual->class == DirectColor) {
   34.39 -        Status status;
   34.40          XColor *colorcells;
   34.41          int i;
   34.42          int ncolors;
   34.43 @@ -757,7 +731,6 @@
   34.44  {
   34.45      SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
   34.46      Display *display = data->videodata->display;
   34.47 -    int x, y;
   34.48  
   34.49      XMoveWindow(display, data->xwindow, window->x, window->y);
   34.50      XFlush(display);
   34.51 @@ -952,7 +925,7 @@
   34.52      int ncolors;
   34.53      int rmask, gmask, bmask;
   34.54      int rshift, gshift, bshift;
   34.55 -    int i, j;
   34.56 +    int i;
   34.57  
   34.58      if (visual->class != DirectColor) {
   34.59          SDL_SetError("Window doesn't have DirectColor visual");