0002-axfer-use-ATTRIBUTE_UNUSED-instead-remove-argument-n.patch 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. From a90faa2dd644af585d6a00f0aaf297c15ea0aa7b Mon Sep 17 00:00:00 2001
  2. From: Jaroslav Kysela <perex@perex.cz>
  3. Date: Mon, 4 Sep 2023 16:33:47 +0200
  4. Subject: [PATCH] axfer: use ATTRIBUTE_UNUSED instead remove argument name
  5. We need to support older compilers than GCC 11.
  6. Link: https://github.com/alsa-project/alsa-utils/issues/233
  7. Fixes: ad5a1c0 ("axfer: fix the verbose compilation warnings for latest gcc")
  8. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
  9. Upstream: https://github.com/alsa-project/alsa-utils/commit/a90faa2dd644af585d6a00f0aaf297c15ea0aa7b
  10. Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
  11. ---
  12. axfer/container-raw.c | 14 +++++++-------
  13. axfer/mapper-single.c | 6 +++---
  14. axfer/subcmd-list.c | 2 +-
  15. axfer/subcmd-transfer.c | 4 ++--
  16. axfer/waiter-poll.c | 4 ++--
  17. axfer/waiter-select.c | 4 ++--
  18. axfer/waiter.h | 1 +
  19. axfer/xfer-libasound-irq-rw.c | 2 +-
  20. axfer/xfer-libasound.c | 4 ++--
  21. axfer/xfer-options.c | 3 ++-
  22. 10 files changed, 23 insertions(+), 21 deletions(-)
  23. diff --git a/axfer/container-raw.c b/axfer/container-raw.c
  24. index 071f94c..1886045 100644
  25. --- a/axfer/container-raw.c
  26. +++ b/axfer/container-raw.c
  27. @@ -13,10 +13,10 @@
  28. #include <sys/stat.h>
  29. #include <unistd.h>
  30. -static int raw_builder_pre_process(struct container_context *,
  31. - snd_pcm_format_t *,
  32. - unsigned int *,
  33. - unsigned int *,
  34. +static int raw_builder_pre_process(struct container_context *cntr ATTRIBUTE_UNUSED,
  35. + snd_pcm_format_t *format ATTRIBUTE_UNUSED,
  36. + unsigned int *samples_per_frame ATTRIBUTE_UNUSED,
  37. + unsigned int *frames_per_second ATTRIBUTE_UNUSED,
  38. uint64_t *byte_count)
  39. {
  40. *byte_count = UINT64_MAX;
  41. @@ -25,9 +25,9 @@ static int raw_builder_pre_process(struct container_context *,
  42. }
  43. static int raw_parser_pre_process(struct container_context *cntr,
  44. - snd_pcm_format_t *,
  45. - unsigned int *,
  46. - unsigned int *,
  47. + snd_pcm_format_t *format ATTRIBUTE_UNUSED,
  48. + unsigned int *samples_per_frame ATTRIBUTE_UNUSED,
  49. + unsigned int *frames_per_second ATTRIBUTE_UNUSED,
  50. uint64_t *byte_count)
  51. {
  52. struct stat buf = {0};
  53. diff --git a/axfer/mapper-single.c b/axfer/mapper-single.c
  54. index 13e7fc5..f669f7f 100644
  55. --- a/axfer/mapper-single.c
  56. +++ b/axfer/mapper-single.c
  57. @@ -62,7 +62,7 @@ static void align_from_vector(void *frame_buf, unsigned int frame_count,
  58. static int single_pre_process(struct mapper_context *mapper,
  59. struct container_context *cntrs,
  60. - unsigned int)
  61. + unsigned int cntr_count ATTRIBUTE_UNUSED)
  62. {
  63. struct single_state *state = mapper->private_data;
  64. unsigned int bytes_per_buffer;
  65. @@ -110,7 +110,7 @@ static int single_muxer_process_frames(struct mapper_context *mapper,
  66. void *frame_buf,
  67. unsigned int *frame_count,
  68. struct container_context *cntrs,
  69. - unsigned int)
  70. + unsigned int cntr_count ATTRIBUTE_UNUSED)
  71. {
  72. struct single_state *state = mapper->private_data;
  73. void *src;
  74. @@ -141,7 +141,7 @@ static int single_demuxer_process_frames(struct mapper_context *mapper,
  75. void *frame_buf,
  76. unsigned int *frame_count,
  77. struct container_context *cntrs,
  78. - unsigned int)
  79. + unsigned int cntr_count ATTRIBUTE_UNUSED)
  80. {
  81. struct single_state *state = mapper->private_data;
  82. void *dst;
  83. diff --git a/axfer/subcmd-list.c b/axfer/subcmd-list.c
  84. index f9c8e0f..187e1d7 100644
  85. --- a/axfer/subcmd-list.c
  86. +++ b/axfer/subcmd-list.c
  87. @@ -19,7 +19,7 @@ enum list_op {
  88. };
  89. static int dump_device(snd_ctl_t *handle, const char *id, const char *name,
  90. - snd_pcm_stream_t, snd_pcm_info_t *info)
  91. + snd_pcm_stream_t stream ATTRIBUTE_UNUSED, snd_pcm_info_t *info)
  92. {
  93. unsigned int i, count;
  94. int err;
  95. diff --git a/axfer/subcmd-transfer.c b/axfer/subcmd-transfer.c
  96. index b39fde8..8d63043 100644
  97. --- a/axfer/subcmd-transfer.c
  98. +++ b/axfer/subcmd-transfer.c
  99. @@ -40,7 +40,7 @@ static void handle_unix_signal_for_finish(int sig)
  100. ctx_ptr->interrupted = true;
  101. }
  102. -static void handle_unix_signal_for_suspend(int)
  103. +static void handle_unix_signal_for_suspend(int sig ATTRIBUTE_UNUSED)
  104. {
  105. sigset_t curr, prev;
  106. struct sigaction sa = {0};
  107. @@ -439,7 +439,7 @@ static int context_process_frames(struct context *ctx,
  108. }
  109. static void context_post_process(struct context *ctx,
  110. - uint64_t)
  111. + uint64_t accumulated_frame_count ATTRIBUTE_UNUSED)
  112. {
  113. uint64_t total_frame_count;
  114. unsigned int i;
  115. diff --git a/axfer/waiter-poll.c b/axfer/waiter-poll.c
  116. index 31fab88..b81300c 100644
  117. --- a/axfer/waiter-poll.c
  118. +++ b/axfer/waiter-poll.c
  119. @@ -13,7 +13,7 @@
  120. #include <errno.h>
  121. #include <poll.h>
  122. -static int poll_prepare(struct waiter_context *)
  123. +static int poll_prepare(struct waiter_context *waiter ATTRIBUTE_UNUSED)
  124. {
  125. // Nothing to do because an instance of waiter has required data.
  126. return 0;
  127. @@ -30,7 +30,7 @@ static int poll_wait_event(struct waiter_context *waiter, int timeout_msec)
  128. return err;
  129. }
  130. -static void poll_release(struct waiter_context *)
  131. +static void poll_release(struct waiter_context *waiter ATTRIBUTE_UNUSED)
  132. {
  133. // Nothing to do because an instance of waiter has required data.
  134. return;
  135. diff --git a/axfer/waiter-select.c b/axfer/waiter-select.c
  136. index 164c9c8..fe19776 100644
  137. --- a/axfer/waiter-select.c
  138. +++ b/axfer/waiter-select.c
  139. @@ -34,7 +34,7 @@ struct select_state {
  140. fd_set rfds_ex;
  141. };
  142. -static int select_prepare(struct waiter_context *)
  143. +static int select_prepare(struct waiter_context *waiter ATTRIBUTE_UNUSED)
  144. {
  145. return 0;
  146. }
  147. @@ -94,7 +94,7 @@ static int select_wait_event(struct waiter_context *waiter, int timeout_msec)
  148. return err;
  149. }
  150. -static void select_release(struct waiter_context *)
  151. +static void select_release(struct waiter_context *waiter ATTRIBUTE_UNUSED)
  152. {
  153. return;
  154. }
  155. diff --git a/axfer/waiter.h b/axfer/waiter.h
  156. index db18e33..0f4e9b9 100644
  157. --- a/axfer/waiter.h
  158. +++ b/axfer/waiter.h
  159. @@ -9,6 +9,7 @@
  160. #ifndef __ALSA_UTILS_AXFER_WAITER__H_
  161. #define __ALSA_UTILS_AXFER_WAITER__H_
  162. +#include <alsa/global.h>
  163. #include <poll.h>
  164. enum waiter_type {
  165. diff --git a/axfer/xfer-libasound-irq-rw.c b/axfer/xfer-libasound-irq-rw.c
  166. index b7f0645..45fb6d5 100644
  167. --- a/axfer/xfer-libasound-irq-rw.c
  168. +++ b/axfer/xfer-libasound-irq-rw.c
  169. @@ -313,7 +313,7 @@ error:
  170. }
  171. static int w_process_frames_nonblocking(struct libasound_state *state,
  172. - snd_pcm_state_t,
  173. + snd_pcm_state_t pcm_state ATTRIBUTE_UNUSED,
  174. unsigned int *frame_count,
  175. struct mapper_context *mapper,
  176. struct container_context *cntrs)
  177. diff --git a/axfer/xfer-libasound.c b/axfer/xfer-libasound.c
  178. index 9713533..36ee08d 100644
  179. --- a/axfer/xfer-libasound.c
  180. +++ b/axfer/xfer-libasound.c
  181. @@ -60,7 +60,7 @@ static const struct option l_opts[] = {
  182. };
  183. static int xfer_libasound_init(struct xfer_context *xfer,
  184. - snd_pcm_stream_t)
  185. + snd_pcm_stream_t stream ATTRIBUTE_UNUSED)
  186. {
  187. struct libasound_state *state = xfer->private_data;
  188. int err;
  189. @@ -887,7 +887,7 @@ static void xfer_libasound_destroy(struct xfer_context *xfer)
  190. state->log = NULL;
  191. }
  192. -static void xfer_libasound_help(struct xfer_context *)
  193. +static void xfer_libasound_help(struct xfer_context *xfer ATTRIBUTE_UNUSED)
  194. {
  195. printf(
  196. " [BASICS]\n"
  197. diff --git a/axfer/xfer-options.c b/axfer/xfer-options.c
  198. index 974570c..e716ded 100644
  199. --- a/axfer/xfer-options.c
  200. +++ b/axfer/xfer-options.c
  201. @@ -447,7 +447,8 @@ static int generate_path_with_suffix(struct xfer_context *xfer,
  202. static int generate_path_without_suffix(struct xfer_context *xfer,
  203. const char *template,
  204. - unsigned int index, const char *)
  205. + unsigned int index,
  206. + const char *suffix ATTRIBUTE_UNUSED)
  207. {
  208. static const char *const single_format = "%s";
  209. static const char *const multiple_format = "%s-%i";
  210. --
  211. 2.39.2