From ee0963b68ea02f99cb3a7301417af75ae9a619c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Mon, 20 Dec 2021 19:20:38 +0100 Subject: [PATCH] spa: alsa: change index type The `card` structure uses `uint32_t` for its index member, on the other hand, the `state` structure uses `int`. No code depends on it being `int`, therefore change it to `uint32_t` for consistency. --- spa/plugins/alsa/alsa-pcm.c | 4 ++-- spa/plugins/alsa/alsa-pcm.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spa/plugins/alsa/alsa-pcm.c b/spa/plugins/alsa/alsa-pcm.c index 180650e2e..d2a2c8ee2 100644 --- a/spa/plugins/alsa/alsa-pcm.c +++ b/spa/plugins/alsa/alsa-pcm.c @@ -402,7 +402,7 @@ int spa_alsa_init(struct state *state, const struct spa_dict *info) } if (state->clock_name[0] == '\0') snprintf(state->clock_name, sizeof(state->clock_name), - "api.alsa.%d", state->card_index); + "api.alsa.%u", state->card_index); if (state->stream == SND_PCM_STREAM_PLAYBACK) { state->is_iec958 = spa_strstartswith(state->props.device, "iec958"); @@ -412,7 +412,7 @@ int spa_alsa_init(struct state *state, const struct spa_dict *info) state->card = ensure_card(state->card_index, state->open_ucm); if (state->card == NULL) { - spa_log_error(state->log, "can't create card %d", state->card_index); + spa_log_error(state->log, "can't create card %u", state->card_index); return -errno; } return 0; diff --git a/spa/plugins/alsa/alsa-pcm.h b/spa/plugins/alsa/alsa-pcm.h index 7c30c8f33..32a9e2001 100644 --- a/spa/plugins/alsa/alsa-pcm.h +++ b/spa/plugins/alsa/alsa-pcm.h @@ -109,7 +109,7 @@ struct state { struct spa_system *data_system; struct spa_loop *data_loop; - int card_index; + uint32_t card_index; struct card *card; snd_pcm_stream_t stream; snd_output_t *output;