From 88dab34ac12bf93cb583b48d53470721eb679431 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 11 Oct 2011 22:04:51 -0400 Subject: [PATCH 01/19] Enable -Wall by default. Fixes Bugzilla #1284. (But probably upsets buildbot. :) ) --- configure.in | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/configure.in b/configure.in index 09d11851b..8c0c3d967 100644 --- a/configure.in +++ b/configure.in @@ -939,6 +939,28 @@ CheckVisibilityHidden() fi } +dnl See if GCC's -Wall is supported. +CheckWarnAll() +{ + AC_MSG_CHECKING(for GCC -Wall option) + have_gcc_Wall=no + + save_CFLAGS="$CFLAGS" + CFLAGS="$save_CFLAGS -Wall" + AC_TRY_COMPILE([ + int x = 0; + ],[ + ],[ + have_gcc_Wall=yes + ]) + AC_MSG_RESULT($have_gcc_Wall) + CFLAGS="$save_CFLAGS" + + if test x$have_gcc_Wall = xyes; then + EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall" + fi +} + dnl Find the X11 include and library directories CheckX11() @@ -2356,6 +2378,9 @@ AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau ;; esac +dnl Do this on all platforms, after everything else. +CheckWarnAll + # Verify that we have all the platform specific files we need if test x$have_joystick != xyes; then From 0a99c98e86b09c123496a5e728d3636e6eb9f541 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 11 Oct 2011 22:34:52 -0400 Subject: [PATCH 02/19] Fixed perl string escaping thing. --- src/audio/sdlgenaudiocvt.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/audio/sdlgenaudiocvt.pl b/src/audio/sdlgenaudiocvt.pl index b574042e3..cea022f00 100755 --- a/src/audio/sdlgenaudiocvt.pl +++ b/src/audio/sdlgenaudiocvt.pl @@ -38,7 +38,7 @@ sub outputHeader { /* DO NOT EDIT! This file is generated by sdlgenaudiocvt.pl */ /* Simple DirectMedia Layer - Copyright (C) 1997-2011 Sam Lantinga + Copyright (C) 1997-2011 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages From bd5cf5489ec02b338b7eebf81b0922e4be5ed90a Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 11 Oct 2011 22:35:19 -0400 Subject: [PATCH 03/19] Fixed compiler warning for unused variable in generated C code. --- src/audio/sdlgenaudiocvt.pl | 1 - 1 file changed, 1 deletion(-) diff --git a/src/audio/sdlgenaudiocvt.pl b/src/audio/sdlgenaudiocvt.pl index cea022f00..0282a8adc 100755 --- a/src/audio/sdlgenaudiocvt.pl +++ b/src/audio/sdlgenaudiocvt.pl @@ -536,7 +536,6 @@ ${sym}(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "$resample (x${multiple}) AUDIO_${from}, ${channels} channels.\\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt $lencvtop $multiple; EOF From 73fbe0cd922d247655d91c3037c13b8346bcd7ac Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 11 Oct 2011 22:42:54 -0400 Subject: [PATCH 04/19] Commit updated generated C code. --- src/audio/SDL_audiotypecvt.c | 200 ----------------------------------- 1 file changed, 200 deletions(-) diff --git a/src/audio/SDL_audiotypecvt.c b/src/audio/SDL_audiotypecvt.c index 4370c81f2..1bf4143c2 100644 --- a/src/audio/SDL_audiotypecvt.c +++ b/src/audio/SDL_audiotypecvt.c @@ -7102,7 +7102,6 @@ SDL_Upsample_U8_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_U8, 1 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 1; const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 1; @@ -7130,7 +7129,6 @@ SDL_Downsample_U8_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_U8, 1 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; Uint8 *dst = (Uint8 *) cvt->buf; const Uint8 *src = (Uint8 *) cvt->buf; @@ -7157,7 +7155,6 @@ SDL_Upsample_U8_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_U8, 1 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 1; const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 1; @@ -7187,7 +7184,6 @@ SDL_Downsample_U8_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_U8, 1 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; Uint8 *dst = (Uint8 *) cvt->buf; const Uint8 *src = (Uint8 *) cvt->buf; @@ -7214,7 +7210,6 @@ SDL_Upsample_U8_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_U8, 2 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 2; const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 2; @@ -7247,7 +7242,6 @@ SDL_Downsample_U8_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_U8, 2 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; Uint8 *dst = (Uint8 *) cvt->buf; const Uint8 *src = (Uint8 *) cvt->buf; @@ -7278,7 +7272,6 @@ SDL_Upsample_U8_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_U8, 2 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 2; const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 2; @@ -7315,7 +7308,6 @@ SDL_Downsample_U8_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_U8, 2 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; Uint8 *dst = (Uint8 *) cvt->buf; const Uint8 *src = (Uint8 *) cvt->buf; @@ -7346,7 +7338,6 @@ SDL_Upsample_U8_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_U8, 4 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 4; const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 4; @@ -7389,7 +7380,6 @@ SDL_Downsample_U8_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_U8, 4 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; Uint8 *dst = (Uint8 *) cvt->buf; const Uint8 *src = (Uint8 *) cvt->buf; @@ -7428,7 +7418,6 @@ SDL_Upsample_U8_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_U8, 4 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 4; const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 4; @@ -7479,7 +7468,6 @@ SDL_Downsample_U8_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_U8, 4 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; Uint8 *dst = (Uint8 *) cvt->buf; const Uint8 *src = (Uint8 *) cvt->buf; @@ -7518,7 +7506,6 @@ SDL_Upsample_U8_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_U8, 6 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 6; const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 6; @@ -7571,7 +7558,6 @@ SDL_Downsample_U8_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_U8, 6 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; Uint8 *dst = (Uint8 *) cvt->buf; const Uint8 *src = (Uint8 *) cvt->buf; @@ -7618,7 +7604,6 @@ SDL_Upsample_U8_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_U8, 6 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 6; const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 6; @@ -7683,7 +7668,6 @@ SDL_Downsample_U8_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_U8, 6 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; Uint8 *dst = (Uint8 *) cvt->buf; const Uint8 *src = (Uint8 *) cvt->buf; @@ -7730,7 +7714,6 @@ SDL_Upsample_U8_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_U8, 8 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 8; const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 8; @@ -7793,7 +7776,6 @@ SDL_Downsample_U8_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_U8, 8 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; Uint8 *dst = (Uint8 *) cvt->buf; const Uint8 *src = (Uint8 *) cvt->buf; @@ -7848,7 +7830,6 @@ SDL_Upsample_U8_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_U8, 8 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 8; const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 8; @@ -7927,7 +7908,6 @@ SDL_Downsample_U8_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_U8, 8 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; Uint8 *dst = (Uint8 *) cvt->buf; const Uint8 *src = (Uint8 *) cvt->buf; @@ -7982,7 +7962,6 @@ SDL_Upsample_S8_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_S8, 1 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 1; const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 1; @@ -8010,7 +7989,6 @@ SDL_Downsample_S8_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_S8, 1 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; Sint8 *dst = (Sint8 *) cvt->buf; const Sint8 *src = (Sint8 *) cvt->buf; @@ -8037,7 +8015,6 @@ SDL_Upsample_S8_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_S8, 1 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 1; const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 1; @@ -8067,7 +8044,6 @@ SDL_Downsample_S8_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_S8, 1 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; Sint8 *dst = (Sint8 *) cvt->buf; const Sint8 *src = (Sint8 *) cvt->buf; @@ -8094,7 +8070,6 @@ SDL_Upsample_S8_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_S8, 2 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 2; const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 2; @@ -8127,7 +8102,6 @@ SDL_Downsample_S8_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_S8, 2 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; Sint8 *dst = (Sint8 *) cvt->buf; const Sint8 *src = (Sint8 *) cvt->buf; @@ -8158,7 +8132,6 @@ SDL_Upsample_S8_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_S8, 2 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 2; const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 2; @@ -8195,7 +8168,6 @@ SDL_Downsample_S8_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_S8, 2 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; Sint8 *dst = (Sint8 *) cvt->buf; const Sint8 *src = (Sint8 *) cvt->buf; @@ -8226,7 +8198,6 @@ SDL_Upsample_S8_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_S8, 4 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 4; const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 4; @@ -8269,7 +8240,6 @@ SDL_Downsample_S8_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_S8, 4 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; Sint8 *dst = (Sint8 *) cvt->buf; const Sint8 *src = (Sint8 *) cvt->buf; @@ -8308,7 +8278,6 @@ SDL_Upsample_S8_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_S8, 4 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 4; const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 4; @@ -8359,7 +8328,6 @@ SDL_Downsample_S8_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_S8, 4 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; Sint8 *dst = (Sint8 *) cvt->buf; const Sint8 *src = (Sint8 *) cvt->buf; @@ -8398,7 +8366,6 @@ SDL_Upsample_S8_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_S8, 6 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 6; const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 6; @@ -8451,7 +8418,6 @@ SDL_Downsample_S8_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_S8, 6 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; Sint8 *dst = (Sint8 *) cvt->buf; const Sint8 *src = (Sint8 *) cvt->buf; @@ -8498,7 +8464,6 @@ SDL_Upsample_S8_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_S8, 6 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 6; const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 6; @@ -8563,7 +8528,6 @@ SDL_Downsample_S8_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_S8, 6 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; Sint8 *dst = (Sint8 *) cvt->buf; const Sint8 *src = (Sint8 *) cvt->buf; @@ -8610,7 +8574,6 @@ SDL_Upsample_S8_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_S8, 8 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 8; const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 8; @@ -8673,7 +8636,6 @@ SDL_Downsample_S8_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_S8, 8 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; Sint8 *dst = (Sint8 *) cvt->buf; const Sint8 *src = (Sint8 *) cvt->buf; @@ -8728,7 +8690,6 @@ SDL_Upsample_S8_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_S8, 8 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 8; const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 8; @@ -8807,7 +8768,6 @@ SDL_Downsample_S8_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_S8, 8 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; Sint8 *dst = (Sint8 *) cvt->buf; const Sint8 *src = (Sint8 *) cvt->buf; @@ -8862,7 +8822,6 @@ SDL_Upsample_U16LSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_U16LSB, 1 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 1; const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; @@ -8890,7 +8849,6 @@ SDL_Downsample_U16LSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_U16LSB, 1 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; Uint16 *dst = (Uint16 *) cvt->buf; const Uint16 *src = (Uint16 *) cvt->buf; @@ -8917,7 +8875,6 @@ SDL_Upsample_U16LSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_U16LSB, 1 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 1; const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; @@ -8947,7 +8904,6 @@ SDL_Downsample_U16LSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_U16LSB, 1 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; Uint16 *dst = (Uint16 *) cvt->buf; const Uint16 *src = (Uint16 *) cvt->buf; @@ -8974,7 +8930,6 @@ SDL_Upsample_U16LSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_U16LSB, 2 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 2; const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 2; @@ -9007,7 +8962,6 @@ SDL_Downsample_U16LSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_U16LSB, 2 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; Uint16 *dst = (Uint16 *) cvt->buf; const Uint16 *src = (Uint16 *) cvt->buf; @@ -9038,7 +8992,6 @@ SDL_Upsample_U16LSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_U16LSB, 2 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 2; const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 2; @@ -9075,7 +9028,6 @@ SDL_Downsample_U16LSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_U16LSB, 2 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; Uint16 *dst = (Uint16 *) cvt->buf; const Uint16 *src = (Uint16 *) cvt->buf; @@ -9106,7 +9058,6 @@ SDL_Upsample_U16LSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_U16LSB, 4 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 4; const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 4; @@ -9149,7 +9100,6 @@ SDL_Downsample_U16LSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_U16LSB, 4 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; Uint16 *dst = (Uint16 *) cvt->buf; const Uint16 *src = (Uint16 *) cvt->buf; @@ -9188,7 +9138,6 @@ SDL_Upsample_U16LSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_U16LSB, 4 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 4; const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 4; @@ -9239,7 +9188,6 @@ SDL_Downsample_U16LSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_U16LSB, 4 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; Uint16 *dst = (Uint16 *) cvt->buf; const Uint16 *src = (Uint16 *) cvt->buf; @@ -9278,7 +9226,6 @@ SDL_Upsample_U16LSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_U16LSB, 6 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 6; const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 6; @@ -9331,7 +9278,6 @@ SDL_Downsample_U16LSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_U16LSB, 6 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; Uint16 *dst = (Uint16 *) cvt->buf; const Uint16 *src = (Uint16 *) cvt->buf; @@ -9378,7 +9324,6 @@ SDL_Upsample_U16LSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_U16LSB, 6 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 6; const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 6; @@ -9443,7 +9388,6 @@ SDL_Downsample_U16LSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_U16LSB, 6 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; Uint16 *dst = (Uint16 *) cvt->buf; const Uint16 *src = (Uint16 *) cvt->buf; @@ -9490,7 +9434,6 @@ SDL_Upsample_U16LSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_U16LSB, 8 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 8; const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 8; @@ -9553,7 +9496,6 @@ SDL_Downsample_U16LSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_U16LSB, 8 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; Uint16 *dst = (Uint16 *) cvt->buf; const Uint16 *src = (Uint16 *) cvt->buf; @@ -9608,7 +9550,6 @@ SDL_Upsample_U16LSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_U16LSB, 8 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 8; const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 8; @@ -9687,7 +9628,6 @@ SDL_Downsample_U16LSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_U16LSB, 8 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; Uint16 *dst = (Uint16 *) cvt->buf; const Uint16 *src = (Uint16 *) cvt->buf; @@ -9742,7 +9682,6 @@ SDL_Upsample_S16LSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_S16LSB, 1 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 1; const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1; @@ -9770,7 +9709,6 @@ SDL_Downsample_S16LSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_S16LSB, 1 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; Sint16 *dst = (Sint16 *) cvt->buf; const Sint16 *src = (Sint16 *) cvt->buf; @@ -9797,7 +9735,6 @@ SDL_Upsample_S16LSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_S16LSB, 1 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 1; const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1; @@ -9827,7 +9764,6 @@ SDL_Downsample_S16LSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_S16LSB, 1 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; Sint16 *dst = (Sint16 *) cvt->buf; const Sint16 *src = (Sint16 *) cvt->buf; @@ -9854,7 +9790,6 @@ SDL_Upsample_S16LSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_S16LSB, 2 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 2; const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 2; @@ -9887,7 +9822,6 @@ SDL_Downsample_S16LSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_S16LSB, 2 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; Sint16 *dst = (Sint16 *) cvt->buf; const Sint16 *src = (Sint16 *) cvt->buf; @@ -9918,7 +9852,6 @@ SDL_Upsample_S16LSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_S16LSB, 2 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 2; const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 2; @@ -9955,7 +9888,6 @@ SDL_Downsample_S16LSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_S16LSB, 2 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; Sint16 *dst = (Sint16 *) cvt->buf; const Sint16 *src = (Sint16 *) cvt->buf; @@ -9986,7 +9918,6 @@ SDL_Upsample_S16LSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_S16LSB, 4 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 4; const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 4; @@ -10029,7 +9960,6 @@ SDL_Downsample_S16LSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_S16LSB, 4 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; Sint16 *dst = (Sint16 *) cvt->buf; const Sint16 *src = (Sint16 *) cvt->buf; @@ -10068,7 +9998,6 @@ SDL_Upsample_S16LSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_S16LSB, 4 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 4; const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 4; @@ -10119,7 +10048,6 @@ SDL_Downsample_S16LSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_S16LSB, 4 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; Sint16 *dst = (Sint16 *) cvt->buf; const Sint16 *src = (Sint16 *) cvt->buf; @@ -10158,7 +10086,6 @@ SDL_Upsample_S16LSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_S16LSB, 6 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 6; const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 6; @@ -10211,7 +10138,6 @@ SDL_Downsample_S16LSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_S16LSB, 6 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; Sint16 *dst = (Sint16 *) cvt->buf; const Sint16 *src = (Sint16 *) cvt->buf; @@ -10258,7 +10184,6 @@ SDL_Upsample_S16LSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_S16LSB, 6 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 6; const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 6; @@ -10323,7 +10248,6 @@ SDL_Downsample_S16LSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_S16LSB, 6 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; Sint16 *dst = (Sint16 *) cvt->buf; const Sint16 *src = (Sint16 *) cvt->buf; @@ -10370,7 +10294,6 @@ SDL_Upsample_S16LSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_S16LSB, 8 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 8; const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 8; @@ -10433,7 +10356,6 @@ SDL_Downsample_S16LSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_S16LSB, 8 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; Sint16 *dst = (Sint16 *) cvt->buf; const Sint16 *src = (Sint16 *) cvt->buf; @@ -10488,7 +10410,6 @@ SDL_Upsample_S16LSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_S16LSB, 8 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 8; const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 8; @@ -10567,7 +10488,6 @@ SDL_Downsample_S16LSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_S16LSB, 8 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; Sint16 *dst = (Sint16 *) cvt->buf; const Sint16 *src = (Sint16 *) cvt->buf; @@ -10622,7 +10542,6 @@ SDL_Upsample_U16MSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_U16MSB, 1 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 1; const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; @@ -10650,7 +10569,6 @@ SDL_Downsample_U16MSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_U16MSB, 1 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; Uint16 *dst = (Uint16 *) cvt->buf; const Uint16 *src = (Uint16 *) cvt->buf; @@ -10677,7 +10595,6 @@ SDL_Upsample_U16MSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_U16MSB, 1 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 1; const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; @@ -10707,7 +10624,6 @@ SDL_Downsample_U16MSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_U16MSB, 1 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; Uint16 *dst = (Uint16 *) cvt->buf; const Uint16 *src = (Uint16 *) cvt->buf; @@ -10734,7 +10650,6 @@ SDL_Upsample_U16MSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_U16MSB, 2 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 2; const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 2; @@ -10767,7 +10682,6 @@ SDL_Downsample_U16MSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_U16MSB, 2 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; Uint16 *dst = (Uint16 *) cvt->buf; const Uint16 *src = (Uint16 *) cvt->buf; @@ -10798,7 +10712,6 @@ SDL_Upsample_U16MSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_U16MSB, 2 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 2; const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 2; @@ -10835,7 +10748,6 @@ SDL_Downsample_U16MSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_U16MSB, 2 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; Uint16 *dst = (Uint16 *) cvt->buf; const Uint16 *src = (Uint16 *) cvt->buf; @@ -10866,7 +10778,6 @@ SDL_Upsample_U16MSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_U16MSB, 4 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 4; const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 4; @@ -10909,7 +10820,6 @@ SDL_Downsample_U16MSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_U16MSB, 4 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; Uint16 *dst = (Uint16 *) cvt->buf; const Uint16 *src = (Uint16 *) cvt->buf; @@ -10948,7 +10858,6 @@ SDL_Upsample_U16MSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_U16MSB, 4 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 4; const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 4; @@ -10999,7 +10908,6 @@ SDL_Downsample_U16MSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_U16MSB, 4 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; Uint16 *dst = (Uint16 *) cvt->buf; const Uint16 *src = (Uint16 *) cvt->buf; @@ -11038,7 +10946,6 @@ SDL_Upsample_U16MSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_U16MSB, 6 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 6; const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 6; @@ -11091,7 +10998,6 @@ SDL_Downsample_U16MSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_U16MSB, 6 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; Uint16 *dst = (Uint16 *) cvt->buf; const Uint16 *src = (Uint16 *) cvt->buf; @@ -11138,7 +11044,6 @@ SDL_Upsample_U16MSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_U16MSB, 6 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 6; const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 6; @@ -11203,7 +11108,6 @@ SDL_Downsample_U16MSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_U16MSB, 6 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; Uint16 *dst = (Uint16 *) cvt->buf; const Uint16 *src = (Uint16 *) cvt->buf; @@ -11250,7 +11154,6 @@ SDL_Upsample_U16MSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_U16MSB, 8 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 8; const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 8; @@ -11313,7 +11216,6 @@ SDL_Downsample_U16MSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_U16MSB, 8 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; Uint16 *dst = (Uint16 *) cvt->buf; const Uint16 *src = (Uint16 *) cvt->buf; @@ -11368,7 +11270,6 @@ SDL_Upsample_U16MSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_U16MSB, 8 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 8; const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 8; @@ -11447,7 +11348,6 @@ SDL_Downsample_U16MSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_U16MSB, 8 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; Uint16 *dst = (Uint16 *) cvt->buf; const Uint16 *src = (Uint16 *) cvt->buf; @@ -11502,7 +11402,6 @@ SDL_Upsample_S16MSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_S16MSB, 1 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 1; const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1; @@ -11530,7 +11429,6 @@ SDL_Downsample_S16MSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_S16MSB, 1 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; Sint16 *dst = (Sint16 *) cvt->buf; const Sint16 *src = (Sint16 *) cvt->buf; @@ -11557,7 +11455,6 @@ SDL_Upsample_S16MSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_S16MSB, 1 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 1; const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1; @@ -11587,7 +11484,6 @@ SDL_Downsample_S16MSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_S16MSB, 1 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; Sint16 *dst = (Sint16 *) cvt->buf; const Sint16 *src = (Sint16 *) cvt->buf; @@ -11614,7 +11510,6 @@ SDL_Upsample_S16MSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_S16MSB, 2 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 2; const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 2; @@ -11647,7 +11542,6 @@ SDL_Downsample_S16MSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_S16MSB, 2 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; Sint16 *dst = (Sint16 *) cvt->buf; const Sint16 *src = (Sint16 *) cvt->buf; @@ -11678,7 +11572,6 @@ SDL_Upsample_S16MSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_S16MSB, 2 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 2; const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 2; @@ -11715,7 +11608,6 @@ SDL_Downsample_S16MSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_S16MSB, 2 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; Sint16 *dst = (Sint16 *) cvt->buf; const Sint16 *src = (Sint16 *) cvt->buf; @@ -11746,7 +11638,6 @@ SDL_Upsample_S16MSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_S16MSB, 4 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 4; const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 4; @@ -11789,7 +11680,6 @@ SDL_Downsample_S16MSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_S16MSB, 4 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; Sint16 *dst = (Sint16 *) cvt->buf; const Sint16 *src = (Sint16 *) cvt->buf; @@ -11828,7 +11718,6 @@ SDL_Upsample_S16MSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_S16MSB, 4 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 4; const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 4; @@ -11879,7 +11768,6 @@ SDL_Downsample_S16MSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_S16MSB, 4 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; Sint16 *dst = (Sint16 *) cvt->buf; const Sint16 *src = (Sint16 *) cvt->buf; @@ -11918,7 +11806,6 @@ SDL_Upsample_S16MSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_S16MSB, 6 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 6; const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 6; @@ -11971,7 +11858,6 @@ SDL_Downsample_S16MSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_S16MSB, 6 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; Sint16 *dst = (Sint16 *) cvt->buf; const Sint16 *src = (Sint16 *) cvt->buf; @@ -12018,7 +11904,6 @@ SDL_Upsample_S16MSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_S16MSB, 6 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 6; const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 6; @@ -12083,7 +11968,6 @@ SDL_Downsample_S16MSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_S16MSB, 6 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; Sint16 *dst = (Sint16 *) cvt->buf; const Sint16 *src = (Sint16 *) cvt->buf; @@ -12130,7 +12014,6 @@ SDL_Upsample_S16MSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_S16MSB, 8 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 8; const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 8; @@ -12193,7 +12076,6 @@ SDL_Downsample_S16MSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_S16MSB, 8 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; Sint16 *dst = (Sint16 *) cvt->buf; const Sint16 *src = (Sint16 *) cvt->buf; @@ -12248,7 +12130,6 @@ SDL_Upsample_S16MSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_S16MSB, 8 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 8; const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 8; @@ -12327,7 +12208,6 @@ SDL_Downsample_S16MSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_S16MSB, 8 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; Sint16 *dst = (Sint16 *) cvt->buf; const Sint16 *src = (Sint16 *) cvt->buf; @@ -12382,7 +12262,6 @@ SDL_Upsample_S32LSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_S32LSB, 1 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 1; const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1; @@ -12410,7 +12289,6 @@ SDL_Downsample_S32LSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_S32LSB, 1 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; Sint32 *dst = (Sint32 *) cvt->buf; const Sint32 *src = (Sint32 *) cvt->buf; @@ -12437,7 +12315,6 @@ SDL_Upsample_S32LSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_S32LSB, 1 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 1; const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1; @@ -12467,7 +12344,6 @@ SDL_Downsample_S32LSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_S32LSB, 1 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; Sint32 *dst = (Sint32 *) cvt->buf; const Sint32 *src = (Sint32 *) cvt->buf; @@ -12494,7 +12370,6 @@ SDL_Upsample_S32LSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_S32LSB, 2 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 2; const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 2; @@ -12527,7 +12402,6 @@ SDL_Downsample_S32LSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_S32LSB, 2 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; Sint32 *dst = (Sint32 *) cvt->buf; const Sint32 *src = (Sint32 *) cvt->buf; @@ -12558,7 +12432,6 @@ SDL_Upsample_S32LSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_S32LSB, 2 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 2; const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 2; @@ -12595,7 +12468,6 @@ SDL_Downsample_S32LSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_S32LSB, 2 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; Sint32 *dst = (Sint32 *) cvt->buf; const Sint32 *src = (Sint32 *) cvt->buf; @@ -12626,7 +12498,6 @@ SDL_Upsample_S32LSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_S32LSB, 4 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 4; const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 4; @@ -12669,7 +12540,6 @@ SDL_Downsample_S32LSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_S32LSB, 4 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; Sint32 *dst = (Sint32 *) cvt->buf; const Sint32 *src = (Sint32 *) cvt->buf; @@ -12708,7 +12578,6 @@ SDL_Upsample_S32LSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_S32LSB, 4 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 4; const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 4; @@ -12759,7 +12628,6 @@ SDL_Downsample_S32LSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_S32LSB, 4 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; Sint32 *dst = (Sint32 *) cvt->buf; const Sint32 *src = (Sint32 *) cvt->buf; @@ -12798,7 +12666,6 @@ SDL_Upsample_S32LSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_S32LSB, 6 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 6; const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 6; @@ -12851,7 +12718,6 @@ SDL_Downsample_S32LSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_S32LSB, 6 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; Sint32 *dst = (Sint32 *) cvt->buf; const Sint32 *src = (Sint32 *) cvt->buf; @@ -12898,7 +12764,6 @@ SDL_Upsample_S32LSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_S32LSB, 6 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 6; const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 6; @@ -12963,7 +12828,6 @@ SDL_Downsample_S32LSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_S32LSB, 6 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; Sint32 *dst = (Sint32 *) cvt->buf; const Sint32 *src = (Sint32 *) cvt->buf; @@ -13010,7 +12874,6 @@ SDL_Upsample_S32LSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_S32LSB, 8 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 8; const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 8; @@ -13073,7 +12936,6 @@ SDL_Downsample_S32LSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_S32LSB, 8 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; Sint32 *dst = (Sint32 *) cvt->buf; const Sint32 *src = (Sint32 *) cvt->buf; @@ -13128,7 +12990,6 @@ SDL_Upsample_S32LSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_S32LSB, 8 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 8; const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 8; @@ -13207,7 +13068,6 @@ SDL_Downsample_S32LSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_S32LSB, 8 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; Sint32 *dst = (Sint32 *) cvt->buf; const Sint32 *src = (Sint32 *) cvt->buf; @@ -13262,7 +13122,6 @@ SDL_Upsample_S32MSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_S32MSB, 1 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 1; const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1; @@ -13290,7 +13149,6 @@ SDL_Downsample_S32MSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_S32MSB, 1 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; Sint32 *dst = (Sint32 *) cvt->buf; const Sint32 *src = (Sint32 *) cvt->buf; @@ -13317,7 +13175,6 @@ SDL_Upsample_S32MSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_S32MSB, 1 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 1; const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1; @@ -13347,7 +13204,6 @@ SDL_Downsample_S32MSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_S32MSB, 1 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; Sint32 *dst = (Sint32 *) cvt->buf; const Sint32 *src = (Sint32 *) cvt->buf; @@ -13374,7 +13230,6 @@ SDL_Upsample_S32MSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_S32MSB, 2 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 2; const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 2; @@ -13407,7 +13262,6 @@ SDL_Downsample_S32MSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_S32MSB, 2 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; Sint32 *dst = (Sint32 *) cvt->buf; const Sint32 *src = (Sint32 *) cvt->buf; @@ -13438,7 +13292,6 @@ SDL_Upsample_S32MSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_S32MSB, 2 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 2; const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 2; @@ -13475,7 +13328,6 @@ SDL_Downsample_S32MSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_S32MSB, 2 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; Sint32 *dst = (Sint32 *) cvt->buf; const Sint32 *src = (Sint32 *) cvt->buf; @@ -13506,7 +13358,6 @@ SDL_Upsample_S32MSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_S32MSB, 4 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 4; const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 4; @@ -13549,7 +13400,6 @@ SDL_Downsample_S32MSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_S32MSB, 4 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; Sint32 *dst = (Sint32 *) cvt->buf; const Sint32 *src = (Sint32 *) cvt->buf; @@ -13588,7 +13438,6 @@ SDL_Upsample_S32MSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_S32MSB, 4 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 4; const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 4; @@ -13639,7 +13488,6 @@ SDL_Downsample_S32MSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_S32MSB, 4 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; Sint32 *dst = (Sint32 *) cvt->buf; const Sint32 *src = (Sint32 *) cvt->buf; @@ -13678,7 +13526,6 @@ SDL_Upsample_S32MSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_S32MSB, 6 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 6; const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 6; @@ -13731,7 +13578,6 @@ SDL_Downsample_S32MSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_S32MSB, 6 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; Sint32 *dst = (Sint32 *) cvt->buf; const Sint32 *src = (Sint32 *) cvt->buf; @@ -13778,7 +13624,6 @@ SDL_Upsample_S32MSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_S32MSB, 6 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 6; const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 6; @@ -13843,7 +13688,6 @@ SDL_Downsample_S32MSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_S32MSB, 6 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; Sint32 *dst = (Sint32 *) cvt->buf; const Sint32 *src = (Sint32 *) cvt->buf; @@ -13890,7 +13734,6 @@ SDL_Upsample_S32MSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_S32MSB, 8 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 8; const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 8; @@ -13953,7 +13796,6 @@ SDL_Downsample_S32MSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_S32MSB, 8 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; Sint32 *dst = (Sint32 *) cvt->buf; const Sint32 *src = (Sint32 *) cvt->buf; @@ -14008,7 +13850,6 @@ SDL_Upsample_S32MSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_S32MSB, 8 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 8; const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 8; @@ -14087,7 +13928,6 @@ SDL_Downsample_S32MSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_S32MSB, 8 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; Sint32 *dst = (Sint32 *) cvt->buf; const Sint32 *src = (Sint32 *) cvt->buf; @@ -14142,7 +13982,6 @@ SDL_Upsample_F32LSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_F32LSB, 1 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; float *dst = ((float *) (cvt->buf + dstsize)) - 1; const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1; @@ -14170,7 +14009,6 @@ SDL_Downsample_F32LSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_F32LSB, 1 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; float *dst = (float *) cvt->buf; const float *src = (float *) cvt->buf; @@ -14197,7 +14035,6 @@ SDL_Upsample_F32LSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_F32LSB, 1 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; float *dst = ((float *) (cvt->buf + dstsize)) - 1; const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1; @@ -14227,7 +14064,6 @@ SDL_Downsample_F32LSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_F32LSB, 1 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; float *dst = (float *) cvt->buf; const float *src = (float *) cvt->buf; @@ -14254,7 +14090,6 @@ SDL_Upsample_F32LSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_F32LSB, 2 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; float *dst = ((float *) (cvt->buf + dstsize)) - 2; const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 2; @@ -14287,7 +14122,6 @@ SDL_Downsample_F32LSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_F32LSB, 2 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; float *dst = (float *) cvt->buf; const float *src = (float *) cvt->buf; @@ -14318,7 +14152,6 @@ SDL_Upsample_F32LSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_F32LSB, 2 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; float *dst = ((float *) (cvt->buf + dstsize)) - 2; const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 2; @@ -14355,7 +14188,6 @@ SDL_Downsample_F32LSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_F32LSB, 2 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; float *dst = (float *) cvt->buf; const float *src = (float *) cvt->buf; @@ -14386,7 +14218,6 @@ SDL_Upsample_F32LSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_F32LSB, 4 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; float *dst = ((float *) (cvt->buf + dstsize)) - 4; const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 4; @@ -14429,7 +14260,6 @@ SDL_Downsample_F32LSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_F32LSB, 4 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; float *dst = (float *) cvt->buf; const float *src = (float *) cvt->buf; @@ -14468,7 +14298,6 @@ SDL_Upsample_F32LSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_F32LSB, 4 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; float *dst = ((float *) (cvt->buf + dstsize)) - 4; const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 4; @@ -14519,7 +14348,6 @@ SDL_Downsample_F32LSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_F32LSB, 4 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; float *dst = (float *) cvt->buf; const float *src = (float *) cvt->buf; @@ -14558,7 +14386,6 @@ SDL_Upsample_F32LSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_F32LSB, 6 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; float *dst = ((float *) (cvt->buf + dstsize)) - 6; const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 6; @@ -14611,7 +14438,6 @@ SDL_Downsample_F32LSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_F32LSB, 6 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; float *dst = (float *) cvt->buf; const float *src = (float *) cvt->buf; @@ -14658,7 +14484,6 @@ SDL_Upsample_F32LSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_F32LSB, 6 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; float *dst = ((float *) (cvt->buf + dstsize)) - 6; const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 6; @@ -14723,7 +14548,6 @@ SDL_Downsample_F32LSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_F32LSB, 6 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; float *dst = (float *) cvt->buf; const float *src = (float *) cvt->buf; @@ -14770,7 +14594,6 @@ SDL_Upsample_F32LSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_F32LSB, 8 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; float *dst = ((float *) (cvt->buf + dstsize)) - 8; const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 8; @@ -14833,7 +14656,6 @@ SDL_Downsample_F32LSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_F32LSB, 8 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; float *dst = (float *) cvt->buf; const float *src = (float *) cvt->buf; @@ -14888,7 +14710,6 @@ SDL_Upsample_F32LSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_F32LSB, 8 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; float *dst = ((float *) (cvt->buf + dstsize)) - 8; const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 8; @@ -14967,7 +14788,6 @@ SDL_Downsample_F32LSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_F32LSB, 8 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; float *dst = (float *) cvt->buf; const float *src = (float *) cvt->buf; @@ -15022,7 +14842,6 @@ SDL_Upsample_F32MSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_F32MSB, 1 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; float *dst = ((float *) (cvt->buf + dstsize)) - 1; const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1; @@ -15050,7 +14869,6 @@ SDL_Downsample_F32MSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_F32MSB, 1 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; float *dst = (float *) cvt->buf; const float *src = (float *) cvt->buf; @@ -15077,7 +14895,6 @@ SDL_Upsample_F32MSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_F32MSB, 1 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; float *dst = ((float *) (cvt->buf + dstsize)) - 1; const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1; @@ -15107,7 +14924,6 @@ SDL_Downsample_F32MSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_F32MSB, 1 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; float *dst = (float *) cvt->buf; const float *src = (float *) cvt->buf; @@ -15134,7 +14950,6 @@ SDL_Upsample_F32MSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_F32MSB, 2 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; float *dst = ((float *) (cvt->buf + dstsize)) - 2; const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 2; @@ -15167,7 +14982,6 @@ SDL_Downsample_F32MSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_F32MSB, 2 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; float *dst = (float *) cvt->buf; const float *src = (float *) cvt->buf; @@ -15198,7 +15012,6 @@ SDL_Upsample_F32MSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_F32MSB, 2 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; float *dst = ((float *) (cvt->buf + dstsize)) - 2; const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 2; @@ -15235,7 +15048,6 @@ SDL_Downsample_F32MSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_F32MSB, 2 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; float *dst = (float *) cvt->buf; const float *src = (float *) cvt->buf; @@ -15266,7 +15078,6 @@ SDL_Upsample_F32MSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_F32MSB, 4 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; float *dst = ((float *) (cvt->buf + dstsize)) - 4; const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 4; @@ -15309,7 +15120,6 @@ SDL_Downsample_F32MSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_F32MSB, 4 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; float *dst = (float *) cvt->buf; const float *src = (float *) cvt->buf; @@ -15348,7 +15158,6 @@ SDL_Upsample_F32MSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_F32MSB, 4 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; float *dst = ((float *) (cvt->buf + dstsize)) - 4; const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 4; @@ -15399,7 +15208,6 @@ SDL_Downsample_F32MSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_F32MSB, 4 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; float *dst = (float *) cvt->buf; const float *src = (float *) cvt->buf; @@ -15438,7 +15246,6 @@ SDL_Upsample_F32MSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_F32MSB, 6 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; float *dst = ((float *) (cvt->buf + dstsize)) - 6; const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 6; @@ -15491,7 +15298,6 @@ SDL_Downsample_F32MSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_F32MSB, 6 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; float *dst = (float *) cvt->buf; const float *src = (float *) cvt->buf; @@ -15538,7 +15344,6 @@ SDL_Upsample_F32MSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_F32MSB, 6 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; float *dst = ((float *) (cvt->buf + dstsize)) - 6; const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 6; @@ -15603,7 +15408,6 @@ SDL_Downsample_F32MSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_F32MSB, 6 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; float *dst = (float *) cvt->buf; const float *src = (float *) cvt->buf; @@ -15650,7 +15454,6 @@ SDL_Upsample_F32MSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x2) AUDIO_F32MSB, 8 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 2; float *dst = ((float *) (cvt->buf + dstsize)) - 8; const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 8; @@ -15713,7 +15516,6 @@ SDL_Downsample_F32MSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x2) AUDIO_F32MSB, 8 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 2; float *dst = (float *) cvt->buf; const float *src = (float *) cvt->buf; @@ -15768,7 +15570,6 @@ SDL_Upsample_F32MSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Upsample (x4) AUDIO_F32MSB, 8 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt * 4; float *dst = ((float *) (cvt->buf + dstsize)) - 8; const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 8; @@ -15847,7 +15648,6 @@ SDL_Downsample_F32MSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) fprintf(stderr, "Downsample (x4) AUDIO_F32MSB, 8 channels.\n"); #endif - const int srcsize = cvt->len_cvt; const int dstsize = cvt->len_cvt / 4; float *dst = (float *) cvt->buf; const float *src = (float *) cvt->buf; From a14464063593a471ce196b8bf33b54ff08ac99f2 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 12 Oct 2011 20:01:09 -0400 Subject: [PATCH 05/19] Make sure window->driverdata is set before we might need it. Thanks to Mako_energy for the fix! --- src/video/windows/SDL_windowswindow.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/video/windows/SDL_windowswindow.c b/src/video/windows/SDL_windowswindow.c index bb5a42b92..b441d9675 100644 --- a/src/video/windows/SDL_windowswindow.c +++ b/src/video/windows/SDL_windowswindow.c @@ -88,6 +88,8 @@ SetupWindowData(_THIS, SDL_Window * window, HWND hwnd, SDL_bool created) data->mouse_pressed = SDL_FALSE; data->videodata = videodata; + window->driverdata = data; + /* Associate the data with the window */ if (!SetProp(hwnd, TEXT("SDL_WindowData"), data)) { ReleaseDC(hwnd, data->hdc); @@ -183,7 +185,6 @@ SetupWindowData(_THIS, SDL_Window * window, HWND hwnd, SDL_bool created) } /* All done! */ - window->driverdata = data; return 0; } From bebad17430090dd32cbaad8982b212be90a3aa95 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 13 Oct 2011 01:08:30 -0400 Subject: [PATCH 06/19] Fixed a whole slew of compiler warnings that -Wall exposed. --- src/cpuinfo/SDL_cpuinfo.c | 3 +++ src/events/SDL_gesture.c | 3 ++- src/events/SDL_mouse.c | 1 - src/power/linux/SDL_syspower.c | 8 -------- src/render/opengl/SDL_render_gl.c | 2 -- src/render/software/SDL_blendline.c | 4 ---- src/render/software/SDL_draw.h | 8 ++++---- src/thread/pthread/SDL_syssem.c | 1 + src/thread/pthread/SDL_systhread.c | 3 +++ src/video/x11/SDL_x11events.c | 9 ++++++--- src/video/x11/SDL_x11framebuffer.c | 3 +++ src/video/x11/SDL_x11mouse.c | 2 +- src/video/x11/SDL_x11opengl.c | 8 +++++--- src/video/x11/SDL_x11shape.c | 1 + src/video/x11/SDL_x11sym.h | 22 +++++++++++----------- src/video/x11/SDL_x11touch.c | 3 +-- src/video/x11/SDL_x11window.c | 29 +---------------------------- 17 files changed, 42 insertions(+), 68 deletions(-) diff --git a/src/cpuinfo/SDL_cpuinfo.c b/src/cpuinfo/SDL_cpuinfo.c index b3f56f979..379511c3a 100644 --- a/src/cpuinfo/SDL_cpuinfo.c +++ b/src/cpuinfo/SDL_cpuinfo.c @@ -384,6 +384,8 @@ SDL_GetCPUType(void) return SDL_CPUType; } + +#ifdef TEST_MAIN /* !!! FIXME: only used for test at the moment. */ static const char * SDL_GetCPUName(void) { @@ -455,6 +457,7 @@ SDL_GetCPUName(void) } return SDL_CPUName; } +#endif int SDL_GetCPUCacheLineSize(void) diff --git a/src/events/SDL_gesture.c b/src/events/SDL_gesture.c index 92db36618..2d6185355 100644 --- a/src/events/SDL_gesture.c +++ b/src/events/SDL_gesture.c @@ -390,10 +390,11 @@ int dollarNormalize(const SDL_DollarPath *path,SDL_FloatPoint *points) { float dollarRecognize(const SDL_DollarPath *path,int *bestTempl,SDL_GestureTouch* touch) { SDL_FloatPoint points[DOLLARNPOINTS]; - int numPoints = dollarNormalize(path,points); int i; float bestDiff = 10000; + dollarNormalize(path,points); + //PrintPath(points); *bestTempl = -1; for(i = 0;i < touch->numDollarTemplates;i++) { diff --git a/src/events/SDL_mouse.c b/src/events/SDL_mouse.c index d4104c571..a514e38d9 100644 --- a/src/events/SDL_mouse.c +++ b/src/events/SDL_mouse.c @@ -349,7 +349,6 @@ SDL_Cursor * SDL_CreateCursor(const Uint8 * data, const Uint8 * mask, int w, int h, int hot_x, int hot_y) { - SDL_Mouse *mouse = SDL_GetMouse(); SDL_Surface *surface; SDL_Cursor *cursor; int x, y; diff --git a/src/power/linux/SDL_syspower.c b/src/power/linux/SDL_syspower.c index f84e9d3e9..9852b789e 100644 --- a/src/power/linux/SDL_syspower.c +++ b/src/power/linux/SDL_syspower.c @@ -128,7 +128,6 @@ check_proc_acpi_battery(const char * node, SDL_bool * have_battery, char *val = NULL; SDL_bool charge = SDL_FALSE; SDL_bool choose = SDL_FALSE; - SDL_bool is_ac = SDL_FALSE; int maximum = -1; int remaining = -1; int secs = -1; @@ -214,13 +213,6 @@ check_proc_acpi_ac_adapter(const char * node, SDL_bool * have_ac) char *ptr = NULL; char *key = NULL; char *val = NULL; - SDL_bool charge = SDL_FALSE; - SDL_bool choose = SDL_FALSE; - SDL_bool is_ac = SDL_FALSE; - int maximum = -1; - int remaining = -1; - int secs = -1; - int pct = -1; if (!load_acpi_file(base, node, "state", state, sizeof (state))) { return; diff --git a/src/render/opengl/SDL_render_gl.c b/src/render/opengl/SDL_render_gl.c index d478fb537..320044645 100644 --- a/src/render/opengl/SDL_render_gl.c +++ b/src/render/opengl/SDL_render_gl.c @@ -348,8 +348,6 @@ GL_CreateRenderer(SDL_Window * window, Uint32 flags) static void GL_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event) { - GL_RenderData *data = (GL_RenderData *) renderer->driverdata; - if (event->event == SDL_WINDOWEVENT_SIZE_CHANGED) { /* Rebind the context to the window area and update matrices */ SDL_CurrentContext = NULL; diff --git a/src/render/software/SDL_blendline.c b/src/render/software/SDL_blendline.c index 19d6431fa..796bd91eb 100644 --- a/src/render/software/SDL_blendline.c +++ b/src/render/software/SDL_blendline.c @@ -124,7 +124,6 @@ SDL_BlendLine_RGB555(SDL_Surface * dst, int x1, int y1, int x2, int y2, SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a, SDL_bool draw_end) { - const SDL_PixelFormat *fmt = dst->format; unsigned r, g, b, a, inva; if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) { @@ -216,7 +215,6 @@ SDL_BlendLine_RGB565(SDL_Surface * dst, int x1, int y1, int x2, int y2, SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a, SDL_bool draw_end) { - const SDL_PixelFormat *fmt = dst->format; unsigned r, g, b, a, inva; if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) { @@ -492,7 +490,6 @@ SDL_BlendLine_RGB888(SDL_Surface * dst, int x1, int y1, int x2, int y2, SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a, SDL_bool draw_end) { - const SDL_PixelFormat *fmt = dst->format; unsigned r, g, b, a, inva; if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) { @@ -584,7 +581,6 @@ SDL_BlendLine_ARGB8888(SDL_Surface * dst, int x1, int y1, int x2, int y2, SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a, SDL_bool draw_end) { - const SDL_PixelFormat *fmt = dst->format; unsigned r, g, b, a, inva; if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) { diff --git a/src/render/software/SDL_draw.h b/src/render/software/SDL_draw.h index bbf69936e..12cd6849c 100644 --- a/src/render/software/SDL_draw.h +++ b/src/render/software/SDL_draw.h @@ -45,13 +45,13 @@ #define DRAW_SETPIXEL(setpixel) \ do { \ - unsigned sr = r, sg = g, sb = b, sa = a; \ + unsigned sr = r, sg = g, sb = b, sa = a; (void) sa; \ setpixel; \ } while (0) #define DRAW_SETPIXEL_BLEND(getpixel, setpixel) \ do { \ - unsigned sr, sg, sb, sa; sa; \ + unsigned sr, sg, sb, sa; (void) sa; \ getpixel; \ sr = DRAW_MUL(inva, sr) + r; \ sg = DRAW_MUL(inva, sg) + g; \ @@ -61,7 +61,7 @@ do { \ #define DRAW_SETPIXEL_ADD(getpixel, setpixel) \ do { \ - unsigned sr, sg, sb, sa; sa; \ + unsigned sr, sg, sb, sa; (void) sa; \ getpixel; \ sr += r; if (sr > 0xff) sr = 0xff; \ sg += g; if (sg > 0xff) sg = 0xff; \ @@ -71,7 +71,7 @@ do { \ #define DRAW_SETPIXEL_MOD(getpixel, setpixel) \ do { \ - unsigned sr, sg, sb, sa; sa; \ + unsigned sr, sg, sb, sa; (void) sa; \ getpixel; \ sr = DRAW_MUL(sr, r); \ sg = DRAW_MUL(sg, g); \ diff --git a/src/thread/pthread/SDL_syssem.c b/src/thread/pthread/SDL_syssem.c index 5980c3b76..9940c5f27 100644 --- a/src/thread/pthread/SDL_syssem.c +++ b/src/thread/pthread/SDL_syssem.c @@ -23,6 +23,7 @@ #include #include #include +#include #include "SDL_thread.h" #include "SDL_timer.h" diff --git a/src/thread/pthread/SDL_systhread.c b/src/thread/pthread/SDL_systhread.c index 334d33abc..bb4296add 100644 --- a/src/thread/pthread/SDL_systhread.c +++ b/src/thread/pthread/SDL_systhread.c @@ -18,6 +18,7 @@ misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ + #include "SDL_config.h" #include @@ -31,6 +32,8 @@ #include #include #include +#include +extern int pthread_setname_np (pthread_t __target_thread, __const char *__name) __THROW __nonnull ((2)); #endif #include "SDL_platform.h" diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c index 1079199e3..84daaa8bf 100644 --- a/src/video/x11/SDL_x11events.c +++ b/src/video/x11/SDL_x11events.c @@ -234,7 +234,6 @@ X11_DispatchEvent(_THIS) case KeyPress:{ KeyCode keycode = xevent.xkey.keycode; KeySym keysym = NoSymbol; - SDL_Scancode scancode; char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; Status status = 0; @@ -243,7 +242,7 @@ X11_DispatchEvent(_THIS) #endif SDL_SendKeyboardKey(SDL_PRESSED, videodata->key_layout[keycode]); #if 1 - if (videodata->key_layout[keycode] == SDLK_UNKNOWN) { + if (videodata->key_layout[keycode] == SDL_SCANCODE_UNKNOWN) { int min_keycode, max_keycode; XDisplayKeycodes(display, &min_keycode, &max_keycode); keysym = XKeycodeToKeysym(display, keycode, 0); @@ -522,6 +521,11 @@ X11_Pending(Display * display) return (0); } + +/* !!! FIXME: this should be exposed in a header, or something. */ +int SDL_GetNumTouch(void); + + void X11_PumpEvents(_THIS) { @@ -545,7 +549,6 @@ X11_PumpEvents(_THIS) #ifdef SDL_INPUT_LINUXEV /* Process Touch events - TODO When X gets touch support, use that instead*/ int i = 0,rd; - char name[256]; struct input_event ev[64]; int size = sizeof (struct input_event); diff --git a/src/video/x11/SDL_x11framebuffer.c b/src/video/x11/SDL_x11framebuffer.c index cab8b8f64..b54a48cfc 100644 --- a/src/video/x11/SDL_x11framebuffer.c +++ b/src/video/x11/SDL_x11framebuffer.c @@ -183,7 +183,10 @@ X11_UpdateWindowFramebuffer(_THIS, SDL_Window * window, SDL_Rect * rects, rect->x, rect->y, rect->w, rect->h); } } + XSync(display, False); + + return 0; } void diff --git a/src/video/x11/SDL_x11mouse.c b/src/video/x11/SDL_x11mouse.c index 2eb162163..396bb9ff4 100644 --- a/src/video/x11/SDL_x11mouse.c +++ b/src/video/x11/SDL_x11mouse.c @@ -136,7 +136,7 @@ X11_CreatePixmapCursor(SDL_Surface * surface, int hot_x, int hot_y) /* Code below assumes ARGB pixel format */ SDL_assert(surface->format->format == SDL_PIXELFORMAT_ARGB8888); - rfg = gfg = bfg = rbg = gbg = bbg = fgBits = 0; + rfg = gfg = bfg = rbg = gbg = bbg = fgBits = bgBits = 0; for (y = 0; y < surface->h; ++y) { ptr = (Uint32 *)((Uint8 *)surface->pixels + y * surface->pitch); for (x = 0; x < surface->w; ++x) { diff --git a/src/video/x11/SDL_x11opengl.c b/src/video/x11/SDL_x11opengl.c index 49ed345ea..2e6d0130f 100644 --- a/src/video/x11/SDL_x11opengl.c +++ b/src/video/x11/SDL_x11opengl.c @@ -19,8 +19,8 @@ 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" - #include "SDL_x11video.h" +#include "SDL_assert.h" /* GLX implementation of SDL OpenGL support */ @@ -388,8 +388,10 @@ X11_GL_GetVisual(_THIS, Display * display, int screen) XVisualInfo *vinfo; /* 64 seems nice. */ - int attribs[64]; - int i = X11_GL_GetAttributes(_this,display,screen,attribs,64); + const int max_attrs = 64; + int attribs[max_attrs]; + const int i = X11_GL_GetAttributes(_this,display,screen,attribs,max_attrs); + SDL_assert(i <= max_attrs); vinfo = _this->gl_data->glXChooseVisual(display, screen, attribs); if (!vinfo) { diff --git a/src/video/x11/SDL_x11shape.c b/src/video/x11/SDL_x11shape.c index 073a73c3f..b98ad554b 100644 --- a/src/video/x11/SDL_x11shape.c +++ b/src/video/x11/SDL_x11shape.c @@ -26,6 +26,7 @@ #include "SDL_x11video.h" #include "SDL_x11shape.h" #include "SDL_x11window.h" +#include "../SDL_shape_internals.h" SDL_Window* X11_CreateShapedWindow(const char *title,unsigned int x,unsigned int y,unsigned int w,unsigned int h,Uint32 flags) { diff --git a/src/video/x11/SDL_x11sym.h b/src/video/x11/SDL_x11sym.h index 6d2d70a8b..390dfa1d4 100644 --- a/src/video/x11/SDL_x11sym.h +++ b/src/video/x11/SDL_x11sym.h @@ -178,17 +178,17 @@ SDL_X11_SYM(int,ipUnallocateAndSendData,(ChannelPtr a,IPCard b),(a,b),return) /* XCursor support */ #if SDL_VIDEO_DRIVER_X11_XCURSOR SDL_X11_MODULE(XCURSOR) -SDL_X11_SYM(XcursorImage*,XcursorImageCreate,(int a,int b),(a,b),) +SDL_X11_SYM(XcursorImage*,XcursorImageCreate,(int a,int b),(a,b),return) SDL_X11_SYM(void,XcursorImageDestroy,(XcursorImage *a),(a),) -SDL_X11_SYM(Cursor,XcursorImageLoadCursor,(Display *a,const XcursorImage *b),(a,b),) +SDL_X11_SYM(Cursor,XcursorImageLoadCursor,(Display *a,const XcursorImage *b),(a,b),return) #endif /* Xinerama support */ #if SDL_VIDEO_DRIVER_X11_XINERAMA SDL_X11_MODULE(XINERAMA) -SDL_X11_SYM(Bool,XineramaIsActive,(Display *a),(a),) -SDL_X11_SYM(Bool,XineramaQueryExtension,(Display *a,int *b,int *c),(a,b,c),) -SDL_X11_SYM(XineramaScreenInfo*,XineramaQueryScreens,(Display *a, int *b),(a,b),) +SDL_X11_SYM(Bool,XineramaIsActive,(Display *a),(a),return) +SDL_X11_SYM(Bool,XineramaQueryExtension,(Display *a,int *b,int *c),(a,b,c),return) +SDL_X11_SYM(XineramaScreenInfo*,XineramaQueryScreens,(Display *a, int *b),(a,b),return) #endif /* XInput support for multiple mice, tablets, etc. */ @@ -229,12 +229,12 @@ SDL_X11_SYM(void,XShapeCombineMask,(Display *dpy,Window dest,int dest_kind,int x #if SDL_VIDEO_DRIVER_X11_XVIDMODE SDL_X11_MODULE(XVIDMODE) -SDL_X11_SYM(Bool,XF86VidModeGetAllModeLines,(Display *a,int b,int *c,XF86VidModeModeInfo ***d),(a,b,c,d),) -SDL_X11_SYM(Bool,XF86VidModeGetModeLine,(Display *a,int b,int *c,XF86VidModeModeLine *d),(a,b,c,d),) -SDL_X11_SYM(Bool,XF86VidModeGetViewPort,(Display *a,int b,int *c,int *d),(a,b,c,d),) -SDL_X11_SYM(Bool,XF86VidModeQueryExtension,(Display *a,int *b,int *c),(a,b,c),) -SDL_X11_SYM(Bool,XF86VidModeQueryVersion,(Display *a,int *b,int *c),(a,b,c),) -SDL_X11_SYM(Bool,XF86VidModeSwitchToMode,(Display *a,int b,XF86VidModeModeInfo *c),(a,b,c),) +SDL_X11_SYM(Bool,XF86VidModeGetAllModeLines,(Display *a,int b,int *c,XF86VidModeModeInfo ***d),(a,b,c,d),return) +SDL_X11_SYM(Bool,XF86VidModeGetModeLine,(Display *a,int b,int *c,XF86VidModeModeLine *d),(a,b,c,d),return) +SDL_X11_SYM(Bool,XF86VidModeGetViewPort,(Display *a,int b,int *c,int *d),(a,b,c,d),return) +SDL_X11_SYM(Bool,XF86VidModeQueryExtension,(Display *a,int *b,int *c),(a,b,c),return) +SDL_X11_SYM(Bool,XF86VidModeQueryVersion,(Display *a,int *b,int *c),(a,b,c),return) +SDL_X11_SYM(Bool,XF86VidModeSwitchToMode,(Display *a,int b,XF86VidModeModeInfo *c),(a,b,c),return) #endif /* *INDENT-ON* */ diff --git a/src/video/x11/SDL_x11touch.c b/src/video/x11/SDL_x11touch.c index 327648d7b..c9f65c783 100644 --- a/src/video/x11/SDL_x11touch.c +++ b/src/video/x11/SDL_x11touch.c @@ -39,7 +39,6 @@ X11_InitTouch(_THIS) FILE *fd; fd = fopen("/proc/bus/input/devices","r"); - char c; int i = 0; int tsfd; char line[256]; @@ -111,7 +110,7 @@ X11_InitTouch(_THIS) } } - close(fd); + fclose(fd); #endif } diff --git a/src/video/x11/SDL_x11window.c b/src/video/x11/SDL_x11window.c index 6421a1fbd..57c19fecc 100644 --- a/src/video/x11/SDL_x11window.c +++ b/src/video/x11/SDL_x11window.c @@ -86,31 +86,6 @@ X11_GetWMStateProperty(_THIS, SDL_Window * window, Atom atoms[3]) return count; } -static void -X11_GetDisplaySize(_THIS, SDL_Window * window, int *w, int *h) -{ - SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; - SDL_DisplayData *displaydata = - (SDL_DisplayData *) SDL_GetDisplayForWindow(window)->driverdata; - XWindowAttributes attr; - - XGetWindowAttributes(data->display, RootWindow(data->display, displaydata->screen), &attr); - if (window->flags & SDL_WINDOW_FULLSCREEN) { - /* The bounds when this window is visible is the fullscreen mode */ - SDL_DisplayMode fullscreen_mode; - if (SDL_GetWindowDisplayMode(window, &fullscreen_mode) == 0) { - attr.width = fullscreen_mode.w; - attr.height = fullscreen_mode.h; - } - } - if (w) { - *w = attr.width; - } - if (h) { - *h = attr.height; - } -} - static int SetupWindowData(_THIS, SDL_Window * window, Window w, BOOL created) { @@ -320,7 +295,6 @@ X11_CreateWindow(_THIS, SDL_Window * window) xattr.border_pixel = 0; if (visual->class == DirectColor) { - Status status; XColor *colorcells; int i; int ncolors; @@ -757,7 +731,6 @@ X11_SetWindowPosition(_THIS, SDL_Window * window) { SDL_WindowData *data = (SDL_WindowData *) window->driverdata; Display *display = data->videodata->display; - int x, y; XMoveWindow(display, data->xwindow, window->x, window->y); XFlush(display); @@ -952,7 +925,7 @@ X11_SetWindowGammaRamp(_THIS, SDL_Window * window, const Uint16 * ramp) int ncolors; int rmask, gmask, bmask; int rshift, gshift, bshift; - int i, j; + int i; if (visual->class != DirectColor) { SDL_SetError("Window doesn't have DirectColor visual"); From d37f894242b7eec90102b52b5b85c2b030efd276 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 13 Oct 2011 01:21:35 -0400 Subject: [PATCH 07/19] Added support for multitouch on Android. Fixes Bugzilla #1294. Thanks to Gabriel Jacobo for the patch! --- .../src/org/libsdl/app/SDLActivity.java | 39 ++++++++++---- src/core/android/SDL_android.cpp | 3 +- src/video/android/SDL_androidtouch.c | 51 +++++++++++++++---- src/video/android/SDL_androidtouch.h | 2 +- 4 files changed, 72 insertions(+), 23 deletions(-) diff --git a/android-project/src/org/libsdl/app/SDLActivity.java b/android-project/src/org/libsdl/app/SDLActivity.java index b883abf60..1e44994ec 100644 --- a/android-project/src/org/libsdl/app/SDLActivity.java +++ b/android-project/src/org/libsdl/app/SDLActivity.java @@ -93,7 +93,8 @@ public class SDLActivity extends Activity { public static native void onNativeResize(int x, int y, int format); public static native void onNativeKeyDown(int keycode); public static native void onNativeKeyUp(int keycode); - public static native void onNativeTouch(int action, float x, + public static native void onNativeTouch(int touchDevId, int pointerFingerId, + int action, float x, float y, float p); public static native void onNativeAccel(float x, float y, float z); public static native void nativeRunAudioThread(); @@ -459,16 +460,34 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, // Touch events public boolean onTouch(View v, MotionEvent event) { - - int action = event.getAction(); - float x = event.getX(); - float y = event.getY(); - float p = event.getPressure(); + { + final int touchDevId = event.getDeviceId(); + final int pointerCount = event.getPointerCount(); + // touchId, pointerId, action, x, y, pressure + int actionPointerIndex = event.getActionIndex(); + int pointerFingerId = event.getPointerId(actionPointerIndex); + int action = event.getActionMasked(); - // TODO: Anything else we need to pass? - SDLActivity.onNativeTouch(action, x, y, p); - return true; - } + float x = event.getX(actionPointerIndex); + float y = event.getY(actionPointerIndex); + float p = event.getPressure(actionPointerIndex); + + if (action == MotionEvent.ACTION_MOVE && pointerCount > 1) { + // TODO send motion to every pointer if its position has + // changed since prev event. + for (int i = 0; i < pointerCount; i++) { + pointerFingerId = event.getPointerId(i); + x = event.getX(i); + y = event.getY(i); + p = event.getPressure(i); + SDLActivity.onNativeTouch(touchDevId, pointerFingerId, action, x, y, p); + } + } else { + SDLActivity.onNativeTouch(touchDevId, pointerFingerId, action, x, y, p); + } + } + return true; + } // Sensor events public void enableSensor(int sensortype, boolean enabled) { diff --git a/src/core/android/SDL_android.cpp b/src/core/android/SDL_android.cpp index 57919b222..2b8da3cb8 100644 --- a/src/core/android/SDL_android.cpp +++ b/src/core/android/SDL_android.cpp @@ -123,9 +123,10 @@ extern "C" void Java_org_libsdl_app_SDLActivity_onNativeKeyUp( // Touch extern "C" void Java_org_libsdl_app_SDLActivity_onNativeTouch( JNIEnv* env, jclass jcls, + jint touch_device_id_in, jint pointer_finger_id_in, jint action, jfloat x, jfloat y, jfloat p) { - Android_OnTouch(action, x, y, p); + Android_OnTouch(touch_device_id_in, pointer_finger_id_in, action, x, y, p); } // Accelerometer diff --git a/src/video/android/SDL_androidtouch.c b/src/video/android/SDL_androidtouch.c index e4dde81d5..5ca966697 100644 --- a/src/video/android/SDL_androidtouch.c +++ b/src/video/android/SDL_androidtouch.c @@ -24,6 +24,7 @@ #include "SDL_events.h" #include "../../events/SDL_mouse_c.h" +#include "../../events/SDL_touch_c.h" #include "SDL_androidtouch.h" @@ -33,27 +34,55 @@ #define ACTION_MOVE 2 #define ACTION_CANCEL 3 #define ACTION_OUTSIDE 4 +// The following two are deprecated but it seems they are still emitted (instead the corresponding ACTION_UP/DOWN) as of Android 3.2 +#define ACTION_POINTER_1_DOWN 5 +#define ACTION_POINTER_1_UP 6 -void Android_OnTouch(int action, float x, float y, float p) +void Android_OnTouch(int touch_device_id_in, int pointer_finger_id_in, int action, float x, float y, float p) { + SDL_TouchID touchDeviceId = 0; + SDL_FingerID fingerId = 0; + if (!Android_Window) { return; } + + touchDeviceId = (SDL_TouchID)touch_device_id_in; + if (!SDL_GetTouch(touchDeviceId)) { + SDL_Touch touch; + memset( &touch, 0, sizeof(touch) ); + touch.id = touchDeviceId; + touch.x_min = 0.0f; + touch.x_max = (float)Android_ScreenWidth; + touch.native_xres = touch.x_max - touch.x_min; + touch.y_min = 0.0f; + touch.y_max = (float)Android_ScreenHeight; + touch.native_yres = touch.y_max - touch.y_min; + touch.pressure_min = 0.0f; + touch.pressure_max = 1.0f; + touch.native_pressureres = touch.pressure_max - touch.pressure_min; + if (SDL_AddTouch(&touch, "") < 0) { + SDL_Log("error: can't add touch %s, %d", __FILE__, __LINE__); + } + } - if ((action != ACTION_CANCEL) && (action != ACTION_OUTSIDE)) { - SDL_SetMouseFocus(Android_Window); - SDL_SendMouseMotion(Android_Window, 0, (int)x, (int)y); - switch(action) { + + fingerId = (SDL_FingerID)pointer_finger_id_in; + switch (action) { case ACTION_DOWN: - SDL_SendMouseButton(Android_Window, SDL_PRESSED, SDL_BUTTON_LEFT); + case ACTION_POINTER_1_DOWN: + SDL_SendFingerDown(touchDeviceId, fingerId, SDL_TRUE, x, y, p); + break; + case ACTION_MOVE: + SDL_SendTouchMotion(touchDeviceId, fingerId, SDL_FALSE, x, y, p); break; case ACTION_UP: - SDL_SendMouseButton(Android_Window, SDL_RELEASED, SDL_BUTTON_LEFT); + case ACTION_POINTER_1_UP: + SDL_SendFingerDown(touchDeviceId, fingerId, SDL_FALSE, x, y, p); break; - } - } else { - SDL_SetMouseFocus(NULL); - } + default: + break; + } } /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/android/SDL_androidtouch.h b/src/video/android/SDL_androidtouch.h index 577494d18..13d0e5d85 100644 --- a/src/video/android/SDL_androidtouch.h +++ b/src/video/android/SDL_androidtouch.h @@ -22,6 +22,6 @@ #include "SDL_androidvideo.h" -extern void Android_OnTouch(int action, float x, float y, float p); +extern void Android_OnTouch( int touch_device_id_in, int pointer_finger_id_in, int action, float x, float y, float p); /* vi: set ts=4 sw=4 expandtab: */ From aff2ea6350439c49938c404f18233bc7504e8a36 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 13 Oct 2011 16:35:25 -0400 Subject: [PATCH 08/19] Don't warn about multichar characters on BeOS/Haiku. The system headers use them generously. (transplanted from 825e1072eac6c950ca4f6e879a91ea199a282b2c) --- configure.in | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/configure.in b/configure.in index 8c0c3d967..22799b9b9 100644 --- a/configure.in +++ b/configure.in @@ -958,6 +958,19 @@ CheckWarnAll() if test x$have_gcc_Wall = xyes; then EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall" + + dnl Haiku headers use multicharacter constants all over the place. Ignore these warnings when using -Wall. + AC_MSG_CHECKING(for necessary GCC -Wno-multichar option) + need_gcc_Wno_multichar=no + case "$host" in + *-*-beos* | *-*-haiku*) + need_gcc_Wno_multichar=yes + ;; + esac + AC_MSG_RESULT($need_gcc_Wno_multichar) + if test x$need_gcc_Wno_multichar = xyes; then + EXTRA_CFLAGS="$EXTRA_CFLAGS -Wno-multichar" + fi fi } From d6af3b40e5cfaa5f50448b37ae114614c5852380 Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Fri, 26 Aug 2011 13:15:05 +0100 Subject: [PATCH 09/19] * Support OpenGL ES 2 on Android --- android-project/src/org/libsdl/app/SDLActivity.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/android-project/src/org/libsdl/app/SDLActivity.java b/android-project/src/org/libsdl/app/SDLActivity.java index 1e44994ec..6bf10b2de 100644 --- a/android-project/src/org/libsdl/app/SDLActivity.java +++ b/android-project/src/org/libsdl/app/SDLActivity.java @@ -1,6 +1,8 @@ package org.libsdl.app; +import javax.microedition.khronos.egl.EGL10; import javax.microedition.khronos.egl.EGLConfig; +import javax.microedition.khronos.egl.EGLContext; import javax.microedition.khronos.opengles.GL10; import javax.microedition.khronos.egl.*; @@ -388,7 +390,13 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, } EGLConfig config = configs[0]; - EGLContext ctx = egl.eglCreateContext(dpy, config, EGL10.EGL_NO_CONTEXT, null); + int EGL_CONTEXT_CLIENT_VERSION=0x3098; + int contextAttrs[] = new int[] + { + EGL_CONTEXT_CLIENT_VERSION, majorVersion, + EGL10.EGL_NONE + }; + EGLContext ctx = egl.eglCreateContext(dpy, config, EGL10.EGL_NO_CONTEXT, contextAttrs); if (ctx == EGL10.EGL_NO_CONTEXT) { Log.e("SDL", "Couldn't create context"); return false; @@ -424,7 +432,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, try { EGL10 egl = (EGL10)EGLContext.getEGL(); - egl.eglWaitNative(EGL10.EGL_NATIVE_RENDERABLE, null); + egl.eglWaitNative(EGL10.EGL_CORE_NATIVE_ENGINE, null); // drawing here From 15426080c6f3c5d798ec006a8e47b05aa65e4e2e Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Fri, 14 Oct 2011 00:20:44 -0400 Subject: [PATCH 10/19] Specify joystick (accelerometer) support for iOS in the config header. Fixes Bugzilla #1292. Thanks to Vittorio Giovara for the patch! --- include/SDL_config_iphoneos.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/SDL_config_iphoneos.h b/include/SDL_config_iphoneos.h index e6a1dea92..f953efef7 100644 --- a/include/SDL_config_iphoneos.h +++ b/include/SDL_config_iphoneos.h @@ -140,6 +140,9 @@ /* enable iPhone keyboard support */ #define SDL_IPHONE_KEYBOARD 1 +/* enable joystick subsystem */ +#define SDL_JOYSTICK_DISABLED 0 + /* Set max recognized G-force from accelerometer See src/joystick/uikit/SDLUIAccelerationDelegate.m for notes on why this is needed */ From 8f4ad957bf3474fdfce10d67ba8200f54a78dcd1 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 13 Oct 2011 01:30:01 -0400 Subject: [PATCH 11/19] Implement GL_GetProcAddress() for Android. Fixes Bugzilla #1290. Thanks to Gabriel Jacobo for the patch! --- src/video/android/SDL_androidgl.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/src/video/android/SDL_androidgl.c b/src/video/android/SDL_androidgl.c index af536e253..f8d47be85 100644 --- a/src/video/android/SDL_androidgl.c +++ b/src/video/android/SDL_androidgl.c @@ -29,26 +29,43 @@ #include +#include + +static void* Android_GLHandle = NULL; /* GL functions */ int Android_GL_LoadLibrary(_THIS, const char *path) { - __android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_LoadLibrary\n"); + if (!Android_GLHandle) { + Android_GLHandle = dlopen("libGLESv1_CM.so",RTLD_GLOBAL); + if (!Android_GLHandle) { + SDL_SetError("Could not initialize GL ES library\n"); + return -1; + } + } return 0; } void * Android_GL_GetProcAddress(_THIS, const char *proc) { - __android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_GetProcAddress\n"); - return 0; + /* + !!! FIXME: this _should_ use eglGetProcAddress(), but it appears to be + !!! FIXME: busted on Android at the moment... + !!! FIXME: http://code.google.com/p/android/issues/detail?id=7681 + !!! FIXME: ...so revisit this later. --ryan. + */ + return dlsym(Android_GLHandle, proc); } void Android_GL_UnloadLibrary(_THIS) { - __android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_UnloadLibrary\n"); + if(Android_GLHandle) { + dlclose(Android_GLHandle); + Android_GLHandle = NULL; + } } SDL_GLContext From 092332dd71731dd055ce4efdcb999c327e694e79 Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Fri, 14 Oct 2011 17:29:49 +0100 Subject: [PATCH 12/19] * Android's InputStream::skip is apparently buggy, so instead read into a dummy buffer --- include/SDL_rwops.h | 1 - src/core/android/SDL_android.cpp | 20 +++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/include/SDL_rwops.h b/include/SDL_rwops.h index 48824f43e..d260f9599 100644 --- a/include/SDL_rwops.h +++ b/include/SDL_rwops.h @@ -89,7 +89,6 @@ typedef struct SDL_RWops void *fileNameRef; void *inputStream; void *inputStreamRef; - void *skipMethod; void *readableByteChannel; void *readableByteChannelRef; void *readMethod; diff --git a/src/core/android/SDL_android.cpp b/src/core/android/SDL_android.cpp index 2b8da3cb8..08bb2d667 100644 --- a/src/core/android/SDL_android.cpp +++ b/src/core/android/SDL_android.cpp @@ -23,6 +23,8 @@ #include "SDL_android.h" +#include + extern "C" { #include "../../events/SDL_events_c.h" #include "../../video/android/SDL_androidkeyboard.h" @@ -346,11 +348,6 @@ static int Android_JNI_FileOpen(SDL_RWops* ctx) ctx->hidden.androidio.inputStream = inputStream; ctx->hidden.androidio.inputStreamRef = mEnv->NewGlobalRef(inputStream); - // Store .skip id for seeking purposes - mid = mEnv->GetMethodID(mEnv->GetObjectClass(inputStream), - "skip", "(J)J"); - ctx->hidden.androidio.skipMethod = mid; - // Despite all the visible documentation on [Asset]InputStream claiming // that the .available() method is not guaranteed to return the entire file // size, comments in /samples//ApiDemos/src/com/example/ ... @@ -518,16 +515,21 @@ extern "C" long Android_JNI_FileSeek(SDL_RWops* ctx, long offset, int whence) long movement = newPosition - ctx->hidden.androidio.position; jobject inputStream = (jobject)ctx->hidden.androidio.inputStream; - jmethodID skipMethod = (jmethodID)ctx->hidden.androidio.skipMethod; if (movement > 0) { + unsigned char buffer[1024]; + // The easy case where we're seeking forwards while (movement > 0) { - // inputStream.skip(...); - movement -= mEnv->CallLongMethod(inputStream, skipMethod, movement); - if (Android_JNI_ExceptionOccurred()) { + size_t result = Android_JNI_FileRead(ctx, buffer, 1, + std::min(movement, (long)sizeof(buffer))); + + if (result <= 0) { + // Failed to read/skip the required amount, so fail return -1; } + + movement -= result; } } else if (movement < 0) { // We can't seek backwards so we have to reopen the file and seek From 7533834caf8a9286753cf9b57a2f882fda04cc43 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sat, 15 Oct 2011 14:16:29 -0700 Subject: [PATCH 13/19] Removed STL dependency in Android code. --- src/core/android/SDL_android.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/core/android/SDL_android.cpp b/src/core/android/SDL_android.cpp index 08bb2d667..774ab4039 100644 --- a/src/core/android/SDL_android.cpp +++ b/src/core/android/SDL_android.cpp @@ -23,8 +23,6 @@ #include "SDL_android.h" -#include - extern "C" { #include "../../events/SDL_events_c.h" #include "../../video/android/SDL_androidkeyboard.h" @@ -521,8 +519,11 @@ extern "C" long Android_JNI_FileSeek(SDL_RWops* ctx, long offset, int whence) // The easy case where we're seeking forwards while (movement > 0) { - size_t result = Android_JNI_FileRead(ctx, buffer, 1, - std::min(movement, (long)sizeof(buffer))); + long amount = (long) sizeof (buffer); + if (amount > movement) { + amount = movement; + } + size_t result = Android_JNI_FileRead(ctx, buffer, 1, amount); if (result <= 0) { // Failed to read/skip the required amount, so fail From f0c4d8739b9070eac35885ddce13bc61ed589c8c Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sat, 15 Oct 2011 14:25:00 -0700 Subject: [PATCH 14/19] Bumped default Android API target to 5 (Android 2.0, up from 1.6). We need this for GLES2 support. --- android-project/default.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android-project/default.properties b/android-project/default.properties index 9d79b12c7..dbf05f24f 100644 --- a/android-project/default.properties +++ b/android-project/default.properties @@ -8,4 +8,4 @@ # project structure. # Project target. -target=android-4 +target=android-5 From d9eb836912ccb3f7c89969def9cbd20aa04549af Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sat, 15 Oct 2011 23:50:06 -0700 Subject: [PATCH 15/19] Don't use a global JNIEnv across threads; it's not thread safe. Obtain the correct environment in a thread-safe way when appropriate instead. Fixes Bugzilla #1312. Thanks to Bill Chenbin for the patch! --- src/core/android/SDL_android.cpp | 71 ++++++++++++++++++++++++++++---- 1 file changed, 63 insertions(+), 8 deletions(-) diff --git a/src/core/android/SDL_android.cpp b/src/core/android/SDL_android.cpp index 774ab4039..0f689ed75 100644 --- a/src/core/android/SDL_android.cpp +++ b/src/core/android/SDL_android.cpp @@ -29,6 +29,14 @@ extern "C" { #include "../../video/android/SDL_androidtouch.h" #include "../../video/android/SDL_androidvideo.h" +#include +#define LOG_TAG "SDL_android" +//#define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__) +//#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__) +#define LOGI(...) do {} while (false) +#define LOGE(...) do {} while (false) + + /* Impelemented in audio/android/SDL_androidaudio.c */ extern void Android_RunAudioThread(); } // C @@ -45,6 +53,7 @@ extern void Android_RunAudioThread(); *******************************************************************************/ static JNIEnv* mEnv = NULL; static JNIEnv* mAudioEnv = NULL; +static JavaVM* mJavaVM; // Main activity static jclass mActivityClass; @@ -68,6 +77,14 @@ static float fLastAccelerometer[3]; // Library init extern "C" jint JNI_OnLoad(JavaVM* vm, void* reserved) { + JNIEnv *env; + mJavaVM = vm; + LOGI("JNI_OnLoad called"); + if (mJavaVM->GetEnv((void**) &env, JNI_VERSION_1_4) != JNI_OK) { + LOGE("Failed to get the environment using GetEnv()"); + return -1; + } + return JNI_VERSION_1_4; } @@ -96,6 +113,7 @@ extern "C" void SDL_Android_Init(JNIEnv* env, jclass cls) !midAudioWriteShortBuffer || !midAudioWriteByteBuffer || !midAudioQuit) { __android_log_print(ANDROID_LOG_WARN, "SDL", "SDL: Couldn't locate Java callbacks, check that they're named and typed correctly"); } + __android_log_print(ANDROID_LOG_INFO, "SDL", "SDL_Android_Init() finished!"); } // Resize @@ -204,29 +222,48 @@ extern "C" int Android_JNI_OpenAudioDevice(int sampleRate, int is16Bit, int chan { int audioBufferFrames; + int status; + JNIEnv *env; + static bool isAttached = false; + status = mJavaVM->GetEnv((void **) &env, JNI_VERSION_1_4); + if(status < 0) { + LOGE("callback_handler: failed to get JNI environment, assuming native thread"); + status = mJavaVM->AttachCurrentThread(&env, NULL); + if(status < 0) { + LOGE("callback_handler: failed to attach current thread"); + return 0; + } + isAttached = true; + } + + __android_log_print(ANDROID_LOG_VERBOSE, "SDL", "SDL audio: opening device"); audioBuffer16Bit = is16Bit; audioBufferStereo = channelCount > 1; - audioBuffer = mEnv->CallStaticObjectMethod(mActivityClass, midAudioInit, sampleRate, audioBuffer16Bit, audioBufferStereo, desiredBufferFrames); + audioBuffer = env->CallStaticObjectMethod(mActivityClass, midAudioInit, sampleRate, audioBuffer16Bit, audioBufferStereo, desiredBufferFrames); if (audioBuffer == NULL) { __android_log_print(ANDROID_LOG_WARN, "SDL", "SDL audio: didn't get back a good audio buffer!"); return 0; } - audioBuffer = mEnv->NewGlobalRef(audioBuffer); + audioBuffer = env->NewGlobalRef(audioBuffer); jboolean isCopy = JNI_FALSE; if (audioBuffer16Bit) { - audioBufferPinned = mEnv->GetShortArrayElements((jshortArray)audioBuffer, &isCopy); - audioBufferFrames = mEnv->GetArrayLength((jshortArray)audioBuffer); + audioBufferPinned = env->GetShortArrayElements((jshortArray)audioBuffer, &isCopy); + audioBufferFrames = env->GetArrayLength((jshortArray)audioBuffer); } else { - audioBufferPinned = mEnv->GetByteArrayElements((jbyteArray)audioBuffer, &isCopy); - audioBufferFrames = mEnv->GetArrayLength((jbyteArray)audioBuffer); + audioBufferPinned = env->GetByteArrayElements((jbyteArray)audioBuffer, &isCopy); + audioBufferFrames = env->GetArrayLength((jbyteArray)audioBuffer); } if (audioBufferStereo) { audioBufferFrames /= 2; } + + if (isAttached) { + mJavaVM->DetachCurrentThread(); + } return audioBufferFrames; } @@ -251,13 +288,31 @@ extern "C" void Android_JNI_WriteAudioBuffer() extern "C" void Android_JNI_CloseAudioDevice() { - mEnv->CallStaticVoidMethod(mActivityClass, midAudioQuit); + int status; + JNIEnv *env; + static bool isAttached = false; + status = mJavaVM->GetEnv((void **) &env, JNI_VERSION_1_4); + if(status < 0) { + LOGE("callback_handler: failed to get JNI environment, assuming native thread"); + status = mJavaVM->AttachCurrentThread(&env, NULL); + if(status < 0) { + LOGE("callback_handler: failed to attach current thread"); + return; + } + isAttached = true; + } + + env->CallStaticVoidMethod(mActivityClass, midAudioQuit); if (audioBuffer) { - mEnv->DeleteGlobalRef(audioBuffer); + env->DeleteGlobalRef(audioBuffer); audioBuffer = NULL; audioBufferPinned = NULL; } + + if (isAttached) { + mJavaVM->DetachCurrentThread(); + } } // Test for an exception and call SDL_SetError with its detail if one occurs From 535f1943d389534a3bfa1307597f79f044d876b4 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Fri, 14 Oct 2011 20:47:53 -0400 Subject: [PATCH 16/19] Fix up some retain/release issues with UIScreenMode objects. Fixes Bugzilla #1191. This patch is based on work done by Vittorio Giovara. --- src/video/uikit/SDL_uikitvideo.m | 14 ++++++++------ src/video/uikit/SDL_uikitwindow.m | 7 ++++++- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/video/uikit/SDL_uikitvideo.m b/src/video/uikit/SDL_uikitvideo.m index 4b9f24071..2678a37aa 100644 --- a/src/video/uikit/SDL_uikitvideo.m +++ b/src/video/uikit/SDL_uikitvideo.m @@ -212,7 +212,8 @@ UIKit_AddDisplay(UIScreen *uiscreen, UIScreenMode *uimode, int w, int h) mode.h = h; mode.refresh_rate = 0; - [uimode retain]; + [uimode retain]; // once for the desktop_mode + [uimode retain]; // once for the current_mode mode.driverdata = uimode; SDL_zero(display); @@ -286,13 +287,14 @@ UIKit_VideoQuit(_THIS) UIScreen *uiscreen = (UIScreen *) display->driverdata; [uiscreen release]; display->driverdata = NULL; + [((UIScreenMode *) display->desktop_mode.driverdata) release]; + display->desktop_mode.driverdata = NULL; + [((UIScreenMode *) display->current_mode.driverdata) release]; + display->current_mode.driverdata = NULL; for (j = 0; j < display->num_display_modes; j++) { SDL_DisplayMode *mode = &display->display_modes[j]; - UIScreenMode *uimode = (UIScreenMode *) mode->driverdata; - if (uimode) { - [uimode release]; - mode->driverdata = NULL; - } + [((UIScreenMode *) mode->driverdata) release]; + mode->driverdata = NULL; } } } diff --git a/src/video/uikit/SDL_uikitwindow.m b/src/video/uikit/SDL_uikitwindow.m index 1745f0033..fc35762a4 100644 --- a/src/video/uikit/SDL_uikitwindow.m +++ b/src/video/uikit/SDL_uikitwindow.m @@ -151,8 +151,13 @@ UIKit_CreateWindow(_THIS, SDL_Window *window) if (bestmode) { UIScreenMode *uimode = (UIScreenMode *) bestmode->driverdata; [uiscreen setCurrentMode:uimode]; - display->desktop_mode = *bestmode; + + // desktop_mode doesn't change here (the higher level will + // use it to set all the screens back to their defaults + // upon window destruction, SDL_Quit(), etc. + [((UIScreenMode *) display->current_mode.driverdata) release]; display->current_mode = *bestmode; + [((UIScreenMode *) display->current_mode.driverdata) retain]; } } } From 73f4a2a1fe9df64c02d0be462b62caa0c59acb02 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sun, 16 Oct 2011 03:02:46 -0400 Subject: [PATCH 17/19] Let iOS use OSAtomicCompareAndSwap32Barrier() if nothing else is available. --- src/atomic/SDL_spinlock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/atomic/SDL_spinlock.c b/src/atomic/SDL_spinlock.c index c96939fb0..653bff0e5 100644 --- a/src/atomic/SDL_spinlock.c +++ b/src/atomic/SDL_spinlock.c @@ -81,7 +81,7 @@ SDL_AtomicTryLock(SDL_SpinLock *lock) : "=r" (result) : "r" (lock), "0" (1) : "cc", "memory"); return (result == 0); -#elif defined(__MACOSX__) +#elif defined(__MACOSX__) || defined(__IPHONEOS__) /* Maybe used for PowerPC, but the Intel asm or gcc atomics are favored. */ return OSAtomicCompareAndSwap32Barrier(0, 1, lock); From e7fb05cb0bfc8380808cb7f91f6f6d9188db2c48 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sun, 16 Oct 2011 03:27:48 -0400 Subject: [PATCH 18/19] Check for __ARM_ARCH_5TEJ__ in spinlock atomics. Fixes Bugzilla #1264. Thanks to Gueniffey for the patch! --- src/atomic/SDL_spinlock.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/atomic/SDL_spinlock.c b/src/atomic/SDL_spinlock.c index 653bff0e5..805afcdaa 100644 --- a/src/atomic/SDL_spinlock.c +++ b/src/atomic/SDL_spinlock.c @@ -60,7 +60,8 @@ SDL_AtomicTryLock(SDL_SpinLock *lock) #elif defined(__GNUC__) && defined(__arm__) && \ (defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__) || \ - defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5TE__)) + defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5TE__) || \ + defined(__ARM_ARCH_5TEJ__)) int result; __asm__ __volatile__ ( "swp %0, %1, [%2]\n" From 2014d62292e314296137a4a3f582ac4d8522628e Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 18 Oct 2011 00:34:45 -0400 Subject: [PATCH 19/19] Don't crash with a NULL thread name. --- src/thread/beos/SDL_systhread.c | 3 ++- src/thread/pthread/SDL_systhread.c | 8 ++++--- src/thread/windows/SDL_systhread.c | 36 ++++++++++++++++-------------- 3 files changed, 26 insertions(+), 21 deletions(-) diff --git a/src/thread/beos/SDL_systhread.c b/src/thread/beos/SDL_systhread.c index 13e2db823..cf2f577b7 100644 --- a/src/thread/beos/SDL_systhread.c +++ b/src/thread/beos/SDL_systhread.c @@ -66,8 +66,9 @@ int SDL_SYS_CreateThread(SDL_Thread * thread, void *args) { /* The docs say the thread name can't be longer than B_OS_NAME_LENGTH. */ + const char *threadname = thread->name ? thread->name : "SDL Thread"; char name[B_OS_NAME_LENGTH]; - SDL_snprintf(name, sizeof (name), "%s", thread->name); + SDL_snprintf(name, sizeof (name), "%s", threadname); name[sizeof (name) - 1] = '\0'; /* Create the thread and go! */ diff --git a/src/thread/pthread/SDL_systhread.c b/src/thread/pthread/SDL_systhread.c index bb4296add..ef4bc2c5a 100644 --- a/src/thread/pthread/SDL_systhread.c +++ b/src/thread/pthread/SDL_systhread.c @@ -82,14 +82,16 @@ SDL_SYS_SetupThread(const char *name) int i; sigset_t mask; + if (name != NULL) { #if ( (__MACOSX__ && (MAC_OS_X_VERSION_MAX_ALLOWED >= 1060)) || \ (__IPHONEOS__ && (__IPHONE_OS_VERSION_MAX_ALLOWED >= 30200)) ) - if (pthread_setname_np != NULL) { pthread_setname_np(name); } + if (pthread_setname_np != NULL) { pthread_setname_np(name); } #elif HAVE_PTHREAD_SETNAME_NP - pthread_setname_np(pthread_self(), name); + pthread_setname_np(pthread_self(), name); #elif HAVE_PTHREAD_SET_NAME_NP - pthread_set_name_np(pthread_self(), name); + pthread_set_name_np(pthread_self(), name); #endif + } /* Mask asynchronous signals for this thread */ sigemptyset(&mask); diff --git a/src/thread/windows/SDL_systhread.c b/src/thread/windows/SDL_systhread.c index e0bd3fbd1..3c133e09c 100644 --- a/src/thread/windows/SDL_systhread.c +++ b/src/thread/windows/SDL_systhread.c @@ -161,25 +161,27 @@ typedef struct tagTHREADNAME_INFO void SDL_SYS_SetupThread(const char *name) { -#if 0 /* !!! FIXME: __except needs C runtime, which we don't link against. */ -#ifdef _MSC_VER /* !!! FIXME: can we do SEH on other compilers yet? */ - /* This magic tells the debugger to name a thread if it's listening. */ - THREADNAME_INFO inf; - inf.dwType = 0x1000; - inf.szName = name; - inf.dwThreadID = (DWORD) -1; - inf.dwFlags = 0; + if (name != NULL) { + #if 0 /* !!! FIXME: __except needs C runtime, which we don't link against. */ + #ifdef _MSC_VER /* !!! FIXME: can we do SEH on other compilers yet? */ + /* This magic tells the debugger to name a thread if it's listening. */ + THREADNAME_INFO inf; + inf.dwType = 0x1000; + inf.szName = name; + inf.dwThreadID = (DWORD) -1; + inf.dwFlags = 0; - __try - { - RaiseException(0x406D1388, 0, sizeof(inf)/sizeof(DWORD), (DWORD*)&inf); + __try + { + RaiseException(0x406D1388, 0, sizeof(inf)/sizeof(DWORD), (DWORD*)&inf); + } + __except(EXCEPTION_CONTINUE_EXECUTION) + { + /* The program itself should ignore this bogus exception. */ + } + #endif + #endif } - __except(EXCEPTION_CONTINUE_EXECUTION) - { - /* The program itself should ignore this bogus exception. */ - } -#endif -#endif } SDL_threadID