alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] alsamixer: Remove exp10 usage
@ 2019-09-02  1:22 Rosen Penev
  2019-09-02  1:22 ` [alsa-devel] " Rosen Penev
  2019-09-03 10:18 ` Takashi Iwai
  0 siblings, 2 replies; 3+ messages in thread
From: Rosen Penev @ 2019-09-02  1:22 UTC (permalink / raw)
  To: alsa-devel

exp10 is a GNU extension and not available everywhere (eg. uClibc-ng).

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 alsamixer/volume_mapping.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/alsamixer/volume_mapping.c b/alsamixer/volume_mapping.c
index 48cfbe2..29ab061 100644
--- a/alsamixer/volume_mapping.c
+++ b/alsamixer/volume_mapping.c
@@ -108,9 +108,9 @@ static double get_normalized_volume(snd_mixer_elem_t *elem,
 	if (use_linear_dB_scale(min, max))
 		return (value - min) / (double)(max - min);
 
-	normalized = exp10((value - max) / 6000.0);
+	normalized = pow(10, (value - max) / 6000.0);
 	if (min != SND_CTL_TLV_DB_GAIN_MUTE) {
-		min_norm = exp10((min - max) / 6000.0);
+		min_norm = pow(10, (min - max) / 6000.0);
 		normalized = (normalized - min_norm) / (1 - min_norm);
 	}
 
@@ -143,7 +143,7 @@ static int set_normalized_volume(snd_mixer_elem_t *elem,
 	}
 
 	if (min != SND_CTL_TLV_DB_GAIN_MUTE) {
-		min_norm = exp10((min - max) / 6000.0);
+		min_norm = pow(10, (min - max) / 6000.0);
 		volume = volume * (1 - min_norm) + min_norm;
 	}
 	value = lrint_dir(6000.0 * log10(volume), dir) + max;
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [alsa-devel] [PATCH] alsamixer: Remove exp10 usage
  2019-09-02  1:22 [PATCH] alsamixer: Remove exp10 usage Rosen Penev
@ 2019-09-02  1:22 ` Rosen Penev
  2019-09-03 10:18 ` Takashi Iwai
  1 sibling, 0 replies; 3+ messages in thread
From: Rosen Penev @ 2019-09-02  1:22 UTC (permalink / raw)
  To: alsa-devel

exp10 is a GNU extension and not available everywhere (eg. uClibc-ng).

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 alsamixer/volume_mapping.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/alsamixer/volume_mapping.c b/alsamixer/volume_mapping.c
index 48cfbe2..29ab061 100644
--- a/alsamixer/volume_mapping.c
+++ b/alsamixer/volume_mapping.c
@@ -108,9 +108,9 @@ static double get_normalized_volume(snd_mixer_elem_t *elem,
 	if (use_linear_dB_scale(min, max))
 		return (value - min) / (double)(max - min);
 
-	normalized = exp10((value - max) / 6000.0);
+	normalized = pow(10, (value - max) / 6000.0);
 	if (min != SND_CTL_TLV_DB_GAIN_MUTE) {
-		min_norm = exp10((min - max) / 6000.0);
+		min_norm = pow(10, (min - max) / 6000.0);
 		normalized = (normalized - min_norm) / (1 - min_norm);
 	}
 
@@ -143,7 +143,7 @@ static int set_normalized_volume(snd_mixer_elem_t *elem,
 	}
 
 	if (min != SND_CTL_TLV_DB_GAIN_MUTE) {
-		min_norm = exp10((min - max) / 6000.0);
+		min_norm = pow(10, (min - max) / 6000.0);
 		volume = volume * (1 - min_norm) + min_norm;
 	}
 	value = lrint_dir(6000.0 * log10(volume), dir) + max;
-- 
2.17.1

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [alsa-devel] [PATCH] alsamixer: Remove exp10 usage
  2019-09-02  1:22 [PATCH] alsamixer: Remove exp10 usage Rosen Penev
  2019-09-02  1:22 ` [alsa-devel] " Rosen Penev
@ 2019-09-03 10:18 ` Takashi Iwai
  1 sibling, 0 replies; 3+ messages in thread
From: Takashi Iwai @ 2019-09-03 10:18 UTC (permalink / raw)
  To: Rosen Penev; +Cc: alsa-devel

On Mon, 02 Sep 2019 03:22:29 +0200,
Rosen Penev wrote:
> 
> exp10 is a GNU extension and not available everywhere (eg. uClibc-ng).
> 
> Signed-off-by: Rosen Penev <rosenp@gmail.com>

Applied now.  Thanks.


Takashi
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-09-03 10:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-02  1:22 [PATCH] alsamixer: Remove exp10 usage Rosen Penev
2019-09-02  1:22 ` [alsa-devel] " Rosen Penev
2019-09-03 10:18 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).