aboutsummaryrefslogtreecommitdiff
path: root/audio/audio.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2022-11-04 17:06:49 +0100
committerMarkus Armbruster <armbru@redhat.com>2022-12-13 18:31:37 +0100
commitceb19c8f684c7541ee878255ed686d92cfb90175 (patch)
treed1dd6429bcc9b9a43958830f50bfde8f6417def2 /audio/audio.c
parentb94ba62fd470715f6290b74c7a878fe2d640e9af (diff)
downloadqemu-ceb19c8f684c7541ee878255ed686d92cfb90175.zip
qemu-ceb19c8f684c7541ee878255ed686d92cfb90175.tar.gz
qemu-ceb19c8f684c7541ee878255ed686d92cfb90175.tar.bz2
qapi audio: Elide redundant has_FOO in generated C
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 <kraxel@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20221104160712.3005652-8-armbru@redhat.com>
Diffstat (limited to 'audio/audio.c')
-rw-r--r--audio/audio.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/audio/audio.c b/audio/audio.c
index 065602c..d849a94 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -2035,15 +2035,13 @@ void audio_create_pdos(Audiodev *dev)
switch (dev->driver) {
#define CASE(DRIVER, driver, pdo_name) \
case AUDIODEV_DRIVER_##DRIVER: \
- if (!dev->u.driver.has_in) { \
+ if (!dev->u.driver.in) { \
dev->u.driver.in = g_malloc0( \
sizeof(Audiodev##pdo_name##PerDirectionOptions)); \
- dev->u.driver.has_in = true; \
} \
- if (!dev->u.driver.has_out) { \
+ if (!dev->u.driver.out) { \
dev->u.driver.out = g_malloc0( \
sizeof(Audiodev##pdo_name##PerDirectionOptions)); \
- dev->u.driver.has_out = true; \
} \
break