Commit f48648ae authored by Alexandre Julliard's avatar Alexandre Julliard

msvcrt: Use the msvcrt atoi() function internally.

parent b7fe06d0
......@@ -357,7 +357,7 @@ LCID MSVCRT_locale_to_LCID(const char *locale, unsigned short *codepage, BOOL *s
locale_cp = CP_UTF8;
#endif
} else {
locale_cp = atoi(cp + 1);
locale_cp = MSVCRT_atoi(cp + 1);
}
if (!IsValidCodePage(locale_cp))
return -1;
......@@ -1118,7 +1118,7 @@ static MSVCRT_pthreadlocinfo create_locinfo(int category,
LCID lcid[6] = { 0 };
unsigned short cp[6] = { 0 };
const char *locale_name[6] = { 0 };
int locale_len[6] = { 0 };
int val, locale_len[6] = { 0 };
char buf[256];
BOOL sname;
#if _MSVCR_VER >= 100
......@@ -1437,65 +1437,65 @@ static MSVCRT_pthreadlocinfo create_locinfo(int category,
return NULL;
}
if(GetLocaleInfoA(lcid[MSVCRT_LC_MONETARY], LOCALE_IINTLCURRDIGITS
|LOCALE_NOUSEROVERRIDE, buf, 256))
locinfo->lconv->int_frac_digits = atoi(buf);
if(GetLocaleInfoW(lcid[MSVCRT_LC_MONETARY], LOCALE_IINTLCURRDIGITS
|LOCALE_NOUSEROVERRIDE|LOCALE_RETURN_NUMBER, (WCHAR *)&val, 2))
locinfo->lconv->int_frac_digits = val;
else {
free_locinfo(locinfo);
return NULL;
}
if(GetLocaleInfoA(lcid[MSVCRT_LC_MONETARY], LOCALE_ICURRDIGITS
|LOCALE_NOUSEROVERRIDE, buf, 256))
locinfo->lconv->frac_digits = atoi(buf);
if(GetLocaleInfoW(lcid[MSVCRT_LC_MONETARY], LOCALE_ICURRDIGITS
|LOCALE_NOUSEROVERRIDE|LOCALE_RETURN_NUMBER, (WCHAR *)&val, 2))
locinfo->lconv->frac_digits = val;
else {
free_locinfo(locinfo);
return NULL;
}
if(GetLocaleInfoA(lcid[MSVCRT_LC_MONETARY], LOCALE_IPOSSYMPRECEDES
|LOCALE_NOUSEROVERRIDE, buf, 256))
locinfo->lconv->p_cs_precedes = atoi(buf);
if(GetLocaleInfoW(lcid[MSVCRT_LC_MONETARY], LOCALE_IPOSSYMPRECEDES
|LOCALE_NOUSEROVERRIDE|LOCALE_RETURN_NUMBER, (WCHAR *)&val, 2))
locinfo->lconv->p_cs_precedes = val;
else {
free_locinfo(locinfo);
return NULL;
}
if(GetLocaleInfoA(lcid[MSVCRT_LC_MONETARY], LOCALE_IPOSSEPBYSPACE
|LOCALE_NOUSEROVERRIDE, buf, 256))
locinfo->lconv->p_sep_by_space = atoi(buf);
if(GetLocaleInfoW(lcid[MSVCRT_LC_MONETARY], LOCALE_IPOSSEPBYSPACE
|LOCALE_NOUSEROVERRIDE|LOCALE_RETURN_NUMBER, (WCHAR *)&val, 2))
locinfo->lconv->p_sep_by_space = val;
else {
free_locinfo(locinfo);
return NULL;
}
if(GetLocaleInfoA(lcid[MSVCRT_LC_MONETARY], LOCALE_INEGSYMPRECEDES
|LOCALE_NOUSEROVERRIDE, buf, 256))
locinfo->lconv->n_cs_precedes = atoi(buf);
if(GetLocaleInfoW(lcid[MSVCRT_LC_MONETARY], LOCALE_INEGSYMPRECEDES
|LOCALE_NOUSEROVERRIDE|LOCALE_RETURN_NUMBER, (WCHAR *)&val, 2))
locinfo->lconv->n_cs_precedes = val;
else {
free_locinfo(locinfo);
return NULL;
}
if(GetLocaleInfoA(lcid[MSVCRT_LC_MONETARY], LOCALE_INEGSEPBYSPACE
|LOCALE_NOUSEROVERRIDE, buf, 256))
locinfo->lconv->n_sep_by_space = atoi(buf);
if(GetLocaleInfoW(lcid[MSVCRT_LC_MONETARY], LOCALE_INEGSEPBYSPACE
|LOCALE_NOUSEROVERRIDE|LOCALE_RETURN_NUMBER, (WCHAR *)&val, 2))
locinfo->lconv->n_sep_by_space = val;
else {
free_locinfo(locinfo);
return NULL;
}
if(GetLocaleInfoA(lcid[MSVCRT_LC_MONETARY], LOCALE_IPOSSIGNPOSN
|LOCALE_NOUSEROVERRIDE, buf, 256))
locinfo->lconv->p_sign_posn = atoi(buf);
if(GetLocaleInfoW(lcid[MSVCRT_LC_MONETARY], LOCALE_IPOSSIGNPOSN
|LOCALE_NOUSEROVERRIDE|LOCALE_RETURN_NUMBER, (WCHAR *)&val, 2))
locinfo->lconv->p_sign_posn = val;
else {
free_locinfo(locinfo);
return NULL;
}
if(GetLocaleInfoA(lcid[MSVCRT_LC_MONETARY], LOCALE_INEGSIGNPOSN
|LOCALE_NOUSEROVERRIDE, buf, 256))
locinfo->lconv->n_sign_posn = atoi(buf);
if(GetLocaleInfoW(lcid[MSVCRT_LC_MONETARY], LOCALE_INEGSIGNPOSN
|LOCALE_NOUSEROVERRIDE|LOCALE_RETURN_NUMBER, (WCHAR *)&val, 2))
locinfo->lconv->n_sign_posn = val;
else {
free_locinfo(locinfo);
return NULL;
......
......@@ -1072,6 +1072,7 @@ void* __cdecl MSVCRT_malloc(MSVCRT_size_t);
void* __cdecl MSVCRT_calloc(MSVCRT_size_t,MSVCRT_size_t);
void* __cdecl MSVCRT_realloc(void*,MSVCRT_size_t);
int __cdecl MSVCRT_atoi(const char *str);
int __cdecl MSVCRT_isalpha(int c);
int __cdecl MSVCRT_isdigit(int c);
int __cdecl MSVCRT_isspace(int c);
......
......@@ -2441,7 +2441,7 @@ int CDECL MSVCRT_I10_OUTPUT(MSVCRT__LDOUBLE ld80, int prec, int flag, struct _I1
MSVCRT_sprintf(buf, format, d);
buf[1] = buf[0];
data->pos = atoi(buf+prec+3);
data->pos = MSVCRT_atoi(buf+prec+3);
if(buf[1] != '0')
data->pos++;
......
......@@ -469,7 +469,7 @@ static BOOL get_modified_type(struct datatype_t *ct, struct parsed_symbol* sym,
sym->current++;
if (!(n1 = get_number(sym))) return FALSE;
num = atoi(n1);
num = MSVCRT_atoi(n1);
if (str_modif[0] == ' ' && !modifier)
str_modif++;
......@@ -1007,7 +1007,7 @@ static BOOL demangle_datatype(struct parsed_symbol* sym, struct datatype_t* ct,
sym->current++;
if (!(n1 = get_number(sym))) goto done;
num = atoi(n1);
num = MSVCRT_atoi(n1);
while (num--)
arr = str_printf(sym, "%s[%s]", arr, get_number(sym));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment