Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/development'
Browse files Browse the repository at this point in the history
  • Loading branch information
John Wellbelove committed Oct 7, 2018
2 parents c505e9a + aee76d6 commit 4703b78
Show file tree
Hide file tree
Showing 30 changed files with 1,770 additions and 34 deletions.
8 changes: 4 additions & 4 deletions include/etl/binary.h
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,8 @@ namespace etl

ETL_ASSERT((NBITS <= std::numeric_limits<TReturn>::digits), ETL_ERROR(binary_out_of_range));

TReturn mask = TReturn(1U) << (NBITS - 1);
value = value & ((1U << NBITS) - 1);
TReturn mask = TReturn(1) << (NBITS - 1);
value = value & static_cast<TValue>((TReturn(1) << NBITS) - 1);

return TReturn((value ^ mask) - mask);
}
Expand All @@ -364,8 +364,8 @@ namespace etl

ETL_ASSERT((NBITS <= std::numeric_limits<TReturn>::digits), ETL_ERROR(binary_out_of_range));

TReturn mask = TReturn(1U) << (NBITS - 1);
value = (value >> SHIFT) & ((1U << NBITS) - 1);
TReturn mask = TReturn(1) << (NBITS - 1);
value = (value >> SHIFT) & static_cast<TValue>((TReturn(1) << NBITS) - 1);

return TReturn((value ^ mask) - mask);
}
Expand Down
Loading

0 comments on commit 4703b78

Please sign in to comment.