SDL-1.2: Merge pull request #865 from ccawley2011/sdl12compat-test-backports

From a7037311cf8228d2d960c4b7d32f9bb7251ccd4f Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Wed, 17 Nov 2021 11:35:02 +0300
Subject: [PATCH 1/8] tests:  silenced several -Wwrite-strings warnings.

---
 test/loopwave.c    | 7 +++----
 test/testalpha.c   | 2 +-
 test/testcdrom.c   | 2 +-
 test/testiconv.c   | 7 +++----
 test/testoverlay.c | 4 ++--
 test/testpalette.c | 2 +-
 test/testsprite.c  | 2 +-
 test/testwin.c     | 2 +-
 test/testwm.c      | 7 +++++--
 test/threadwin.c   | 2 +-
 10 files changed, 19 insertions(+), 18 deletions(-)

diff --git a/test/loopwave.c b/test/loopwave.c
index e1df747a7..426837377 100644
--- a/test/loopwave.c
+++ b/test/loopwave.c
@@ -63,17 +63,16 @@ void poked(int sig)
 int main(int argc, char *argv[])
 {
 	char name[32];
+	const char *file;
 
 	/* Load the SDL library */
 	if ( SDL_Init(SDL_INIT_AUDIO) < 0 ) {
 		fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError());
 		return(1);
 	}
-	if ( argv[1] == NULL ) {
-		argv[1] = "sample.wav";
-	}
+	file = (argc < 2)? "sample.wav" : argv[1];
 	/* Load the wave file into memory */
