summaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2003-10-29 15:02:40 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2003-10-29 15:02:40 +0000
commita6a69f52b49f74e7787a6b05e609eb0e28753b44 (patch)
treeccc48a0bb63969c812e46a5d2b277fdb8e87337e /libstdc++-v3
parentac51a971a5e4c06778cd2fc1f6c3ed9ed34b2357 (diff)
downloadgcc-a6a69f52b49f74e7787a6b05e609eb0e28753b44.tar.gz
2003-10-29 Paolo Carlini <pcarlini@suse.de>
* include/bits/locale_facets.tcc (num_get::_M_extract_float): Revert the last commit, is incorrect, sorry. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@73042 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog5
-rw-r--r--libstdc++-v3/include/bits/locale_facets.tcc18
2 files changed, 16 insertions, 7 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index e68a7250336..b10e8ad0807 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,5 +1,10 @@
2003-10-29 Paolo Carlini <pcarlini@suse.de>
+ * include/bits/locale_facets.tcc (num_get::_M_extract_float):
+ Revert the last commit, is not correct, sorry.
+
+2003-10-29 Paolo Carlini <pcarlini@suse.de>
+
* config/locale/generic/c_locale.cc: Add back <cmath> and
<cstdlib>.
diff --git a/libstdc++-v3/include/bits/locale_facets.tcc b/libstdc++-v3/include/bits/locale_facets.tcc
index fae6988b03c..cb8110888a1 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;
- for (; __beg != __end; ++__beg)
+ while (__beg != __end)
{
// Only look in digits.
const char_type __c = *__beg;
@@ -182,6 +182,7 @@ 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)
@@ -192,6 +193,7 @@ namespace std
{
__found_grouping += static_cast<char>(__sep_pos);
__sep_pos = 0;
+ ++__beg;
}
else
{
@@ -209,6 +211,7 @@ namespace std
__found_grouping += static_cast<char>(__sep_pos);
__xtrc += '.';
__found_dec = true;
+ ++__beg;
}
else if ((__e = __traits_type::eq(__c, __lit[_S_ie])
|| __traits_type::eq(__c, __lit[_S_iE]))
@@ -216,18 +219,19 @@ namespace std
{
// Scientific notation.
__xtrc += __e ? _S_atoms_in[_S_ie] : _S_atoms_in[_S_iE];
-
+ __found_sci = true;
+
// Remove optional plus or minus sign, if they exist.
if (++__beg != __end)
{
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];
- __found_sci = true;
+ {
+ __xtrc += __plus ? _S_atoms_in[_S_iplus]
+ : _S_atoms_in[_S_iminus];
+ ++__beg;
+ }
}
- else
- break;
}
else
// Not a valid input item.