|
Boost-Commit : |
From: technews_at_[hidden]
Date: 2008-01-17 21:03:42
Author: turkanis
Date: 2008-01-17 21:03:40 EST (Thu, 17 Jan 2008)
New Revision: 42838
URL: http://svn.boost.org/trac/boost/changeset/42838
Log:
full merge from trunk at 42837 of boost/iostreams and libs iostreams
Text files modified:
branches/release/boost/iostreams/combine.hpp | 21 ++++++++-
branches/release/boost/iostreams/compose.hpp | 90 +++++++++++++++++++++++++++++++++------
branches/release/boost/iostreams/detail/config/disable_warnings.hpp | 1
branches/release/boost/iostreams/detail/config/enable_warnings.hpp | 2
branches/release/boost/iostreams/detail/config/rtl.hpp | 2
branches/release/boost/iostreams/detail/execute.hpp | 13 +----
branches/release/boost/iostreams/detail/streambuf/indirect_streambuf.hpp | 6 ++
branches/release/boost/iostreams/device/mapped_file.hpp | 7 ++
branches/release/boost/iostreams/filter/gzip.hpp | 2
branches/release/boost/iostreams/filter/newline.hpp | 32 ++++++--------
branches/release/boost/iostreams/filter/symmetric.hpp | 7 +-
branches/release/libs/iostreams/test/close_test.cpp | 8 ++-
branches/release/libs/iostreams/test/combine_test.cpp | 57 +++++++++++++++++++++++-
branches/release/libs/iostreams/test/compose_test.cpp | 38 +++++++++-------
branches/release/libs/iostreams/test/copy_test.cpp | 28 +++++++++---
branches/release/libs/iostreams/test/detail/utf8_codecvt_facet.cpp | 3
branches/release/libs/iostreams/test/restrict_test.cpp | 11 ++--
17 files changed, 239 insertions(+), 89 deletions(-)
Modified: branches/release/boost/iostreams/combine.hpp
==============================================================================
--- branches/release/boost/iostreams/combine.hpp (original)
+++ branches/release/boost/iostreams/combine.hpp 2008-01-17 21:03:40 EST (Thu, 17 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: branches/release/boost/iostreams/compose.hpp
==============================================================================
--- branches/release/boost/iostreams/compose.hpp (original)
+++ branches/release/boost/iostreams/compose.hpp 2008-01-17 21:03:40 EST (Thu, 17 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: branches/release/boost/iostreams/detail/config/disable_warnings.hpp
==============================================================================
--- branches/release/boost/iostreams/detail/config/disable_warnings.hpp (original)
+++ branches/release/boost/iostreams/detail/config/disable_warnings.hpp 2008-01-17 21:03:40 EST (Thu, 17 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: branches/release/boost/iostreams/detail/config/enable_warnings.hpp
==============================================================================
--- branches/release/boost/iostreams/detail/config/enable_warnings.hpp (original)
+++ branches/release/boost/iostreams/detail/config/enable_warnings.hpp 2008-01-17 21:03:40 EST (Thu, 17 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: branches/release/boost/iostreams/detail/config/rtl.hpp
==============================================================================
--- branches/release/boost/iostreams/detail/config/rtl.hpp (original)
+++ branches/release/boost/iostreams/detail/config/rtl.hpp 2008-01-17 21:03:40 EST (Thu, 17 Jan 2008)
@@ -46,7 +46,7 @@
#else // Non-windows
# if defined(_LARGEFILE64_SOURCE) && \
(!defined(_FILE_OFFSET_BITS) || _FILE_OFFSET_BITS != 64) || \
- defined(__IBMCPP__) && !defined(_LARGE_FILES) || \
+ defined(_AIX) && !defined(_LARGE_FILES) || \
defined(BOOST_IOSTREAMS_HAS_LARGE_FILE_EXTENSIONS)
/**/
Modified: branches/release/boost/iostreams/detail/execute.hpp
==============================================================================
--- branches/release/boost/iostreams/detail/execute.hpp (original)
+++ branches/release/boost/iostreams/detail/execute.hpp 2008-01-17 21:03:40 EST (Thu, 17 Jan 2008)
@@ -18,13 +18,9 @@
* are thrown. If one of the operations throws an exception, performs the
* remaining operations and rethrows the initial exception.
*
- * In order to preserve support for old compilers, no attempt is made to deduce
- * the return type of the primary operation, even though it could be easily
- * deduced in all the intended use cases.
- *
* execute_foreach() is a variant of std::foreach which invokes a function
* object for each item in a sequence, catching all execptions and rethrowing
- * the first caucht exception after the function object has been invoked on each
+ * the first caught exception after the function object has been invoked on each
* item.
*/
@@ -35,7 +31,8 @@
# pragma once
#endif
-#include <boost/config.hpp> // BOOST_NO_RESULT_OF
+#include <boost/config.hpp>
+#include <boost/detail/workaround.hpp>
#include <boost/iostreams/detail/config/limits.hpp> // MAX_EXECUTE_ARITY
#include <boost/preprocessor/arithmetic/dec.hpp>
#include <boost/preprocessor/cat.hpp>
@@ -43,9 +40,7 @@
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
#include <boost/preprocessor/punctuation/comma_if.hpp>
-#ifndef BOOST_NO_RESULT_OF
-# include <boost/utility/result_of.hpp>
-#endif
+#include <boost/utility/result_of.hpp>
namespace boost { namespace iostreams { namespace detail {
Modified: branches/release/boost/iostreams/detail/streambuf/indirect_streambuf.hpp
==============================================================================
--- branches/release/boost/iostreams/detail/streambuf/indirect_streambuf.hpp (original)
+++ branches/release/boost/iostreams/detail/streambuf/indirect_streambuf.hpp 2008-01-17 21:03:40 EST (Thu, 17 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: branches/release/boost/iostreams/device/mapped_file.hpp
==============================================================================
--- branches/release/boost/iostreams/device/mapped_file.hpp (original)
+++ branches/release/boost/iostreams/device/mapped_file.hpp 2008-01-17 21:03:40 EST (Thu, 17 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: branches/release/boost/iostreams/filter/gzip.hpp
==============================================================================
--- branches/release/boost/iostreams/filter/gzip.hpp (original)
+++ branches/release/boost/iostreams/filter/gzip.hpp 2008-01-17 21:03:40 EST (Thu, 17 Jan 2008)
@@ -251,6 +251,8 @@
throw;
}
close_impl();
+ } else {
+ close_impl();
}
}
private:
Modified: branches/release/boost/iostreams/filter/newline.hpp
==============================================================================
--- branches/release/boost/iostreams/filter/newline.hpp (original)
+++ branches/release/boost/iostreams/filter/newline.hpp 2008-01-17 21:03:40 EST (Thu, 17 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: branches/release/boost/iostreams/filter/symmetric.hpp
==============================================================================
--- branches/release/boost/iostreams/filter/symmetric.hpp (original)
+++ branches/release/boost/iostreams/filter/symmetric.hpp 2008-01-17 21:03:40 EST (Thu, 17 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: branches/release/libs/iostreams/test/close_test.cpp
==============================================================================
--- branches/release/libs/iostreams/test/close_test.cpp (original)
+++ branches/release/libs/iostreams/test/close_test.cpp 2008-01-17 21:03:40 EST (Thu, 17 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: branches/release/libs/iostreams/test/combine_test.cpp
==============================================================================
--- branches/release/libs/iostreams/test/combine_test.cpp (original)
+++ branches/release/libs/iostreams/test/combine_test.cpp 2008-01-17 21:03:40 EST (Thu, 17 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: branches/release/libs/iostreams/test/compose_test.cpp
==============================================================================
--- branches/release/libs/iostreams/test/compose_test.cpp (original)
+++ branches/release/libs/iostreams/test/compose_test.cpp 2008-01-17 21:03:40 EST (Thu, 17 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: branches/release/libs/iostreams/test/copy_test.cpp
==============================================================================
--- branches/release/libs/iostreams/test/copy_test.cpp (original)
+++ branches/release/libs/iostreams/test/copy_test.cpp 2008-01-17 21:03:40 EST (Thu, 17 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: branches/release/libs/iostreams/test/detail/utf8_codecvt_facet.cpp
==============================================================================
--- branches/release/libs/iostreams/test/detail/utf8_codecvt_facet.cpp (original)
+++ branches/release/libs/iostreams/test/detail/utf8_codecvt_facet.cpp 2008-01-17 21:03:40 EST (Thu, 17 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: branches/release/libs/iostreams/test/restrict_test.cpp
==============================================================================
--- branches/release/libs/iostreams/test/restrict_test.cpp (original)
+++ branches/release/libs/iostreams/test/restrict_test.cpp 2008-01-17 21:03:40 EST (Thu, 17 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