builder: fix calls to builder_add that are not terminated by NULL

spa_pod_builder_add() is a va_args function that is terminated by a NULL
argument. The last argument must be a pointer type, because otherwise
checking for a NULL pointer can fail.

The __attribute__((__sentinel__)) prints a compiler warning, if the last
argument of a call to spa_pod_builder_add() is not a pointer type.

Fix all sentinel warnings by replacing all integer type 0 with pointer
type NULL in calls to spa_pod_builder_add().
This commit is contained in:
Michael Tretter 2019-07-05 12:57:55 +02:00 committed by Wim Taymans
parent 4350bd624f
commit 39c01ba2fe
6 changed files with 32 additions and 31 deletions

View file

@ -143,7 +143,7 @@ spa_alsa_enum_format(struct state *state, uint32_t *index,
spa_pod_builder_push_object(&b, state->type.param.idEnumFormat, state->type.format);
spa_pod_builder_add(&b,
"I", state->type.media_type.audio,
"I", state->type.media_subtype.raw, 0);
"I", state->type.media_subtype.raw, NULL);
snd_pcm_format_mask_alloca(&fmask);
snd_pcm_hw_params_get_format_mask(params, fmask);