qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] audio/sdlaudio: remove unused variable
@ 2010-04-22  7:55 Serge Ziryukin
  2010-04-22 10:51 ` malc
  0 siblings, 1 reply; 4+ messages in thread
From: Serge Ziryukin @ 2010-04-22  7:55 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1526 bytes --]

Remove unused 'shift' variable spotted by clang.
Also clean up aud_to_sdlfmt which used to get the value
of shift.
---
 audio/sdlaudio.c |   11 ++---------
 1 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c
index 8e7e5cb..c353016 100644
--- a/audio/sdlaudio.c
+++ b/audio/sdlaudio.c
@@ -115,23 +115,19 @@ static int sdl_unlock_and_post (SDLAudioState *s, const char *forfn)
     return sdl_post (s, forfn);
 }
 
-static int aud_to_sdlfmt (audfmt_e fmt, int *shift)
+static int aud_to_sdlfmt (audfmt_e fmt)
 {
     switch (fmt) {
     case AUD_FMT_S8:
-        *shift = 0;
         return AUDIO_S8;
 
     case AUD_FMT_U8:
-        *shift = 0;
         return AUDIO_U8;
 
     case AUD_FMT_S16:
-        *shift = 1;
         return AUDIO_S16LSB;
 
     case AUD_FMT_U16:
-        *shift = 1;
         return AUDIO_U16LSB;
 
     default:
@@ -326,16 +322,13 @@ static int sdl_init_out (HWVoiceOut *hw, struct audsettings *as)
     SDLVoiceOut *sdl = (SDLVoiceOut *) hw;
     SDLAudioState *s = &glob_sdl;
     SDL_AudioSpec req, obt;
-    int shift;
     int endianess;
     int err;
     audfmt_e effective_fmt;
     struct audsettings obt_as;
 
-    shift <<= as->nchannels == 2;
-
     req.freq = as->freq;
-    req.format = aud_to_sdlfmt (as->fmt, &shift);
+    req.format = aud_to_sdlfmt (as->fmt);
     req.channels = as->nchannels;
     req.samples = conf.nb_samples;
     req.callback = sdl_callback;
-- 
1.7.0.5


[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: [Qemu-devel] [PATCH] audio/sdlaudio: remove unused variable
  2010-04-22  7:55 [Qemu-devel] [PATCH] audio/sdlaudio: remove unused variable Serge Ziryukin
@ 2010-04-22 10:51 ` malc
  0 siblings, 0 replies; 4+ messages in thread
From: malc @ 2010-04-22 10:51 UTC (permalink / raw)
  To: Serge Ziryukin; +Cc: qemu-devel

On Thu, 22 Apr 2010, Serge Ziryukin wrote:

> Remove unused 'shift' variable spotted by clang.
> Also clean up aud_to_sdlfmt which used to get the value
> of shift.
> ---
>  audio/sdlaudio.c |   11 ++---------
>  1 files changed, 2 insertions(+), 9 deletions(-)

The patch submission lacks a sign off.

[..snip..]

-- 
mailto:av1474@comtv.ru

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

* [Qemu-devel] [PATCH] audio/sdlaudio: remove unused variable
@ 2010-04-22 11:14 Serge Ziryukin
  2010-04-22 11:23 ` malc
  0 siblings, 1 reply; 4+ messages in thread
From: Serge Ziryukin @ 2010-04-22 11:14 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1581 bytes --]

Remove unused 'shift' variable spotted by clang.
Also clean up aud_to_sdlfmt which used to get the value
of shift.

Signed-off-by: Serge Ziryukin <ftrvxmtrx@gmail.com>
---
 audio/sdlaudio.c |   11 ++---------
 1 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c
index 8e7e5cb..c353016 100644
--- a/audio/sdlaudio.c
+++ b/audio/sdlaudio.c
@@ -115,23 +115,19 @@ static int sdl_unlock_and_post (SDLAudioState *s, const char *forfn)
     return sdl_post (s, forfn);
 }
 
-static int aud_to_sdlfmt (audfmt_e fmt, int *shift)
+static int aud_to_sdlfmt (audfmt_e fmt)
 {
     switch (fmt) {
     case AUD_FMT_S8:
-        *shift = 0;
         return AUDIO_S8;
 
     case AUD_FMT_U8:
-        *shift = 0;
         return AUDIO_U8;
 
     case AUD_FMT_S16:
-        *shift = 1;
         return AUDIO_S16LSB;
 
     case AUD_FMT_U16:
-        *shift = 1;
         return AUDIO_U16LSB;
 
     default:
@@ -326,16 +322,13 @@ static int sdl_init_out (HWVoiceOut *hw, struct audsettings *as)
     SDLVoiceOut *sdl = (SDLVoiceOut *) hw;
     SDLAudioState *s = &glob_sdl;
     SDL_AudioSpec req, obt;
-    int shift;
     int endianess;
     int err;
     audfmt_e effective_fmt;
     struct audsettings obt_as;
 
-    shift <<= as->nchannels == 2;
-
     req.freq = as->freq;
-    req.format = aud_to_sdlfmt (as->fmt, &shift);
+    req.format = aud_to_sdlfmt (as->fmt);
     req.channels = as->nchannels;
     req.samples = conf.nb_samples;
     req.callback = sdl_callback;
-- 
1.7.0.5


[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: [Qemu-devel] [PATCH] audio/sdlaudio: remove unused variable
  2010-04-22 11:14 Serge Ziryukin
@ 2010-04-22 11:23 ` malc
  0 siblings, 0 replies; 4+ messages in thread
From: malc @ 2010-04-22 11:23 UTC (permalink / raw)
  To: Serge Ziryukin; +Cc: qemu-devel

On Thu, 22 Apr 2010, Serge Ziryukin wrote:

> Remove unused 'shift' variable spotted by clang.
> Also clean up aud_to_sdlfmt which used to get the value
> of shift.
> 

Applied. Thank you.

-- 
mailto:av1474@comtv.ru

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

end of thread, other threads:[~2010-04-22 11:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-22  7:55 [Qemu-devel] [PATCH] audio/sdlaudio: remove unused variable Serge Ziryukin
2010-04-22 10:51 ` malc
  -- strict thread matches above, loose matches on Subject: below --
2010-04-22 11:14 Serge Ziryukin
2010-04-22 11:23 ` malc

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).