mirror of git://gcc.gnu.org/git/gcc.git
numeric_traits.h: Do not include <limits>.
2007-04-13 Paolo Carlini <pcarlini@suse.de> * include/ext/numeric_traits.h: Do not include <limits>. (__numeric_traits_integer::__is_signed, __digits): Add. (__numeric_traits_floating::__digits10, __max_exponent10): Add. * src/istream.cc (ignore<char>(streamsize, int_type), operator>> (basic_istream<char>&, char*), ignore<wchar_t>(streamsize, int_type)): Use the latter. * src/compatibility.cc (ignore<char>(streamsize), ignore<wchar_t>(streamsize)): Likewise. * include/ext/vstring_util.h (__vstring_utility<>::_S_compare): Likewise. * include/bits/stl_memory.h (__get_temporary_buffer): Likewise. * include/bits/stl_algobase.h (lexicographical_compare(const char*, const char*, const char*, const char*)): Likewise. * include/bits/locale_facets.tcc (num_get<>::_M_extract_int(_InIter, _InIter, ios_base&, ios_base::iostate&, _ValueT&), num_put<>::_M_insert_int(_OutIter, ios_base&, _CharT, _ValueT), num_put<>::_M_insert_float(_OutIter, ios_base&, _CharT, char, _ValueT), collate<>::do_hash(const _CharT*, const _CharT*)): Likewise. * include/bits/basic_string.h (basic_string<>::_S_compare): Likewise. * include/bits/istream.tcc (operator>>(short&), operator>>(int&), ignore(streamsize), ignore(streamsize, int_type), operator>> (basic_istream<>&, _CharT*)): Likewise. * include/bits/stl_bvector.h (vector<bool>::max_size): Likewise. * include/tr1/functional_hash.h (struct hash<long double>): Likewise. * include/std/istream: Do not include <limits>. * include/tr1/cmath: Include <limits>. * testsuite/23_containers/vector/bool/capacity/29134.cc: Likewise. * testsuite/27_io/basic_istream/extractors_arithmetic/char/12.cc: Likewise. * testsuite/27_io/basic_istream/extractors_arithmetic/char/13.cc: Likewise. * testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/12.cc: Likewise. * testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/13.cc: Likewise. * testsuite/27_io/ios_base/storage/2.cc: Likewise. * include/tr1/hashtable: Do not include the whole <iterator>. From-SVN: r123779
This commit is contained in:
parent
9bb6aa4304
commit
6725add54e
|
@ -1,3 +1,44 @@
|
|||
2007-04-13 Paolo Carlini <pcarlini@suse.de>
|
||||
|
||||
* include/ext/numeric_traits.h: Do not include <limits>.
|
||||
(__numeric_traits_integer::__is_signed, __digits): Add.
|
||||
(__numeric_traits_floating::__digits10, __max_exponent10): Add.
|
||||
* src/istream.cc (ignore<char>(streamsize, int_type), operator>>
|
||||
(basic_istream<char>&, char*), ignore<wchar_t>(streamsize,
|
||||
int_type)): Use the latter.
|
||||
* src/compatibility.cc (ignore<char>(streamsize),
|
||||
ignore<wchar_t>(streamsize)): Likewise.
|
||||
* include/ext/vstring_util.h (__vstring_utility<>::_S_compare):
|
||||
Likewise.
|
||||
* include/bits/stl_memory.h (__get_temporary_buffer): Likewise.
|
||||
* include/bits/stl_algobase.h (lexicographical_compare(const char*,
|
||||
const char*, const char*, const char*)): Likewise.
|
||||
* include/bits/locale_facets.tcc (num_get<>::_M_extract_int(_InIter,
|
||||
_InIter, ios_base&, ios_base::iostate&, _ValueT&),
|
||||
num_put<>::_M_insert_int(_OutIter, ios_base&, _CharT, _ValueT),
|
||||
num_put<>::_M_insert_float(_OutIter, ios_base&, _CharT, char,
|
||||
_ValueT), collate<>::do_hash(const _CharT*, const _CharT*)): Likewise.
|
||||
* include/bits/basic_string.h (basic_string<>::_S_compare): Likewise.
|
||||
* include/bits/istream.tcc (operator>>(short&), operator>>(int&),
|
||||
ignore(streamsize), ignore(streamsize, int_type), operator>>
|
||||
(basic_istream<>&, _CharT*)): Likewise.
|
||||
* include/bits/stl_bvector.h (vector<bool>::max_size): Likewise.
|
||||
* include/tr1/functional_hash.h (struct hash<long double>): Likewise.
|
||||
* include/std/istream: Do not include <limits>.
|
||||
* include/tr1/cmath: Include <limits>.
|
||||
* testsuite/23_containers/vector/bool/capacity/29134.cc: Likewise.
|
||||
* testsuite/27_io/basic_istream/extractors_arithmetic/char/12.cc:
|
||||
Likewise.
|
||||
* testsuite/27_io/basic_istream/extractors_arithmetic/char/13.cc:
|
||||
Likewise.
|
||||
* testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/12.cc:
|
||||
Likewise.
|
||||
* testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/13.cc:
|
||||
Likewise.
|
||||
* testsuite/27_io/ios_base/storage/2.cc: Likewise.
|
||||
|
||||
* include/tr1/hashtable: Do not include the whole <iterator>.
|
||||
|
||||
2007-04-11 Paolo Carlini <pcarlini@suse.de>
|
||||
|
||||
* config/locale/gnu/c_locale.h: Do not include <langinfo.h>
|
||||
|
|
|
@ -395,12 +395,12 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
|||
{
|
||||
const difference_type __d = difference_type(__n1 - __n2);
|
||||
|
||||
if (__d > numeric_limits<int>::max())
|
||||
return numeric_limits<int>::max();
|
||||
else if (__d < numeric_limits<int>::min())
|
||||
return numeric_limits<int>::min();
|
||||
if (__d > __gnu_cxx::__numeric_traits<int>::__max)
|
||||
return __gnu_cxx::__numeric_traits<int>::__max;
|
||||
else if (__d < __gnu_cxx::__numeric_traits<int>::__min)
|
||||
return __gnu_cxx::__numeric_traits<int>::__min;
|
||||
else
|
||||
return int(__d);
|
||||
return int(__d);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -117,8 +117,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
|||
_M_extract(__l);
|
||||
if (!this->fail())
|
||||
{
|
||||
if (numeric_limits<short>::min() <= __l
|
||||
&& __l <= numeric_limits<short>::max())
|
||||
if (__gnu_cxx::__numeric_traits<short>::__min <= __l
|
||||
&& __l <= __gnu_cxx::__numeric_traits<short>::__max)
|
||||
__n = short(__l);
|
||||
else
|
||||
this->setstate(ios_base::failbit);
|
||||
|
@ -137,8 +137,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
|||
_M_extract(__l);
|
||||
if (!this->fail())
|
||||
{
|
||||
if (numeric_limits<int>::min() <= __l
|
||||
&& __l <= numeric_limits<int>::max())
|
||||
if (__gnu_cxx::__numeric_traits<int>::__min <= __l
|
||||
&& __l <= __gnu_cxx::__numeric_traits<int>::__max)
|
||||
__n = int(__l);
|
||||
else
|
||||
this->setstate(ios_base::failbit);
|
||||
|
@ -432,10 +432,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
|||
++_M_gcount;
|
||||
__c = __sb->snextc();
|
||||
}
|
||||
if (__n == numeric_limits<streamsize>::max()
|
||||
if (__n == __gnu_cxx::__numeric_traits<streamsize>::__max
|
||||
&& !traits_type::eq_int_type(__c, __eof))
|
||||
{
|
||||
_M_gcount = numeric_limits<streamsize>::min();
|
||||
_M_gcount =
|
||||
__gnu_cxx::__numeric_traits<streamsize>::__min;
|
||||
__large_ignore = true;
|
||||
}
|
||||
else
|
||||
|
@ -443,7 +444,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
|||
}
|
||||
|
||||
if (__large_ignore)
|
||||
_M_gcount = numeric_limits<streamsize>::max();
|
||||
_M_gcount = __gnu_cxx::__numeric_traits<streamsize>::__max;
|
||||
|
||||
if (traits_type::eq_int_type(__c, __eof))
|
||||
__err |= ios_base::eofbit;
|
||||
|
@ -483,11 +484,12 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
|||
++_M_gcount;
|
||||
__c = __sb->snextc();
|
||||
}
|
||||
if (__n == numeric_limits<streamsize>::max()
|
||||
if (__n == __gnu_cxx::__numeric_traits<streamsize>::__max
|
||||
&& !traits_type::eq_int_type(__c, __eof)
|
||||
&& !traits_type::eq_int_type(__c, __delim))
|
||||
{
|
||||
_M_gcount = numeric_limits<streamsize>::min();
|
||||
_M_gcount =
|
||||
__gnu_cxx::__numeric_traits<streamsize>::__min;
|
||||
__large_ignore = true;
|
||||
}
|
||||
else
|
||||
|
@ -495,13 +497,14 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
|||
}
|
||||
|
||||
if (__large_ignore)
|
||||
_M_gcount = numeric_limits<streamsize>::max();
|
||||
_M_gcount = __gnu_cxx::__numeric_traits<streamsize>::__max;
|
||||
|
||||
if (traits_type::eq_int_type(__c, __eof))
|
||||
__err |= ios_base::eofbit;
|
||||
else if (traits_type::eq_int_type(__c, __delim))
|
||||
{
|
||||
if (_M_gcount < numeric_limits<streamsize>::max())
|
||||
if (_M_gcount
|
||||
< __gnu_cxx::__numeric_traits<streamsize>::__max)
|
||||
++_M_gcount;
|
||||
__sb->sbumpc();
|
||||
}
|
||||
|
@ -800,7 +803,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
|||
// Figure out how many characters to extract.
|
||||
streamsize __num = __in.width();
|
||||
if (__num <= 0)
|
||||
__num = numeric_limits<streamsize>::max();
|
||||
__num = __gnu_cxx::__numeric_traits<streamsize>::__max;
|
||||
|
||||
const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc());
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
|
||||
#pragma GCC system_header
|
||||
|
||||
#include <limits> // For numeric_limits
|
||||
#include <ext/numeric_traits.h>
|
||||
#include <typeinfo> // For bad_cast.
|
||||
#include <bits/streambuf_iterator.h>
|
||||
#include <ext/type_traits.h>
|
||||
|
@ -538,7 +538,7 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
|
|||
if (!__testeof)
|
||||
{
|
||||
__c = *__beg;
|
||||
if (numeric_limits<_ValueT>::is_signed)
|
||||
if (__gnu_cxx::__numeric_traits<_ValueT>::__is_signed)
|
||||
__negative = __c == __lit[__num_base::_S_iminus];
|
||||
if ((__negative || __c == __lit[__num_base::_S_iplus])
|
||||
&& !(__lc->_M_use_grouping && __c == __lc->_M_thousands_sep)
|
||||
|
@ -607,8 +607,9 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
|
|||
if (__lc->_M_use_grouping)
|
||||
__found_grouping.reserve(32);
|
||||
bool __testfail = false;
|
||||
const __unsigned_type __max = __negative ?
|
||||
-numeric_limits<_ValueT>::min() : numeric_limits<_ValueT>::max();
|
||||
const __unsigned_type __max = __negative
|
||||
? -__gnu_cxx::__numeric_traits<_ValueT>::__min
|
||||
: __gnu_cxx::__numeric_traits<_ValueT>::__max;
|
||||
const __unsigned_type __smax = __max / __base;
|
||||
__unsigned_type __result = 0;
|
||||
int __digit = 0;
|
||||
|
@ -1029,7 +1030,7 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
|
|||
if (__v > 0)
|
||||
{
|
||||
if (__flags & ios_base::showpos
|
||||
&& numeric_limits<_ValueT>::is_signed)
|
||||
&& __gnu_cxx::__numeric_traits<_ValueT>::__is_signed)
|
||||
*--__cs = __lit[__num_base::_S_oplus], ++__len;
|
||||
}
|
||||
else if (__v)
|
||||
|
@ -1116,7 +1117,8 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
|
|||
// Use default precision if out of range.
|
||||
const streamsize __prec = __io.precision() < 0 ? 6 : __io.precision();
|
||||
|
||||
const int __max_digits = numeric_limits<_ValueT>::digits10;
|
||||
const int __max_digits =
|
||||
__gnu_cxx::__numeric_traits<_ValueT>::__digits10;
|
||||
|
||||
// [22.2.2.2.2] Stage 1, numeric conversion to character.
|
||||
int __len;
|
||||
|
@ -1143,7 +1145,8 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
|
|||
#else
|
||||
// Consider the possibility of long ios_base::fixed outputs
|
||||
const bool __fixed = __io.flags() & ios_base::fixed;
|
||||
const int __max_exp = numeric_limits<_ValueT>::max_exponent10;
|
||||
const int __max_exp =
|
||||
__gnu_cxx::__numeric_traits<_ValueT>::__max_exponent10;
|
||||
|
||||
// The size of the output string is computed as follows.
|
||||
// ios_base::fixed outputs may need up to __max_exp + 1 chars
|
||||
|
@ -1790,7 +1793,8 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
|
|||
}
|
||||
#else
|
||||
// max_exponent10 + 1 for the integer part, + 2 for sign and '\0'.
|
||||
const int __cs_size = numeric_limits<long double>::max_exponent10 + 3;
|
||||
const int __cs_size =
|
||||
__gnu_cxx::__numeric_traits<long double>::__max_exponent10 + 3;
|
||||
char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
|
||||
int __len = std::__convert_from_v(_S_get_c_locale(), __cs, 0, "%.*Lf",
|
||||
0, __units);
|
||||
|
@ -2499,8 +2503,10 @@ _GLIBCXX_END_LDBL_NAMESPACE
|
|||
{
|
||||
unsigned long __val = 0;
|
||||
for (; __lo < __hi; ++__lo)
|
||||
__val = *__lo + ((__val << 7) |
|
||||
(__val >> (numeric_limits<unsigned long>::digits - 7)));
|
||||
__val =
|
||||
*__lo + ((__val << 7)
|
||||
| (__val >> (__gnu_cxx::__numeric_traits<unsigned long>::
|
||||
__digits - 7)));
|
||||
return static_cast<long>(__val);
|
||||
}
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@
|
|||
#include <bits/stl_pair.h>
|
||||
#include <bits/cpp_type_traits.h>
|
||||
#include <ext/type_traits.h>
|
||||
#include <limits>
|
||||
#include <ext/numeric_traits.h>
|
||||
#include <bits/stl_iterator_base_types.h>
|
||||
#include <bits/stl_iterator_base_funcs.h>
|
||||
#include <bits/stl_iterator.h>
|
||||
|
@ -1018,7 +1018,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
|||
__glibcxx_requires_valid_range(__first1, __last1);
|
||||
__glibcxx_requires_valid_range(__first2, __last2);
|
||||
|
||||
if (std::numeric_limits<char>::is_signed)
|
||||
if (__gnu_cxx::__numeric_traits<char>::__is_signed)
|
||||
return std::lexicographical_compare((const signed char*) __first1,
|
||||
(const signed char*) __last1,
|
||||
(const signed char*) __first2,
|
||||
|
|
|
@ -583,7 +583,8 @@ template<typename _Alloc>
|
|||
max_size() const
|
||||
{
|
||||
const size_type __isize =
|
||||
std::numeric_limits<difference_type>::max() - int(_S_word_bit) + 1;
|
||||
__gnu_cxx::__numeric_traits<difference_type>::__max
|
||||
- int(_S_word_bit) + 1;
|
||||
const size_type __asize = _M_get_Bit_allocator().max_size();
|
||||
return (__asize <= __isize / int(_S_word_bit)
|
||||
? __asize * int(_S_word_bit) : __isize);
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
#include <bits/stl_uninitialized.h>
|
||||
#include <bits/stl_raw_storage_iter.h>
|
||||
#include <debug/debug.h>
|
||||
#include <limits>
|
||||
|
||||
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||
|
||||
|
@ -57,7 +56,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
|||
pair<_Tp*, ptrdiff_t>
|
||||
__get_temporary_buffer(ptrdiff_t __len, _Tp*)
|
||||
{
|
||||
const ptrdiff_t __max = numeric_limits<ptrdiff_t>::max() / sizeof(_Tp);
|
||||
const ptrdiff_t __max =
|
||||
__gnu_cxx::__numeric_traits<ptrdiff_t>::__max / sizeof(_Tp);
|
||||
if (__len > __max)
|
||||
__len = __max;
|
||||
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
|
||||
#pragma GCC system_header
|
||||
|
||||
#include <limits>
|
||||
#include <bits/cpp_type_traits.h>
|
||||
#include <ext/type_traits.h>
|
||||
|
||||
|
@ -62,6 +61,11 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
|
|||
// Only integers for initialization of member constant.
|
||||
static const _Value __min = __glibcxx_min(_Value);
|
||||
static const _Value __max = __glibcxx_max(_Value);
|
||||
|
||||
// NB: these two also available in std::numeric_limits as compile
|
||||
// time constants, but <limits> is big and we avoid including it.
|
||||
static const bool __is_signed = __glibcxx_signed(_Value);
|
||||
static const int __digits = __glibcxx_digits(_Value);
|
||||
};
|
||||
|
||||
template<typename _Value>
|
||||
|
@ -70,17 +74,52 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
|
|||
template<typename _Value>
|
||||
const _Value __numeric_traits_integer<_Value>::__max;
|
||||
|
||||
template<typename _Value>
|
||||
const bool __numeric_traits_integer<_Value>::__is_signed;
|
||||
|
||||
template<typename _Value>
|
||||
const int __numeric_traits_integer<_Value>::__digits;
|
||||
|
||||
#undef __glibcxx_signed
|
||||
#undef __glibcxx_digits
|
||||
#undef __glibcxx_min
|
||||
#undef __glibcxx_max
|
||||
|
||||
#define __glibcxx_floating(_Tp, _Fval, _Dval, _LDval) \
|
||||
(std::__are_same<_Tp, float>::__value ? _Fval \
|
||||
: std::__are_same<_Tp, double>::__value ? _Dval : _LDval)
|
||||
|
||||
#define __glibcxx_max_digits10(_Tp) \
|
||||
(2 + __glibcxx_floating(_Tp, __FLT_MANT_DIG__, __DBL_MANT_DIG__, \
|
||||
__LDBL_MANT_DIG__) * 3010 / 10000)
|
||||
|
||||
#define __glibcxx_digits10(_Tp) \
|
||||
__glibcxx_floating(_Tp, __FLT_DIG__, __DBL_DIG__, __LDBL_DIG__)
|
||||
|
||||
#define __glibcxx_max_exponent10(_Tp) \
|
||||
__glibcxx_floating(_Tp, __FLT_MAX_10_EXP__, __DBL_MAX_10_EXP__, \
|
||||
__LDBL_MAX_10_EXP__)
|
||||
|
||||
template<typename _Value>
|
||||
struct __numeric_traits_floating
|
||||
{
|
||||
// Only floating point types. See N1822.
|
||||
static const int __max_digits10 =
|
||||
2 + std::numeric_limits<_Value>::digits * 3010/10000;
|
||||
static const int __max_digits10 = __glibcxx_max_digits10(_Value);
|
||||
|
||||
// See above comment...
|
||||
static const int __digits10 = __glibcxx_digits10(_Value);
|
||||
static const int __max_exponent10 = __glibcxx_max_exponent10(_Value);
|
||||
};
|
||||
|
||||
template<typename _Value>
|
||||
const int __numeric_traits_floating<_Value>::__max_digits10;
|
||||
|
||||
template<typename _Value>
|
||||
const int __numeric_traits_floating<_Value>::__digits10;
|
||||
|
||||
template<typename _Value>
|
||||
const int __numeric_traits_floating<_Value>::__max_exponent10;
|
||||
|
||||
template<typename _Value>
|
||||
struct __numeric_traits
|
||||
: public __conditional_type<std::__is_integer<_Value>::__value,
|
||||
|
@ -90,9 +129,9 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
|
|||
|
||||
_GLIBCXX_END_NAMESPACE
|
||||
|
||||
#undef __glibcxx_signed
|
||||
#undef __glibcxx_min
|
||||
#undef __glibcxx_max
|
||||
#undef __glibcxx_digits
|
||||
#undef __glibcxx_floating
|
||||
#undef __glibcxx_max_digits10
|
||||
#undef __glibcxx_digits10
|
||||
#undef __glibcxx_max_exponent10
|
||||
|
||||
#endif
|
||||
|
|
|
@ -165,12 +165,12 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
|
|||
{
|
||||
const difference_type __d = difference_type(__n1 - __n2);
|
||||
|
||||
if (__d > std::numeric_limits<int>::max())
|
||||
return std::numeric_limits<int>::max();
|
||||
else if (__d < std::numeric_limits<int>::min())
|
||||
return std::numeric_limits<int>::min();
|
||||
if (__d > __numeric_traits_integer<int>::__max)
|
||||
return __numeric_traits_integer<int>::__max;
|
||||
else if (__d < __numeric_traits_integer<int>::__min)
|
||||
return __numeric_traits_integer<int>::__min;
|
||||
else
|
||||
return int(__d);
|
||||
return int(__d);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -45,7 +45,6 @@
|
|||
#include <ios>
|
||||
#include <locale>
|
||||
#include <ostream>
|
||||
#include <limits> // For numeric_limits
|
||||
|
||||
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
|
||||
#include <bits/c++config.h>
|
||||
#include <bits/stl_algobase.h>
|
||||
#include <limits>
|
||||
#include <cmath>
|
||||
#include <tr1/common.h>
|
||||
|
||||
|
|
|
@ -208,7 +208,7 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
|
|||
__ldval = __ldval < 0.0l ? -(__ldval + 0.5l) : __ldval;
|
||||
|
||||
const long double __mult =
|
||||
std::numeric_limits<std::size_t>::max() + 1.0l;
|
||||
__gnu_cxx::__numeric_traits<std::size_t>::__max + 1.0l;
|
||||
__ldval *= __mult;
|
||||
|
||||
// Try to use all the bits of the mantissa (really necessary only
|
||||
|
@ -217,8 +217,7 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
|
|||
__ldval = (__ldval - (long double)__hibits) * __mult;
|
||||
|
||||
const std::size_t __coeff =
|
||||
(std::numeric_limits<std::size_t>::max()
|
||||
/ std::numeric_limits<long double>::max_exponent);
|
||||
__gnu_cxx::__numeric_traits<std::size_t>::__max / __LDBL_MAX_EXP__;
|
||||
|
||||
__result = __hibits + (std::size_t)__ldval + __coeff * __exponent;
|
||||
|
||||
|
|
|
@ -53,9 +53,10 @@
|
|||
#define _TR1_HASHTABLE 1
|
||||
|
||||
#include <utility> // For std::pair
|
||||
#include <iterator>
|
||||
#include <cstddef>
|
||||
#include <cmath>
|
||||
#include <bits/stl_iterator_base_types.h>
|
||||
#include <bits/stl_iterator_base_funcs.h>
|
||||
#include <bits/allocator.h>
|
||||
#include <bits/functexcept.h>
|
||||
#include <tr1/type_traits> // For true_type and false_type
|
||||
|
|
|
@ -51,6 +51,7 @@
|
|||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include <cmath>
|
||||
#include <ext/numeric_traits.h>
|
||||
|
||||
_GLIBCXX_BEGIN_NAMESPACE(std)
|
||||
|
||||
|
@ -96,10 +97,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
|||
__c = __sb->snextc();
|
||||
}
|
||||
}
|
||||
if (__n == numeric_limits<streamsize>::max()
|
||||
if (__n == __gnu_cxx::__numeric_traits<streamsize>::__max
|
||||
&& !traits_type::eq_int_type(__c, __eof))
|
||||
{
|
||||
_M_gcount = numeric_limits<streamsize>::min();
|
||||
_M_gcount =
|
||||
__gnu_cxx::__numeric_traits<streamsize>::__min;
|
||||
__large_ignore = true;
|
||||
}
|
||||
else
|
||||
|
@ -107,7 +109,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
|||
}
|
||||
|
||||
if (__large_ignore)
|
||||
_M_gcount = numeric_limits<streamsize>::max();
|
||||
_M_gcount = __gnu_cxx::__numeric_traits<streamsize>::__max;
|
||||
|
||||
if (traits_type::eq_int_type(__c, __eof))
|
||||
__err |= ios_base::eofbit;
|
||||
|
@ -161,10 +163,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
|||
__c = __sb->snextc();
|
||||
}
|
||||
}
|
||||
if (__n == numeric_limits<streamsize>::max()
|
||||
if (__n == __gnu_cxx::__numeric_traits<streamsize>::__max
|
||||
&& !traits_type::eq_int_type(__c, __eof))
|
||||
{
|
||||
_M_gcount = numeric_limits<streamsize>::min();
|
||||
_M_gcount =
|
||||
__gnu_cxx::__numeric_traits<streamsize>::__min;
|
||||
__large_ignore = true;
|
||||
}
|
||||
else
|
||||
|
@ -172,7 +175,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
|||
}
|
||||
|
||||
if (__large_ignore)
|
||||
_M_gcount = numeric_limits<streamsize>::max();
|
||||
_M_gcount = __gnu_cxx::__numeric_traits<streamsize>::__max;
|
||||
|
||||
if (traits_type::eq_int_type(__c, __eof))
|
||||
__err |= ios_base::eofbit;
|
||||
|
|
|
@ -152,11 +152,12 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
|||
__c = __sb->snextc();
|
||||
}
|
||||
}
|
||||
if (__n == numeric_limits<streamsize>::max()
|
||||
if (__n == __gnu_cxx::__numeric_traits<streamsize>::__max
|
||||
&& !traits_type::eq_int_type(__c, __eof)
|
||||
&& !traits_type::eq_int_type(__c, __delim))
|
||||
{
|
||||
_M_gcount = numeric_limits<streamsize>::min();
|
||||
_M_gcount =
|
||||
__gnu_cxx::__numeric_traits<streamsize>::__min;
|
||||
__large_ignore = true;
|
||||
}
|
||||
else
|
||||
|
@ -164,13 +165,14 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
|||
}
|
||||
|
||||
if (__large_ignore)
|
||||
_M_gcount = numeric_limits<streamsize>::max();
|
||||
_M_gcount = __gnu_cxx::__numeric_traits<streamsize>::__max;
|
||||
|
||||
if (traits_type::eq_int_type(__c, __eof))
|
||||
__err |= ios_base::eofbit;
|
||||
else if (traits_type::eq_int_type(__c, __delim))
|
||||
{
|
||||
if (_M_gcount < numeric_limits<streamsize>::max())
|
||||
if (_M_gcount
|
||||
< __gnu_cxx::__numeric_traits<streamsize>::__max)
|
||||
++_M_gcount;
|
||||
__sb->sbumpc();
|
||||
}
|
||||
|
@ -204,7 +206,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
|||
// Figure out how many characters to extract.
|
||||
streamsize __num = __in.width();
|
||||
if (__num <= 0)
|
||||
__num = numeric_limits<streamsize>::max();
|
||||
__num = __gnu_cxx::__numeric_traits<streamsize>::__max;
|
||||
|
||||
const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc());
|
||||
|
||||
|
@ -532,11 +534,12 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
|||
__c = __sb->snextc();
|
||||
}
|
||||
}
|
||||
if (__n == numeric_limits<streamsize>::max()
|
||||
if (__n == __gnu_cxx::__numeric_traits<streamsize>::__max
|
||||
&& !traits_type::eq_int_type(__c, __eof)
|
||||
&& !traits_type::eq_int_type(__c, __delim))
|
||||
{
|
||||
_M_gcount = numeric_limits<streamsize>::min();
|
||||
_M_gcount =
|
||||
__gnu_cxx::__numeric_traits<streamsize>::__min;
|
||||
__large_ignore = true;
|
||||
}
|
||||
else
|
||||
|
@ -544,13 +547,14 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
|||
}
|
||||
|
||||
if (__large_ignore)
|
||||
_M_gcount = numeric_limits<streamsize>::max();
|
||||
_M_gcount = __gnu_cxx::__numeric_traits<streamsize>::__max;
|
||||
|
||||
if (traits_type::eq_int_type(__c, __eof))
|
||||
__err |= ios_base::eofbit;
|
||||
else if (traits_type::eq_int_type(__c, __delim))
|
||||
{
|
||||
if (_M_gcount < numeric_limits<streamsize>::max())
|
||||
if (_M_gcount
|
||||
< __gnu_cxx::__numeric_traits<streamsize>::__max)
|
||||
++_M_gcount;
|
||||
__sb->sbumpc();
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
// 23.2.5 class vector<bool> [lib.vector.bool]
|
||||
|
||||
#include <vector>
|
||||
#include <limits>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
// libstdc++/29134
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// 1999-04-12 bkoz
|
||||
|
||||
// Copyright (C) 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
|
||||
// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
|
||||
// Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
|
@ -27,6 +28,7 @@
|
|||
|
||||
#include <istream>
|
||||
#include <sstream>
|
||||
#include <limits>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
// libstdc++/3720
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// 1999-04-12 bkoz
|
||||
|
||||
// Copyright (C) 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
|
||||
// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
|
||||
// Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
|
@ -23,6 +24,7 @@
|
|||
#include <istream>
|
||||
#include <sstream>
|
||||
#include <locale>
|
||||
#include <limits>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
// libstdc++/3720 part two
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (C) 2004 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
|
@ -25,6 +25,7 @@
|
|||
|
||||
#include <istream>
|
||||
#include <sstream>
|
||||
#include <limits>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
// libstdc++/3720
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (C) 2004 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
|
@ -21,6 +21,7 @@
|
|||
#include <istream>
|
||||
#include <sstream>
|
||||
#include <locale>
|
||||
#include <limits>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
// libstdc++/3720 part two
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// 2000-12-19 bkoz
|
||||
|
||||
// Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation
|
||||
// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
|
||||
// Free Software Foundation
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the
|
||||
|
@ -32,6 +33,7 @@
|
|||
|
||||
#include <sstream>
|
||||
#include <iostream>
|
||||
#include <limits>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
// libstdc++/3129
|
||||
|
|
Loading…
Reference in New Issue