[ox/std] Fix some type implicit conversions in ox_itoa

This commit is contained in:
Gary Talent 2023-07-16 13:53:28 -05:00
parent 6e94c2be8d
commit f514b33b06

View File

@ -170,7 +170,7 @@ constexpr T ox_itoa(Integer v, T str) noexcept {
constexpr auto base = 10; constexpr auto base = 10;
auto it = 0; auto it = 0;
if (val < 0) { if (val < 0) {
str[it] = '-'; str[static_cast<std::size_t>(it)] = '-';
it++; it++;
} }
while (mod) { while (mod) {
@ -183,11 +183,11 @@ constexpr T ox_itoa(Integer v, T str) noexcept {
start = 'a'; start = 'a';
digit -= 10; digit -= 10;
} }
str[it] = static_cast<typename ox::remove_reference<decltype(str[0])>::type>(start + digit); str[static_cast<std::size_t>(it)] = static_cast<typename ox::remove_reference<decltype(str[0])>::type>(start + digit);
it++; it++;
} }
} }
str[it] = 0; str[static_cast<std::size_t>(it)] = 0;
} else { } else {
// 0 is a special case // 0 is a special case
str[0] = '0'; str[0] = '0';