qemu-trivial.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Weil <sw@weilnetz.de>
To: qemu-trivial <qemu-trivial@nongnu.org>
Cc: Stefan Weil <sw@weilnetz.de>,
	"Vassili Karpov \(malc\)" <av1474@comtv.ru>,
	qemu-devel <qemu-devel@nongnu.org>
Subject: [Qemu-trivial] [PATCH] audio: Replace macro GCC_ATTR by GCC_FMT_ATTR and use inline functions
Date: Sun,  9 Jun 2013 14:22:16 +0200	[thread overview]
Message-ID: <1370780536-28150-1-git-send-email-sw@weilnetz.de> (raw)

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>
---
 audio/audio_int.h       |    8 +++-----
 include/qemu/compiler.h |    3 ---
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/audio/audio_int.h b/audio/audio_int.h
index b9b0676..5a6284b 100644
--- a/audio/audio_int.h
+++ b/audio/audio_int.h
@@ -243,7 +243,7 @@ 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, ...)
+static inline void GCC_FMT_ATTR(1, 2) dolog (const char *fmt, ...)
 {
     va_list ap;
 
@@ -253,7 +253,7 @@ static void GCC_ATTR dolog (const char *fmt, ...)
 }
 
 #ifdef DEBUG
-static void GCC_ATTR ldebug (const char *fmt, ...)
+static inline void GCC_FMT_ATTR(1, 2) ldebug (const char *fmt, ...)
 {
     va_list ap;
 
@@ -267,15 +267,13 @@ static void GCC_ATTR ldebug (const char *fmt, ...)
 #elif defined NDEBUG && defined _MSC_VER
 #define ldebug __noop
 #else
-static void GCC_ATTR ldebug (const char *fmt, ...)
+static inline void GCC_FMT_ATTR(1, 2) ldebug (const char *fmt, ...)
 {
     (void) fmt;
 }
 #endif
 #endif
 
-#undef GCC_ATTR
-
 #define AUDIO_STRINGIFY_(n) #n
 #define AUDIO_STRINGIFY(n) AUDIO_STRINGIFY_(n)
 
diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h
index 6175c24..155b358 100644
--- a/include/qemu/compiler.h
+++ b/include/qemu/compiler.h
@@ -38,11 +38,9 @@
 #if defined __GNUC__
 # if !QEMU_GNUC_PREREQ(4, 4)
    /* gcc versions before 4.4.x don't support gnu_printf, so use printf. */
-#  define GCC_ATTR __attribute__((__unused__, format(printf, 1, 2)))
 #  define GCC_FMT_ATTR(n, m) __attribute__((format(printf, n, m)))
 # else
    /* Use gnu_printf when supported (qemu uses standard format strings). */
-#  define GCC_ATTR __attribute__((__unused__, format(gnu_printf, 1, 2)))
 #  define GCC_FMT_ATTR(n, m) __attribute__((format(gnu_printf, n, m)))
 #  if defined(_WIN32)
     /* Map __printf__ to __gnu_printf__ because we want standard format strings
@@ -51,7 +49,6 @@
 #  endif
 # endif
 #else
-#define GCC_ATTR /**/
 #define GCC_FMT_ATTR(n, m)
 #endif
 
-- 
1.7.10.4



             reply	other threads:[~2013-06-09 12:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-09 12:22 Stefan Weil [this message]
2013-06-09 17:28 ` [Qemu-trivial] [Qemu-devel] [PATCH] audio: Replace macro GCC_ATTR by GCC_FMT_ATTR and use inline functions Andreas Färber
2013-06-10 15:38 ` [Qemu-trivial] " Michael Tokarev
2013-06-11 12:38 ` Michael Tokarev
2013-06-11 12:42   ` [Qemu-trivial] [Qemu-devel] " Andreas Färber
2013-06-11 17:24   ` [Qemu-trivial] " Stefan Weil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1370780536-28150-1-git-send-email-sw@weilnetz.de \
    --to=sw@weilnetz.de \
    --cc=av1474@comtv.ru \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).