summaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>2003-02-21 08:34:18 +0000
committerbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>2003-02-21 08:34:18 +0000
commit8c726f8b0ccd895f08cb2b1e53c5ab6b13cf5e09 (patch)
tree9c362f225f0593e002759ffa243ee11d9ef106c8 /libstdc++-v3
parentcb71ffb8c065a8a6f1ac9f5c0bb58b15f9d4f9b0 (diff)
downloadgcc-8c726f8b0ccd895f08cb2b1e53c5ab6b13cf5e09.tar.gz
2003-02-21 Jerry Quinn <jlquinn@optonline.net>
* include/bits/locale_facets.tcc (_M_convert_float): Replace numpunct facet accesses with data from __locale_cache. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@63213 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog6
-rw-r--r--libstdc++-v3/include/bits/locale_facets.tcc11
2 files changed, 11 insertions, 6 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index fb3b77fa405..9081936787b 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,8 @@
+2003-02-21 Jerry Quinn <jlquinn@optonline.net>
+
+ * include/bits/locale_facets.tcc (_M_convert_float): Replace
+ numpunct facet accesses with data from __locale_cache.
+
2003-02-20 Phil Edwards <pme@gcc.gnu.org>
* docs/html/faq/index.html (3.9): New note, wchar_t on FreeBSD.
@@ -60,7 +65,6 @@
cache literal string, grouping flag, thousands separator.
(__locale_cache<_CharT>::__locale_cache): New.
(__locale_cache<_CharT>::_M_init): New.
- (__locale_cache<_CharT>::_M_populate): New.
* src/ios.cc: Clear _M_locale_cache in constructor.
* src/locale-inst.cc (__locale_cache<char>, __locale_cache<_char_t>):
New.
diff --git a/libstdc++-v3/include/bits/locale_facets.tcc b/libstdc++-v3/include/bits/locale_facets.tcc
index 857074f976f..cb6dccd19e6 100644
--- a/libstdc++-v3/include/bits/locale_facets.tcc
+++ b/libstdc++-v3/include/bits/locale_facets.tcc
@@ -872,6 +872,9 @@ namespace std
else if (__prec < static_cast<streamsize>(0))
__prec = static_cast<streamsize>(6);
+ typedef __locale_cache<_CharT> __cache_type;
+ __cache_type& __lc = static_cast<__cache_type&>(__io._M_cache());
+
// [22.2.2.2.2] Stage 1, numeric conversion to character.
int __len;
// Long enough for the max format spec.
@@ -917,7 +920,6 @@ namespace std
// numpunct.decimal_point() values for '.' and adding grouping.
const locale __loc = __io.getloc();
const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
- const numpunct<_CharT>& __np = use_facet<numpunct<_CharT> >(__loc);
_CharT* __ws = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
* __len));
@@ -925,21 +927,20 @@ namespace std
// Replace decimal point.
const _CharT __cdec = __ctype.widen('.');
- const _CharT __dec = __np.decimal_point();
+ const _CharT __dec = __lc._M_decimal_point;
const _CharT* __p;
if (__p = char_traits<_CharT>::find(__ws, __len, __cdec))
__ws[__p - __ws] = __dec;
// Add grouping, if necessary.
_CharT* __ws2;
- const string __grouping = __np.grouping();
- if (__grouping.size())
+ if (__lc._M_use_grouping)
{
// Grouping can add (almost) as many separators as the
// number of digits, but no more.
__ws2 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
* __len * 2));
- _M_group_float(__grouping, __np.thousands_sep(), __p,
+ _M_group_float(__lc._M_grouping, __lc._M_thousands_sep, __p,
__ws2, __ws, __len);
__ws = __ws2;
}