Updates the SDL library to the latest standard bugfix release

This commit is contained in:
JeffR 2023-07-13 15:20:29 -05:00
parent cb766f2878
commit 083d2175ea
1280 changed files with 343926 additions and 179615 deletions

View file

@ -1,5 +1,5 @@
/*
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -10,6 +10,11 @@
freely.
*/
/* quiet windows compiler warnings */
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)
#define _CRT_SECURE_NO_WARNINGS
#endif
#include <stdio.h>
#include "SDL.h"
@ -19,15 +24,14 @@ static size_t
widelen(char *data)
{
size_t len = 0;
Uint32 *p = (Uint32 *) data;
Uint32 *p = (Uint32 *)data;
while (*p++) {
++len;
}
return len;
}
int
main(int argc, char *argv[])
int main(int argc, char *argv[])
{
const char *formats[] = {
"UTF8",
@ -44,7 +48,7 @@ main(int argc, char *argv[])
"UCS-4",
};
char * fname;
char *fname;
char buffer[BUFSIZ];
char *ucs4;
char *test[2];
@ -57,9 +61,9 @@ main(int argc, char *argv[])
fname = GetResourceFilename(argc > 1 ? argv[1] : NULL, "utf8.txt");
file = fopen(fname, "rb");
if (!file) {
if (file == NULL) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to open %s\n", fname);
return (1);
return 1;
}
SDL_free(fname);
@ -82,9 +86,11 @@ main(int argc, char *argv[])
}
test[0] = SDL_iconv_string("UTF-8", "UCS-4", ucs4, len);
SDL_free(ucs4);
fputs(test[0], stdout);
(void)fputs(test[0], stdout);
SDL_free(test[0]);
}
fclose(file);
return (errors ? errors + 1 : 0);
(void)fclose(file);
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "Total errors: %d\n", errors);
return errors ? errors + 1 : 0;
}