Skip to content

Commit

Permalink
bat: use ATTRIBUTE_UNUSED instead remove argument name
Browse files Browse the repository at this point in the history
We need to support older compilers than GCC 11.

Link: #233
Fixes: b366875 ("bat: fix the verbose compilation warnings for latest gcc")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
  • Loading branch information
perexg committed Sep 4, 2023
1 parent 7552aef commit 94eeb5a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion bat/bat.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
3 changes: 2 additions & 1 deletion bat/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions bat/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
*
*/

#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"

Expand Down

0 comments on commit 94eeb5a

Please sign in to comment.