Skip to content

[libc][__support] Fix -Wimplicit-int-conversion warning #132839

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions libc/src/__support/float_to_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ class FloatToString {

LIBC_INLINE constexpr BlockInt get_negative_block(int block_index) {
if (exponent < 0) {
const int32_t idx = -exponent / IDX_SIZE;
const int32_t idx = -exponent / static_cast<int32_t>(IDX_SIZE);

UInt<MID_INT_SIZE> val;

Expand Down Expand Up @@ -579,7 +579,7 @@ class FloatToString {

return num_requested_digits > -exponent;
#else
const int32_t idx = -exponent / IDX_SIZE;
const int32_t idx = -exponent / static_cast<int32_t>(IDX_SIZE);
const size_t p =
POW10_OFFSET_2[idx] + negative_block_index - MIN_BLOCK_2[idx];
// If the remaining digits are all 0, then this is the lowest block.
Expand All @@ -601,7 +601,7 @@ class FloatToString {
}
return 0;
#else
return MIN_BLOCK_2[-exponent / IDX_SIZE];
return MIN_BLOCK_2[-exponent / static_cast<int32_t>(IDX_SIZE)];
#endif
}
};
Expand Down
Loading