[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 17/25] audio: remove gcc specific audio_MIN, aud
From: |
Marc-André Lureau |
Subject: |
Re: [Qemu-devel] [PATCH 17/25] audio: remove gcc specific audio_MIN, audio_MAX |
Date: |
Thu, 20 Aug 2015 22:36:22 +0200 |
Hi
On Thu, Aug 6, 2015 at 8:28 PM, Kővágó, Zoltán <address@hidden> wrote:
> Currently the gcc specific version only evaluates the arguments once,
> while the generic version evaluates one argument twice, which can cause
> debugging headaches when an argument has a side effect. This patch at
> least provides consistent behavior between compilers.
>
Going this way, you could simply replace audio_MIN/MAX with MIN/MAX
(from osdep.h and glib headers)
Reviewed-by: Marc-André Lureau <address@hidden>
> Signed-off-by: Kővágó, Zoltán <address@hidden>
> ---
> audio/audio.h | 14 --------------
> 1 file changed, 14 deletions(-)
>
> diff --git a/audio/audio.h b/audio/audio.h
> index 68545b6..3a54e17 100644
> --- a/audio/audio.h
> +++ b/audio/audio.h
> @@ -150,22 +150,8 @@ static inline void *advance (void *p, int incr)
> return (d + incr);
> }
>
> -#ifdef __GNUC__
> -#define audio_MIN(a, b) ( __extension__ ({ \
> - __typeof (a) ta = a; \
> - __typeof (b) tb = b; \
> - ((ta)>(tb)?(tb):(ta)); \
> -}))
> -
> -#define audio_MAX(a, b) ( __extension__ ({ \
> - __typeof (a) ta = a; \
> - __typeof (b) tb = b; \
> - ((ta)<(tb)?(tb):(ta)); \
> -}))
> -#else
> #define audio_MIN(a, b) ((a)>(b)?(b):(a))
> #define audio_MAX(a, b) ((a)<(b)?(b):(a))
> -#endif
>
> int wav_start_capture(AudioState *state, CaptureState *s, const char *path,
> int freq, int bits, int nchannels);
> --
> 2.4.5
>
>
--
Marc-André Lureau
- Re: [Qemu-devel] [PATCH 19/25] paaudio: fix playback glitches, (continued)
- [Qemu-devel] [PATCH 18/25] audio: do not run each backend in audio_run, Kővágó, Zoltán, 2015/08/06
- [Qemu-devel] [PATCH 25/25] audio: split ctl_* functions into enable_* and volume_*, Kővágó, Zoltán, 2015/08/06
- [Qemu-devel] [PATCH 17/25] audio: remove gcc specific audio_MIN, audio_MAX, Kővágó, Zoltán, 2015/08/06
- [Qemu-devel] [PATCH 14/25] audio: audiodev= parameters no longer optional when -audiodev present, Kővágó, Zoltán, 2015/08/06
- [Qemu-devel] [PATCH 22/25] audio: add mixeng option (documentation), Kővágó, Zoltán, 2015/08/06
- [Qemu-devel] [PATCH 13/25] audio: add audiodev properties to frontends, Kővágó, Zoltán, 2015/08/06
- [Qemu-devel] [PATCH 21/25] audio: common rate control code for timer based outputs, Kővágó, Zoltán, 2015/08/06