Skip to content

Commit

Permalink
Fix -Wtype-limits warning.
Browse files Browse the repository at this point in the history
The compiler emits the following warning:

"warning: comparison is always true due to
limited range of data type [-Wtype-limits]"

Because the affected ipp file is included
in every project that includes bitcoin.hpp
this warning generates a lot of noise when
compiling other libbitcoin repos.
  • Loading branch information
toxeus committed Jul 18, 2018
1 parent 56f1da2 commit ffb1e0c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions include/bitcoin/bitcoin/impl/machine/operation.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,6 @@ inline bool operation::is_positive(opcode code)
inline bool operation::is_reserved(opcode code)
{
BC_CONSTEXPR auto op_186 = static_cast<uint8_t>(opcode::reserved_186);
BC_CONSTEXPR auto op_255 = static_cast<uint8_t>(opcode::reserved_255);

switch (code)
{
Expand All @@ -316,8 +315,7 @@ inline bool operation::is_reserved(opcode code)
case opcode::reserved_138:
return true;
default:
const auto value = static_cast<uint8_t>(code);
return value >= op_186 && value <= op_255;
return static_cast<uint8_t>(code) >= op_186;
}
}

Expand Down

0 comments on commit ffb1e0c

Please sign in to comment.