All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Forney <mforney@mforney.org>
To: alsa-devel@alsa-project.org
Subject: [alsa-devel] [PATCH alsa-utils 1/4] Use __func__ instead of __FUNCTION__
Date: Wed,  5 Feb 2020 00:12:18 -0800	[thread overview]
Message-ID: <20200205081221.18665-1-mforney@mforney.org> (raw)

They are equivalent, but __func__ is in C99. __FUNCTION__ exists only
for backwards compatibility with old gcc versions.

Signed-off-by: Michael Forney <mforney@mforney.org>
---
 alsactl/alsactl.h | 16 ++++++++--------
 aplay/aplay.c     |  4 ++--
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/alsactl/alsactl.h b/alsactl/alsactl.h
index 4f969ec..69b539c 100644
--- a/alsactl/alsactl.h
+++ b/alsactl/alsactl.h
@@ -13,15 +13,15 @@ void cerror_(const char *fcn, long line, int cond, const char *fmt, ...);
 void dbg_(const char *fcn, long line, const char *fmt, ...);
 
 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
-#define info(...) do { info_(__FUNCTION__, __LINE__, __VA_ARGS__); } while (0)
-#define error(...) do { error_(__FUNCTION__, __LINE__, __VA_ARGS__); } while (0)
-#define cerror(cond, ...) do { cerror_(__FUNCTION__, __LINE__, (cond) != 0, __VA_ARGS__); } while (0)
-#define dbg(...) do { dbg_(__FUNCTION__, __LINE__, __VA_ARGS__); } while (0)
+#define info(...) do { info_(__func__, __LINE__, __VA_ARGS__); } while (0)
+#define error(...) do { error_(__func__, __LINE__, __VA_ARGS__); } while (0)
+#define cerror(cond, ...) do { cerror_(__func__, __LINE__, (cond) != 0, __VA_ARGS__); } while (0)
+#define dbg(...) do { dbg_(__func__, __LINE__, __VA_ARGS__); } while (0)
 #else
-#define info(args...) do { info_(__FUNCTION__, __LINE__, ##args); }  while (0)
-#define error(args...) do { error_(__FUNCTION__, __LINE__, ##args); }  while (0)
-#define cerror(cond, ...) do { error_(__FUNCTION__, __LINE__, (cond) != 0, ##args); } while (0)
-#define dbg(args...) do { dbg_(__FUNCTION__, __LINE__, ##args); }  while (0)
+#define info(args...) do { info_(__func__, __LINE__, ##args); }  while (0)
+#define error(args...) do { error_(__func__, __LINE__, ##args); }  while (0)
+#define cerror(cond, ...) do { error_(__func__, __LINE__, (cond) != 0, ##args); } while (0)
+#define dbg(args...) do { dbg_(__func__, __LINE__, ##args); }  while (0)
 #endif	
 
 int init(const char *file, const char *cardname);
diff --git a/aplay/aplay.c b/aplay/aplay.c
index 1a887e4..908093c 100644
--- a/aplay/aplay.c
+++ b/aplay/aplay.c
@@ -186,13 +186,13 @@ static const struct fmt_capture {
 
 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
 #define error(...) do {\
-	fprintf(stderr, "%s: %s:%d: ", command, __FUNCTION__, __LINE__); \
+	fprintf(stderr, "%s: %s:%d: ", command, __func__, __LINE__); \
 	fprintf(stderr, __VA_ARGS__); \
 	putc('\n', stderr); \
 } while (0)
 #else
 #define error(args...) do {\
-	fprintf(stderr, "%s: %s:%d: ", command, __FUNCTION__, __LINE__); \
+	fprintf(stderr, "%s: %s:%d: ", command, __func__, __LINE__); \
 	fprintf(stderr, ##args); \
 	putc('\n', stderr); \
 } while (0)
-- 
2.25.0

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

             reply	other threads:[~2020-02-05  8:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-05  8:12 Michael Forney [this message]
2020-02-05  8:12 ` [alsa-devel] [PATCH alsa-utils 2/4] Avoid pointer arithmetic on `void *` Michael Forney
2020-02-05 10:21   ` Takashi Sakamoto
2020-02-05 15:50   ` Clemens Ladisch
2020-02-06  0:00     ` Michael Forney
2020-02-05  8:12 ` [alsa-devel] [PATCH alsa-utils 3/4] Use %lli for long long in printf Michael Forney
2020-02-05 10:24   ` Takashi Sakamoto
2020-02-05  8:12 ` [alsa-devel] [PATCH alsa-utils 4/4] Avoid empty initializer list Michael Forney
2020-02-05 10:25   ` Takashi Sakamoto
2020-02-06  0:02     ` Michael Forney
2020-02-06  1:53       ` Takashi Sakamoto
2020-02-05 10:19 ` [alsa-devel] [PATCH alsa-utils 1/4] Use __func__ instead of __FUNCTION__ Takashi Sakamoto

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=20200205081221.18665-1-mforney@mforney.org \
    --to=mforney@mforney.org \
    --cc=alsa-devel@alsa-project.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.