forked from boostorg/beast
Fix integer types in deflate_stream::bi_reverse
This commit is contained in:
1 parent
246f55321c
commit
b5c69ff7c7
2 files changed
+10
-5
No files matched your search
@@ -646,9 +646,10 @@ protected:
|
||||
init();
|
||||
}
|
||||
|
||||
template<class Unsigned>
|
||||
static
|
||||
unsigned
|
||||
bi_reverse(unsigned code, int len);
|
||||
Unsigned
|
||||
bi_reverse(Unsigned code, unsigned len);
|
||||
|
||||
template<class = void>
|
||||
static
|
||||
@@ -742,12 +743,15 @@ protected:
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
// Reverse the first len bits of a code
|
||||
template<class Unsigned>
|
||||
inline
|
||||
unsigned
|
||||
Unsigned
|
||||
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
|
||||
{
|
||||
res |= code & 1;
|
||||
|
||||
Reference in new issue
Block a user