-	if ( SDL_LoadWAV(argv[1],
+	if ( SDL_LoadWAV(file,
 			&wave.spec, &wave.sound, &wave.soundlen) == NULL ) {
 		fprintf(stderr, "Couldn't load %s: %s\n",
 						argv[1], SDL_GetError());
diff --git a/test/testalpha.c b/test/testalpha.c
index 7e04fbe08..2ba899d03 100644
--- a/test/testalpha.c
+++ b/test/testalpha.c
@@ -178,7 +178,7 @@ static SDL_Rect    position;
 static int         x_vel, y_vel;
 static int	   alpha_vel;
 
-int LoadSprite(SDL_Surface *screen, char *file)
+int LoadSprite(SDL_Surface *screen, const char *file)
 {
 	SDL_Surface *converted;
 
diff --git a/test/testcdrom.c b/test/testcdrom.c
index 2fc6daeb9..f1c4b2a34 100644
--- a/test/testcdrom.c
+++ b/test/testcdrom.c
@@ -51,7 +51,7 @@ static void ListTracks(SDL_CD *cdrom)
 {
 	int i;
 	int m, s, f;
-	char* trtype;
+	const char *trtype;
 
 	SDL_CDStatus(cdrom);
 	printf("Drive tracks: %d\n", cdrom->numtracks);
diff --git a/test/testiconv.c b/test/testiconv.c
index 5f1cff471..bc429a770 100644
--- a/test/testiconv.c
+++ b/test/testiconv.c
@@ -29,6 +29,7 @@ int main(int argc, char *argv[])
 		"UCS4",
 		"UCS-4",
 	};
+	const char *fname;
 	char buffer[BUFSIZ];
 	char *ucs4;
 	char *test[2];
@@ -36,10 +37,8 @@ int main(int argc, char *argv[])
 	FILE *file;
 	int errors = 0;
 
-	if ( !argv[1] ) {
-		argv[1] = "utf8.txt";
-	}
-	file = fopen(argv[1], "rb");
+	fname = (argc < 2) ? "utf8.txt" : argv[1];
+	file = fopen(fname, "rb");
 	if ( !file ) {
 		fprintf(stderr, "Unable to open %s\n", argv[1]);
 		return (1);
diff --git a/test/testoverlay.c b/test/testoverlay.c
index da53f9ea0..0afae05dc 100644
--- a/test/testoverlay.c
+++ b/test/testoverlay.c
@@ -325,7 +325,7 @@ int main(int argc, char **argv)
 	int delay;
 	int desired_bpp;
 	Uint32 video_flags, overlay_format;
-	char *bmpfile;
+	const char *bmpfile;
 #ifdef BENCHMARK_SDL
 	Uint32 then, now;
 #endif
@@ -480,7 +480,7 @@ int main(int argc, char **argv)
 	SDL_WM_SetCaption("SDL test overlay", "testoverlay");
 
 	/* Load picture */
-	bmpfile=(argv[1]?argv[1]:"sample.bmp");
+	bmpfile = argv[1] ? argv[1]:"sample.bmp";
 	pic = SDL_LoadBMP(bmpfile);
 	if ( pic == NULL ) {
 		fprintf(stderr, "Couldn't load %s: %s\n", bmpfile,
diff --git a/test/testpalette.c b/test/testpalette.c
index 2ad49164a..efa07327c 100644
--- a/test/testpalette.c
+++ b/test/testpalette.c
@@ -61,7 +61,7 @@ static void quit(int rc)
 	exit(rc);
 }
 
-static void sdlerr(char *when)
+static void sdlerr(const char *when)
 {
     fprintf(stderr, "SDL error: %s: %s\n", when, SDL_GetError());
     quit(1);
diff --git a/test/testsprite.c b/test/testsprite.c
index 6d9e0a859..da6537bce 100644
--- a/test/testsprite.c
+++ b/test/testsprite.c
@@ -28,7 +28,7 @@ static void quit(int rc)
 	exit(rc);
 }
 
-int LoadSprite(char *file)
+int LoadSprite(const char *file)
 {
 	SDL_Surface *temp;
 
diff --git a/test/testwin.c b/test/testwin.c
index 261ea9942..2fcbd1084 100644
--- a/test/testwin.c
+++ b/test/testwin.c
@@ -18,7 +18,7 @@ static void quit(int rc)
 	exit(rc);
 }
 
-void DrawPict(SDL_Surface *screen, char *bmpfile,
+void DrawPict(SDL_Surface *screen, const char *bmpfile,
 					int speedy, int flip, int nofade)
 {
 	SDL_Surface *picture;
diff --git a/test/testwm.c b/test/testwm.c
index 9c3c0506b..d971589ec 100644
--- a/test/testwm.c
+++ b/test/testwm.c
@@ -60,7 +60,7 @@ int SetVideoMode(int w, int h)
 	return(0);
 }
 
-SDL_Surface *LoadIconSurface(char *file, Uint8 **maskp)
+SDL_Surface *LoadIconSurface(const char *file, Uint8 **maskp)
 {
 	SDL_Surface *icon;
 	Uint8       *pixels;
@@ -330,6 +330,9 @@ int SDLCALL FilterEvents(const SDL_Event *event)
 	}
 }
 
+
+static char testtitle[] = "Testing  1.. 2.. 3...";
+
 int main(int argc, char *argv[])
 {
 	SDL_Event event;
@@ -396,7 +399,7 @@ int main(int argc, char *argv[])
 
 	/* Set the title bar */
 	if ( argv[1] == NULL )
-		title = "Testing  1.. 2.. 3...";
+		title = testtitle;
 	else
 		title = argv[1];
 	SDL_WM_SetCaption(title, "testwm");
diff --git a/test/threadwin.c b/test/threadwin.c
index c704b30d1..761fdbc8f 100644
--- a/test/threadwin.c
+++ b/test/threadwin.c
@@ -21,7 +21,7 @@ static void quit(int rc)
 	exit(rc);
 }
 
-SDL_Surface *LoadIconSurface(char *file, Uint8 **maskp)
+SDL_Surface *LoadIconSurface(const char *file, Uint8 **maskp)
 {
 	SDL_Surface *icon;
 	Uint8       *pixels;

From b1511330a5ebfb94d58d7d5fb2c4f0bb192d902b Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <sezeroz@gmail.com>
Date: Sat, 20 Nov 2021 01:01:10 +0300
Subject: [PATCH 2/8] tests: fixed two oversights in the previous
 -Wwrite-strings patch.

---
 test/loopwave.c  | 8 +++-----
 test/testiconv.c | 5 +++--
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/test/loopwave.c b/test/loopwave.c
index 426837377..414b9eda0 100644
--- a/test/loopwave.c
+++ b/test/loopwave.c
@@ -70,12 +70,10 @@ int main(int argc, char *argv[])
 		fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError());
 		return(1);
 	}
-	file = (argc < 2)? "sample.wav" : argv[1];
+	file = (argc < 2) ? "sample.wav" : argv[1];
 	/* Load the wave file into memory */
-	if ( SDL_LoadWAV(file,
-			&wave.spec, &wave.sound, &wave.soundlen) == NULL ) {
-		fprintf(stderr, "Couldn't load %s: %s\n",
-						argv[1], SDL_GetError());
+	if ( SDL_LoadWAV(file, &wave.spec, &wave.sound, &wave.soundlen) == NULL ) {
+		fprintf(stderr, "Couldn't load %s: %s\n", file, SDL_GetError());
 		quit(1);
 	}
 
diff --git a/test/testiconv.c b/test/testiconv.c
index bc429a770..7e71320c1 100644
--- a/test/testiconv.c
+++ b/test/testiconv.c
@@ -29,7 +29,8 @@ int main(int argc, char *argv[])
 		"UCS4",
 		"UCS-4",
 	};
-	const char *fname;
+
+	const char * fname;
 	char buffer[BUFSIZ];
 	char *ucs4;
 	char *test[2];
@@ -40,7 +41,7 @@ int main(int argc, char *argv[])
 	fname = (argc < 2) ? "utf8.txt" : argv[1];
 	file = fopen(fname, "rb");
 	if ( !file ) {
-		fprintf(stderr, "Unable to open %s\n", argv[1]);
+		fprintf(stderr, "Unable to open %s\n", fname);
 		return (1);
 	}
 

From 9601883f2dda4c45c2aa4f0e77ab4303cd5801e0 Mon Sep 17 00:00:00 2001
From: David Gow <david@ingeniumdigital.com>
Date: Tue, 8 Jun 2021 17:36:48 +0800
Subject: [PATCH 3/8] testoverlay: Remove unused 'flip' variable.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The testoverlay SDL 1.2 test program has a variable 'flip' which is
never used. It seems to be intended to be used for double-buffering/page
flipping, but it's never read from after it's set.

This results in a warning being printed on gcc 10.3:
/home/david/Development/sdl12-compat/test/testoverlay.c: In function ‘main’:
/home/david/Development/sdl12-compat/test/testoverlay.c:324:6: warning: variable ‘flip’ set but not used [-Wunused-but-set-variable]
---
 test/testoverlay.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/test/testoverlay.c b/test/testoverlay.c
index 0afae05dc..436fc95b6 100644
--- a/test/testoverlay.c
+++ b/test/testoverlay.c
@@ -321,7 +321,6 @@ static void PrintUsage(char *argv0)
 int main(int argc, char **argv)
 {
 	char *argv0 = argv[0];
-	int flip;
 	int delay;
 	int desired_bpp;
 	Uint32 video_flags, overlay_format;
@@ -332,7 +331,6 @@ int main(int argc, char **argv)
 	int i;
 
 	/* Set default options and check command-line */
-	flip = 0;
 	scale=0;
         monochrome=0;
         luminance=100;
@@ -473,7 +471,6 @@ int main(int argc, char **argv)
 			(screen->flags&SDL_HWSURFACE) ? "video" : "system");
 	if ( screen->flags & SDL_DOUBLEBUF ) {
 		printf("Double-buffering enabled\n");
-		flip = 1;
 	}
 
 	/* Set the window manager title bar */

From 076abcb66830d11f0f89267eb687c996f4933962 Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <icculus@icculus.org>
Date: Tue, 1 Jun 2021 22:20:42 -0400
Subject: [PATCH 4/8] Fixed a few test app type conversions that Visual Studio
 complains about.

---
 test/graywin.c      |  2 +-
 test/testdyngl.c    |  8 ++++----
 test/testoverlay.c  | 16 ++++++++--------
 test/testoverlay2.c | 20 ++++++++++----------
 test/testsprite.c   |  6 +++---
 5 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/test/graywin.c b/test/graywin.c
index 456311496..c1f8a5dd3 100644
--- a/test/graywin.c
+++ b/test/graywin.c
@@ -24,7 +24,7 @@ void DrawBox(SDL_Surface *screen, int X, int Y, int width, int height)
 
 	/* Seed the random number generator */
 	if ( seeded == 0 ) {
-		srand(time(NULL));
+		srand((unsigned int) time(NULL));
 		seeded = 1;
 	}
 
diff --git a/test/testdyngl.c b/test/testdyngl.c
index a20bd1a48..538b47fcb 100644
--- a/test/testdyngl.c
+++ b/test/testdyngl.c
@@ -138,9 +138,9 @@ int main(int argc,char *argv[])
 
 	for(i=0;i<NB_PIXELS;i++)
 	{
-		pixels[3*i]=rand()%250-125;
-		pixels[3*i+1]=rand()%250-125;
-		pixels[3*i+2]=rand()%250-125;
+		pixels[3*i]=(GLfloat) (rand()%250-125);
+		pixels[3*i+1]=(GLfloat) (rand()%250-125);
+		pixels[3*i+2]=(GLfloat) (rand()%250-125);
 	}
 	
 	f.glViewport(0,0,640,480);
@@ -166,7 +166,7 @@ int main(int argc,char *argv[])
 	f.glEnable(GL_FOG);
 	f.glFogf(GL_FOG_START,-500);
 	f.glFogf(GL_FOG_END,500);
-	f.glFogf(GL_FOG_DENSITY,0.005);
+	f.glFogf(GL_FOG_DENSITY,0.005f);
 	
 	do
 	{
diff --git a/test/testoverlay.c b/test/testoverlay.c
index 436fc95b6..01ab8ed1c 100644
--- a/test/testoverlay.c
+++ b/test/testoverlay.c
@@ -37,11 +37,11 @@ void RGBtoYUV(Uint8 *rgb, int *yuv, int monochrome, int luminance)
     if (monochrome)
     {
 #if 1 /* these are the two formulas that I found on the FourCC site... */
-        yuv[0] = 0.299*rgb[0] + 0.587*rgb[1] + 0.114*rgb[2];
+        yuv[0] = (int) (0.299*rgb[0] + 0.587*rgb[1] + 0.114*rgb[2]);
         yuv[1] = 128;
         yuv[2] = 128;
 #else
-        yuv[0] = (0.257 * rgb[0]) + (0.504 * rgb[1]) + (0.098 * rgb[2]) + 16;
+        yuv[0] = (int) ((0.257 * rgb[0]) + (0.504 * rgb[1]) + (0.098 * rgb[2]) + 16);
         yuv[1] = 128;
         yuv[2] = 128;
 #endif
@@ -49,13 +49,13 @@ void RGBtoYUV(Uint8 *rgb, int *yuv, int monochrome, int luminance)
     else
     {
 #if 1 /* these are the two formulas that I found on the FourCC site... */
-        yuv[0] = 0.299*rgb[0] + 0.587*rgb[1] + 0.114*rgb[2];
-        yuv[1] = (rgb[2]-yuv[0])*0.565 + 128;
-        yuv[2] = (rgb[0]-yuv[0])*0.713 + 128;
+        yuv[0] = (int) (0.299*rgb[0] + 0.587*rgb[1] + 0.114*rgb[2]);
+        yuv[1] = (int) ((rgb[2]-yuv[0])*0.565 + 128);
+        yuv[2] = (int) ((rgb[0]-yuv[0])*0.713 + 128);
 #else
-        yuv[0] = (0.257 * rgb[0]) + (0.504 * rgb[1]) + (0.098 * rgb[2]) + 16;
-        yuv[1] = 128 - (0.148 * rgb[0]) - (0.291 * rgb[1]) + (0.439 * rgb[2]);
-        yuv[2] = 128 + (0.439 * rgb[0]) - (0.368 * rgb[1]) - (0.071 * rgb[2]);
+        yuv[0] = (int) ((0.257 * rgb[0]) + (0.504 * rgb[1]) + (0.098 * rgb[2]) + 16);
+        yuv[1] = (int) (128 - (0.148 * rgb[0]) - (0.291 * rgb[1]) + (0.439 * rgb[2]));
+        yuv[2] = (int) (128 + (0.439 * rgb[0]) - (0.368 * rgb[1]) - (0.071 * rgb[2]));
 #endif
     }
 
diff --git a/test/testoverlay2.c b/test/testoverlay2.c
index 5f491f22d..b93989a11 100644
--- a/test/testoverlay2.c
+++ b/test/testoverlay2.c
@@ -60,11 +60,11 @@ void RGBtoYUV(Uint8 *rgb, int *yuv, int monochrome, int luminance)
     if (monochrome)
     {
 #if 1 /* these are the two formulas that I found on the FourCC site... */
-        yuv[0] = 0.299*rgb[0] + 0.587*rgb[1] + 0.114*rgb[2];
+        yuv[0] = (int) (0.299*rgb[0] + 0.587*rgb[1] + 0.114*rgb[2]);
         yuv[1] = 128;
         yuv[2] = 128;
 #else
-        yuv[0] = (0.257 * rgb[0]) + (0.504 * rgb[1]) + (0.098 * rgb[2]) + 16;
+        yuv[0] = (int) ((0.257 * rgb[0]) + (0.504 * rgb[1]) + (0.098 * rgb[2]) + 16);
         yuv[1] = 128;
         yuv[2] = 128;
 #endif
@@ -72,13 +72,13 @@ void RGBtoYUV(Uint8 *rgb, int *yuv, int monochrome, int luminance)
     else
     {
 #if 1 /* these are the two formulas that I found on the FourCC site... */
-        yuv[0] = 0.299*rgb[0] + 0.587*rgb[1] + 0.114*rgb[2];
-        yuv[1] = (rgb[2]-yuv[0])*0.565 + 128;
-        yuv[2] = (rgb[0]-yuv[0])*0.713 + 128;
+        yuv[0] = (int) (0.299*rgb[0] + 0.587*rgb[1] + 0.114*rgb[2]);
+        yuv[1] = (int) ((rgb[2]-yuv[0])*0.565 + 128);
+        yuv[2] = (int) ((rgb[0]-yuv[0])*0.713 + 128);
 #else
-        yuv[0] = (0.257 * rgb[0]) + (0.504 * rgb[1]) + (0.098 * rgb[2]) + 16;
-        yuv[1] = 128 - (0.148 * rgb[0]) - (0.291 * rgb[1]) + (0.439 * rgb[2]);
-        yuv[2] = 128 + (0.439 * rgb[0]) - (0.368 * rgb[1]) - (0.071 * rgb[2]);
+        yuv[0] = (int) ((0.257 * rgb[0]) + (0.504 * rgb[1]) + (0.098 * rgb[2]) + 16);
+        yuv[1] = (int) (128 - (0.148 * rgb[0]) - (0.291 * rgb[1]) + (0.439 * rgb[2]));
+        yuv[2] = (int) (128 + (0.439 * rgb[0]) - (0.368 * rgb[1]) - (0.071 * rgb[2]));
 #endif
     }
 
@@ -290,7 +290,7 @@ int main(int argc, char **argv)
     int resized=0;
     int i;
     int fps=12;
-    int fpsdelay;
+    Uint32 fpsdelay;
     int overlay_format=SDL_YUY2_OVERLAY;
     int scale=5;
 
@@ -503,7 +503,7 @@ int main(int argc, char **argv)
 
     /* set the start frame */
     i=0;
-    fpsdelay=1000/fps;
+    fpsdelay=(Uint32)(1000/fps);
 
     /* Ignore key up events, they don't even get filtered */
     SDL_EventState(SDL_KEYUP, SDL_IGNORE);
diff --git a/test/testsprite.c b/test/testsprite.c
index da6537bce..f83de9a14 100644
--- a/test/testsprite.c
+++ b/test/testsprite.c
@@ -97,7 +97,7 @@ void MoveSprites(SDL_Surface *screen, Uint32 background)
 
 			Uint32 color = SDL_MapRGB (screen->format, 255, 0, 0);
 			SDL_Rect r;
-			r.x = (sin((float)t * 2 * 3.1459) + 1.0) / 2.0 * (screen->w-20);
+			r.x = (Sint16) ((sin((float)t * 2 * 3.1459) + 1.0) / 2.0 * (screen->w-20));
 			r.y = 0;
 			r.w = 20;
 			r.h = screen->h;
@@ -137,7 +137,7 @@ Uint32 FastestFlags(Uint32 flags, int width, int height, int bpp)
 		/* Direct hardware blitting without double-buffering
 		   causes really bad flickering.
 		 */
-		if ( info->video_mem*1024 > (height*width*bpp/8) ) {
+		if ( info->video_mem*1024 > ((Uint32)(height*width*bpp/8)) ) {
 			flags |= SDL_DOUBLEBUF;
 		} else {
 			flags &= ~SDL_HWSURFACE;
@@ -239,7 +239,7 @@ int main(int argc, char *argv[])
 	sprite_rects += numsprites;
 	sprite_w = sprite->w;
 	sprite_h = sprite->h;
-	srand(time(NULL));
+	srand((unsigned int) time(NULL));
 	for ( i=0; i<numsprites; ++i ) {
 		positions[i].x = rand()%(screen->w - sprite_w);
 		positions[i].y = rand()%(screen->h - sprite_h);

From c55843826e8a33ded6d0af7c95cc921b628cad82 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <sezeroz@gmail.com>
Date: Thu, 15 Jul 2021 21:15:02 +0300
Subject: [PATCH 5/8] testplatform.c: always use %I64 instead of %ll for all
 windows builds;

fixes MinGW gcc warnings:

testplatform.c:115:3: warning: unknown conversion type character 'l' in format
testplatform.c:115:3: warning: unknown conversion type character 'l' in format
testplatform.c:115:3: warning: too many arguments for format
---
 test/testplatform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/testplatform.c b/test/testplatform.c
index a7b0916a4..aed0f5fd0 100644
--- a/test/testplatform.c
+++ b/test/testplatform.c
@@ -109,7 +109,7 @@ int TestEndian(SDL_bool verbose)
 	}
 #ifdef SDL_HAS_64BIT_TYPE
 	if ( verbose ) {
-#ifdef _MSC_VER
+#ifdef _WIN32
 		printf("Value 64 = 0x%I64X, swapped = 0x%I64X\n", value64, SDL_Swap64(value64));
 #else
 		printf("Value 64 = 0x%llX, swapped = 0x%llX\n", (unsigned long long) value64, (unsigned long long) SDL_Swap64(value64));

From f3c9cf1a2604b931246439f96b9410316400c377 Mon Sep 17 00:00:00 2001
From: Daniel Gibson <metalcaedes@gmail.com>
Date: Mon, 8 Nov 2021 00:33:30 +0100
Subject: [PATCH 6/8] checkkeys test: Improve printing of Unicode-Chars
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

.. at least on platforms that use UTF-8, like modern Linux (Windows
should work as well as before).
Also unified the output to print sth like "'Ä' (0x00C4)", i.e. both the
actual char and the unicode constant, on all platforms.
---
 test/checkkeys.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/test/checkkeys.c b/test/checkkeys.c
index b37da9305..2df1d90ed 100644
--- a/test/checkkeys.c
+++ b/test/checkkeys.c
@@ -68,13 +68,19 @@ static void PrintKey(SDL_keysym *sym, int pressed)
 			printf(" (^%c)", sym->unicode+'@');
 		} else {
 #ifdef UNICODE
-			printf(" (%c)", sym->unicode);
-#else
+			printf(" '%c' (0x%.4X)", sym->unicode, (int)sym->unicode);
+#elif defined(_WIN32)
 			/* This is a Latin-1 program, so only show 8-bits */
 			if ( !(sym->unicode & 0xFF00) )
-				printf(" (%c)", sym->unicode);
+				printf(" '%c' (0x%.4X)", sym->unicode, (int)sym->unicode);
 			else
-				printf(" (0x%X)", sym->unicode);
+				printf(" (0x%.4X)", (int)sym->unicode);
+#else /* other platforms than Windows hopefully use UTF-8 for 8bit chars */
+			Uint32 utf32str[2] = { sym->unicode, 0 };
+			const char* utf32type = (SDL_BYTEORDER == SDL_LIL_ENDIAN) ? "UTF-32LE" : "UTF-32BE";
+			char* utf8str = SDL_iconv_string("UTF-8", utf32type, (const char*)utf32str, 2*4);
+			printf(" '%s' (0x%.4X)", utf8str, (int)sym->unicode);
+			SDL_free(utf8str);
 #endif
 		}
 	}

From 2c9bd94dd34564fd9591c76b24d21e10f9b8b528 Mon Sep 17 00:00:00 2001
From: Cameron Cawley <ccawley2011@gmail.com>
Date: Fri, 23 Sep 2022 16:15:49 +0100
Subject: [PATCH 7/8] testsprite: Add -noframe argument

Change from libsdl-org/sdl12-compat@c92f6807e05955fbe35098ff12f687dc6ec12aca
---
 test/testsprite.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/test/testsprite.c b/test/testsprite.c
index f83de9a14..0e2fd17cd 100644
--- a/test/testsprite.c
+++ b/test/testsprite.c
@@ -202,6 +202,9 @@ int main(int argc, char *argv[])
 		if ( strcmp(argv[argc], "-fullscreen") == 0 ) {
 			videoflags ^= SDL_FULLSCREEN;
 		} else
+		if ( strcmp(argv[argc], "-noframe") == 0 ) {
+			videoflags ^= SDL_NOFRAME;
+		} else
 		if ( isdigit(argv[argc][0]) ) {
 			numsprites = atoi(argv[argc]);
 		} else {

From c497db14c187c932ec403058acefa8e970d8ed43 Mon Sep 17 00:00:00 2001
From: Cameron Cawley <ccawley2011@gmail.com>
Date: Fri, 23 Sep 2022 16:17:51 +0100
Subject: [PATCH 8/8] testtimer: Check removing bogus timers

Change from libsdl-org/sdl12-compat@10fe724eb2698f6b2925db1421a8c5bb6af7c8b7 and libsdl-org/sdl12-compat@807814398fb5bcd861eb2891e83fcb8421cd0a24
---
 test/testtimer.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/test/testtimer.c b/test/testtimer.c
index 95608c120..591133995 100644
--- a/test/testtimer.c
+++ b/test/testtimer.c
@@ -82,6 +82,13 @@ int main(int argc, char *argv[])
 	SDL_RemoveTimer(t2);
 	SDL_RemoveTimer(t3);
 
+	printf("Removing bogus timer...");
+	if (SDL_RemoveTimer(t1)) {
+		printf("UHOH, SHOULD HAVE FAILED\n");
+	} else {
+		printf("OK!\n");
+	}
+
 	SDL_Quit();
 	return(0);
 }