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