diff options
Diffstat (limited to 'boost/iostreams/filter')
-rw-r--r-- | boost/iostreams/filter/bzip2.hpp | 14 | ||||
-rw-r--r-- | boost/iostreams/filter/gzip.hpp | 22 | ||||
-rw-r--r-- | boost/iostreams/filter/symmetric.hpp | 7 | ||||
-rw-r--r-- | boost/iostreams/filter/zlib.hpp | 34 |
4 files changed, 39 insertions, 38 deletions
diff --git a/boost/iostreams/filter/bzip2.hpp b/boost/iostreams/filter/bzip2.hpp index 7c1d1efc10..029338d1c6 100644 --- a/boost/iostreams/filter/bzip2.hpp +++ b/boost/iostreams/filter/bzip2.hpp @@ -87,9 +87,9 @@ const bool default_small = false; struct bzip2_params { // Non-explicit constructor for compression. - bzip2_params( int block_size = bzip2::default_block_size, - int work_factor = bzip2::default_work_factor ) - : block_size(block_size), work_factor(work_factor) + bzip2_params( int block_size_ = bzip2::default_block_size, + int work_factor_ = bzip2::default_work_factor ) + : block_size(block_size_), work_factor(work_factor_) { } // Constructor for decompression. @@ -242,7 +242,7 @@ public: typedef typename base_type::char_type char_type; typedef typename base_type::category category; basic_bzip2_compressor( const bzip2_params& = bzip2::default_block_size, - int buffer_size = default_device_buffer_size ); + std::streamsize buffer_size = default_device_buffer_size ); }; BOOST_IOSTREAMS_PIPABLE(basic_bzip2_compressor, 1) @@ -264,7 +264,7 @@ public: typedef typename base_type::char_type char_type; typedef typename base_type::category category; basic_bzip2_decompressor( bool small = bzip2::default_small, - int buffer_size = default_device_buffer_size ); + std::streamsize buffer_size = default_device_buffer_size ); }; BOOST_IOSTREAMS_PIPABLE(basic_bzip2_decompressor, 1) @@ -386,7 +386,7 @@ inline void bzip2_decompressor_impl<Alloc>::init() template<typename Alloc> basic_bzip2_compressor<Alloc>::basic_bzip2_compressor - (const bzip2_params& p, int buffer_size) + (const bzip2_params& p, std::streamsize buffer_size) : base_type(buffer_size, p) { } @@ -394,7 +394,7 @@ basic_bzip2_compressor<Alloc>::basic_bzip2_compressor template<typename Alloc> basic_bzip2_decompressor<Alloc>::basic_bzip2_decompressor - (bool small, int buffer_size) + (bool small, std::streamsize buffer_size) : base_type(buffer_size, small) { } diff --git a/boost/iostreams/filter/gzip.hpp b/boost/iostreams/filter/gzip.hpp index fb18224ea1..d7939c82d2 100644 --- a/boost/iostreams/filter/gzip.hpp +++ b/boost/iostreams/filter/gzip.hpp @@ -32,7 +32,7 @@ #include <boost/iostreams/detail/adapter/non_blocking_adapter.hpp> #include <boost/iostreams/detail/adapter/range_adapter.hpp> #include <boost/iostreams/detail/char_traits.hpp> -#include <boost/iostreams/detail/ios.hpp> // failure. +#include <boost/iostreams/detail/ios.hpp> // failure, streamsize. #include <boost/iostreams/detail/error.hpp> #include <boost/iostreams/operations.hpp> #include <boost/iostreams/device/back_inserter.hpp> @@ -143,11 +143,11 @@ struct gzip_params : zlib_params { int window_bits = gzip::default_window_bits, int mem_level = gzip::default_mem_level, int strategy = gzip::default_strategy, - std::string file_name = "", - std::string comment = "", - std::time_t mtime = 0 ) + std::string file_name_ = "", + std::string comment_ = "", + std::time_t mtime_ = 0 ) : zlib_params(level, method, window_bits, mem_level, strategy), - file_name(file_name), comment(comment), mtime(mtime) + file_name(file_name_), comment(comment_), mtime(mtime_) { } std::string file_name; std::string comment; @@ -197,7 +197,7 @@ public: closable_tag { }; basic_gzip_compressor( const gzip_params& = gzip::default_compression, - int buffer_size = default_device_buffer_size ); + std::streamsize buffer_size = default_device_buffer_size ); template<typename Source> std::streamsize read(Source& src, char_type* s, std::streamsize n) @@ -285,7 +285,7 @@ private: boost::iostreams::put(next, static_cast<char>(0xFF & (n >> 24))); } template<typename Sink> - static void write_long(long n, Sink& next, boost::mpl::false_) + static void write_long(long, Sink&, boost::mpl::false_) { } template<typename Sink> @@ -411,7 +411,7 @@ public: closable_tag { }; basic_gzip_decompressor( int window_bits = gzip::default_window_bits, - int buffer_size = default_device_buffer_size ); + std::streamsize buffer_size = default_device_buffer_size ); template<typename Sink> std::streamsize write(Sink& snk, const char_type* s, std::streamsize n) @@ -505,7 +505,7 @@ public: if (footer_.done()) { if (footer_.crc() != this->crc()) boost::throw_exception(gzip_error(gzip::bad_crc)); - int c = boost::iostreams::get(peek); + c = boost::iostreams::get(peek); if (traits_type::is_eof(c)) { state_ = s_done; } else { @@ -645,7 +645,7 @@ typedef basic_gzip_decompressor<> gzip_decompressor; template<typename Alloc> basic_gzip_compressor<Alloc>::basic_gzip_compressor - (const gzip_params& p, int buffer_size) + (const gzip_params& p, std::streamsize buffer_size) : base_type(normalize_params(p), buffer_size), offset_(0), flags_(0) { @@ -731,7 +731,7 @@ std::streamsize basic_gzip_compressor<Alloc>::read_string template<typename Alloc> basic_gzip_decompressor<Alloc>::basic_gzip_decompressor - (int window_bits, int buffer_size) + (int window_bits, std::streamsize buffer_size) : base_type(make_params(window_bits), buffer_size), state_(s_start) { } diff --git a/boost/iostreams/filter/symmetric.hpp b/boost/iostreams/filter/symmetric.hpp index 57ceea7727..f18089f4fb 100644 --- a/boost/iostreams/filter/symmetric.hpp +++ b/boost/iostreams/filter/symmetric.hpp @@ -42,13 +42,14 @@ #endif #include <boost/assert.hpp> -#include <memory> // allocator, auto_ptr. +#include <memory> // allocator. #include <boost/config.hpp> // BOOST_DEDUCED_TYPENAME. #include <boost/iostreams/char_traits.hpp> #include <boost/iostreams/constants.hpp> // buffer size. #include <boost/iostreams/detail/buffer.hpp> #include <boost/iostreams/detail/char_traits.hpp> #include <boost/iostreams/detail/config/limits.hpp> +#include <boost/iostreams/detail/ios.hpp> // streamsize. #include <boost/iostreams/detail/template_params.hpp> #include <boost/iostreams/traits.hpp> #include <boost/iostreams/operations.hpp> // read, write. @@ -85,7 +86,7 @@ public: #define BOOST_PP_LOCAL_MACRO(n) \ BOOST_IOSTREAMS_TEMPLATE_PARAMS(n, T) \ explicit symmetric_filter( \ - int buffer_size BOOST_PP_COMMA_IF(n) \ + std::streamsize buffer_size BOOST_PP_COMMA_IF(n) \ BOOST_PP_ENUM_BINARY_PARAMS(n, const T, &t) ) \ : pimpl_(new impl(buffer_size BOOST_PP_COMMA_IF(n) \ BOOST_PP_ENUM_PARAMS(n, t))) \ @@ -252,7 +253,7 @@ private: // Expands to a sequence of ctors which forward to SymmetricFilter. #define BOOST_PP_LOCAL_MACRO(n) \ BOOST_IOSTREAMS_TEMPLATE_PARAMS(n, T) \ - impl( int buffer_size BOOST_PP_COMMA_IF(n) \ + impl( std::streamsize buffer_size BOOST_PP_COMMA_IF(n) \ BOOST_PP_ENUM_BINARY_PARAMS(n, const T, &t) ) \ : SymmetricFilter(BOOST_PP_ENUM_PARAMS(n, t)), \ buf_(buffer_size), state_(0) \ diff --git a/boost/iostreams/filter/zlib.hpp b/boost/iostreams/filter/zlib.hpp index 848af89255..3d0de14a70 100644 --- a/boost/iostreams/filter/zlib.hpp +++ b/boost/iostreams/filter/zlib.hpp @@ -110,16 +110,16 @@ const bool default_noheader = false; struct zlib_params { // Non-explicit constructor. - zlib_params( int level = zlib::default_compression, - int method = zlib::deflated, - int window_bits = zlib::default_window_bits, - int mem_level = zlib::default_mem_level, - int strategy = zlib::default_strategy, - bool noheader = zlib::default_noheader, - bool calculate_crc = zlib::default_crc ) - : level(level), method(method), window_bits(window_bits), - mem_level(mem_level), strategy(strategy), - noheader(noheader), calculate_crc(calculate_crc) + zlib_params( int level_ = zlib::default_compression, + int method_ = zlib::deflated, + int window_bits_ = zlib::default_window_bits, + int mem_level_ = zlib::default_mem_level, + int strategy_ = zlib::default_strategy, + bool noheader_ = zlib::default_noheader, + bool calculate_crc_ = zlib::default_crc ) + : level(level_), method(method_), window_bits(window_bits_), + mem_level(mem_level_), strategy(strategy_), + noheader(noheader_), calculate_crc(calculate_crc_) { } int level; int method; @@ -263,7 +263,7 @@ public: typedef typename base_type::char_type char_type; typedef typename base_type::category category; basic_zlib_compressor( const zlib_params& = zlib::default_compression, - int buffer_size = default_device_buffer_size ); + std::streamsize buffer_size = default_device_buffer_size ); zlib::ulong crc() { return this->filter().crc(); } int total_in() { return this->filter().total_in(); } }; @@ -287,9 +287,9 @@ public: typedef typename base_type::char_type char_type; typedef typename base_type::category category; basic_zlib_decompressor( int window_bits = zlib::default_window_bits, - int buffer_size = default_device_buffer_size ); + std::streamsize buffer_size = default_device_buffer_size ); basic_zlib_decompressor( const zlib_params& p, - int buffer_size = default_device_buffer_size ); + std::streamsize buffer_size = default_device_buffer_size ); zlib::ulong crc() { return this->filter().crc(); } int total_out() { return this->filter().total_out(); } bool eof() { return this->filter().eof(); } @@ -347,7 +347,7 @@ bool zlib_compressor_impl<Alloc>::filter int result = xdeflate(flush ? zlib::finish : zlib::no_flush); after(src_begin, dest_begin, true); zlib_error::check BOOST_PREVENT_MACRO_SUBSTITUTION(result); - return result != zlib::stream_end; + return result != zlib::stream_end; } template<typename Alloc> @@ -396,19 +396,19 @@ void zlib_decompressor_impl<Alloc>::close() { template<typename Alloc> basic_zlib_compressor<Alloc>::basic_zlib_compressor - (const zlib_params& p, int buffer_size) + (const zlib_params& p, std::streamsize buffer_size) : base_type(buffer_size, p) { } //------------------Implementation of zlib_decompressor-----------------------// template<typename Alloc> basic_zlib_decompressor<Alloc>::basic_zlib_decompressor - (int window_bits, int buffer_size) + (int window_bits, std::streamsize buffer_size) : base_type(buffer_size, window_bits) { } template<typename Alloc> basic_zlib_decompressor<Alloc>::basic_zlib_decompressor - (const zlib_params& p, int buffer_size) + (const zlib_params& p, std::streamsize buffer_size) : base_type(buffer_size, p) { } //----------------------------------------------------------------------------// |