From e55a5441b8b292fa4fc7955b727f6bddf549a4aa Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 6 Sep 2021 15:13:05 +1000 Subject: [PATCH] spa: silence two -Wformat-nonliteral warnings In one we can duplicate the spa_asprintf call without real drawbacks. The second one can be split up without losing details. Note that there is another one in backend-native.c where splitting it up will make the code harder to understand. The warning for that one remains. --- spa/plugins/bluez5/backend-native.c | 6 +++--- spa/plugins/bluez5/bluez5-device.c | 8 +++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/spa/plugins/bluez5/backend-native.c b/spa/plugins/bluez5/backend-native.c index 9c4a225a3..50257200f 100644 --- a/spa/plugins/bluez5/backend-native.c +++ b/spa/plugins/bluez5/backend-native.c @@ -408,13 +408,13 @@ static bool rfcomm_send_volume_cmd(struct spa_source *source, int id) rfcomm->volumes[id].hw_volume = hw_volume; if (id == SPA_BT_VOLUME_ID_TX) - format = "AT+VGM=%d"; + format = "AT+VGM"; else if (id == SPA_BT_VOLUME_ID_RX) - format = "AT+VGS=%d"; + format = "AT+VGS"; else spa_assert_not_reached(); - rfcomm_send_cmd(rfcomm, format, hw_volume); + rfcomm_send_cmd(rfcomm, "%s=%d", format, hw_volume); return true; } diff --git a/spa/plugins/bluez5/bluez5-device.c b/spa/plugins/bluez5/bluez5-device.c index d37e48580..baa5c964e 100644 --- a/spa/plugins/bluez5/bluez5-device.c +++ b/spa/plugins/bluez5/bluez5-device.c @@ -1159,11 +1159,13 @@ static struct spa_pod *build_profile(struct impl *this, struct spa_pod_builder * name_and_codec = spa_aprintf("%s-%s", name, a2dp_codec->name); name = name_and_codec; if (profile == SPA_BT_PROFILE_A2DP_SINK && !a2dp_codec->duplex_codec) { - desc = _("High Fidelity Playback (A2DP Sink, codec %s)"); + desc_and_codec = spa_aprintf(_("High Fidelity Playback (A2DP Sink, codec %s)"), + a2dp_codec->description); } else { - desc = _("High Fidelity Duplex (A2DP Source/Sink, codec %s)"); + desc_and_codec = spa_aprintf(_("High Fidelity Duplex (A2DP Source/Sink, codec %s)"), + a2dp_codec->description); + } - desc_and_codec = spa_aprintf(desc, a2dp_codec->description); desc = desc_and_codec; } else { if (profile == SPA_BT_PROFILE_A2DP_SINK) {