All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2] alsa: fix warning
@ 2009-06-17 11:51 Gerd Hoffmann
  2009-06-17 18:15 ` malc
  0 siblings, 1 reply; 3+ messages in thread
From: Gerd Hoffmann @ 2009-06-17 11:51 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann


Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 audio/alsaaudio.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/audio/alsaaudio.c b/audio/alsaaudio.c
index 2f6c764..f1d573a 100644
--- a/audio/alsaaudio.c
+++ b/audio/alsaaudio.c
@@ -626,8 +626,9 @@ static int alsa_init_out (HWVoiceOut *hw, struct audsettings *as)
     req.period_size = conf.period_size_out;
     req.buffer_size = conf.buffer_size_out;
     req.size_in_usec = conf.size_in_usec_out;
-    req.override_mask = !!conf.period_size_out_overridden
-        | (!!conf.buffer_size_out_overridden << 1);
+    req.override_mask =
+        (conf.period_size_out_overridden ? 1 : 0) |
+        (conf.buffer_size_out_overridden ? 2 : 0);
 
     if (alsa_open (0, &req, &obt, &handle)) {
         return -1;
@@ -706,8 +707,9 @@ static int alsa_init_in (HWVoiceIn *hw, struct audsettings *as)
     req.period_size = conf.period_size_in;
     req.buffer_size = conf.buffer_size_in;
     req.size_in_usec = conf.size_in_usec_in;
-    req.override_mask = !!conf.period_size_in_overridden
-        | (!!conf.buffer_size_in_overridden << 1);
+    req.override_mask =
+        (conf.period_size_in_overridden ? 1 : 0) |
+        (conf.buffer_size_in_overridden ? 2 : 0);
 
     if (alsa_open (1, &req, &obt, &handle)) {
         return -1;
-- 
1.6.2.2

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

* Re: [Qemu-devel] [PATCH v2] alsa: fix warning
  2009-06-17 11:51 [Qemu-devel] [PATCH v2] alsa: fix warning Gerd Hoffmann
@ 2009-06-17 18:15 ` malc
  2009-06-18  6:27   ` Gerd Hoffmann
  0 siblings, 1 reply; 3+ messages in thread
From: malc @ 2009-06-17 18:15 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: qemu-devel

On Wed, 17 Jun 2009, Gerd Hoffmann wrote:

> 
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  audio/alsaaudio.c |   10 ++++++----
>  1 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/audio/alsaaudio.c b/audio/alsaaudio.c
> index 2f6c764..f1d573a 100644
> --- a/audio/alsaaudio.c
> +++ b/audio/alsaaudio.c
> @@ -626,8 +626,9 @@ static int alsa_init_out (HWVoiceOut *hw, struct audsettings *as)
>      req.period_size = conf.period_size_out;
>      req.buffer_size = conf.buffer_size_out;
>      req.size_in_usec = conf.size_in_usec_out;
> -    req.override_mask = !!conf.period_size_out_overridden
> -        | (!!conf.buffer_size_out_overridden << 1);
> +    req.override_mask =
> +        (conf.period_size_out_overridden ? 1 : 0) |
> +        (conf.buffer_size_out_overridden ? 2 : 0);
>  
[..snip..]

What warning does that fix?

-- 
mailto:av1474@comtv.ru

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

* Re: [Qemu-devel] [PATCH v2] alsa: fix warning
  2009-06-17 18:15 ` malc
@ 2009-06-18  6:27   ` Gerd Hoffmann
  0 siblings, 0 replies; 3+ messages in thread
From: Gerd Hoffmann @ 2009-06-18  6:27 UTC (permalink / raw)
  To: malc; +Cc: qemu-devel

On 06/17/09 20:15, malc wrote:
> On Wed, 17 Jun 2009, Gerd Hoffmann wrote:
>
>> Signed-off-by: Gerd Hoffmann<kraxel@redhat.com>
>> ---
>>   audio/alsaaudio.c |   10 ++++++----
>>   1 files changed, 6 insertions(+), 4 deletions(-)
>>
>> diff --git a/audio/alsaaudio.c b/audio/alsaaudio.c
>> index 2f6c764..f1d573a 100644
>> --- a/audio/alsaaudio.c
>> +++ b/audio/alsaaudio.c
>> @@ -626,8 +626,9 @@ static int alsa_init_out (HWVoiceOut *hw, struct audsettings *as)
>>       req.period_size = conf.period_size_out;
>>       req.buffer_size = conf.buffer_size_out;
>>       req.size_in_usec = conf.size_in_usec_out;
>> -    req.override_mask = !!conf.period_size_out_overridden
>> -        | (!!conf.buffer_size_out_overridden<<  1);
>> +    req.override_mask =
>> +        (conf.period_size_out_overridden ? 1 : 0) |
>> +        (conf.buffer_size_out_overridden ? 2 : 0);
>>
> [..snip..]
>
> What warning does that fix?
>

   CC    audio/alsaaudio.o
cc1: warnings being treated as errors
/home/kraxel/projects/qemu/audio/alsaaudio.c: In function ‘alsa_init_out’:
/home/kraxel/projects/qemu/audio/alsaaudio.c:630: error: suggest 
parentheses around operand of ‘!’ or change ‘|’ to ‘||’ or ‘!’ to ‘~’
/home/kraxel/projects/qemu/audio/alsaaudio.c: In function ‘alsa_init_in’:
/home/kraxel/projects/qemu/audio/alsaaudio.c:710: error: suggest 
parentheses around operand of ‘!’ or change ‘|’ to ‘||’ or ‘!’ to ‘~’
make: *** [audio/alsaaudio.o] Error 1

cheers,
   Gerd

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

end of thread, other threads:[~2009-06-18  6:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-17 11:51 [Qemu-devel] [PATCH v2] alsa: fix warning Gerd Hoffmann
2009-06-17 18:15 ` malc
2009-06-18  6:27   ` Gerd Hoffmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.