OSDN Git Service

ctlparse: Respect softfloat configure option
authorAlexander Stein <a.stein@systec-electronic.com>
Thu, 19 May 2011 13:16:36 +0000 (15:16 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 20 May 2011 07:10:04 +0000 (09:10 +0200)
If we want softlfoat we can't use ceil which uses libm.

Signed-off-by: Alexander Stein <a.stein@systec-electronic.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
src/control/ctlparse.c

index a929816..a16f96a 100644 (file)
 
 /* 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)))