aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/src/ios.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++-v3/src/ios.cc')
-rw-r--r--libstdc++-v3/src/ios.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/libstdc++-v3/src/ios.cc b/libstdc++-v3/src/ios.cc
index 9f4c71841b4..c6cff753472 100644
--- a/libstdc++-v3/src/ios.cc
+++ b/libstdc++-v3/src/ios.cc
@@ -159,11 +159,12 @@ namespace std
void
ios_base::Init::_S_ios_create(bool __sync)
{
- int __out_size = __sync ? 0 : static_cast<int>(BUFSIZ);
+ size_t __out_size = __sync ? 0 : static_cast<size_t>(BUFSIZ);
#ifdef _GLIBCPP_HAVE_ISATTY
- int __in_size = (__sync || isatty (0)) ? 1 : static_cast<int>(BUFSIZ);
+ size_t __in_size =
+ (__sync || isatty (0)) ? 1 : static_cast<size_t>(BUFSIZ);
#else
- int __in_size = 1;
+ size_t __in_size = 1;
#endif
// NB: The file globals.cc creates the four standard files
@@ -252,8 +253,6 @@ namespace std
{ words = new _Words[newsize]; }
catch (...)
{
- delete [] _M_word;
- _M_word = 0;
_M_streambuf_state |= badbit;
if (_M_streambuf_state & _M_exception)
__throw_ios_failure("ios_base::_M_grow_words failure");
@@ -270,6 +269,8 @@ namespace std
else
{
_M_streambuf_state |= badbit;
+ if (_M_streambuf_state & _M_exception)
+ __throw_ios_failure("ios_base::_M_grow_words failure");
return _M_word_zero;
}
}
@@ -286,8 +287,6 @@ namespace std
_M_precision = 6;
_M_width = 0;
_M_flags = skipws | dec;
- _M_callbacks = 0;
- _M_word_size = 0;
_M_ios_locale = locale();
}
@@ -301,7 +300,8 @@ namespace std
return __old;
}
- ios_base::ios_base() : _M_callbacks(0), _M_word(0)
+ ios_base::ios_base() : _M_callbacks(0), _M_word_size(_S_local_word_size),
+ _M_word(_M_local_word)
{
// Do nothing: basic_ios::init() does it.
// NB: _M_callbacks and _M_word must be zero for non-initialized
@@ -313,7 +313,7 @@ namespace std
{
_M_call_callbacks(erase_event);
_M_dispose_callbacks();
- if (_M_word && _M_word != _M_local_word)
+ if (_M_word != _M_local_word)
{
delete [] _M_word;
_M_word = 0;