[beast: 20/24] DRIVERS: use Rapicorn's string_format()
- From: Tim Janik <timj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [beast: 20/24] DRIVERS: use Rapicorn's string_format()
- Date: Thu, 24 Sep 2015 20:11:17 +0000 (UTC)
commit b497fd42faaebb36ce91b3a007e0bff90453ac90
Author: Tim Janik <timj gnu org>
Date: Wed Sep 23 20:50:31 2015 +0200
DRIVERS: use Rapicorn's string_format()
drivers/bsemididevice-alsa.cc | 5 ++---
drivers/bsepcmdevice-alsa.cc | 5 ++---
2 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/drivers/bsemididevice-alsa.cc b/drivers/bsemididevice-alsa.cc
index d847168..3da99a7 100644
--- a/drivers/bsemididevice-alsa.cc
+++ b/drivers/bsemididevice-alsa.cc
@@ -100,10 +100,9 @@ bse_midi_device_alsa_list_devices (BseDevice *device)
while (cindex >= 0)
{
snd_ctl_card_info_clear (cinfo);
- char hwid[128];
- g_snprintf (hwid, 128, "hw:CARD=%u", cindex);
+ String hwid = string_format ("hw:CARD=%u", cindex);
snd_ctl_t *chandle = NULL;
- if (snd_ctl_open (&chandle, hwid, SND_CTL_NONBLOCK) < 0 || !chandle)
+ if (snd_ctl_open (&chandle, hwid.c_str(), SND_CTL_NONBLOCK) < 0 || !chandle)
continue;
if (snd_ctl_card_info (chandle, cinfo) < 0)
{
diff --git a/drivers/bsepcmdevice-alsa.cc b/drivers/bsepcmdevice-alsa.cc
index 964a0a7..aeea86d 100644
--- a/drivers/bsepcmdevice-alsa.cc
+++ b/drivers/bsepcmdevice-alsa.cc
@@ -124,10 +124,9 @@ bse_pcm_device_alsa_list_devices (BseDevice *device)
while (cindex >= 0)
{
snd_ctl_card_info_clear (cinfo);
- char hwid[128];
- g_snprintf (hwid, 128, "hw:CARD=%u", cindex);
+ String hwid = string_format ("hw:CARD=%u", cindex);
snd_ctl_t *chandle = NULL;
- if (snd_ctl_open (&chandle, hwid, SND_CTL_NONBLOCK) < 0 || !chandle)
+ if (snd_ctl_open (&chandle, hwid.c_str(), SND_CTL_NONBLOCK) < 0 || !chandle)
continue;
if (snd_ctl_card_info (chandle, cinfo) < 0)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]