mirror of
https://github.com/boostorg/beast.git
synced 2025-08-03 06:44:39 +02:00
Squelch spurious warning on gcc
This commit is contained in:
@@ -10,6 +10,7 @@ Version 66:
|
|||||||
* Add header aliases
|
* Add header aliases
|
||||||
* basic_fields optimizations
|
* basic_fields optimizations
|
||||||
* Add http-server example
|
* Add http-server example
|
||||||
|
* Squelch spurious warning on gcc
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@@ -39,6 +39,7 @@
|
|||||||
#include <beast/zlib/detail/ranges.hpp>
|
#include <beast/zlib/detail/ranges.hpp>
|
||||||
#include <beast/core/detail/type_traits.hpp>
|
#include <beast/core/detail/type_traits.hpp>
|
||||||
#include <boost/assert.hpp>
|
#include <boost/assert.hpp>
|
||||||
|
#include <boost/config.hpp>
|
||||||
#include <boost/optional.hpp>
|
#include <boost/optional.hpp>
|
||||||
#include <boost/throw_exception.hpp>
|
#include <boost/throw_exception.hpp>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
@@ -667,7 +668,7 @@ protected:
|
|||||||
template<class = void> std::size_t doUpperBound (std::size_t sourceLen) const;
|
template<class = void> std::size_t doUpperBound (std::size_t sourceLen) const;
|
||||||
template<class = void> void doTune (int good_length, int max_lazy, int nice_length, int max_chain);
|
template<class = void> void doTune (int good_length, int max_lazy, int nice_length, int max_chain);
|
||||||
template<class = void> void doParams (z_params& zs, int level, Strategy strategy, error_code& ec);
|
template<class = void> void doParams (z_params& zs, int level, Strategy strategy, error_code& ec);
|
||||||
template<class = void> void doWrite (z_params& zs, Flush flush, error_code& ec);
|
template<class = void> void doWrite (z_params& zs, boost::optional<Flush> flush, error_code& ec);
|
||||||
template<class = void> void doDictionary (Byte const* dict, uInt dictLength, error_code& ec);
|
template<class = void> void doDictionary (Byte const* dict, uInt dictLength, error_code& ec);
|
||||||
template<class = void> void doPrime (int bits, int value, error_code& ec);
|
template<class = void> void doPrime (int bits, int value, error_code& ec);
|
||||||
template<class = void> void doPending (unsigned* value, int* bits);
|
template<class = void> void doPending (unsigned* value, int* bits);
|
||||||
@@ -1014,10 +1015,14 @@ doParams(z_params& zs, int level, Strategy strategy, error_code& ec)
|
|||||||
strategy_ = strategy;
|
strategy_ = strategy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// VFALCO boost::optional param is a workaround for
|
||||||
|
// gcc "maybe uninitialized" warning
|
||||||
|
// https://github.com/vinniefalco/Beast/issues/532
|
||||||
|
//
|
||||||
template<class>
|
template<class>
|
||||||
void
|
void
|
||||||
deflate_stream::
|
deflate_stream::
|
||||||
doWrite(z_params& zs, Flush flush, error_code& ec)
|
doWrite(z_params& zs, boost::optional<Flush> flush, error_code& ec)
|
||||||
{
|
{
|
||||||
maybe_init();
|
maybe_init();
|
||||||
|
|
||||||
@@ -1081,14 +1086,14 @@ doWrite(z_params& zs, Flush flush, error_code& ec)
|
|||||||
switch(strategy_)
|
switch(strategy_)
|
||||||
{
|
{
|
||||||
case Strategy::huffman:
|
case Strategy::huffman:
|
||||||
bstate = deflate_huff(zs, flush);
|
bstate = deflate_huff(zs, flush.get());
|
||||||
break;
|
break;
|
||||||
case Strategy::rle:
|
case Strategy::rle:
|
||||||
bstate = deflate_rle(zs, flush);
|
bstate = deflate_rle(zs, flush.get());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
bstate = (this->*(get_config(level_).func))(zs, flush);
|
bstate = (this->*(get_config(level_).func))(zs, flush.get());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user