Commit e899bd82 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcp: Fix setting decimal point and thousands separator in numpunct_wchar__Init.

parent d5846519
...@@ -1997,6 +1997,14 @@ int __cdecl _Mbrtowc(wchar_t *out, const char *in, MSVCP_size_t len, int *state, ...@@ -1997,6 +1997,14 @@ int __cdecl _Mbrtowc(wchar_t *out, const char *in, MSVCP_size_t len, int *state,
return 1; return 1;
} }
static inline wchar_t mb_to_wc(char ch, const _Cvtvec *cvt)
{
int state = 0;
wchar_t ret;
return _Mbrtowc(&ret, &ch, 1, &state, cvt) == 1 ? ret : 0;
}
/* ?_Dowiden@?$ctype@_W@std@@IBE_WD@Z */ /* ?_Dowiden@?$ctype@_W@std@@IBE_WD@Z */
/* ?_Dowiden@?$ctype@_W@std@@IEBA_WD@Z */ /* ?_Dowiden@?$ctype@_W@std@@IEBA_WD@Z */
/* ?_Dowiden@?$ctype@G@std@@IBEGD@Z */ /* ?_Dowiden@?$ctype@G@std@@IBEGD@Z */
...@@ -3454,8 +3462,8 @@ static void numpunct_wchar__Init(numpunct_wchar *this, ...@@ -3454,8 +3462,8 @@ static void numpunct_wchar__Init(numpunct_wchar *this,
if(this->grouping) if(this->grouping)
memcpy((char*)this->grouping, lc->grouping, len); memcpy((char*)this->grouping, lc->grouping, len);
this->dp = lc->decimal_point[0]; this->dp = mb_to_wc(lc->decimal_point[0], &cvt);
this->sep = lc->thousands_sep[0]; this->sep = mb_to_wc(lc->thousands_sep[0], &cvt);
} }
if(!this->false_name || !this->true_name || !this->grouping) { if(!this->false_name || !this->true_name || !this->grouping) {
...@@ -4083,14 +4091,6 @@ num_get* num_get_short_use_facet(const locale *loc) ...@@ -4083,14 +4091,6 @@ num_get* num_get_short_use_facet(const locale *loc)
return obj; return obj;
} }
static inline wchar_t mb_to_wc(char ch, const _Cvtvec *cvt)
{
int state = 0;
wchar_t ret;
return _Mbrtowc(&ret, &ch, 1, &state, cvt) == 1 ? ret : 0;
}
static int num_get__Getffld(const num_get *this, char *dest, istreambuf_iterator_wchar *first, static int num_get__Getffld(const num_get *this, char *dest, istreambuf_iterator_wchar *first,
istreambuf_iterator_wchar *last, const locale *loc, numpunct_wchar *numpunct) istreambuf_iterator_wchar *last, const locale *loc, numpunct_wchar *numpunct)
{ {
......
...@@ -2394,6 +2394,14 @@ int __cdecl _Mbrtowc(wchar_t *out, const char *in, MSVCP_size_t len, int *state, ...@@ -2394,6 +2394,14 @@ int __cdecl _Mbrtowc(wchar_t *out, const char *in, MSVCP_size_t len, int *state,
return 1; return 1;
} }
static inline wchar_t mb_to_wc(char ch, const _Cvtvec *cvt)
{
int state = 0;
wchar_t ret;
return _Mbrtowc(&ret, &ch, 1, &state, cvt) == 1 ? ret : 0;
}
/* ?_Dowiden@?$ctype@_W@std@@IBE_WD@Z */ /* ?_Dowiden@?$ctype@_W@std@@IBE_WD@Z */
/* ?_Dowiden@?$ctype@_W@std@@IEBA_WD@Z */ /* ?_Dowiden@?$ctype@_W@std@@IEBA_WD@Z */
/* ?_Dowiden@?$ctype@G@std@@IBEGD@Z */ /* ?_Dowiden@?$ctype@G@std@@IBEGD@Z */
...@@ -4167,8 +4175,8 @@ void __thiscall numpunct_wchar__Init(numpunct_wchar *this, ...@@ -4167,8 +4175,8 @@ void __thiscall numpunct_wchar__Init(numpunct_wchar *this,
if(this->grouping) if(this->grouping)
memcpy((char*)this->grouping, lc->grouping, len); memcpy((char*)this->grouping, lc->grouping, len);
this->dp = lc->decimal_point[0]; this->dp = mb_to_wc(lc->decimal_point[0], &cvt);
this->sep = lc->thousands_sep[0]; this->sep = mb_to_wc(lc->thousands_sep[0], &cvt);
} }
if(!this->false_name || !this->true_name || !this->grouping) { if(!this->false_name || !this->true_name || !this->grouping) {
...@@ -4896,14 +4904,6 @@ num_get* num_get_short_use_facet(const locale *loc) ...@@ -4896,14 +4904,6 @@ num_get* num_get_short_use_facet(const locale *loc)
return obj; return obj;
} }
static inline wchar_t mb_to_wc(char ch, const _Cvtvec *cvt)
{
int state = 0;
wchar_t ret;
return _Mbrtowc(&ret, &ch, 1, &state, cvt) == 1 ? ret : 0;
}
static int num_get__Getffld(const num_get *this, char *dest, istreambuf_iterator_wchar *first, static int num_get__Getffld(const num_get *this, char *dest, istreambuf_iterator_wchar *first,
istreambuf_iterator_wchar *last, const locale *loc, numpunct_wchar *numpunct) istreambuf_iterator_wchar *last, const locale *loc, numpunct_wchar *numpunct)
{ {
......
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