Skip to content

Commit 13ed341

Browse files
committedFeb 21, 2024
Fix implicit conversion warnings
1 parent 21b03af commit 13ed341

File tree

1 file changed

+6
-4
lines changed
  • include/boost/charconv/detail/dragonbox

1 file changed

+6
-4
lines changed
 

‎include/boost/charconv/detail/dragonbox/floff.hpp

+6-4
Original file line numberDiff line numberDiff line change
@@ -3811,15 +3811,16 @@ BOOST_CHARCONV_SAFEBUFFERS to_chars_result floff(const double x, int precision,
38113811
{
38123812
// Insert decimal dot.
38133813
decimal_dot_pos = buffer_starting_pos + decimal_exponent_normalized + 1;
3814-
std::memmove(buffer_starting_pos, buffer_starting_pos + 1, decimal_dot_pos - buffer_starting_pos);
3814+
std::memmove(buffer_starting_pos, buffer_starting_pos + 1,
3815+
static_cast<std::size_t>(decimal_dot_pos - buffer_starting_pos));
38153816
*decimal_dot_pos = '.';
38163817
}
38173818
else
38183819
{
38193820
// Print leading zeros and insert decimal dot.
38203821
int number_of_leading_zeros = -decimal_exponent_normalized - 1;
3821-
std::memmove(buffer_starting_pos + number_of_leading_zeros + 2,
3822-
buffer_starting_pos + 1, buffer - buffer_starting_pos - 1);
3822+
std::memmove(buffer_starting_pos + number_of_leading_zeros + 2, buffer_starting_pos + 1,
3823+
static_cast<std::size_t>(buffer - buffer_starting_pos - 1));
38233824
std::memcpy(buffer_starting_pos, "0.", 2);
38243825
std::memset(buffer_starting_pos + 2, '0', static_cast<std::size_t>(number_of_leading_zeros));
38253826
buffer += number_of_leading_zeros + 1;
@@ -3855,7 +3856,8 @@ BOOST_CHARCONV_SAFEBUFFERS to_chars_result floff(const double x, int precision,
38553856
}
38563857
else if (decimal_dot_pos != buffer_starting_pos)
38573858
{
3858-
std::memmove(buffer_starting_pos, buffer_starting_pos + 1, decimal_dot_pos - buffer_starting_pos);
3859+
std::memmove(buffer_starting_pos, buffer_starting_pos + 1,
3860+
static_cast<std::size_t>(decimal_dot_pos - buffer_starting_pos));
38593861
*decimal_dot_pos = '.';
38603862
}
38613863

0 commit comments

Comments
 (0)