aboutsummaryrefslogtreecommitdiff
path: root/contrib/libstdc++/include/std
diff options
context:
space:
mode:
authorAlexander Kabaev <kan@FreeBSD.org>2005-06-03 03:29:38 +0000
committerAlexander Kabaev <kan@FreeBSD.org>2005-06-03 03:29:38 +0000
commitf260e61b15c6fe09294fd820b334752d0f0459ab (patch)
treec4e455c4fe8d2a3ed1d621536386e3e252ad36bc /contrib/libstdc++/include/std
parentd51085f37e16c95804f0fdabb7b1226e4b4e7de9 (diff)
Notes
Diffstat (limited to 'contrib/libstdc++/include/std')
-rw-r--r--contrib/libstdc++/include/std/std_complex.h16
-rw-r--r--contrib/libstdc++/include/std/std_fstream.h19
-rw-r--r--contrib/libstdc++/include/std/std_memory.h8
-rw-r--r--contrib/libstdc++/include/std/std_sstream.h12
4 files changed, 16 insertions, 39 deletions
diff --git a/contrib/libstdc++/include/std/std_complex.h b/contrib/libstdc++/include/std/std_complex.h
index e1027f65991f..244ed284f699 100644
--- a/contrib/libstdc++/include/std/std_complex.h
+++ b/contrib/libstdc++/include/std/std_complex.h
@@ -1,6 +1,6 @@
// The template and inlines for the -*- C++ -*- complex number classes.
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -736,9 +736,7 @@ namespace std
typedef float value_type;
complex(float = 0.0f, float = 0.0f);
-#ifdef _GLIBCXX_BUGGY_COMPLEX
- complex(const complex& __z) : _M_value(__z._M_value) { }
-#endif
+
explicit complex(const complex<double>&);
explicit complex(const complex<long double>&);
@@ -892,10 +890,8 @@ namespace std
public:
typedef double value_type;
- complex(double =0.0, double =0.0);
-#ifdef _GLIBCXX_BUGGY_COMPLEX
- complex(const complex& __z) : _M_value(__z._M_value) { }
-#endif
+ complex(double = 0.0, double = 0.0);
+
complex(const complex<float>&);
explicit complex(const complex<long double>&);
@@ -1049,9 +1045,7 @@ namespace std
typedef long double value_type;
complex(long double = 0.0L, long double = 0.0L);
-#ifdef _GLIBCXX_BUGGY_COMPLEX
- complex(const complex& __z) : _M_value(__z._M_value) { }
-#endif
+
complex(const complex<float>&);
complex(const complex<double>&);
diff --git a/contrib/libstdc++/include/std/std_fstream.h b/contrib/libstdc++/include/std/std_fstream.h
index 040f5798b11a..3dec366fcc16 100644
--- a/contrib/libstdc++/include/std/std_fstream.h
+++ b/contrib/libstdc++/include/std/std_fstream.h
@@ -418,24 +418,7 @@ namespace std
// [documentation is inherited]
virtual streamsize
- xsgetn(char_type* __s, streamsize __n)
- {
- // Clear out pback buffer before going on to the real deal...
- streamsize __ret = 0;
- if (this->_M_pback_init)
- {
- if (__n && this->gptr() == this->eback())
- {
- *__s++ = *this->gptr();
- this->gbump(1);
- __ret = 1;
- }
- _M_destroy_pback();
- }
- if (__ret < __n)
- __ret += __streambuf_type::xsgetn(__s, __n - __ret);
- return __ret;
- }
+ xsgetn(char_type* __s, streamsize __n);
// [documentation is inherited]
virtual streamsize
diff --git a/contrib/libstdc++/include/std/std_memory.h b/contrib/libstdc++/include/std/std_memory.h
index 4e6641ef6739..1d278e6cb868 100644
--- a/contrib/libstdc++/include/std/std_memory.h
+++ b/contrib/libstdc++/include/std/std_memory.h
@@ -58,6 +58,7 @@
#include <bits/stl_uninitialized.h>
#include <bits/stl_raw_storage_iter.h>
#include <debug/debug.h>
+#include <limits>
namespace std
{
@@ -73,8 +74,9 @@ namespace std
pair<_Tp*, ptrdiff_t>
__get_temporary_buffer(ptrdiff_t __len, _Tp*)
{
- if (__len > ptrdiff_t(INT_MAX / sizeof(_Tp)))
- __len = INT_MAX / sizeof(_Tp);
+ const ptrdiff_t __max = numeric_limits<ptrdiff_t>::max() / sizeof(_Tp);
+ if (__len > __max)
+ __len = __max;
while (__len > 0)
{
@@ -105,7 +107,7 @@ namespace std
* Provides the nothrow exception guarantee.
*/
template<typename _Tp>
- inline pair<_Tp*,ptrdiff_t>
+ inline pair<_Tp*, ptrdiff_t>
get_temporary_buffer(ptrdiff_t __len)
{ return std::__get_temporary_buffer(__len, static_cast<_Tp*>(0)); }
diff --git a/contrib/libstdc++/include/std/std_sstream.h b/contrib/libstdc++/include/std/std_sstream.h
index 6b5728b94ced..0a6738adf8ad 100644
--- a/contrib/libstdc++/include/std/std_sstream.h
+++ b/contrib/libstdc++/include/std/std_sstream.h
@@ -111,8 +111,8 @@ namespace std
*/
explicit
basic_stringbuf(ios_base::openmode __mode = ios_base::in | ios_base::out)
- : __streambuf_type(), _M_mode(), _M_string()
- { _M_stringbuf_init(__mode); }
+ : __streambuf_type(), _M_mode(__mode), _M_string()
+ { }
/**
* @brief Starts with an existing string buffer.
@@ -140,8 +140,7 @@ namespace std
__string_type
str() const
{
- const bool __testout = this->_M_mode & ios_base::out;
- if (__testout)
+ if (this->pptr())
{
// The current egptr() may not be the actual string end.
if (this->pptr() > this->egptr())
@@ -169,7 +168,7 @@ namespace std
}
protected:
- // Common initialization code for both ctors goes here.
+ // Common initialization code goes here.
/**
* @if maint
* @doctodo
@@ -277,9 +276,8 @@ namespace std
_M_update_egptr()
{
const bool __testin = this->_M_mode & ios_base::in;
- const bool __testout = this->_M_mode & ios_base::out;
- if (__testout && this->pptr() > this->egptr())
+ if (this->pptr() && this->pptr() > this->egptr())
if (__testin)
this->setg(this->eback(), this->gptr(), this->pptr());
else