remove empty statements and fix integral promotion warning
This commit is contained in:
parent
af5fe587c0
commit
e8543ecf54
|
@ -942,7 +942,8 @@ namespace detail {
|
||||||
&& ret.m_tokens[stack[current_frame - 1].token].type == bdecode_token::dict)
|
&& ret.m_tokens[stack[current_frame - 1].token].type == bdecode_token::dict)
|
||||||
{
|
{
|
||||||
// the next item we parse is the opposite
|
// the next item we parse is the opposite
|
||||||
stack[current_frame - 1].state = ~stack[current_frame - 1].state;
|
// state is an unsigned 1-bit member. adding 1 will flip the bit
|
||||||
|
stack[current_frame - 1].state = (stack[current_frame - 1].state + 1) & 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// this terminates the top level node, we're done!
|
// this terminates the top level node, we're done!
|
||||||
|
|
10
src/sha1.cpp
10
src/sha1.cpp
|
@ -71,11 +71,11 @@ using u8 = std::uint8_t;
|
||||||
^block->l[((i)+2)&15]^block->l[(i)&15],1))
|
^block->l[((i)+2)&15]^block->l[(i)&15],1))
|
||||||
|
|
||||||
// (R0+R1), R2, R3, R4 are the different operations used in SHA1
|
// (R0+R1), R2, R3, R4 are the different operations used in SHA1
|
||||||
#define R0(v,w,x,y,z,i) z+=(((w)&((x)^(y)))^(y))+BlkFun::apply(block, i)+0x5A827999+rol(v,5);(w)=rol(w,30);
|
#define R0(v,w,x,y,z,i) z+=(((w)&((x)^(y)))^(y))+BlkFun::apply(block, i)+0x5A827999+rol(v,5);(w)=rol(w,30)
|
||||||
#define R1(v,w,x,y,z,i) z+=(((w)&((x)^(y)))^(y))+blk(i)+0x5A827999+rol(v,5);(w)=rol(w,30);
|
#define R1(v,w,x,y,z,i) z+=(((w)&((x)^(y)))^(y))+blk(i)+0x5A827999+rol(v,5);(w)=rol(w,30)
|
||||||
#define R2(v,w,x,y,z,i) z+=((w)^(x)^(y))+blk(i)+0x6ED9EBA1+rol(v,5);(w)=rol(w,30);
|
#define R2(v,w,x,y,z,i) z+=((w)^(x)^(y))+blk(i)+0x6ED9EBA1+rol(v,5);(w)=rol(w,30)
|
||||||
#define R3(v,w,x,y,z,i) z+=((((w)|(x))&(y))|((w)&(x)))+blk(i)+0x8F1BBCDC+rol(v,5);(w)=rol(w,30);
|
#define R3(v,w,x,y,z,i) z+=((((w)|(x))&(y))|((w)&(x)))+blk(i)+0x8F1BBCDC+rol(v,5);(w)=rol(w,30)
|
||||||
#define R4(v,w,x,y,z,i) z+=((w)^(x)^(y))+blk(i)+0xCA62C1D6+rol(v,5);(w)=rol(w,30);
|
#define R4(v,w,x,y,z,i) z+=((w)^(x)^(y))+blk(i)+0xCA62C1D6+rol(v,5);(w)=rol(w,30)
|
||||||
|
|
||||||
// Hash a single 512-bit block. This is the core of the algorithm.
|
// Hash a single 512-bit block. This is the core of the algorithm.
|
||||||
template <class BlkFun>
|
template <class BlkFun>
|
||||||
|
|
Loading…
Reference in New Issue