]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Prefer __func__ to __FUNCTION__.
authorAndre Noll <maan@tuebingen.mpg.de>
Mon, 2 Jun 2025 20:48:41 +0000 (22:48 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Tue, 10 Jun 2025 13:25:48 +0000 (15:25 +0200)
The former is part of the C99 standard, while the latter is only provided
for backward compatibility. This change also silences many gcc warnings when
compiling with -Wpendantic (disabled in the default build).

para.h
play.c

diff --git a/para.h b/para.h
index d97ffd2b2a67291bd89323607f2524a6aafccdac..973cc5a51542543fa0ad28ffd8fc51914dbe15f2 100644 (file)
--- a/para.h
+++ b/para.h
@@ -217,13 +217,13 @@ enum sample_format {SAMPLE_FORMATS};
 /** Debug, Info, etc. */
 enum loglevels {LOGLEVELS, NUM_LOGLEVELS};
 
-#define PARA_DEBUG_LOG(f,...) para_log(LL_DEBUG, "%s: " f, __FUNCTION__, ## __VA_ARGS__)
-#define PARA_INFO_LOG(f,...) para_log(LL_INFO, "%s: " f, __FUNCTION__, ## __VA_ARGS__)
-#define PARA_NOTICE_LOG(f,...) para_log(LL_NOTICE, "%s: " f, __FUNCTION__, ## __VA_ARGS__)
-#define PARA_WARNING_LOG(f,...) para_log(LL_WARNING, "%s: " f, __FUNCTION__, ##  __VA_ARGS__)
-#define PARA_ERROR_LOG(f,...) para_log(LL_ERROR, "%s: " f, __FUNCTION__, ## __VA_ARGS__)
-#define PARA_CRIT_LOG(f,...) para_log(LL_CRIT, "%s: " f, __FUNCTION__, ## __VA_ARGS__)
-#define PARA_EMERG_LOG(f,...) para_log(LL_EMERG, "%s: " f, __FUNCTION__, ## __VA_ARGS__)
+#define PARA_DEBUG_LOG(f,...) para_log(LL_DEBUG, "%s: " f, __func__, ## __VA_ARGS__)
+#define PARA_INFO_LOG(f,...) para_log(LL_INFO, "%s: " f, __func__, ## __VA_ARGS__)
+#define PARA_NOTICE_LOG(f,...) para_log(LL_NOTICE, "%s: " f, __func__, ## __VA_ARGS__)
+#define PARA_WARNING_LOG(f,...) para_log(LL_WARNING, "%s: " f, __func__, ##  __VA_ARGS__)
+#define PARA_ERROR_LOG(f,...) para_log(LL_ERROR, "%s: " f, __func__, ## __VA_ARGS__)
+#define PARA_CRIT_LOG(f,...) para_log(LL_CRIT, "%s: " f, __func__, ## __VA_ARGS__)
+#define PARA_EMERG_LOG(f,...) para_log(LL_EMERG, "%s: " f, __func__, ## __VA_ARGS__)
 
 /** \cond status_items */
 #define STATUS_ITEMS \
diff --git a/play.c b/play.c
index df06b1ccd417c48e272d3d4cc81bf839a5cd3697..815dc60990d5cf14dc41187f8f2b702642471cbb 100644 (file)
--- a/play.c
+++ b/play.c
@@ -962,7 +962,7 @@ static int run_command(char *line)
        struct lls_parse_result *lpr;
        const struct lls_command *cmd;
 
-       attach_stdout(__FUNCTION__);
+       attach_stdout(__func__);
        ret = create_argv(line, " ", &argv);
        if (ret < 0)
                goto out;
@@ -1065,7 +1065,7 @@ static void session_open(void)
 
        ici.bound_keyseqs = get_mapped_keyseqs();
        pt->btrn = ici.producer = btr_new_node(&(struct btr_node_description)
-               EMBRACE(.name = __FUNCTION__));
+               EMBRACE(.name = __func__));
        ret = i9e_open(&ici, &sched);
        if (ret < 0)
                goto out;
@@ -1137,7 +1137,7 @@ static int play_post_monitor(__a_unused struct sched *s, __a_unused void *contex
        if (pt->background)
                detach_stdout();
        else
-               attach_stdout(__FUNCTION__);
+               attach_stdout(__func__);
        i9e_error = i9e_get_error();
        ret = eof_cleanup();
        if (pt->rq == CRT_TERM_RQ || i9e_error < 0) /* com_quit() or CTRL+D */