mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-01 22:58:49 -04:00
ctlparse: Respect softfloat configure option
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>
This commit is contained in:
parent
ea020c3b2e
commit
1720d30ad8
1 changed files with 9 additions and 0 deletions
|
|
@ -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)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue