|
33 | 33 | #include "src/__support/uint128.h" |
34 | 34 | #include "src/errno/libc_errno.h" // For ERANGE |
35 | 35 |
|
| 36 | +#include <_types/_uint32_t.h> |
36 | 37 | #include <stdint.h> |
37 | 38 |
|
38 | 39 | namespace LIBC_NAMESPACE_DECL { |
@@ -802,7 +803,7 @@ LIBC_INLINE FloatConvertReturn<T> binary_exp_to_float(ExpandedFloat<T> init_num, |
802 | 803 |
|
803 | 804 | // Handle subnormals. |
804 | 805 | if (biased_exponent <= 0) { |
805 | | - amount_to_shift_right += 1 - biased_exponent; |
| 806 | + amount_to_shift_right += static_cast<uint32_t>(1 - biased_exponent); |
806 | 807 | biased_exponent = 0; |
807 | 808 |
|
808 | 809 | if (amount_to_shift_right > FPBits::STORAGE_LEN) { |
@@ -909,7 +910,7 @@ decimal_string_to_float(const char *__restrict src, const char DECIMAL_POINT, |
909 | 910 | cpp::numeric_limits<StorageType>::max() / BASE; |
910 | 911 | while (true) { |
911 | 912 | if (isdigit(src[index])) { |
912 | | - uint32_t digit = b36_char_to_int(src[index]); |
| 913 | + uint32_t digit = static_cast<uint32_t>(b36_char_to_int(src[index])); |
913 | 914 | seen_digit = true; |
914 | 915 |
|
915 | 916 | if (mantissa < bitstype_max_div_by_base) { |
@@ -956,7 +957,7 @@ decimal_string_to_float(const char *__restrict src, const char DECIMAL_POINT, |
956 | 957 | if (result.has_error()) |
957 | 958 | output.error = result.error; |
958 | 959 | int32_t add_to_exponent = result.value; |
959 | | - index += result.parsed_len; |
| 960 | + index += static_cast<size_t>(result.parsed_len); |
960 | 961 |
|
961 | 962 | // Here we do this operation as int64 to avoid overflow. |
962 | 963 | int64_t temp_exponent = static_cast<int64_t>(exponent) + |
@@ -1020,7 +1021,7 @@ hexadecimal_string_to_float(const char *__restrict src, |
1020 | 1021 | cpp::numeric_limits<StorageType>::max() / BASE; |
1021 | 1022 | while (true) { |
1022 | 1023 | if (isalnum(src[index])) { |
1023 | | - uint32_t digit = b36_char_to_int(src[index]); |
| 1024 | + uint32_t digit = static_cast<uint32_t>(b36_char_to_int(src[index])); |
1024 | 1025 | if (digit < BASE) |
1025 | 1026 | seen_digit = true; |
1026 | 1027 | else |
@@ -1070,7 +1071,7 @@ hexadecimal_string_to_float(const char *__restrict src, |
1070 | 1071 | output.error = result.error; |
1071 | 1072 |
|
1072 | 1073 | int32_t add_to_exponent = result.value; |
1073 | | - index += result.parsed_len; |
| 1074 | + index += static_cast<size_t>(result.parsed_len); |
1074 | 1075 |
|
1075 | 1076 | // Here we do this operation as int64 to avoid overflow. |
1076 | 1077 | int64_t temp_exponent = static_cast<int64_t>(exponent) + |
|
0 commit comments