Skip to content

Commit 770f594

Browse files
committed
Fix more sign conversions
1 parent b4cdb5a commit 770f594

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

include/boost/decimal/detail/u256.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -419,13 +419,13 @@ constexpr u256 operator>>(const u256& lhs, const int shift) noexcept
419419
return result;
420420
}
421421

422-
const auto word_shift {shift / 64};
423-
const auto bit_shift {shift % 64};
422+
const auto word_shift {static_cast<std::size_t>(shift / 64)};
423+
const auto bit_shift {static_cast<std::size_t>(shift % 64)};
424424

425425
// Only moving whole words
426426
if (bit_shift == 0)
427427
{
428-
for (int i {}; i < 4 - word_shift; ++i)
428+
for (std::size_t i {}; i < 4 - word_shift; ++i)
429429
{
430430
result[i] = lhs[i + word_shift];
431431
}
@@ -434,7 +434,7 @@ constexpr u256 operator>>(const u256& lhs, const int shift) noexcept
434434
}
435435

436436
// Handle partial shifts across word boundaries
437-
for (int i {}; i < 4 - word_shift - 1; ++i)
437+
for (std::size_t i {}; i < 4 - word_shift - 1; ++i)
438438
{
439439
result[i] = (lhs[i + word_shift] >> bit_shift) |
440440
(lhs[i + word_shift + 1] << (64 - bit_shift));

0 commit comments

Comments
 (0)