forked from boostorg/beast
Fix integer types in deflate_stream::bi_reverse
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
Version 65:
|
Version 65:
|
||||||
|
|
||||||
* Enable narrowing warning on msvc cmake
|
* Enable narrowing warning on msvc cmake
|
||||||
|
* Fix integer types in deflate_stream::bi_reverse
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@@ -646,9 +646,10 @@ protected:
|
|||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<class Unsigned>
|
||||||
static
|
static
|
||||||
unsigned
|
Unsigned
|
||||||
bi_reverse(unsigned code, int len);
|
bi_reverse(Unsigned code, unsigned len);
|
||||||
|
|
||||||
template<class = void>
|
template<class = void>
|
||||||
static
|
static
|
||||||
@@ -742,12 +743,15 @@ protected:
|
|||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
|
|
||||||
// Reverse the first len bits of a code
|
// Reverse the first len bits of a code
|
||||||
|
template<class Unsigned>
|
||||||
inline
|
inline
|
||||||
unsigned
|
Unsigned
|
||||||
deflate_stream::
|
deflate_stream::
|
||||||
bi_reverse(unsigned code, int len)
|
bi_reverse(Unsigned code, unsigned len)
|
||||||
{
|
{
|
||||||
unsigned res = 0;
|
BOOST_STATIC_ASSERT(std::is_unsigned<Unsigned>::value);
|
||||||
|
BOOST_ASSERT(len <= 8 * sizeof(unsigned));
|
||||||
|
Unsigned res = 0;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
res |= code & 1;
|
res |= code & 1;
|
||||||
|
Reference in New Issue
Block a user