Skip to content

Commit

Permalink
fix compile error with gcc 13
Browse files Browse the repository at this point in the history
The result of bit_width is an integer, and that can't be used
with bit_ceil. Adds an extra cast to make sure the type is
correct.

Fixes #3.
  • Loading branch information
Snektron committed Mar 20, 2024
1 parent 7f09fc0 commit fc0213d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/pareas/lpg/render_util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
namespace pareas {
template <typename T>
constexpr T int_bit_width(T x) {
auto width = std::max(T{8}, std::bit_ceil(std::bit_width(x)));
auto width = std::max(T{8}, std::bit_ceil(static_cast<T>(std::bit_width(x))));
// This should only happen if there are a LOT of rules anyway.
assert(width <= 64);
return width;
Expand Down

0 comments on commit fc0213d

Please sign in to comment.