Add explicit cast in fix16_from_dbl()

This fixes the error:

    implicit conversion from 'float' to 'double' to match other operand
    of binary expression

When the compiler options -fsingle-precision-constant -Wdouble-promotion
are set
This commit is contained in:
David Lechner 2019-06-16 13:46:19 -05:00
parent 47a5aa74ff
commit 3b7f96f982
1 changed files with 1 additions and 1 deletions

View File

@ -70,7 +70,7 @@ static inline fix16_t fix16_from_dbl(double a)
{
double temp = a * fix16_one;
#ifndef FIXMATH_NO_ROUNDING
temp += (temp >= 0) ? 0.5f : -0.5f;
temp += (double)((temp >= 0) ? 0.5f : -0.5f);
#endif
return (fix16_t)temp;
}