remove empty statements and fix integral promotion warning

This commit is contained in:
arvidn 2019-08-20 10:50:41 +02:00 committed by Arvid Norberg
parent af5fe587c0
commit e8543ecf54
2 changed files with 7 additions and 6 deletions

View File

@ -942,7 +942,8 @@ namespace detail {
&& ret.m_tokens[stack[current_frame - 1].token].type == bdecode_token::dict)
{
// 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!

View File

@ -71,11 +71,11 @@ using u8 = std::uint8_t;
^block->l[((i)+2)&15]^block->l[(i)&15],1))
// (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 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 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 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 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 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.
template <class BlkFun>