Skip to content

Commit

Permalink
Merge pull request #12 from RegardsIM/patch-1
Browse files Browse the repository at this point in the history
Fix VS 2022 shift conversion warning
  • Loading branch information
p-ranav authored Sep 27, 2022
2 parents cdfa510 + 2f7a595 commit 3654776
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/alpaca/detail/variable_length_encoding.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ namespace alpaca {
namespace detail {

template <typename T> bool CHECK_BIT(T &value, uint8_t pos) {
return ((value) & (1 << (pos)));
return ((value) & (T{1} << (pos)));
}

template <typename T> void SET_BIT(T &value, uint8_t pos) {
value = value | 1 << pos;
value = value | T{1} << pos;
}

template <typename T> void RESET_BIT(T &value, uint8_t pos) {
value = value & ~(1 << pos);
value = value & ~(T{1} << pos);
}

template <typename int_t, typename Container>
Expand Down Expand Up @@ -242,4 +242,4 @@ decode_varint(Container &input, std::size_t &current_index) {

} // namespace detail

} // namespace alpaca
} // namespace alpaca

0 comments on commit 3654776

Please sign in to comment.