Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r57603 - in trunk/boost/iostreams: . detail
From: daniel_james_at_[hidden]
Date: 2009-11-12 14:17:57


Author: danieljames
Date: 2009-11-12 14:17:56 EST (Thu, 12 Nov 2009)
New Revision: 57603
URL: http://svn.boost.org/trac/boost/changeset/57603

Log:
Fix unthrown exceptions. Refs #3311.

Thanks to Gareth Sylvester-Bradley and Richard Smith.
Text files modified:
   trunk/boost/iostreams/detail/restrict_impl.hpp | 12 ++++++------
   trunk/boost/iostreams/stream_buffer.hpp | 2 +-
   2 files changed, 7 insertions(+), 7 deletions(-)

Modified: trunk/boost/iostreams/detail/restrict_impl.hpp
==============================================================================
--- trunk/boost/iostreams/detail/restrict_impl.hpp (original)
+++ trunk/boost/iostreams/detail/restrict_impl.hpp 2009-11-12 14:17:56 EST (Thu, 12 Nov 2009)
@@ -160,7 +160,7 @@
         if (!open_)
             open(snk, BOOST_IOS::out);
         if (end_ != -1 && pos_ + n >= end_)
- bad_write();
+ throw bad_write();
         std::streamsize result =
             iostreams::write(this->component(), snk, s, n);
         pos_ += result;
@@ -181,11 +181,11 @@
             // Restriction is half-open; seek relative to the actual end.
             pos_ = this->component().seek(dev, off, BOOST_IOS::end);
             if (pos_ < beg_)
- bad_seek();
+ throw bad_seek();
             return offset_to_position(pos_ - beg_);
         }
         if (next < beg_ || (end_ != -1 && next >= end_))
- bad_seek();
+ throw bad_seek();
         pos_ = this->component().seek(dev, next, BOOST_IOS::cur);
         return offset_to_position(pos_ - beg_);
     }
@@ -272,7 +272,7 @@
     (const char_type* s, std::streamsize n)
 {
     if (end_ != -1 && pos_ + n >= end_)
- bad_write();
+ throw bad_write();
     std::streamsize result = iostreams::write(this->component(), s, n);
     pos_ += result;
     return result;
@@ -293,11 +293,11 @@
         // Restriction is half-open; seek relative to the actual end.
         pos_ = iostreams::seek(this->component(), off, BOOST_IOS::end);
         if (pos_ < beg_)
- bad_seek();
+ throw bad_seek();
         return offset_to_position(pos_ - beg_);
     }
     if (next < beg_ || (end_ != -1 && next >= end_))
- bad_seek();
+ throw bad_seek();
     pos_ = iostreams::seek(this->component(), next - pos_, BOOST_IOS::cur);
     return offset_to_position(pos_ - beg_);
 }

Modified: trunk/boost/iostreams/stream_buffer.hpp
==============================================================================
--- trunk/boost/iostreams/stream_buffer.hpp (original)
+++ trunk/boost/iostreams/stream_buffer.hpp 2009-11-12 14:17:56 EST (Thu, 12 Nov 2009)
@@ -99,7 +99,7 @@
     void open_impl(const T& t BOOST_IOSTREAMS_PUSH_PARAMS())
         { // Used for forwarding.
             if (this->is_open())
- BOOST_IOSTREAMS_FAILURE("already open");
+ throw BOOST_IOSTREAMS_FAILURE("already open");
             base_type::open(t BOOST_IOSTREAMS_PUSH_ARGS());
         }
 };


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk