iostreams: unused argument in boost/iostreams/filter/zlib.hpp

In CVS boost/iostreams/filter/zlib.hpp, revision 1.21 there is: ... 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(zlib::default_crc) { } ... g++ -Wall -W (correctly) states: .../boost/iostreams/filter/zlib.hpp:120: warning: unused parameter 'calculate_crc' Normally I wouldn't worry about trivial warnings, but in this case the argument is being ignored when initialising the member data which looks a bit odd to me... phil -- change name before "@" to "phil" for email

Phil Richards wrote:
In CVS boost/iostreams/filter/zlib.hpp, revision 1.21 there is:
... 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(zlib::default_crc) { } ...
g++ -Wall -W (correctly) states: .../boost/iostreams/filter/zlib.hpp:120: warning: unused parameter 'calculate_crc'
Normally I wouldn't worry about trivial warnings, but in this case the argument is being ignored when initialising the member data which looks a bit odd to me...
Yes, it is a bit odd, so I fixed the initialization to use the supplied value. It doesn't affect the ordinary use of zlib or gzip, however, since plain zlib users don't use the crc most of the time and gzip sets the calculate_crc flag explicitly. Thanks for the report.
phil
Jonathan

On 6/10/05, Phil Richards <news@derived-software.ltd.uk> wrote:
In CVS boost/iostreams/filter/zlib.hpp, revision 1.21 there is:
... 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(zlib::default_crc) { } ...
g++ -Wall -W (correctly) states: .../boost/iostreams/filter/zlib.hpp:120: warning: unused parameter 'calculate_crc'
Normally I wouldn't worry about trivial warnings, but in this case the argument is being ignored when initialising the member data which looks a bit odd to me...
this->calculate_crc is being initialized with zlib::default_crc and not the ctor argument.
phil -- change name before "@" to "phil" for email
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
-- Cory Nelson http://www.int64.org
participants (3)
-
Cory Nelson
-
Jonathan Turkanis
-
Phil Richards