diff options
author | Stefan Weil <sw@weilnetz.de> | 2013-06-16 11:19:31 +0200 |
---|---|---|
committer | Michael Tokarev <mjt@tls.msk.ru> | 2013-06-21 22:52:50 +0400 |
commit | 87e613ea9ed30f4217fd11aa2ad28a9fb4f1c54a (patch) | |
tree | 5c93a1999d2a2742ff47cb6c188fd8992e9074ff /audio | |
parent | 48f0475f813dfa5ceb0e1f10c2ac3f28a8af583b (diff) | |
download | qemu-87e613ea9ed30f4217fd11aa2ad28a9fb4f1c54a.tar.gz qemu-87e613ea9ed30f4217fd11aa2ad28a9fb4f1c54a.tar.bz2 qemu-87e613ea9ed30f4217fd11aa2ad28a9fb4f1c54a.zip |
audio: Replace static functions in header file by macros, remove GCC_ATTR
Using macros instead of static functions for dolog and for ldebug
simplifies the code and can also reduce the total code size.
GCC_ATTR was only used in audio_int.h, so it is now unused and
the definition can be removed from compiler.h.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'audio')
-rw-r--r-- | audio/audio_int.h | 31 |
1 files changed, 3 insertions, 28 deletions
diff --git a/audio/audio_int.h b/audio/audio_int.h index b9b0676d77..fd019a0fc3 100644 --- a/audio/audio_int.h +++ b/audio/audio_int.h @@ -243,38 +243,13 @@ static inline int audio_ring_dist (int dst, int src, int len) return (dst >= src) ? (dst - src) : (len - src + dst); } -static void GCC_ATTR dolog (const char *fmt, ...) -{ - va_list ap; - - va_start (ap, fmt); - AUD_vlog (AUDIO_CAP, fmt, ap); - va_end (ap); -} +#define dolog(fmt, ...) AUD_log(AUDIO_CAP, fmt, ## __VA_ARGS__) #ifdef DEBUG -static void GCC_ATTR ldebug (const char *fmt, ...) -{ - va_list ap; - - va_start (ap, fmt); - AUD_vlog (AUDIO_CAP, fmt, ap); - va_end (ap); -} +#define ldebug(fmt, ...) AUD_log(AUDIO_CAP, fmt, ## __VA_ARGS__) #else -#if defined NDEBUG && defined __GNUC__ -#define ldebug(...) -#elif defined NDEBUG && defined _MSC_VER -#define ldebug __noop -#else -static void GCC_ATTR ldebug (const char *fmt, ...) -{ - (void) fmt; -} +#define ldebug(fmt, ...) (void)0 #endif -#endif - -#undef GCC_ATTR #define AUDIO_STRINGIFY_(n) #n #define AUDIO_STRINGIFY(n) AUDIO_STRINGIFY_(n) |