From 4f3632326091fc7da7f42bc08d9c472b0a1a1cd4 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Wed, 29 Oct 2003 13:34:04 +0000 Subject: [PATCH] c_locale.cc: Add back and . 2003-10-29 Paolo Carlini * config/locale/generic/c_locale.cc: Add back and . * include/bits/locale_facets.tcc (num_get::_M_extract_float): Clean up. From-SVN: r73036 --- libstdc++-v3/ChangeLog | 8 ++++++++ libstdc++-v3/config/locale/generic/c_locale.cc | 2 ++ libstdc++-v3/include/bits/locale_facets.tcc | 16 ++++++---------- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 264136df7e4..e68a7250336 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,11 @@ +2003-10-29 Paolo Carlini + + * config/locale/generic/c_locale.cc: Add back and + . + + * include/bits/locale_facets.tcc (num_get::_M_extract_float): + Clean up. + 2003-10-29 Paolo Carlini * include/bits/locale_facets.tcc (time_put::put): Absolutely diff --git a/libstdc++-v3/config/locale/generic/c_locale.cc b/libstdc++-v3/config/locale/generic/c_locale.cc index 4697357c561..d0f81b8b4e3 100644 --- a/libstdc++-v3/config/locale/generic/c_locale.cc +++ b/libstdc++-v3/config/locale/generic/c_locale.cc @@ -34,6 +34,8 @@ // Written by Benjamin Kosnik #include // For errno +#include // For isinf, finite, finitef, fabs +#include // For strof, strtold #include #ifdef _GLIBCXX_HAVE_IEEEFP_H diff --git a/libstdc++-v3/include/bits/locale_facets.tcc b/libstdc++-v3/include/bits/locale_facets.tcc index 681a4c3870e..fae6988b03c 100644 --- a/libstdc++-v3/include/bits/locale_facets.tcc +++ b/libstdc++-v3/include/bits/locale_facets.tcc @@ -169,7 +169,7 @@ namespace std string __found_grouping; int __sep_pos = 0; bool __e; - while (__beg != __end) + for (; __beg != __end; ++__beg) { // Only look in digits. const char_type __c = *__beg; @@ -182,7 +182,6 @@ namespace std __xtrc += _S_atoms_in[__p - __lit]; __found_mantissa = true; ++__sep_pos; - ++__beg; } else if (__traits_type::eq(__c, __lc->_M_thousands_sep) && __lc->_M_use_grouping && !__found_dec) @@ -193,7 +192,6 @@ namespace std { __found_grouping += static_cast(__sep_pos); __sep_pos = 0; - ++__beg; } else { @@ -211,7 +209,6 @@ namespace std __found_grouping += static_cast(__sep_pos); __xtrc += '.'; __found_dec = true; - ++__beg; } else if ((__e = __traits_type::eq(__c, __lit[_S_ie]) || __traits_type::eq(__c, __lit[_S_iE])) @@ -225,13 +222,12 @@ namespace std { const bool __plus = __traits_type::eq(*__beg, __lit[_S_iplus]); if (__plus || __traits_type::eq(*__beg, __lit[_S_iminus])) - { - __xtrc += __plus ? _S_atoms_in[_S_iplus] - : _S_atoms_in[_S_iminus]; - ++__beg; - } + __xtrc += __plus ? _S_atoms_in[_S_iplus] + : _S_atoms_in[_S_iminus]; + __found_sci = true; } - __found_sci = true; + else + break; } else // Not a valid input item.