]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
use C99 initializers for all audio/*
authorJuan Quintela <quintela@redhat.com>
Tue, 11 Aug 2009 00:31:17 +0000 (02:31 +0200)
committermalc <av1474@comtv.ru>
Tue, 11 Aug 2009 16:51:24 +0000 (20:51 +0400)
Signed-off-by: Juan Quintela <quintela@redhat.com>
audio/alsaaudio.c
audio/dsoundaudio.c
audio/esdaudio.c
audio/fmodaudio.c
audio/ossaudio.c
audio/paaudio.c
audio/sdlaudio.c
audio/wavaudio.c

index e079dba8a4f66ccb2ddf83193ea5aff777c7edb1..862579a9d70e99fdb8803fe4b05e44cf1066a302 100644 (file)
@@ -786,8 +786,10 @@ 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;
index aff08177f89c302a0ab7ef869193fb3887d6105c..45c1dfd2028146cf1a7c15090abd53d2c131f132 100644 (file)
@@ -49,18 +49,16 @@ static struct {
     struct audsettings settings;
     int latency_millis;
 } conf = {
-    1,
-    1,
-    1,
-    0,
-    16384,
-    16384,
-    {
-        44100,
-        2,
-        AUD_FMT_S16
-    },
-    10
+    .lock_retries       = 1,
+    .restore_retries    = 1,
+    .getstatus_retries  = 1,
+    .set_primary        = 0,
+    .bufsize_in         = 16384,
+    .bufsize_out        = 16384,
+    .settings.freq      = 44100,
+    .settings.nchannels = 2,
+    .settings.fmt       = AUD_FMT_S16
+    .latency_millis     = 10
 };
 
 typedef struct {
index 23e488a88cd6eba292142c83bec11dbd5a71ec6e..4648fd4b0d767c7dd08021cde3575b5183e7d09e 100644 (file)
@@ -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, ...)
index 17ade51dda8d1611f5d6115e3b1a41dacd02b1c7..11ad09bb29253bfb352517b3d7bed15977930249 100644 (file)
@@ -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,40 @@ 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)
index 03e17b57072ad0cd197e2118d373d694552e4ce5..bda275661b5096f5da08586416a55b46ef97bf9f 100644 (file)
@@ -654,8 +654,10 @@ 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) {
index 942e64f2b22ef6201eb4fa20f0263a8315291091..dbc40813ee2243fbc0fc3b53c887d043c10a5f86 100644 (file)
@@ -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, ...)
index e8c6a2866b5b64d1e0c51fd48eb475aba92eac25..864060d16b3fd7075902be973a9665e088dca872 100644 (file)
@@ -48,7 +48,7 @@ typedef struct SDLVoiceOut {
 static struct {
     int nb_samples;
 } conf = {
-    1024
+    .nb_samples = 1024
 };
 
 static struct SDLAudioState {
index 4c49f23e958d9ead0075885b8600e40789ca96bb..8d1d7147f7d49ff92fb759f41702ced612f0fc14 100644 (file)
@@ -40,13 +40,10 @@ static struct {
     struct audsettings settings;
     const char *wav_path;
 } conf = {
-    {
-        44100,
-        2,
-        AUD_FMT_S16,
-        0
-    },
-    "qemu.wav"
+    .settings.freq      = 44100,
+    .settings.nchannels = 2,
+    .settings.fmt       = AUD_FMT_S16,
+    .wav_path           = "qemu.wav"
 };
 
 static int wav_run_out (HWVoiceOut *hw)