diff options
Diffstat (limited to 'libstdc++-v3/src/locale.cc')
-rw-r--r-- | libstdc++-v3/src/locale.cc | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/libstdc++-v3/src/locale.cc b/libstdc++-v3/src/locale.cc index c5c6dd8a049..17ccdc2e4c6 100644 --- a/libstdc++-v3/src/locale.cc +++ b/libstdc++-v3/src/locale.cc @@ -1,4 +1,4 @@ -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -28,7 +28,6 @@ #include <clocale> #include <cstring> -#include <cassert> #include <cctype> #include <cwctype> // For towupper, etc. #include <locale> @@ -449,6 +448,8 @@ namespace std __c_locale locale::facet::_S_c_locale; + char locale::facet::_S_c_name[2]; + locale::facet:: ~facet() { } @@ -500,13 +501,16 @@ namespace std const money_base::pattern money_base::_S_default_pattern = { {symbol, sign, none, value} }; - const char __num_base::_S_atoms[] = "0123456789eEabcdfABCDF"; + const char* __num_base::_S_atoms_in = "0123456789eEabcdfABCDF"; + const char* __num_base::_S_atoms_out ="-+xX0123456789abcdef0123456789ABCDEF"; - bool - __num_base::_S_format_float(const ios_base& __io, char* __fptr, char __mod, - streamsize __prec) + // _GLIBCPP_RESOLVE_LIB_DEFECTS + // According to the resolution of DR 231, about 22.2.2.2.2, p11, + // "str.precision() is specified in the conversion specification". + void + __num_base::_S_format_float(const ios_base& __io, char* __fptr, + char __mod, streamsize/* unused post DR 231 */) { - bool __incl_prec = false; ios_base::fmtflags __flags = __io.flags(); *__fptr++ = '%'; // [22.2.2.2.2] Table 60 @@ -514,13 +518,12 @@ namespace std *__fptr++ = '+'; if (__flags & ios_base::showpoint) *__fptr++ = '#'; - // As per [22.2.2.2.2.11] - if (__flags & ios_base::fixed || __prec > 0) - { - *__fptr++ = '.'; - *__fptr++ = '*'; - __incl_prec = true; - } + + // As per DR 231: _always_, not only when + // __flags & ios_base::fixed || __prec > 0 + *__fptr++ = '.'; + *__fptr++ = '*'; + if (__mod) *__fptr++ = __mod; ios_base::fmtflags __fltfield = __flags & ios_base::floatfield; @@ -532,7 +535,6 @@ namespace std else *__fptr++ = (__flags & ios_base::uppercase) ? 'G' : 'g'; *__fptr = '\0'; - return __incl_prec; } void |