Fix another warning

Cast the args with static_cast so the compiler knows its intentional
This commit is contained in:
Marek Roszko 2023-05-20 08:05:14 -04:00
parent 8a7044c3fb
commit 4eeae65411
1 changed files with 14 additions and 12 deletions

View File

@ -357,21 +357,23 @@ VECTOR2<T> VECTOR2<T>::Resize( T aNewLength ) const
if( std::is_integral<T>::value ) if( std::is_integral<T>::value )
{ {
return VECTOR2<T> ( return VECTOR2<T>( static_cast<T>(
( x < 0 ? -1 : 1 ) * ( x < 0 ? -1 : 1 ) *
KiROUND( std::sqrt( rescale( l_sq_new, (extended_type) x * x, l_sq_current ) ) ), KiROUND( std::sqrt( rescale( l_sq_new, (extended_type) x * x, l_sq_current ) ) ) ),
( y < 0 ? -1 : 1 ) * static_cast<T>(
KiROUND( std::sqrt( rescale( l_sq_new, (extended_type) y * y, l_sq_current ) ) ) ) ( y < 0 ? -1 : 1 ) *
* sign( aNewLength ); KiROUND( std::sqrt( rescale( l_sq_new, (extended_type) y * y, l_sq_current ) ) ) )
* sign( aNewLength ) );
} }
else else
{ {
return VECTOR2<T> ( return VECTOR2<T> ( static_cast<T>(
( x < 0 ? -1 : 1 ) * ( x < 0 ? -1 : 1 ) *
std::sqrt( rescale( l_sq_new, (extended_type) x * x, l_sq_current ) ), std::sqrt( rescale( l_sq_new, (extended_type) x * x, l_sq_current ) ) ),
( y < 0 ? -1 : 1 ) * static_cast<T>(
std::sqrt( rescale( l_sq_new, (extended_type) y * y, l_sq_current ) ) ) ( y < 0 ? -1 : 1 ) *
* sign( aNewLength ); std::sqrt( rescale( l_sq_new, (extended_type) y * y, l_sq_current ) ) )
* sign( aNewLength ) );
} }
} }