diff mbox

[03/11] audio: use a nominal volume of 1^32-1

Message ID 1330612087-1882-4-git-send-email-marcandre.lureau@redhat.com
State New
Headers show

Commit Message

Marc-André Lureau March 1, 2012, 2:27 p.m. UTC
So we can easily fit it into smaller int.

We can just >>16 to fit it into a 16bits volume range for example.
---
 audio/audio.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Comments

Eric Blake March 1, 2012, 3:16 p.m. UTC | #1
On 03/01/2012 07:27 AM, Marc-André Lureau wrote:
> So we can easily fit it into smaller int.

Fix your subject.  1^32-1 is 0; you meant 2^32 - 1.

> 
> We can just >>16 to fit it into a 16bits volume range for example.
> ---
>  audio/audio.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/audio/audio.c b/audio/audio.c
> index bd9237e..9ea5b39 100644
> --- a/audio/audio.c
> +++ b/audio/audio.c
> @@ -110,8 +110,8 @@ const struct mixeng_volume nominal_volume = {
>      .r = 1.0,
>      .l = 1.0,
>  #else
> -    .r = 1ULL << 32,
> -    .l = 1ULL << 32,
> +    .r = (1ULL << 32) - 1,
> +    .l = (1ULL << 32) - 1,
>  #endif
>  };
>
diff mbox

Patch

diff --git a/audio/audio.c b/audio/audio.c
index bd9237e..9ea5b39 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -110,8 +110,8 @@  const struct mixeng_volume nominal_volume = {
     .r = 1.0,
     .l = 1.0,
 #else
-    .r = 1ULL << 32,
-    .l = 1ULL << 32,
+    .r = (1ULL << 32) - 1,
+    .l = (1ULL << 32) - 1,
 #endif
 };