|
2957 | 2957 |
|
2958 | 2958 | ++dst; |
2959 | 2959 |
|
2960 | | - tu >>= 4; |
| 2960 | + tu >>= static_cast<unsigned>(UINT8_C(4)); |
2961 | 2961 | } |
2962 | 2962 |
|
2963 | 2963 | return dst; |
|
4283 | 4283 |
|
4284 | 4284 | const auto n = static_cast<local_uint_index_type> (number_of_limbs - v_offset); |
4285 | 4285 | const auto m = static_cast<local_uint_index_type>(static_cast<local_uint_index_type>(number_of_limbs - u_offset) - n); |
4286 | | - const auto vj0 = static_cast<local_uint_index_type>(static_cast<local_uint_index_type>(number_of_limbs - 1U) - v_offset); |
| 4286 | + const auto vj0 = static_cast<local_uint_index_type>(static_cast<local_uint_index_type>(n - static_cast<local_uint_index_type>(UINT8_C(1)))); |
4287 | 4287 |
|
4288 | 4288 | auto vv_at_vj0_it = detail::advance_and_point(vv.cbegin(), static_cast<size_t>(vj0)); // NOLINT(llvm-qualified-auto,readability-qualified-auto) |
4289 | 4289 |
|
|
4332 | 4332 | // Replace u[j, ... j + n] by u[j, ... j + n] - q_hat * v[1, ... n]. |
4333 | 4333 |
|
4334 | 4334 | // Set nv = q_hat * (v[1, ... n]). |
4335 | | - uu_array_type nv; |
| 4335 | + uu_array_type nv { }; |
4336 | 4336 |
|
4337 | 4337 | *(nv.begin() + static_cast<size_t>(n)) = eval_multiply_1d(nv.begin(), vv.cbegin(), q_hat, n); |
4338 | 4338 |
|
|
4342 | 4342 | nv.cbegin(), |
4343 | 4343 | n + 1U); |
4344 | 4344 |
|
4345 | | - |
4346 | 4345 | // Step D5: Test the remainder. |
4347 | 4346 | // Set the result value: Set result.m_data[m - j] = q_hat. |
4348 | 4347 | // Use the condition (u[j] < 0), in other words if the borrow |
|
4639 | 4638 | { |
4640 | 4639 | const auto uc_oct = static_cast<std::uint8_t>(c - static_cast<char>(UINT8_C(0x30))); |
4641 | 4640 |
|
4642 | | - operator<<=(3U); |
| 4641 | + operator<<=(static_cast<unsigned>(UINT8_C(3))); |
4643 | 4642 |
|
4644 | 4643 | *values.begin() = static_cast<limb_type>(*values.begin() | uc_oct); |
4645 | 4644 | } |
|
4673 | 4672 | else if(char_is_a_to_f_hi) { uc_hex = static_cast<std::uint8_t>(c - static_cast<char>(UINT8_C( 55))); } |
4674 | 4673 | else if(char_is_0_to_9) { uc_hex = static_cast<std::uint8_t>(c - static_cast<char>(UINT8_C(0x30))); } |
4675 | 4674 |
|
4676 | | - operator<<=(4U); |
| 4675 | + operator<<=(static_cast<unsigned>(UINT8_C(4))); |
4677 | 4676 |
|
4678 | 4677 | *values.begin() = static_cast<limb_type>(*values.begin() | uc_hex); |
4679 | 4678 | } |
|
4920 | 4919 |
|
4921 | 4920 | local_wide_integer_type remainder; |
4922 | 4921 |
|
4923 | | - local_wide_integer_type((!u_is_neg) ? u : -u).eval_divide_by_single_limb(v, 0U, &remainder); |
| 4922 | + local_wide_integer_type((!u_is_neg) ? u : -u).eval_divide_by_single_limb(v, static_cast<unsigned_fast_type>(UINT8_C(0)), &remainder); |
4924 | 4923 |
|
4925 | 4924 | using local_limb_type = typename local_wide_integer_type::limb_type; |
4926 | 4925 |
|
4927 | 4926 | auto u_rem = static_cast<local_limb_type>(remainder); |
4928 | 4927 |
|
4929 | | - return ((!u_is_neg) ? u_rem : static_cast<local_limb_type>(static_cast<local_limb_type>(~u_rem) + 1U)); |
| 4928 | + return ((!u_is_neg) ? u_rem : static_cast<local_limb_type>(static_cast<local_limb_type>(~u_rem) + static_cast<local_limb_type>(UINT8_C(1)))); |
4930 | 4929 | } |
4931 | 4930 |
|
4932 | 4931 | template<typename IntegralType, const size_t Width2, typename LimbType, typename AllocatorType, const bool IsSigned> |
|
5273 | 5272 | // on the lowest bit position of the fundamental type. |
5274 | 5273 | while(static_cast<std::uint_fast8_t>(static_cast<std::uint_fast8_t>(mask) & static_cast<std::uint_fast8_t>(UINT8_C(1))) == static_cast<std::uint_fast8_t>(UINT8_C(0))) // NOLINT(hicpp-signed-bitwise,altera-id-dependent-backward-branch) |
5275 | 5274 | { |
5276 | | - mask = static_cast<local_unsigned_integral_type>(mask >> 1U); |
| 5275 | + mask = static_cast<local_unsigned_integral_type>(mask >> static_cast<unsigned>(UINT8_C(1))); |
5277 | 5276 |
|
5278 | 5277 | ++result; |
5279 | 5278 | } |
|
5509 | 5508 | { |
5510 | 5509 | s = u; |
5511 | 5510 |
|
5512 | | - u = (s + (m / s)) >> 1; |
| 5511 | + u = (s + (m / s)) >> static_cast<unsigned>(UINT8_C(1)); |
5513 | 5512 |
|
5514 | 5513 | if(u >= s) { break; } // LCOV_EXCL_LINE |
5515 | 5514 | } |
|
5580 | 5579 | m_over_s_pow_3_minus_one /= s; |
5581 | 5580 | } |
5582 | 5581 |
|
5583 | | - u = ((s * three_minus_one) + m_over_s_pow_3_minus_one) / 3U; |
| 5582 | + u = ((s * three_minus_one) + m_over_s_pow_3_minus_one) / static_cast<unsigned>(UINT8_C(3)); |
5584 | 5583 |
|
5585 | 5584 | if(u >= s) { break; } |
5586 | 5585 | } |
|
5687 | 5686 |
|
5688 | 5687 | if((p0 == static_cast<local_limb_type>(UINT8_C(0))) && (p == static_cast<OtherIntegralTypeP>(0))) |
5689 | 5688 | { |
5690 | | - result = local_wide_integer_type(static_cast<std::uint8_t>(1U)); |
| 5689 | + result = local_wide_integer_type(static_cast<std::uint8_t>(UINT8_C(1))); |
5691 | 5690 | } |
5692 | 5691 | else if((p0 == static_cast<local_limb_type>(UINT8_C(1))) && (p == static_cast<OtherIntegralTypeP>(1))) |
5693 | 5692 | { |
|
5705 | 5704 | local_wide_integer_type y (b); |
5706 | 5705 | local_wide_integer_type p_local(p); |
5707 | 5706 |
|
5708 | | - while(((p0 = static_cast<local_limb_type>(p_local)) != 0U) || (p_local != 0U)) // NOLINT(altera-id-dependent-backward-branch) |
| 5707 | + while(((p0 = static_cast<local_limb_type>(p_local)) != static_cast<local_limb_type>(UINT8_C(0))) || (p_local != static_cast<local_wide_integer_type>(UINT8_C(0)))) // NOLINT(altera-id-dependent-backward-branch) |
5709 | 5708 | { |
5710 | 5709 | if(static_cast<unsigned_fast_type>(p0 & static_cast<local_limb_type>(UINT8_C(1))) != static_cast<unsigned_fast_type>(UINT8_C(0))) |
5711 | 5710 | { |
|
5745 | 5744 |
|
5746 | 5745 | if((p0 == static_cast<local_limb_type>(UINT8_C(0))) && (p == static_cast<OtherIntegralTypeP>(0))) |
5747 | 5746 | { |
5748 | | - result = local_normal_width_type((m != 1U) ? static_cast<std::uint8_t>(1U) : static_cast<std::uint8_t>(UINT8_C(0))); |
| 5747 | + result = local_normal_width_type((m != static_cast<unsigned>(UINT8_C(1))) ? static_cast<std::uint8_t>(UINT8_C(1)) : static_cast<std::uint8_t>(UINT8_C(0))); |
5749 | 5748 | } |
5750 | 5749 | else if((p0 == static_cast<local_limb_type>(UINT8_C(1))) && (p == static_cast<OtherIntegralTypeP>(1))) |
5751 | 5750 | { |
|
5760 | 5759 | } |
5761 | 5760 | else |
5762 | 5761 | { |
5763 | | - local_double_width_type x (static_cast<std::uint8_t>(UINT8_C(1))); |
5764 | | - OtherIntegralTypeP p_local(p); |
| 5762 | + using local_other_integral_p_type = OtherIntegralTypeP; |
| 5763 | + |
| 5764 | + local_double_width_type x (static_cast<std::uint8_t>(UINT8_C(1))); |
| 5765 | + local_other_integral_p_type p_local(p); |
5765 | 5766 |
|
5766 | | - while(((p0 = static_cast<local_limb_type>(p_local)) != 0U) || (p_local != static_cast<OtherIntegralTypeP>(0))) // NOLINT(altera-id-dependent-backward-branch) |
| 5767 | + while(((p0 = static_cast<local_limb_type>(p_local)) != static_cast<local_limb_type>(UINT8_C(0))) || (p_local != static_cast<local_other_integral_p_type>(0))) // NOLINT(altera-id-dependent-backward-branch) |
5767 | 5768 | { |
5768 | 5769 | if(static_cast<unsigned_fast_type>(p0 & static_cast<local_limb_type>(UINT8_C(1))) != static_cast<unsigned_fast_type>(UINT8_C(0))) |
5769 | 5770 | { |
|
5841 | 5842 |
|
5842 | 5843 | v -= u; |
5843 | 5844 |
|
5844 | | - while(static_cast<std::uint_fast8_t>(static_cast<std::uint_fast8_t>(v) & UINT8_C(1)) == UINT8_C(0)) // NOLINT(hicpp-signed-bitwise,altera-id-dependent-backward-branch) |
| 5845 | + while(static_cast<std::uint_fast8_t>(static_cast<std::uint_fast8_t>(v) & static_cast<std::uint_fast8_t>(UINT8_C(1))) == static_cast<std::uint_fast8_t>(UINT8_C(0))) // NOLINT(hicpp-signed-bitwise,altera-id-dependent-backward-branch) |
5845 | 5846 | { |
5846 | | - v >>= 1U; |
| 5847 | + v >>= static_cast<unsigned>(UINT8_C(1)); |
5847 | 5848 | } |
5848 | 5849 | } |
5849 | 5850 |
|
|
6289 | 6290 |
|
6290 | 6291 | constexpr auto digits_generator_result_type = static_cast<std::uint32_t>(GeneratorResultBits); |
6291 | 6292 |
|
6292 | | - static_assert((digits_generator_result_type % UINT32_C(8)) == UINT32_C(0), |
| 6293 | + static_assert(static_cast<std::uint32_t>(digits_generator_result_type % static_cast<std::uint32_t>(UINT8_C(8))) == static_cast<std::uint32_t>(UINT32_C(0)), |
6293 | 6294 | "Error: Generator result type must have a multiple of 8 bits."); |
6294 | 6295 |
|
6295 | 6296 | constexpr auto digits_limb_ratio = |
6296 | | - static_cast<std::uint32_t>(std::numeric_limits<local_limb_type>::digits / 8U); |
| 6297 | + static_cast<std::uint32_t>(std::numeric_limits<local_limb_type>::digits / static_cast<int>(INT8_C(8))); |
6297 | 6298 |
|
6298 | | - constexpr auto digits_gtor_ratio = static_cast<std::uint32_t>(digits_generator_result_type / 8U); |
| 6299 | + constexpr auto digits_gtor_ratio = static_cast<std::uint32_t>(digits_generator_result_type / static_cast<std::uint32_t>(UINT8_C(8))); |
6299 | 6300 |
|
6300 | 6301 | generator_result_type value = generator_result_type(); |
6301 | 6302 |
|
|
6539 | 6540 |
|
6540 | 6541 | const auto fn0 = static_cast<local_limb_type>(fn); |
6541 | 6542 |
|
6542 | | - if((fn0 != 1U) && (fn != 1U)) |
| 6543 | + if((fn0 != static_cast<local_limb_type>(UINT8_C(1))) && (fn != 1U)) |
6543 | 6544 | { |
6544 | 6545 | return false; |
6545 | 6546 | } |
|
6572 | 6573 | { |
6573 | 6574 | const local_limb_type y0(y); |
6574 | 6575 |
|
6575 | | - if((y0 == 1U) && (y == 1U)) |
| 6576 | + if((y0 == static_cast<local_limb_type>(UINT8_C(1))) && (y == 1U)) |
6576 | 6577 | { |
6577 | 6578 | if(j != static_cast<unsigned_fast_type>(UINT8_C(0))) |
6578 | 6579 | { |
|
0 commit comments