Fix compilation warning

This commit is contained in:
Wojtek Figat
2025-04-13 20:14:10 +02:00
parent 5d3d9d7e82
commit c4d8345b7c

View File

@@ -396,7 +396,7 @@ bool ParseFloat(const C* str, T* ret)
{
// [Reference: https://stackoverflow.com/a/44741229]
T result = 0;
T sign = *str == '-' ? str++, -1.0 : 1.0;
T sign = *str == '-' ? str++, (T)-1.0 : (T)1.0;
while (*str >= '0' && *str <= '9')
{
result *= 10;
@@ -418,7 +418,7 @@ bool ParseFloat(const C* str, T* ret)
if (*str == 'e' || *str == 'E')
{
str++;
T powerer = *str == '-' ? str++, 0.1 : 10;
T powerer = *str == '-' ? str++, (T)0.1 : (T)10;
T power = 0;
while (*str >= '0' && *str <= '9')
{