forked from Green-Sky/tomato
Merge commit '852f2a6343518919e5ca8d3c1bbcab9f493e3cd8'
This commit is contained in:
7
external/sdl/SDL/src/locale/SDL_locale.c
vendored
7
external/sdl/SDL/src/locale/SDL_locale.c
vendored
@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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
|
||||
@ -31,7 +31,7 @@ static SDL_Locale *build_locales_from_csv_string(char *csv)
|
||||
SDL_Locale *loc;
|
||||
SDL_Locale *retval;
|
||||
|
||||
if (csv == NULL || !csv[0]) {
|
||||
if (!csv || !csv[0]) {
|
||||
return NULL; /* nothing to report */
|
||||
}
|
||||
|
||||
@ -47,8 +47,7 @@ static SDL_Locale *build_locales_from_csv_string(char *csv)
|
||||
alloclen = slen + (num_locales * sizeof(SDL_Locale));
|
||||
|
||||
loc = retval = (SDL_Locale *)SDL_calloc(1, alloclen);
|
||||
if (retval == NULL) {
|
||||
SDL_OutOfMemory();
|
||||
if (!retval) {
|
||||
return NULL; /* oh well */
|
||||
}
|
||||
ptr = (char *)(retval + num_locales);
|
||||
|
2
external/sdl/SDL/src/locale/SDL_syslocale.h
vendored
2
external/sdl/SDL/src/locale/SDL_syslocale.h
vendored
@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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
external/sdl/SDL/src/locale/unix/SDL_syslocale.c
vendored
10
external/sdl/SDL/src/locale/unix/SDL_syslocale.c
vendored
@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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
|
||||
@ -27,12 +27,12 @@ static void normalize_locale_str(char *dst, char *str, size_t buflen)
|
||||
char *ptr;
|
||||
|
||||
ptr = SDL_strchr(str, '.'); /* chop off encoding if specified. */
|
||||
if (ptr != NULL) {
|
||||
if (ptr) {
|
||||
*ptr = '\0';
|
||||
}
|
||||
|
||||
ptr = SDL_strchr(str, '@'); /* chop off extra bits if specified. */
|
||||
if (ptr != NULL) {
|
||||
if (ptr) {
|
||||
*ptr = '\0';
|
||||
}
|
||||
|
||||
@ -71,8 +71,8 @@ int SDL_SYS_GetPreferredLocales(char *buf, size_t buflen)
|
||||
|
||||
SDL_assert(buflen > 0);
|
||||
tmp = SDL_small_alloc(char, buflen, &isstack);
|
||||
if (tmp == NULL) {
|
||||
return SDL_OutOfMemory();
|
||||
if (!tmp) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
*tmp = '\0';
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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
|
||||
@ -65,8 +65,8 @@ static int SDL_SYS_GetPreferredLocales_vista(char *buf, size_t buflen)
|
||||
pGetUserPreferredUILanguages(MUI_LANGUAGE_NAME, &numlangs, NULL, &wbuflen);
|
||||
|
||||
wbuf = SDL_small_alloc(WCHAR, wbuflen, &isstack);
|
||||
if (wbuf == NULL) {
|
||||
return SDL_OutOfMemory();
|
||||
if (!wbuf) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!pGetUserPreferredUILanguages(MUI_LANGUAGE_NAME, &numlangs, wbuf, &wbuflen)) {
|
||||
@ -102,7 +102,7 @@ int SDL_SYS_GetPreferredLocales(char *buf, size_t buflen)
|
||||
}
|
||||
}
|
||||
|
||||
if (pGetUserPreferredUILanguages == NULL) {
|
||||
if (!pGetUserPreferredUILanguages) {
|
||||
SDL_SYS_GetPreferredLocales_winxp(buf, buflen); /* this is always available */
|
||||
} else {
|
||||
SDL_SYS_GetPreferredLocales_vista(buf, buflen); /* available on Vista and later. */
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 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
|
||||
|
Reference in New Issue
Block a user