diff mbox series

[01/23] sdlaudio: remove leftover SDL1.2 code

Message ID 20210110100239.27588-1-vr_qemu@t-online.de (mailing list archive)
State New, archived
Headers show
Series next round of audio patches | expand

Commit Message

Volker Rümelin Jan. 10, 2021, 10:02 a.m. UTC
Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
---
 audio/sdlaudio.c | 30 +++++++++++++-----------------
 1 file changed, 13 insertions(+), 17 deletions(-)

Comments

Thomas Huth Jan. 14, 2021, 3:28 p.m. UTC | #1
On 10/01/2021 11.02, Volker Rümelin wrote:
> Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
> ---
>   audio/sdlaudio.c | 30 +++++++++++++-----------------
>   1 file changed, 13 insertions(+), 17 deletions(-)
> 
> diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c
> index 21b7a0484b..bf3cfb8456 100644
> --- a/audio/sdlaudio.c
> +++ b/audio/sdlaudio.c
> @@ -240,28 +240,24 @@ static void sdl_callback (void *opaque, Uint8 *buf, int len)
>       }
>   }
>   
> -#define SDL_WRAPPER_FUNC(name, ret_type, args_decl, args, fail, unlock) \
> -    static ret_type glue(sdl_, name)args_decl                           \
> -    {                                                                   \
> -        ret_type ret;                                                   \
> -                                                                        \
> -        SDL_LockAudio();                                                \
> -                                                                        \
> -        ret = glue(audio_generic_, name)args;                           \
> -                                                                        \
> -        SDL_UnlockAudio();                                              \
> -        return ret;                                                     \
> +#define SDL_WRAPPER_FUNC(name, ret_type, args_decl, args)      \
> +    static ret_type glue(sdl_, name)args_decl                  \
> +    {                                                          \
> +        ret_type ret;                                          \
> +                                                               \
> +        SDL_LockAudio();                                       \
> +        ret = glue(audio_generic_, name)args;                  \
> +        SDL_UnlockAudio();                                     \
> +                                                               \
> +        return ret;                                            \
>       }
>   
>   SDL_WRAPPER_FUNC(get_buffer_out, void *, (HWVoiceOut *hw, size_t *size),
> -                 (hw, size), *size = 0, sdl_unlock)
> +                 (hw, size))
>   SDL_WRAPPER_FUNC(put_buffer_out, size_t,
> -                 (HWVoiceOut *hw, void *buf, size_t size), (hw, buf, size),
> -                 /*nothing*/, sdl_unlock_and_post)
> +                 (HWVoiceOut *hw, void *buf, size_t size), (hw, buf, size))
>   SDL_WRAPPER_FUNC(write, size_t,
> -                 (HWVoiceOut *hw, void *buf, size_t size), (hw, buf, size),
> -                 /*nothing*/, sdl_unlock_and_post)
> -
> +                 (HWVoiceOut *hw, void *buf, size_t size), (hw, buf, size))
>   #undef SDL_WRAPPER_FUNC
>   
>   static void sdl_fini_out (HWVoiceOut *hw)
> 

Right, sdl_unlock and sdl_unlock_and_post have been removed in commit 
8a7816c4ac13e6ba61de2 already.

Reviewed-by: Thomas Huth <thuth@redhat.com>
diff mbox series

Patch

diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c
index 21b7a0484b..bf3cfb8456 100644
--- a/audio/sdlaudio.c
+++ b/audio/sdlaudio.c
@@ -240,28 +240,24 @@  static void sdl_callback (void *opaque, Uint8 *buf, int len)
     }
 }
 
-#define SDL_WRAPPER_FUNC(name, ret_type, args_decl, args, fail, unlock) \
-    static ret_type glue(sdl_, name)args_decl                           \
-    {                                                                   \
-        ret_type ret;                                                   \
-                                                                        \
-        SDL_LockAudio();                                                \
-                                                                        \
-        ret = glue(audio_generic_, name)args;                           \
-                                                                        \
-        SDL_UnlockAudio();                                              \
-        return ret;                                                     \
+#define SDL_WRAPPER_FUNC(name, ret_type, args_decl, args)      \
+    static ret_type glue(sdl_, name)args_decl                  \
+    {                                                          \
+        ret_type ret;                                          \
+                                                               \
+        SDL_LockAudio();                                       \
+        ret = glue(audio_generic_, name)args;                  \
+        SDL_UnlockAudio();                                     \
+                                                               \
+        return ret;                                            \
     }
 
 SDL_WRAPPER_FUNC(get_buffer_out, void *, (HWVoiceOut *hw, size_t *size),
-                 (hw, size), *size = 0, sdl_unlock)
+                 (hw, size))
 SDL_WRAPPER_FUNC(put_buffer_out, size_t,
-                 (HWVoiceOut *hw, void *buf, size_t size), (hw, buf, size),
-                 /*nothing*/, sdl_unlock_and_post)
+                 (HWVoiceOut *hw, void *buf, size_t size), (hw, buf, size))
 SDL_WRAPPER_FUNC(write, size_t,
-                 (HWVoiceOut *hw, void *buf, size_t size), (hw, buf, size),
-                 /*nothing*/, sdl_unlock_and_post)
-
+                 (HWVoiceOut *hw, void *buf, size_t size), (hw, buf, size))
 #undef SDL_WRAPPER_FUNC
 
 static void sdl_fini_out (HWVoiceOut *hw)