Update SDL3 from 3.2.4 to 3.2.20
This commit is contained in:
@@ -368,14 +368,12 @@ static size_t SDL_ScanUnsignedLongLongInternal(const char *text, int count, int
|
||||
negative = *text == '-';
|
||||
++text;
|
||||
}
|
||||
if ((radix == 0 || radix == 16) && *text == '0' && text[1] != '\0') {
|
||||
if ((radix == 0 || radix == 16) && *text == '0' && (text[1] == 'x' || text[1] == 'X')) {
|
||||
text += 2;
|
||||
radix = 16;
|
||||
} else if (radix == 0 && *text == '0' && (text[1] >= '0' && text[1] <= '9')) {
|
||||
++text;
|
||||
if (*text == 'x' || *text == 'X') {
|
||||
radix = 16;
|
||||
++text;
|
||||
} else if (radix == 0) {
|
||||
radix = 8;
|
||||
}
|
||||
radix = 8;
|
||||
} else if (radix == 0) {
|
||||
radix = 10;
|
||||
}
|
||||
@@ -462,14 +460,12 @@ static size_t SDL_ScanUnsignedLongLongInternalW(const wchar_t *text, int count,
|
||||
negative = *text == '-';
|
||||
++text;
|
||||
}
|
||||
if ((radix == 0 || radix == 16) && *text == '0') {
|
||||
if ((radix == 0 || radix == 16) && *text == '0' && (text[1] == 'x' || text[1] == 'X')) {
|
||||
text += 2;
|
||||
radix = 16;
|
||||
} else if (radix == 0 && *text == '0' && (text[1] >= '0' && text[1] <= '9')) {
|
||||
++text;
|
||||
if (*text == 'x' || *text == 'X') {
|
||||
radix = 16;
|
||||
++text;
|
||||
} else if (radix == 0) {
|
||||
radix = 8;
|
||||
}
|
||||
radix = 8;
|
||||
} else if (radix == 0) {
|
||||
radix = 10;
|
||||
}
|
||||
@@ -1448,6 +1444,7 @@ static bool CharacterMatchesSet(char c, const char *set, size_t set_len)
|
||||
// NOLINTNEXTLINE(readability-non-const-parameter)
|
||||
int SDL_vsscanf(const char *text, SDL_SCANF_FORMAT_STRING const char *fmt, va_list ap)
|
||||
{
|
||||
const char *start = text;
|
||||
int result = 0;
|
||||
|
||||
if (!text || !*text) {
|
||||
@@ -1718,6 +1715,36 @@ int SDL_vsscanf(const char *text, SDL_SCANF_FORMAT_STRING const char *fmt, va_li
|
||||
}
|
||||
done = true;
|
||||
break;
|
||||
case 'n':
|
||||
switch (inttype) {
|
||||
case DO_SHORT:
|
||||
{
|
||||
short *valuep = va_arg(ap, short *);
|
||||
*valuep = (short)(text - start);
|
||||
} break;
|
||||
case DO_INT:
|
||||
{
|
||||
int *valuep = va_arg(ap, int *);
|
||||
*valuep = (int)(text - start);
|
||||
} break;
|
||||
case DO_LONG:
|
||||
{
|
||||
long *valuep = va_arg(ap, long *);
|
||||
*valuep = (long)(text - start);
|
||||
} break;
|
||||
case DO_LONGLONG:
|
||||
{
|
||||
long long *valuep = va_arg(ap, long long *);
|
||||
*valuep = (long long)(text - start);
|
||||
} break;
|
||||
case DO_SIZE_T:
|
||||
{
|
||||
size_t *valuep = va_arg(ap, size_t *);
|
||||
*valuep = (size_t)(text - start);
|
||||
} break;
|
||||
}
|
||||
done = true;
|
||||
break;
|
||||
case '[':
|
||||
{
|
||||
const char *set = fmt + 1;
|
||||
|
||||
Reference in New Issue
Block a user