Boost logo

Boost-Commit :

From: technews_at_[hidden]
Date: 2008-01-14 15:47:19


Author: turkanis
Date: 2008-01-14 15:47:17 EST (Mon, 14 Jan 2008)
New Revision: 42778
URL: http://svn.boost.org/trac/boost/changeset/42778

Log:
overhaul of dual_use filters: close() is now called just once; suppressed Borland/Dinkumware warnings in mapped_file.hpp
Text files modified:
   trunk/boost/iostreams/combine.hpp | 21 ++++++++-
   trunk/boost/iostreams/compose.hpp | 90 +++++++++++++++++++++++++++++++++------
   trunk/boost/iostreams/detail/config/disable_warnings.hpp | 1
   trunk/boost/iostreams/detail/config/enable_warnings.hpp | 2
   trunk/boost/iostreams/detail/streambuf/indirect_streambuf.hpp | 6 ++
   trunk/boost/iostreams/device/mapped_file.hpp | 7 ++
   trunk/boost/iostreams/filter/gzip.hpp | 2
   trunk/boost/iostreams/filter/newline.hpp | 32 ++++++--------
   trunk/boost/iostreams/filter/symmetric.hpp | 7 +-
   trunk/libs/iostreams/test/close_test.cpp | 8 ++-
   trunk/libs/iostreams/test/combine_test.cpp | 57 +++++++++++++++++++++++-
   trunk/libs/iostreams/test/compose_test.cpp | 38 +++++++++-------
   trunk/libs/iostreams/test/copy_test.cpp | 28 +++++++++---
   trunk/libs/iostreams/test/detail/utf8_codecvt_facet.cpp | 3
   trunk/libs/iostreams/test/restrict_test.cpp | 11 ++--
   15 files changed, 234 insertions(+), 79 deletions(-)

Modified: trunk/boost/iostreams/combine.hpp
==============================================================================
--- trunk/boost/iostreams/combine.hpp (original)
+++ trunk/boost/iostreams/combine.hpp 2008-01-14 15:47:17 EST (Mon, 14 Jan 2008)
@@ -26,6 +26,9 @@
 #include <boost/type_traits/is_convertible.hpp>
 #include <boost/type_traits/is_same.hpp>
 
