c_locale.cc: Add back <cmath> and <cstdlib>.

2003-10-29  Paolo Carlini  <pcarlini@suse.de>

	* config/locale/generic/c_locale.cc: Add back <cmath>
	and <cstdlib>.

	* include/bits/locale_facets.tcc
	(num_get::_M_extract_float): Clean up.

From-SVN: r73036
This commit is contained in:
Paolo Carlini 2003-10-29 13:34:04 +00:00 committed by Paolo Carlini
parent 6bf0b59cbf
commit 4f36323260
3 changed files with 16 additions and 10 deletions

View File

@ -1,3 +1,11 @@
2003-10-29 Paolo Carlini <pcarlini@suse.de>
* config/locale/generic/c_locale.cc: Add back <cmath> and
<cstdlib>.
* include/bits/locale_facets.tcc (num_get::_M_extract_float):
Clean up.
2003-10-29 Paolo Carlini <pcarlini@suse.de> 2003-10-29 Paolo Carlini <pcarlini@suse.de>
* include/bits/locale_facets.tcc (time_put::put): Absolutely * include/bits/locale_facets.tcc (time_put::put): Absolutely

View File

@ -34,6 +34,8 @@
// Written by Benjamin Kosnik <bkoz@redhat.com> // Written by Benjamin Kosnik <bkoz@redhat.com>
#include <cerrno> // For errno #include <cerrno> // For errno
#include <cmath> // For isinf, finite, finitef, fabs
#include <cstdlib> // For strof, strtold
#include <locale> #include <locale>
#ifdef _GLIBCXX_HAVE_IEEEFP_H #ifdef _GLIBCXX_HAVE_IEEEFP_H

View File

@ -169,7 +169,7 @@ namespace std
string __found_grouping; string __found_grouping;
int __sep_pos = 0; int __sep_pos = 0;
bool __e; bool __e;
while (__beg != __end) for (; __beg != __end; ++__beg)
{ {
// Only look in digits. // Only look in digits.
const char_type __c = *__beg; const char_type __c = *__beg;
@ -182,7 +182,6 @@ namespace std
__xtrc += _S_atoms_in[__p - __lit]; __xtrc += _S_atoms_in[__p - __lit];
__found_mantissa = true; __found_mantissa = true;
++__sep_pos; ++__sep_pos;
++__beg;
} }
else if (__traits_type::eq(__c, __lc->_M_thousands_sep) else if (__traits_type::eq(__c, __lc->_M_thousands_sep)
&& __lc->_M_use_grouping && !__found_dec) && __lc->_M_use_grouping && !__found_dec)
@ -193,7 +192,6 @@ namespace std
{ {
__found_grouping += static_cast<char>(__sep_pos); __found_grouping += static_cast<char>(__sep_pos);
__sep_pos = 0; __sep_pos = 0;
++__beg;
} }
else else
{ {
@ -211,7 +209,6 @@ namespace std
__found_grouping += static_cast<char>(__sep_pos); __found_grouping += static_cast<char>(__sep_pos);
__xtrc += '.'; __xtrc += '.';
__found_dec = true; __found_dec = true;
++__beg;
} }
else if ((__e = __traits_type::eq(__c, __lit[_S_ie]) else if ((__e = __traits_type::eq(__c, __lit[_S_ie])
|| __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]); const bool __plus = __traits_type::eq(*__beg, __lit[_S_iplus]);
if (__plus || __traits_type::eq(*__beg, __lit[_S_iminus])) if (__plus || __traits_type::eq(*__beg, __lit[_S_iminus]))
{ __xtrc += __plus ? _S_atoms_in[_S_iplus]
__xtrc += __plus ? _S_atoms_in[_S_iplus] : _S_atoms_in[_S_iminus];
: _S_atoms_in[_S_iminus]; __found_sci = true;
++__beg;
}
} }
__found_sci = true; else
break;
} }
else else
// Not a valid input item. // Not a valid input item.