aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Kosnik <bkoz@redhat.com>2003-03-28 19:45:44 +0000
committerBenjamin Kosnik <bkoz@gcc.gnu.org>2003-03-28 19:45:44 +0000
commitd29cc32f9d9c0e93e68cbfe5410d918e19f4701c (patch)
tree91b711798ef9b8fce499fcda83f47a839a27bb6d
parent400fbc086860b08dfc220532a0f3b7aad382ce4c (diff)
downloadgcc-d29cc32f9d9c0e93e68cbfe5410d918e19f4701c.zip
gcc-d29cc32f9d9c0e93e68cbfe5410d918e19f4701c.tar.gz
gcc-d29cc32f9d9c0e93e68cbfe5410d918e19f4701c.tar.bz2
std_sstream.h (basic_istringstream): Adjust initialization.
2003-03-28 Benjamin Kosnik <bkoz@redhat.com> * include/std/std_sstream.h (basic_istringstream): Adjust initialization. (basic_ostringstream): Same. (basic_stringstream): Same. * include/std/std_fstream.h (basic_ifstream): Adjust initialization. (basic_ofstream): Same. (basic_fstream): Same. * include/std/std_ostream.h (basic_ostrem): Add protected ctor that does not call init. * include/std/std_istream.h (basic_istream): Same. (basic_iostream): Construct istream, ostream uninitialized, use init to initialize just once. Add protected ctor that does not call init. From-SVN: r64980
-rw-r--r--libstdc++-v3/ChangeLog16
-rw-r--r--libstdc++-v3/include/bits/basic_ios.h2
-rw-r--r--libstdc++-v3/include/std/std_fstream.h12
-rw-r--r--libstdc++-v3/include/std/std_istream.h23
-rw-r--r--libstdc++-v3/include/std/std_ostream.h4
-rw-r--r--libstdc++-v3/include/std/std_sstream.h12
6 files changed, 47 insertions, 22 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index c038ba0..30a8b3b 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,19 @@
+2003-03-28 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/std/std_sstream.h (basic_istringstream): Adjust
+ initialization.
+ (basic_ostringstream): Same.
+ (basic_stringstream): Same.
+ * include/std/std_fstream.h (basic_ifstream): Adjust initialization.
+ (basic_ofstream): Same.
+ (basic_fstream): Same.
+ * include/std/std_ostream.h (basic_ostrem): Add protected ctor
+ that does not call init.
+ * include/std/std_istream.h (basic_istream): Same.
+ (basic_iostream): Construct istream, ostream uninitialized, use
+ init to initialize just once. Add protected ctor that does not
+ call init.
+
2003-03-28 Paolo Carlini <pcarlini@unitus.it>
Nathan Myers <ncm@cantrip.org>
diff --git a/libstdc++-v3/include/bits/basic_ios.h b/libstdc++-v3/include/bits/basic_ios.h
index 03b54b7..ba0fcee 100644
--- a/libstdc++-v3/include/bits/basic_ios.h
+++ b/libstdc++-v3/include/bits/basic_ios.h
@@ -419,7 +419,7 @@ namespace std
* The default constructor does nothing and is not normally
* accessible to users.
*/
- basic_ios() : ios_base()
+ basic_ios() : ios_base(), _M_fctype(0), _M_fnumput(0), _M_fnumget(0)
{ }
/**
diff --git a/libstdc++-v3/include/std/std_fstream.h b/libstdc++-v3/include/std/std_fstream.h
index a95b064..845a914 100644
--- a/libstdc++-v3/include/std/std_fstream.h
+++ b/libstdc++-v3/include/std/std_fstream.h
@@ -525,8 +525,7 @@ namespace std
* @c &sb to the base class initializer. Does not open any files
* (you haven't given it a filename to open).
*/
- basic_ifstream()
- : __istream_type(NULL), _M_filebuf()
+ basic_ifstream() : __istream_type(), _M_filebuf()
{ this->init(&_M_filebuf); }
/**
@@ -541,7 +540,7 @@ namespace std
*/
explicit
basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in)
- : __istream_type(NULL), _M_filebuf()
+ : __istream_type(), _M_filebuf()
{
this->init(&_M_filebuf);
this->open(__s, __mode);
@@ -648,8 +647,7 @@ namespace std
* @c &sb to the base class initializer. Does not open any files
* (you haven't given it a filename to open).
*/
- basic_ofstream()
- : __ostream_type(NULL), _M_filebuf()
+ basic_ofstream(): __ostream_type(), _M_filebuf()
{ this->init(&_M_filebuf); }
/**
@@ -666,7 +664,7 @@ namespace std
explicit
basic_ofstream(const char* __s,
ios_base::openmode __mode = ios_base::out|ios_base::trunc)
- : __ostream_type(NULL), _M_filebuf()
+ : __ostream_type(), _M_filebuf()
{
this->init(&_M_filebuf);
this->open(__s, __mode);
@@ -776,7 +774,7 @@ namespace std
* (you haven't given it a filename to open).
*/
basic_fstream()
- : __iostream_type(NULL), _M_filebuf()
+ : __iostream_type(), _M_filebuf()
{ this->init(&_M_filebuf); }
/**
diff --git a/libstdc++-v3/include/std/std_istream.h b/libstdc++-v3/include/std/std_istream.h
index fa97f72..616fd8a 100644
--- a/libstdc++-v3/include/std/std_istream.h
+++ b/libstdc++-v3/include/std/std_istream.h
@@ -1,6 +1,7 @@
// Input streams -*- C++ -*-
-// Copyright (C) 1997, 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+// Copyright (C) 1997, 1998, 1999, 2001, 2002, 2003
+// 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
@@ -101,11 +102,8 @@ namespace std
* their own stream buffer.
*/
explicit
- basic_istream(__streambuf_type* __sb)
- {
- this->init(__sb);
- _M_gcount = streamsize(0);
- }
+ basic_istream(__streambuf_type* __sb): _M_gcount(streamsize(0))
+ { this->init(__sb); }
/**
* @brief Base destructor.
@@ -573,6 +571,10 @@ namespace std
__istream_type&
seekg(off_type, ios_base::seekdir);
//@}
+
+ protected:
+ explicit
+ basic_istream(): _M_gcount(streamsize(0)) { }
};
/**
@@ -738,14 +740,19 @@ namespace std
*/
explicit
basic_iostream(basic_streambuf<_CharT, _Traits>* __sb)
- : __istream_type(__sb), __ostream_type(__sb)
- { }
+ : __istream_type(), __ostream_type()
+ { this->init(__sb); }
/**
* @brief Destructor does nothing.
*/
virtual
~basic_iostream() { }
+
+ protected:
+ explicit
+ basic_iostream() : __istream_type(), __ostream_type()
+ { }
};
// [27.6.1.4] standard basic_istream manipulators
diff --git a/libstdc++-v3/include/std/std_ostream.h b/libstdc++-v3/include/std/std_ostream.h
index 103b3fd..94b5a96 100644
--- a/libstdc++-v3/include/std/std_ostream.h
+++ b/libstdc++-v3/include/std/std_ostream.h
@@ -355,6 +355,10 @@ namespace std
*/
__ostream_type&
seekp(off_type, ios_base::seekdir);
+
+ protected:
+ explicit
+ basic_ostream() { }
};
/**
diff --git a/libstdc++-v3/include/std/std_sstream.h b/libstdc++-v3/include/std/std_sstream.h
index cb538b5..6c0e139 100644
--- a/libstdc++-v3/include/std/std_sstream.h
+++ b/libstdc++-v3/include/std/std_sstream.h
@@ -326,7 +326,7 @@ namespace std
*/
explicit
basic_istringstream(ios_base::openmode __mode = ios_base::in)
- : __istream_type(NULL), _M_stringbuf(__mode | ios_base::in)
+ : __istream_type(), _M_stringbuf(__mode | ios_base::in)
{ this->init(&_M_stringbuf); }
/**
@@ -347,7 +347,7 @@ namespace std
explicit
basic_istringstream(const __string_type& __str,
ios_base::openmode __mode = ios_base::in)
- : __istream_type(NULL), _M_stringbuf(__str, __mode | ios_base::in)
+ : __istream_type(), _M_stringbuf(__str, __mode | ios_base::in)
{ this->init(&_M_stringbuf); }
/**
@@ -445,7 +445,7 @@ namespace std
*/
explicit
basic_ostringstream(ios_base::openmode __mode = ios_base::out)
- : __ostream_type(NULL), _M_stringbuf(__mode | ios_base::out)
+ : __ostream_type(), _M_stringbuf(__mode | ios_base::out)
{ this->init(&_M_stringbuf); }
/**
@@ -466,7 +466,7 @@ namespace std
explicit
basic_ostringstream(const __string_type& __str,
ios_base::openmode __mode = ios_base::out)
- : __ostream_type(NULL), _M_stringbuf(__str, __mode | ios_base::out)
+ : __ostream_type(), _M_stringbuf(__str, __mode | ios_base::out)
{ this->init(&_M_stringbuf); }
/**
@@ -562,7 +562,7 @@ namespace std
*/
explicit
basic_stringstream(ios_base::openmode __m = ios_base::out | ios_base::in)
- : __iostream_type(NULL), _M_stringbuf(__m)
+ : __iostream_type(), _M_stringbuf(__m)
{ this->init(&_M_stringbuf); }
/**
@@ -581,7 +581,7 @@ namespace std
explicit
basic_stringstream(const __string_type& __str,
ios_base::openmode __m = ios_base::out | ios_base::in)
- : __iostream_type(NULL), _M_stringbuf(__str, __m)
+ : __iostream_type(), _M_stringbuf(__str, __m)
{ this->init(&_M_stringbuf); }
/**