+// Must come last.
+#include <boost/iostreams/detail/config/disable_warnings.hpp>
+
 namespace boost { namespace iostreams {
 
 namespace detail {
@@ -96,12 +99,22 @@
 
     template<typename Sink>
     void close(Sink& snk, BOOST_IOS::openmode which)
- {
- if (which == BOOST_IOS::in)
+ {
+ if (which == BOOST_IOS::in) {
+ if (is_convertible<in_category, dual_use>::value) {
+ iostreams::close(in_, snk, BOOST_IOS::in);
+ } else {
                 detail::close_all(in_, snk);
- if (which == BOOST_IOS::out)
+ }
+ }
+ if (which == BOOST_IOS::out) {
+ if (is_convertible<out_category, dual_use>::value) {
+ iostreams::close(out_, snk, BOOST_IOS::out);
+ } else {
                 detail::close_all(out_, snk);
+ }
         }
+ }
     #ifndef BOOST_NO_STD_LOCALE
         void imbue(const std::locale& loc);
     #endif
@@ -230,4 +243,6 @@
 
 } } // End namespaces iostreams, boost.
 
+#include <boost/iostreams/detail/config/enable_warnings.hpp>
+
 #endif // #ifndef BOOST_IOSTREAMS_COMBINE_HPP_INCLUDED

Modified: trunk/boost/iostreams/compose.hpp
==============================================================================
--- trunk/boost/iostreams/compose.hpp (original)
+++ trunk/boost/iostreams/compose.hpp 2008-01-14 15:47:17 EST (Mon, 14 Jan 2008)
@@ -65,6 +65,8 @@
 class composite_device {
 private:
     typedef typename detail::param_type<Device>::type param_type;
+ typedef typename mode_of<Filter>::type filter_mode;
+ typedef typename mode_of<Device>::type device_mode;
     typedef typename
             iostreams::select< // Disambiguation for Tru64.
                 is_direct<Device>, direct_adapter<Device>,
@@ -120,7 +122,23 @@
               BOOST_DEDUCED_TYPENAME composite_mode<Filter1, Filter2>::type >
 class composite_filter {
 private:
- typedef reference_wrapper<Filter2> filter_ref;
+ typedef reference_wrapper<Filter2> filter_ref;
+ typedef typename mode_of<Filter1>::type first_mode;
+ typedef typename mode_of<Filter2>::type second_mode;
+
+ // A dual-use filter cannot be composed with a read-write filter
+ BOOST_STATIC_ASSERT(
+ !(is_convertible<first_mode, dual_use>::value) ||
+ !(is_convertible<second_mode, input>::value) ||
+ !(is_convertible<second_mode, output>::value) ||
+ (is_convertible<second_mode, dual_use>::value)
+ );
+ BOOST_STATIC_ASSERT(
+ !(is_convertible<second_mode, dual_use>::value) ||
+ !(is_convertible<first_mode, input>::value) ||
+ !(is_convertible<first_mode, output>::value) ||
+ (is_convertible<first_mode, dual_use>::value)
+ );
 public:
     typedef typename char_type_of<Filter1>::type char_type;
     struct category
@@ -170,12 +188,24 @@
 
         // Close input sequences in reverse order and output sequences in
         // forward order
- detail::execute_all(
- detail::call_close(filter2_, dev, BOOST_IOS::in),
- detail::call_close(filter1_, cmp, BOOST_IOS::in),
- detail::call_close(filter1_, cmp, BOOST_IOS::out),
- detail::call_close(filter2_, dev, BOOST_IOS::out)
- );
+ if (!is_convertible<first_mode, dual_use>::value) {
+ detail::execute_all(
+ detail::call_close(filter2_, dev, BOOST_IOS::in),
+ detail::call_close(filter1_, cmp, BOOST_IOS::in),
+ detail::call_close(filter1_, cmp, BOOST_IOS::out),
+ detail::call_close(filter2_, dev, BOOST_IOS::out)
+ );
+ } else if (is_convertible<second_mode, input>::value) {
+ detail::execute_all(
+ detail::call_close(filter2_, dev, BOOST_IOS::in),
+ detail::call_close(filter1_, cmp, BOOST_IOS::in)
+ );
+ } else {
+ detail::execute_all(
+ detail::call_close(filter1_, cmp, BOOST_IOS::out),
+ detail::call_close(filter2_, dev, BOOST_IOS::out)
+ );
+ }
     }
 
     template<typename Device>
@@ -190,18 +220,26 @@
         composite_device<filter_ref, Device> cmp(boost::ref(filter2_), dev);
 
         // Close input sequences in reverse order
- if (which == BOOST_IOS::in)
+ if ( which == BOOST_IOS::in &&
+ ( !is_convertible<first_mode, dual_use>::value ||
+ is_convertible<second_mode, input>::value ) )
+ {
             detail::execute_all(
                 detail::call_close(filter2_, dev, BOOST_IOS::in),
                 detail::call_close(filter1_, cmp, BOOST_IOS::in)
             );
+ }
 
         // Close output sequences in forward order
- if (which == BOOST_IOS::out)
+ if ( which == BOOST_IOS::out &&
+ ( !is_convertible<first_mode, dual_use>::value ||
+ is_convertible<second_mode, output>::value ) )
+ {
             detail::execute_all(
                 detail::call_close(filter1_, cmp, BOOST_IOS::out),
                 detail::call_close(filter2_, dev, BOOST_IOS::out)
             );
+ }
     }
 
     template<typename Device>
@@ -378,33 +416,55 @@
 void composite_device<Filter, Device, Mode>::close()
 {
     BOOST_STATIC_ASSERT((!is_convertible<Mode, two_sequence>::value));
+ BOOST_STATIC_ASSERT(
+ !(is_convertible<filter_mode, dual_use>::value) ||
+ !(is_convertible<device_mode, input>::value) ||
+ !(is_convertible<device_mode, output>::value)
+ );
 
     // Close input sequences in reverse order and output sequences
     // in forward order
- detail::execute_all( detail::call_close(device_, BOOST_IOS::in),
- detail::call_close(filter_, device_, BOOST_IOS::in),
- detail::call_close(filter_, device_, BOOST_IOS::out),
- detail::call_close(device_, BOOST_IOS::out) );
+ if (!is_convertible<filter_mode, dual_use>::value) {
+ detail::execute_all(
+ detail::call_close(device_, BOOST_IOS::in),
+ detail::call_close(filter_, device_, BOOST_IOS::in),
+ detail::call_close(filter_, device_, BOOST_IOS::out),
+ detail::call_close(device_, BOOST_IOS::out)
+ );
+ } else if (is_convertible<device_mode, input>::value) {
+ detail::execute_all(
+ detail::call_close(device_, BOOST_IOS::in),
+ detail::call_close(filter_, device_, BOOST_IOS::in)
+ );
+ } else {
+ detail::execute_all(
+ detail::call_close(filter_, device_, BOOST_IOS::out),
+ detail::call_close(device_, BOOST_IOS::out)
+ );
+ }
 }
 
 template<typename Filter, typename Device, typename Mode>
 void composite_device<Filter, Device, Mode>::close(BOOST_IOS::openmode which)
 {
     BOOST_STATIC_ASSERT((is_convertible<Mode, two_sequence>::value));
+ BOOST_STATIC_ASSERT(!(is_convertible<filter_mode, dual_use>::value));
 
     // Close input sequences in reverse order
- if (which == BOOST_IOS::in)
+ if (which == BOOST_IOS::in) {
         detail::execute_all(
             detail::call_close(device_, BOOST_IOS::in),
             detail::call_close(filter_, device_, BOOST_IOS::in)
         );
+ }
 
     // Close output sequences in forward order
- if (which == BOOST_IOS::out)
+ if (which == BOOST_IOS::out) {
         detail::execute_all(
             detail::call_close(filter_, device_, BOOST_IOS::out),
             detail::call_close(device_, BOOST_IOS::out)
         );
+ }
 }
 
 template<typename Filter, typename Device, typename Mode>

Modified: trunk/boost/iostreams/detail/config/disable_warnings.hpp
==============================================================================
--- trunk/boost/iostreams/detail/config/disable_warnings.hpp (original)
+++ trunk/boost/iostreams/detail/config/disable_warnings.hpp 2008-01-14 15:47:17 EST (Mon, 14 Jan 2008)
@@ -18,6 +18,7 @@
 #else
 # if BOOST_WORKAROUND(__BORLANDC__, < 0x600)
 # pragma warn -8008 // Condition always true/false.
+# pragma warn -8066 // Unreachable code.
 # pragma warn -8071 // Conversion may lose significant digits.
 # pragma warn -8072 // Suspicious pointer arithmetic.
 # pragma warn -8080 // identifier declared but never used.

Modified: trunk/boost/iostreams/detail/config/enable_warnings.hpp
==============================================================================
--- trunk/boost/iostreams/detail/config/enable_warnings.hpp (original)
+++ trunk/boost/iostreams/detail/config/enable_warnings.hpp 2008-01-14 15:47:17 EST (Mon, 14 Jan 2008)
@@ -9,7 +9,9 @@
 #else
 # if BOOST_WORKAROUND(__BORLANDC__, < 0x600)
 # pragma warn .8008 // Condition always true/false.
+# pragma warn .8066 // Unreachable code.
 # pragma warn .8071 // Conversion may lose significant digits.
+# pragma warn .8072 // Suspicious pointer arithmetic.
 # pragma warn .8080 // identifier declared but never used.
 # endif
 #endif

Modified: trunk/boost/iostreams/detail/streambuf/indirect_streambuf.hpp
==============================================================================
--- trunk/boost/iostreams/detail/streambuf/indirect_streambuf.hpp (original)
+++ trunk/boost/iostreams/detail/streambuf/indirect_streambuf.hpp 2008-01-14 15:47:17 EST (Mon, 14 Jan 2008)
@@ -374,7 +374,11 @@
         sync();
         setp(0, 0);
     }
- obj().close(which, next_);
+ if ( !is_convertible<category, dual_use>::value ||
+ is_convertible<Mode, input>::value == (which == BOOST_IOS::in) )
+ {
+ obj().close(which, next_);
+ }
 }
 
 //----------State changing functions------------------------------------------//

