qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 17/25] audio: remove gcc specific audio_MIN, audio_M


From: Kővágó, Zoltán
Subject: [Qemu-devel] [PATCH 17/25] audio: remove gcc specific audio_MIN, audio_MAX
Date: Thu, 6 Aug 2015 20:28:29 +0200

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.

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]