From: Alexander Stein Date: Thu, 19 May 2011 13:16:36 +0000 (+0200) Subject: ctlparse: Respect softfloat configure option X-Git-Tag: v1.0.25~31 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=1720d30ad82ebb8b5f52fc08c6c610e51203fa89;p=alsa-lib.git ctlparse: Respect softfloat configure option If we want softlfoat we can't use ceil which uses libm. Signed-off-by: Alexander Stein Signed-off-by: Takashi Iwai --- diff --git a/src/control/ctlparse.c b/src/control/ctlparse.c index a9298167..a16f96a9 100644 --- a/src/control/ctlparse.c +++ b/src/control/ctlparse.c @@ -33,8 +33,17 @@ /* Function to convert from percentage to volume. val = percentage */ +#ifdef HAVE_SOFT_FLOAT +static inline long int convert_prange1(long val, long min, long max) +{ + long temp = val * (max - min); + return temp / 100 + min + ((temp % 100) == 0 ? 0 : 1); +} +#else + #define convert_prange1(val, min, max) \ ceil((val) * ((max) - (min)) * 0.01 + (min)) +#endif #define check_range(val, min, max) \ ((val < min) ? (min) : ((val > max) ? (max) : (val)))