Modified: trunk/boost/iostreams/device/mapped_file.hpp
==============================================================================
--- trunk/boost/iostreams/device/mapped_file.hpp (original)
+++ trunk/boost/iostreams/device/mapped_file.hpp 2008-01-14 15:47:17 EST (Mon, 14 Jan 2008)
@@ -62,7 +62,9 @@
 
 struct mapped_file_params {
     explicit mapped_file_params()
- #if BOOST_WORKAROUND(BOOST_MSVC, < 1400) && defined(BOOST_RWSTD_VER)
+ #if BOOST_WORKAROUND(BOOST_MSVC, < 1400) && defined(BOOST_RWSTD_VER) || \
+ defined(__BORLANDC__) && defined(_CPPLIB_VER)
+ /**/
         : mode(std::ios_base::openmode(0)),
     #else
         : mode(),
@@ -72,7 +74,8 @@
         { }
     explicit mapped_file_params(const std::string& path)
         : path(path),
- #if BOOST_WORKAROUND(BOOST_MSVC, < 1400) && defined(BOOST_RWSTD_VER)
+ #if BOOST_WORKAROUND(BOOST_MSVC, < 1400) && defined(BOOST_RWSTD_VER) || \
+ defined(__BORLANDC__) && defined(_CPPLIB_VER)
           mode(std::ios_base::openmode(0)),
     #else
           mode(),

Modified: trunk/boost/iostreams/filter/gzip.hpp
==============================================================================
--- trunk/boost/iostreams/filter/gzip.hpp (original)
+++ trunk/boost/iostreams/filter/gzip.hpp 2008-01-14 15:47:17 EST (Mon, 14 Jan 2008)
@@ -251,6 +251,8 @@
                 throw;
             }
             close_impl();
