--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401865
This commit is contained in:
Sam Lantinga 2006-06-20 05:55:23 +00:00
parent a4fb97b662
commit e64b9862f0

View file

@ -511,7 +511,15 @@ long SDL_strtol(const char *string, char **endp, int base)
size_t len;
long value;
len = SDL_ScanLong(string, base ? base : 10, &value);
if ( !base ) {
if ( (SDL_strlen(string) > 2) && (SDL_strncmp(string, "0x", 2) == 0) ) {
base = 16;
} else {
base = 10;
}
}
len = SDL_ScanLong(string, base, &value);
if ( endp ) {
*endp = (char *)string + len;
}
@ -525,7 +533,15 @@ unsigned long SDL_strtoul(const char *string, char **endp, int base)
size_t len;
unsigned long value;
len = SDL_ScanUnsignedLong(string, base ? base : 10, &value);
if ( !base ) {
if ( (SDL_strlen(string) > 2) && (SDL_strncmp(string, "0x", 2) == 0) ) {
base = 16;
} else {
base = 10;
}
}
len = SDL_ScanUnsignedLong(string, base, &value);
if ( endp ) {
*endp = (char *)string + len;
}
@ -593,7 +609,15 @@ Sint64 SDL_strtoll(const char *string, char **endp, int base)
size_t len;
Sint64 value;
len = SDL_ScanLongLong(string, base ? base : 10, &value);
if ( !base ) {
if ( (SDL_strlen(string) > 2) && (SDL_strncmp(string, "0x", 2) == 0) ) {
base = 16;
} else {
base = 10;
}
}
len = SDL_ScanLongLong(string, base, &value);
if ( endp ) {
*endp = (char *)string + len;
}
@ -607,7 +631,15 @@ Uint64 SDL_strtoull(const char *string, char **endp, int base)
size_t len;
Uint64 value;
len = SDL_ScanUnsignedLongLong(string, base ? base : 10, &value);
if ( !base ) {
if ( (SDL_strlen(string) > 2) && (SDL_strncmp(string, "0x", 2) == 0) ) {
base = 16;
} else {
base = 10;
}
}
len = SDL_ScanUnsignedLongLong(string, base, &value);
if ( endp ) {
*endp = (char *)string + len;
}