]> git.alsa-project.org Git - alsa-utils.git/commitdiff
bat: use ATTRIBUTE_UNUSED instead remove argument name
authorJaroslav Kysela <perex@perex.cz>
Mon, 4 Sep 2023 14:49:03 +0000 (16:49 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 4 Sep 2023 14:49:36 +0000 (16:49 +0200)
We need to support older compilers than GCC 11.

Link: https://github.com/alsa-project/alsa-utils/issues/233
Fixes: b366875 ("bat: fix the verbose compilation warnings for latest gcc")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
bat/bat.c
bat/common.c
bat/common.h

index e88c65f72f4951e1abf62e318de14a5c5abd70cc..ea04ed9c88132e4cba0e0f496afab0b45aabe65f 100644 (file)
--- a/bat/bat.c
+++ b/bat/bat.c
@@ -158,7 +158,8 @@ static void get_format(struct bat *bat, char *optarg)
        }
 }
 
-static inline int thread_wait_completion(struct bat *, pthread_t id, int **val)
+static inline int thread_wait_completion(struct bat *bat ATTRIBUTE_UNUSED,
+                                        pthread_t id, int **val)
 {
        int err;
 
index 9ff940572029127a3b463eb8bc5ff42394dfc01d..470a7e6ffc150f0c59b17d6358813e19bc753ea3 100644 (file)
@@ -47,7 +47,8 @@ static int update_fmt_to_bat(struct bat *bat, struct chunk_fmt *fmt)
 }
 
 /* calculate frames and update to bat */
-static int update_frames_to_bat(struct bat *bat, struct wav_chunk_header *header, FILE *)
+static int update_frames_to_bat(struct bat *bat, struct wav_chunk_header *header,
+                               FILE *file ATTRIBUTE_UNUSED)
 {
        /* The number of analyzed captured frames is arbitrarily set to half of
           the number of frames of the wav file or the number of frames of the
index a9bae5d2b7417e29ab424f778a9eef2c42b508d3..bb51b0d452e26363c103bd8b806e7c40eaaa1956 100644 (file)
  *
  */
 
+#ifndef ATTRIBUTE_UNUSED
+/** do not print warning (gcc) when function parameter is not used */
+#define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
+#endif
+
 #define TEMP_RECORD_FILE_NAME          "/tmp/bat.wav.XXXXXX"
 #define DEFAULT_DEV_NAME               "default"