+ } else {
+ close_impl();
         }
     }
 private:

Modified: trunk/boost/iostreams/filter/newline.hpp
==============================================================================
--- trunk/boost/iostreams/filter/newline.hpp (original)
+++ trunk/boost/iostreams/filter/newline.hpp 2008-01-14 15:47:17 EST (Mon, 14 Jan 2008)
@@ -215,8 +215,7 @@
         typedef typename iostreams::category_of<Sink>::type category;
         if ((flags_ & f_write) != 0 && (flags_ & f_has_CR) != 0)
             newline_if_sink(dest);
- if (which == BOOST_IOS::out)
- flags_ &= newline::platform_mask;
+ flags_ &= ~f_has_LF; // Restore original flags.
     }
 private:
 
@@ -402,24 +401,21 @@
     {
         using iostreams::newline::final_newline;
 
- if (which == BOOST_IOS::out) {
-
- // Update final_newline flag.
- if ( (source() & f_has_CR) != 0 ||
- (source() & f_line_complete) != 0 )
- {
- source() |= final_newline;
- }
+ // Update final_newline flag.
+ if ( (source() & f_has_CR) != 0 ||
+ (source() & f_line_complete) != 0 )
+ {
+ source() |= final_newline;
+ }
 
- // Clear non-sticky flags.
- source() &= ~(f_has_CR | f_line_complete);
+ // Clear non-sticky flags.
+ source() &= ~(f_has_CR | f_line_complete);
 
- // Check for errors.
- if ( (target_ & final_newline) != 0 &&
- (source() & final_newline) == 0 )
- {
- fail();
- }
+ // Check for errors.
+ if ( (target_ & final_newline) != 0 &&
+ (source() & final_newline) == 0 )
+ {
+ fail();
         }
     }
 private:

Modified: trunk/boost/iostreams/filter/symmetric.hpp
==============================================================================
--- trunk/boost/iostreams/filter/symmetric.hpp (original)
+++ trunk/boost/iostreams/filter/symmetric.hpp 2008-01-14 15:47:17 EST (Mon, 14 Jan 2008)
@@ -153,10 +153,7 @@
     template<typename Sink>
     void close(Sink& snk, BOOST_IOS::openmode which)
     {
- using namespace std;
- if ((state() & f_write) == 0 && which == BOOST_IOS::in)
- close_impl();
- if ((state() & f_write) != 0 && which == BOOST_IOS::out) {
+ if ((state() & f_write) != 0) {
 
             // Repeatedly invoke filter() with no input.
             try {
@@ -175,6 +172,8 @@
                 throw;
             }
             close_impl();
+ } else {
+ close_impl();
         }
     }
     SymmetricFilter& filter() { return *pimpl_; }

Modified: trunk/libs/iostreams/test/close_test.cpp
==============================================================================
--- trunk/libs/iostreams/test/close_test.cpp (original)
+++ trunk/libs/iostreams/test/close_test.cpp 2008-01-14 15:47:17 EST (Mon, 14 Jan 2008)
@@ -104,12 +104,13 @@
     {
         operation_sequence seq;
         chain<input> ch;
+ operation dummy;
 
         // Test chain::pop()
         ch.push(
             closable_filter<dual_use>(
                 seq.new_operation(2),
- seq.new_operation(3)
+ dummy
             )
         );
         ch.push(closable_device<input>(seq.new_operation(1)));
@@ -264,12 +265,13 @@
     {
         operation_sequence seq;
         chain<output> ch;
+ operation dummy;
 
         // Test chain::pop()
         ch.push(
             closable_filter<dual_use>(
- seq.new_operation(1),
- seq.new_operation(2)
+ dummy,
+ seq.new_operation(1)
             )
         );
         ch.push(closable_device<output>(seq.new_operation(3)));

Modified: trunk/libs/iostreams/test/combine_test.cpp
==============================================================================
--- trunk/libs/iostreams/test/combine_test.cpp (original)
+++ trunk/libs/iostreams/test/combine_test.cpp 2008-01-14 15:47:17 EST (Mon, 14 Jan 2008)
@@ -142,26 +142,75 @@
         BOOST_CHECK_OPERATION_SEQUENCE(seq);
     }
 
+ // Combine a dual-use filter and an input filter
+ {
+ operation_sequence seq;
+ chain<bidirectional> ch;
+ operation dummy;
+ ch.push(
+ io::combine(
+ closable_filter<input>(seq.new_operation(2)),
+ closable_filter<dual_use>(
+ dummy,
+ seq.new_operation(3)
+ )
+ )
+ );
+ ch.push(
+ closable_device<bidirectional>(
+ seq.new_operation(1),
+ seq.new_operation(4)
+ )
+ );
+ BOOST_CHECK_NO_THROW(ch.reset());
+ BOOST_CHECK_OPERATION_SEQUENCE(seq);
+ }
+
+ // Combine a dual-use filter and an output filter
+ {
+ operation_sequence seq;
+ chain<bidirectional> ch;
+ operation dummy;
+ ch.push(
+ io::combine(
+ closable_filter<dual_use>(
+ seq.new_operation(2),
+ dummy
+ ),
+ closable_filter<output>(seq.new_operation(3))
+ )
+ );
+ ch.push(
+ closable_device<bidirectional>(
+ seq.new_operation(1),
+ seq.new_operation(4)
+ )
+ );
+ BOOST_CHECK_NO_THROW(ch.reset());
+ BOOST_CHECK_OPERATION_SEQUENCE(seq);
+ }
+
     // Combine two dual-use filters
     {
         operation_sequence seq;
         chain<bidirectional> ch;
+ operation dummy;
         ch.push(
             io::combine(
                 closable_filter<dual_use>(
                     seq.new_operation(2),
- seq.new_operation(3)
+ dummy
                 ),
                 closable_filter<dual_use>(
- seq.new_operation(4),
- seq.new_operation(5)
+ dummy,
+ seq.new_operation(3)
                 )
             )
         );
         ch.push(
             closable_device<bidirectional>(
                 seq.new_operation(1),
- seq.new_operation(6)
+ seq.new_operation(4)
             )
         );
         BOOST_CHECK_NO_THROW(ch.reset());

Modified: trunk/libs/iostreams/test/compose_test.cpp
==============================================================================
--- trunk/libs/iostreams/test/compose_test.cpp (original)
+++ trunk/libs/iostreams/test/compose_test.cpp 2008-01-14 15:47:17 EST (Mon, 14 Jan 2008)
@@ -156,11 +156,12 @@
     {
         operation_sequence seq;
         chain<input> ch;
+ operation dummy;
         ch.push(
             io::compose(
                 closable_filter<dual_use>(
                     seq.new_operation(2),
- seq.new_operation(3)
+ dummy
                 ),
                 closable_device<input>(seq.new_operation(1))
             )
@@ -218,13 +219,14 @@
     {
         operation_sequence seq;
         chain<output> ch;
+ operation dummy;
         ch.push(
             io::compose(
                 closable_filter<dual_use>(
- seq.new_operation(1),
- seq.new_operation(2)
+ dummy,
+ seq.new_operation(1)
                 ),
- closable_device<output>(seq.new_operation(3))
+ closable_device<output>(seq.new_operation(2))
             )
         );
         BOOST_CHECK_NO_THROW(ch.reset());
@@ -320,11 +322,12 @@
     {
         operation_sequence seq;
         chain<input> ch;
+ operation dummy;
         ch.push(
             io::compose(
                 closable_filter<dual_use>(
                     seq.new_operation(3),
- seq.new_operation(4)
+ dummy
                 ),
                 closable_filter<input>(seq.new_operation(2))
             )
@@ -386,16 +389,17 @@
     {
         operation_sequence seq;
         chain<output> ch;
+ operation dummy;
         ch.push(
             io::compose(
                 closable_filter<dual_use>(
- seq.new_operation(1),
- seq.new_operation(2)
+ dummy,
+ seq.new_operation(1)
                 ),
- closable_filter<output>(seq.new_operation(3))
+ closable_filter<output>(seq.new_operation(2))
             )
         );
- ch.push(closable_device<output>(seq.new_operation(4)));
+ ch.push(closable_device<output>(seq.new_operation(3)));
         BOOST_CHECK_NO_THROW(ch.reset());
         BOOST_CHECK_OPERATION_SEQUENCE(seq);
     }
@@ -445,15 +449,16 @@
     {
         operation_sequence seq;
         chain<input> ch;
+ operation dummy;
         ch.push(
             io::compose(
                 closable_filter<dual_use>(
                     seq.new_operation(3),
- seq.new_operation(4)
+ dummy
                 ),
                 closable_filter<dual_use>(
                     seq.new_operation(2),
- seq.new_operation(5)
+ dummy
                 )
             )
         );
@@ -466,19 +471,20 @@
     {
         operation_sequence seq;
         chain<output> ch;
+ operation dummy;
         ch.push(
             io::compose(
                 closable_filter<dual_use>(
- seq.new_operation(2),
- seq.new_operation(3)
+ dummy,
+ seq.new_operation(1)
                 ),
                 closable_filter<dual_use>(
- seq.new_operation(1),
- seq.new_operation(4)
+ dummy,
+ seq.new_operation(2)
                 )
             )
         );
- ch.push(closable_device<output>(seq.new_operation(5)));
+ ch.push(closable_device<output>(seq.new_operation(3)));
         BOOST_CHECK_NO_THROW(ch.reset());
         BOOST_CHECK_OPERATION_SEQUENCE(seq);
     }

Modified: trunk/libs/iostreams/test/copy_test.cpp
==============================================================================
--- trunk/libs/iostreams/test/copy_test.cpp (original)
+++ trunk/libs/iostreams/test/copy_test.cpp 2008-01-14 15:47:17 EST (Mon, 14 Jan 2008)
@@ -68,7 +68,9 @@
         first.open(vector_source(src));
         second.open(vector_sink(dest));
         BOOST_CHECK_MESSAGE(
- boost::iostreams::copy(first, second) == src.size() && src == dest,
+ boost::iostreams::copy(first, second) ==
+ static_cast<streamsize>(src.size()) &&
+ src == dest,
             "failed copying from stream to stream"
         );
     }
@@ -81,7 +83,9 @@
         vector_sink out(dest);
         in.open(vector_source(src));
         BOOST_CHECK_MESSAGE(
- boost::iostreams::copy(in, out) == src.size() && src == dest,
+ boost::iostreams::copy(in, out) ==
+ static_cast<streamsize>(src.size()) &&
+ src == dest,
             "failed copying from stream to indirect sink"
         );
     }
@@ -94,7 +98,9 @@
         vector_ostream out;
         out.open(vector_sink(dest));
         BOOST_CHECK_MESSAGE(
- boost::iostreams::copy(in, out) == src.size() && src == dest,
+ boost::iostreams::copy(in, out) ==
+ static_cast<streamsize>(src.size()) &&
+ src == dest,
             "failed copying from indirect source to stream"
         );
     }
@@ -106,7 +112,9 @@
         vector_source in(src);
         vector_sink out(dest);
         BOOST_CHECK_MESSAGE(
- boost::iostreams::copy(in, out) == src.size() && src == dest,
+ boost::iostreams::copy(in, out) ==
+ static_cast<streamsize>(src.size()) &&
+ src == dest,
             "failed copying from indirect source to indirect sink"
         );
     }
@@ -118,7 +126,9 @@
         array_source in(&src[0], &src[0] + src.size());
         array_sink out(&dest[0], &dest[0] + dest.size());
         BOOST_CHECK_MESSAGE(
- boost::iostreams::copy(in, out) == src.size() && src == dest,
+ boost::iostreams::copy(in, out) ==
+ static_cast<streamsize>(src.size()) &&
+ src == dest,
             "failed copying from direct source to direct sink"
         );
     }
@@ -130,7 +140,9 @@
         array_source in(&src[0], &src[0] + src.size());
         vector_ostream out(dest);
         BOOST_CHECK_MESSAGE(
- boost::iostreams::copy(in, out) == src.size() && src == dest,
+ boost::iostreams::copy(in, out) ==
+ static_cast<streamsize>(src.size()) &&
+ src == dest,
             "failed copying from direct source to indirect sink"
         );
     }
@@ -143,7 +155,9 @@
         array_sink out(&dest[0], &dest[0] + dest.size());
         in.open(vector_source(src));
         BOOST_CHECK_MESSAGE(
- boost::iostreams::copy(in, out) == src.size() && src == dest,
+ boost::iostreams::copy(in, out) ==
+ static_cast<streamsize>(src.size()) &&
+ src == dest,
             "failed copying from indirect source to direct sink"
         );
     }

Modified: trunk/libs/iostreams/test/detail/utf8_codecvt_facet.cpp
==============================================================================
--- trunk/libs/iostreams/test/detail/utf8_codecvt_facet.cpp (original)
+++ trunk/libs/iostreams/test/detail/utf8_codecvt_facet.cpp 2008-01-14 15:47:17 EST (Mon, 14 Jan 2008)
@@ -236,7 +236,8 @@
 // wchar_t is defined as UCS2. The warnings are superfluous as
 // the specialization is never instantitiated with such compilers.
 template<>
-int get_cont_octet_out_count_impl<4>(wchar_t word){
+int get_cont_octet_out_count_impl<4>(wchar_t word)
+{
     if (word < 0x80) {
         return 0;
     }

Modified: trunk/libs/iostreams/test/restrict_test.cpp
==============================================================================
--- trunk/libs/iostreams/test/restrict_test.cpp (original)
+++ trunk/libs/iostreams/test/restrict_test.cpp 2008-01-14 15:47:17 EST (Mon, 14 Jan 2008)
@@ -8,7 +8,6 @@
 // replace BOOST_RESTRICT with BOOST_IOSTREAMS_RESTRICT here, since that
 // would interfere with the oepration of the header
 // <boost/iostreams/restrict.hpp>
-
 #ifndef BOOST_RESTRICT
 # define BOOST_RESTRICT restrict
 # define BOOST_RESTRICT_HEADER <boost/iostreams/restrict.hpp>
@@ -633,11 +632,12 @@
     {
         operation_sequence seq;
         chain<input> ch;
+ operation dummy;
         ch.push(
             io::BOOST_RESTRICT(
                 closable_filter<dual_use>(
                     seq.new_operation(2),
- seq.new_operation(3)
+ dummy
                 ),
                 0
             )
@@ -651,16 +651,17 @@
     {
         operation_sequence seq;
         chain<output> ch;
+ operation dummy;
         ch.push(
             io::BOOST_RESTRICT(
                 closable_filter<dual_use>(
- seq.new_operation(1),
- seq.new_operation(2)
+ dummy,
+ seq.new_operation(1)
                 ),
                 0
             )
         );
- ch.push(closable_device<output>(seq.new_operation(3)));
+ ch.push(closable_device<output>(seq.new_operation(2)));
         BOOST_CHECK_NO_THROW(ch.reset());
         BOOST_CHECK_OPERATION_SEQUENCE(seq);
     }


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