From b773723097c8f6b82842e9d3deaa18933d9bbff4 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Thu, 11 Apr 2002 22:42:23 -0700 Subject: [PATCH] fstream.tcc (basic_filebuf<>::open): Fix & ordering. * include/bits/fstream.tcc (basic_filebuf<>::open): Fix & ordering. * include/bits/ostream.tcc (basic_ostream<>::operator<<(long)): Same. (basic_ostream<>::operator<<(long long)): Same. From-SVN: r52198 --- libstdc++-v3/ChangeLog | 6 ++++++ libstdc++-v3/include/bits/fstream.tcc | 2 +- libstdc++-v3/include/bits/ostream.tcc | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 05c398401a3..6533d391f62 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2002-04-11 Richard Henderson + + * include/bits/fstream.tcc (basic_filebuf<>::open): Fix & ordering. + * include/bits/ostream.tcc (basic_ostream<>::operator<<(long)): Same. + (basic_ostream<>::operator<<(long long)): Same. + 2002-04-11 Richard Henderson * config/linker-map.gnu: Add __gxx_personality_sj0. diff --git a/libstdc++-v3/include/bits/fstream.tcc b/libstdc++-v3/include/bits/fstream.tcc index 92a0730d67b..85143235436 100644 --- a/libstdc++-v3/include/bits/fstream.tcc +++ b/libstdc++-v3/include/bits/fstream.tcc @@ -165,7 +165,7 @@ namespace std // For time being, set both (in/out) sets of pointers. _M_set_indeterminate(); - if (__mode & ios_base::ate + if ((__mode & ios_base::ate) && this->seekoff(0, ios_base::end, __mode) < 0) this->close(); __ret = this; diff --git a/libstdc++-v3/include/bits/ostream.tcc b/libstdc++-v3/include/bits/ostream.tcc index 5c4799b9caa..d15b9f2afa3 100644 --- a/libstdc++-v3/include/bits/ostream.tcc +++ b/libstdc++-v3/include/bits/ostream.tcc @@ -185,7 +185,7 @@ namespace std if (_M_check_facet(_M_fnumput)) { bool __b = false; - if (__fmt & ios_base::oct || __fmt & ios_base::hex) + if ((__fmt & ios_base::oct) || (__fmt & ios_base::hex)) { unsigned long __l = static_cast(__n); __b = _M_fnumput->put(*this, *this, __c, __l).failed(); @@ -248,7 +248,7 @@ namespace std if (_M_check_facet(_M_fnumput)) { bool __b = false; - if (__fmt & ios_base::oct || __fmt & ios_base::hex) + if ((__fmt & ios_base::oct) || (__fmt & ios_base::hex)) { unsigned long long __l; __l = static_cast(__n); -- 2.30.2