[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;
auto it = 0;
if (val < 0) {
str[it] = '-';
str[static_cast<std::size_t>(it)] = '-';
it++;
}
while (mod) {
@ -183,11 +183,11 @@ constexpr T ox_itoa(Integer v, T str) noexcept {
start = 'a';
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++;
}
}
str[it] = 0;
str[static_cast<std::size_t>(it)] = 0;
} else {
// 0 is a special case
str[0] = '0';