summaryrefslogtreecommitdiffstats
path: root/libstdc++-v3/src
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2007-04-13 10:54:37 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2007-04-13 10:54:37 +0000
commitee620c0dc32fef05144d97efaa876db5f0b8d632 (patch)
tree964911b205248c21c697666def199f988fde36c0 /libstdc++-v3/src
parentf3d56fef7dc684fd737b19dc06be9765d4e6d124 (diff)
downloadppe42-gcc-ee620c0dc32fef05144d97efaa876db5f0b8d632.tar.gz
ppe42-gcc-ee620c0dc32fef05144d97efaa876db5f0b8d632.zip
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>. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123779 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/src')
-rw-r--r--libstdc++-v3/src/compatibility.cc15
-rw-r--r--libstdc++-v3/src/istream.cc22
2 files changed, 22 insertions, 15 deletions
diff --git a/libstdc++-v3/src/compatibility.cc b/libstdc++-v3/src/compatibility.cc
index f88fbc740d8..83b20b96706 100644
--- a/libstdc++-v3/src/compatibility.cc
+++ b/libstdc++-v3/src/compatibility.cc
@@ -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;
diff --git a/libstdc++-v3/src/istream.cc b/libstdc++-v3/src/istream.cc
index 688ad165835..0f24340e031 100644
--- a/libstdc++-v3/src/istream.cc
+++ b/libstdc++-v3/src/istream.cc
@@ -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();
}
OpenPOWER on IntegriCloud