From 1cd95d4f828c066d5854c77845cbe8c9e97c72f1 Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Wed, 14 Nov 2012 15:39:08 +0100 Subject: [PATCH] msvcp60: Fixed num_put::fput implementation. --- dlls/msvcp60/locale.c | 47 ------------------------------------------- 1 file changed, 47 deletions(-) diff --git a/dlls/msvcp60/locale.c b/dlls/msvcp60/locale.c index 2ed61de9d56..a2a50df162b 100644 --- a/dlls/msvcp60/locale.c +++ b/dlls/msvcp60/locale.c @@ -5732,10 +5732,7 @@ static ostreambuf_iterator_char* num_put_char_fput(const num_put *this, ostreamb ostreambuf_iterator_char dest, ios_base *base, char fill, char *buf, MSVCP_size_t count) { numpunct_char *numpunct = numpunct_char_use_facet(&base->loc); - basic_string_char grouping_bstr; - const char *grouping; char *p, sep = *localeconv()->decimal_point; - int cur_group = 0, group_size = 0; int adjustfield = base->fmtfl & FMTFLAG_adjustfield; MSVCP_size_t pad; @@ -5750,25 +5747,6 @@ static ostreambuf_iterator_char* num_put_char_fput(const num_put *this, ostreamb } p--; - /* Add separators to number */ - numpunct_char_grouping(numpunct, &grouping_bstr); - grouping = basic_string_char_c_str(&grouping_bstr); - sep = grouping[0] ? numpunct_char_thousands_sep(numpunct) : '\0'; - - for(; p>buf && sep && grouping[cur_group]!=CHAR_MAX; p--) { - group_size++; - if(group_size == grouping[cur_group]) { - group_size = 0; - if(grouping[cur_group+1]) - cur_group++; - - memmove(p+1, p, buf+count-p); - *p = sep; - count++; - } - } - basic_string_char_dtor(&grouping_bstr); - /* Display number with padding */ if(count >= base->wide) pad = 0; @@ -6420,11 +6398,7 @@ static ostreambuf_iterator_wchar* num_put__fput(const num_put *this, ostreambuf_ ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, char *buf, MSVCP_size_t count, numpunct_wchar *numpunct) { - basic_string_char grouping_bstr; - const char *grouping; char *p, dec_point = *localeconv()->decimal_point; - wchar_t sep; - int cur_group = 0, group_size = 0; int adjustfield = base->fmtfl & FMTFLAG_adjustfield; MSVCP_size_t i, pad; @@ -6436,25 +6410,6 @@ static ostreambuf_iterator_wchar* num_put__fput(const num_put *this, ostreambuf_ } p--; - /* Add separators to number */ - numpunct_wchar_grouping(numpunct, &grouping_bstr); - grouping = basic_string_char_c_str(&grouping_bstr); - sep = grouping[0] ? numpunct_wchar_thousands_sep(numpunct) : '\0'; - - for(; p>buf && sep && grouping[cur_group]!=CHAR_MAX; p--) { - group_size++; - if(group_size == grouping[cur_group]) { - group_size = 0; - if(grouping[cur_group+1]) - cur_group++; - - memmove(p+1, p, buf+count-p); - *p = '\0'; /* mark thousands separator positions */ - count++; - } - } - basic_string_char_dtor(&grouping_bstr); - /* Display number with padding */ if(count >= base->wide) pad = 0; @@ -6474,8 +6429,6 @@ static ostreambuf_iterator_wchar* num_put__fput(const num_put *this, ostreambuf_ for(i=0; i