[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 4/4] use C99 initializers for all audio/*
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 4/4] use C99 initializers for all audio/* |
Date: |
Mon, 27 Jul 2009 22:23:08 +0200 |
Signed-off-by: Juan Quintela <address@hidden>
---
audio/alsaaudio.c | 9 +++++-
audio/dsoundaudio.c | 20 ++++++++--------
audio/esdaudio.c | 6 +---
audio/fmodaudio.c | 63 ++++++++++++++++++++++++++++++++++----------------
audio/ossaudio.c | 9 +++++-
audio/paaudio.c | 7 +----
audio/sdlaudio.c | 2 +-
audio/wavaudio.c | 9 +++----
8 files changed, 76 insertions(+), 49 deletions(-)
diff --git a/audio/alsaaudio.c b/audio/alsaaudio.c
index fcaf84f..1e19d5b 100644
--- a/audio/alsaaudio.c
+++ b/audio/alsaaudio.c
@@ -763,8 +763,13 @@ static int alsa_run_in (HWVoiceIn *hw)
int add;
int len;
} bufs[2] = {
- { hw->wpos, 0 },
- { 0, 0 }
+ {
+ .add = hw->wpos,
+ .len = 0
+ },{
+ .add = 0,
+ .len = 0
+ }
};
snd_pcm_sframes_t avail;
snd_pcm_uframes_t read_samples = 0;
diff --git a/audio/dsoundaudio.c b/audio/dsoundaudio.c
index 55d42bb..b39bde8 100644
--- a/audio/dsoundaudio.c
+++ b/audio/dsoundaudio.c
@@ -49,18 +49,18 @@ static struct {
struct audsettings settings;
int latency_millis;
} conf = {
- 1,
- 1,
- 1,
- 0,
- 16384,
- 16384,
+ .lock_retries = 1,
+ .restore_retries = 1,
+ .getstatus_retries = 1,
+ .set_primary = 0,
+ .bufsize_in = 16384,
+ .bufsize_out = 16384,
{
- 44100,
- 2,
- AUD_FMT_S16
+ .freq = 44100,
+ .nchannels = 2,
+ .fmt = AUD_FMT_S16
},
- 10
+ .latency_millis = 10
};
typedef struct {
diff --git a/audio/esdaudio.c b/audio/esdaudio.c
index 002e263..c941abd 100644
--- a/audio/esdaudio.c
+++ b/audio/esdaudio.c
@@ -58,10 +58,8 @@ static struct {
char *dac_host;
char *adc_host;
} conf = {
- 1024,
- 2,
- NULL,
- NULL
+ .samples = 1024,
+ .divisor = 2,
};
static void GCC_FMT_ATTR (2, 3) qesd_logerr (int err, const char *fmt, ...)
diff --git a/audio/fmodaudio.c b/audio/fmodaudio.c
index 1bf443f..d9ca713 100644
--- a/audio/fmodaudio.c
+++ b/audio/fmodaudio.c
@@ -50,13 +50,9 @@ static struct {
int threshold;
int broken_adc;
} conf = {
- NULL,
- 2048 * 2,
- 44100,
- 2,
- 0,
- 0,
- 0
+ .nb_samples = 2048 * 2,
+ .freq = 44100,
+ .nb_channels = 2,
};
static void GCC_FMT_ATTR (1, 2) fmod_logerr (const char *fmt, ...)
@@ -517,27 +513,54 @@ static struct {
const char *name;
int type;
} drvtab[] = {
- {"none", FSOUND_OUTPUT_NOSOUND},
+ {
+ .name = "none",
+ .type = FSOUND_OUTPUT_NOSOUND
+ },{
#ifdef _WIN32
- {"winmm", FSOUND_OUTPUT_WINMM},
- {"dsound", FSOUND_OUTPUT_DSOUND},
- {"a3d", FSOUND_OUTPUT_A3D},
- {"asio", FSOUND_OUTPUT_ASIO},
+ .name = "winmm",
+ .type = FSOUND_OUTPUT_WINMM
+ },{
+ .name = "dsound",
+ .type = FSOUND_OUTPUT_DSOUND
+ },{
+ .name = "a3d",
+ .type = FSOUND_OUTPUT_A3D
+ },{
+ .name = "asio",
+ .type = FSOUND_OUTPUT_ASIO
+ },{
#endif
#ifdef __linux__
- {"oss", FSOUND_OUTPUT_OSS},
- {"alsa", FSOUND_OUTPUT_ALSA},
- {"esd", FSOUND_OUTPUT_ESD},
+ .name = "oss",
+ .type = FSOUND_OUTPUT_OSS
+ },{
+ .name = "alsa",
+ .type = FSOUND_OUTPUT_ALSA
+ },{
+ .name = "esd",
+ .type = FSOUND_OUTPUT_ESD
+ },{
#endif
#ifdef __APPLE__
- {"mac", FSOUND_OUTPUT_MAC},
+ .name = "mac",
+ .type = FSOUND_OUTPUT_MAC
+ },{
#endif
#if 0
- {"xbox", FSOUND_OUTPUT_XBOX},
- {"ps2", FSOUND_OUTPUT_PS2},
- {"gcube", FSOUND_OUTPUT_GC},
+ .name = "xbox",
+ .type = FSOUND_OUTPUT_XBOX
+ },{
+ .name = "ps2",
+ .type = FSOUND_OUTPUT_PS2
+ },{
+ .name = "gcube",
+ .type = FSOUND_OUTPUT_GC
+ }, {
#endif
- {"none-realtime", FSOUND_OUTPUT_NOSOUND_NONREALTIME}
+ .name = "none-realtime",
+ .type = FSOUND_OUTPUT_NOSOUND_NONREALTIME
+ }
};
static void *fmod_audio_init (void)
diff --git a/audio/ossaudio.c b/audio/ossaudio.c
index 6d27d58..bdcd86e 100644
--- a/audio/ossaudio.c
+++ b/audio/ossaudio.c
@@ -654,8 +654,13 @@ static int oss_run_in (HWVoiceIn *hw)
int add;
int len;
} bufs[2] = {
- { hw->wpos, 0 },
- { 0, 0 }
+ {
+ .add = hw->wpos,
+ .len = 0
+ },{
+ .add = 0,
+ .len = 0
+ }
};
if (!dead) {
diff --git a/audio/paaudio.c b/audio/paaudio.c
index 8492e1a..959b7d5 100644
--- a/audio/paaudio.c
+++ b/audio/paaudio.c
@@ -38,11 +38,8 @@ static struct {
char *sink;
char *source;
} conf = {
- 1024,
- 2,
- NULL,
- NULL,
- NULL
+ .samples = 1024,
+ .divisor = 2,
};
static void GCC_FMT_ATTR (2, 3) qpa_logerr (int err, const char *fmt, ...)
diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c
index 4e4544f..1247871 100644
--- a/audio/sdlaudio.c
+++ b/audio/sdlaudio.c
@@ -48,7 +48,7 @@ typedef struct SDLVoiceOut {
static struct {
int nb_samples;
} conf = {
- 1024
+ .nb_samples = 1024
};
static struct SDLAudioState {
diff --git a/audio/wavaudio.c b/audio/wavaudio.c
index 6c11359..3f143e0 100644
--- a/audio/wavaudio.c
+++ b/audio/wavaudio.c
@@ -41,12 +41,11 @@ static struct {
const char *wav_path;
} conf = {
{
- 44100,
- 2,
- AUD_FMT_S16,
- 0
+ .freq = 44100,
+ .nchannels = 2,
+ .fmt = AUD_FMT_S16,
},
- "qemu.wav"
+ .wav_path = "qemu.wav"
};
static int wav_run_out (HWVoiceOut *hw)
--
1.6.2.5
- [Qemu-devel] [PATCH 2/4] use C99 initializers for audio_pcm_ops, (continued)
[Qemu-devel] [PATCH 4/4] use C99 initializers for all audio/*,
Juan Quintela <=
[Qemu-devel] Re: [PATCH 0/4] Use C99 struct initializers in audio/*, Anthony Liguori, 2009/07/27