From ceb19c8f684c7541ee878255ed686d92cfb90175 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Fri, 4 Nov 2022 17:06:49 +0100 Subject: qapi audio: Elide redundant has_FOO in generated C MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The has_FOO for pointer-valued FOO are redundant, except for arrays. They are also a nuisance to work with. Recent commit "qapi: Start to elide redundant has_FOO in generated C" provided the means to elide them step by step. This is the step for qapi/audio.json. Said commit explains the transformation in more detail. The invariant violations mentioned there do not occur here. Additionally, helper get_str() loses its @has_dst parameter. Cc: Gerd Hoffmann Signed-off-by: Markus Armbruster Reviewed-by: Daniel P. Berrangé Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20221104160712.3005652-8-armbru@redhat.com> --- audio/sndioaudio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'audio/sndioaudio.c') diff --git a/audio/sndioaudio.c b/audio/sndioaudio.c index 7c45276d36..632b0e3825 100644 --- a/audio/sndioaudio.c +++ b/audio/sndioaudio.c @@ -333,7 +333,7 @@ static int sndio_init(SndioVoice *self, unsigned int nch; int i, nfds; - dev_name = opts->has_dev ? opts->dev : SIO_DEVANY; + dev_name = opts->dev ?: SIO_DEVANY; latency = opts->has_latency ? opts->latency : SNDIO_LATENCY_US; /* open the device in non-blocking mode */ -- cgit v1.2.3