use C99 struct initializers

The old struct initializers are error prone and don't allow moving
elements around.  Since we are going to overhaul some of the APIs
soon, it's easier to have all implementations use C99 initializers.
This commit is contained in:
Max Kellermann 2008-09-29 15:55:17 +02:00
parent 21d3d300fd
commit de7cda1d6e
20 changed files with 141 additions and 190 deletions

View File

@ -406,15 +406,14 @@ static int alsa_playAudio(void *data, const char *playChunk, size_t size)
}
const struct audio_output_plugin alsaPlugin = {
"alsa",
alsa_testDefault,
alsa_initDriver,
alsa_finishDriver,
alsa_openDevice,
alsa_playAudio,
alsa_dropBufferedAudio,
alsa_closeDevice,
NULL, /* sendMetadataFunc */
.name = "alsa",
.test_default_device = alsa_testDefault,
.init = alsa_initDriver,
.finish = alsa_finishDriver,
.open = alsa_openDevice,
.play = alsa_playAudio,
.cancel = alsa_dropBufferedAudio,
.close = alsa_closeDevice,
};
#else /* HAVE ALSA */

View File

@ -238,15 +238,13 @@ static int audioOutputAo_play(void *data, const char *playChunk, size_t size)
}
const struct audio_output_plugin aoPlugin = {
"ao",
NULL,
audioOutputAo_initDriver,
audioOutputAo_finishDriver,
audioOutputAo_openDevice,
audioOutputAo_play,
audioOutputAo_dropBufferedAudio,
audioOutputAo_closeDevice,
NULL, /* sendMetadataFunc */
.name = "ao",
.init = audioOutputAo_initDriver,
.finish = audioOutputAo_finishDriver,
.open = audioOutputAo_openDevice,
.play = audioOutputAo_play,
.cancel = audioOutputAo_dropBufferedAudio,
.close = audioOutputAo_closeDevice,
};
#else

View File

@ -270,15 +270,13 @@ static int fifo_playAudio(void *data,
}
const struct audio_output_plugin fifoPlugin = {
"fifo",
NULL, /* testDefaultDeviceFunc */
fifo_initDriver,
fifo_finishDriver,
fifo_openDevice,
fifo_playAudio,
fifo_dropBufferedAudio,
fifo_closeDevice,
NULL, /* sendMetadataFunc */
.name = "fifo",
.init = fifo_initDriver,
.finish = fifo_finishDriver,
.open = fifo_openDevice,
.play = fifo_playAudio,
.cancel = fifo_dropBufferedAudio,
.close = fifo_closeDevice,
};
#else /* HAVE_FIFO */

View File

@ -435,15 +435,14 @@ static int jack_playAudio(void *data,
}
const struct audio_output_plugin jackPlugin = {
"jack",
jack_testDefault,
jack_initDriver,
jack_finishDriver,
jack_openDevice,
jack_playAudio,
jack_dropBufferedAudio,
jack_closeDevice,
NULL, /* sendMetadataFunc */
.name = "jack",
.test_default_device = jack_testDefault,
.init = jack_initDriver,
.finish = jack_finishDriver,
.open = jack_openDevice,
.play = jack_playAudio,
.cancel = jack_dropBufferedAudio,
.close = jack_closeDevice,
};
#else /* HAVE JACK */

View File

@ -257,15 +257,14 @@ static int mvp_playAudio(struct audio_output *audioOutput,
}
const struct audio_output_plugin mvpPlugin = {
"mvp",
mvp_testDefault,
mvp_initDriver,
mvp_finishDriver,
mvp_openDevice,
mvp_playAudio,
mvp_dropBufferedAudio,
mvp_closeDevice,
NULL, /* sendMetadataFunc */
.name = "mvp",
.test_default_device = mvp_testDefault,
.init = mvp_initDriver,
.finish = mvp_finishDriver,
.open = mvp_openDevice,
.play = mvp_playAudio,
.cancel = mvp_dropBufferedAudio,
.close = mvp_closeDevice,
};
#else /* HAVE_MVP */

View File

@ -76,13 +76,10 @@ static void null_dropBufferedAudio(void *data)
}
const struct audio_output_plugin nullPlugin = {
"null",
NULL,
null_initDriver,
NULL,
null_openDevice,
null_playAudio,
null_dropBufferedAudio,
null_closeDevice,
NULL,
.name = "null",
.init = null_initDriver,
.open = null_openDevice,
.play = null_playAudio,
.cancel = null_dropBufferedAudio,
.close = null_closeDevice,
};

View File

@ -544,15 +544,14 @@ static int oss_playAudio(void *data,
}
const struct audio_output_plugin ossPlugin = {
"oss",
oss_testDefault,
oss_initDriver,
oss_finishDriver,
oss_openDevice,
oss_playAudio,
oss_dropBufferedAudio,
oss_closeDevice,
NULL, /* sendMetadataFunc */
.name = "oss",
.test_default_device = oss_testDefault,
.init = oss_initDriver,
.finish = oss_finishDriver,
.open = oss_openDevice,
.play = oss_playAudio,
.cancel = oss_dropBufferedAudio,
.close = oss_closeDevice,
};
#else /* HAVE OSS */

View File

@ -353,15 +353,14 @@ static int osx_play(struct audio_output *audioOutput,
}
const struct audio_output_plugin osxPlugin = {
"osx",
osx_testDefault,
osx_initDriver,
osx_finishDriver,
osx_openDevice,
osx_play,
osx_dropBufferedAudio,
osx_closeDevice,
NULL, /* sendMetadataFunc */
.name = "osx",
.test_default_device = osx_testDefault,
.init = osx_initDriver,
.finish = osx_finishDriver,
.open = osx_openDevice,
.play = osx_play,
.cancel = osx_dropBufferedAudio,
.close = osx_closeDevice,
};
#else

View File

@ -204,15 +204,14 @@ static int pulse_playAudio(void *data,
}
const struct audio_output_plugin pulsePlugin = {
"pulse",
pulse_testDefault,
pulse_initDriver,
pulse_finishDriver,
pulse_openDevice,
pulse_playAudio,
pulse_dropBufferedAudio,
pulse_closeDevice,
NULL, /* sendMetadataFunc */
.name = "pulse",
.test_default_device = pulse_testDefault,
.init = pulse_initDriver,
.finish = pulse_finishDriver,
.open = pulse_openDevice,
.play = pulse_playAudio,
.cancel = pulse_dropBufferedAudio,
.close = pulse_closeDevice,
};
#else /* HAVE_PULSE */

View File

@ -534,15 +534,14 @@ static void my_shout_set_tag(void *data,
}
const struct audio_output_plugin shoutPlugin = {
"shout",
NULL,
my_shout_init_driver,
my_shout_finish_driver,
my_shout_open_device,
my_shout_play,
my_shout_drop_buffered_audio,
my_shout_close_device,
my_shout_set_tag,
.name = "shout",
.init = my_shout_init_driver,
.finish = my_shout_finish_driver,
.open = my_shout_open_device,
.play = my_shout_play,
.cancel = my_shout_drop_buffered_audio,
.close = my_shout_close_device,
.send_tag = my_shout_set_tag,
};
#else

View File

@ -593,16 +593,13 @@ static const char *aac_suffixes[] = { "aac", NULL };
static const char *aac_mimeTypes[] = { "audio/aac", "audio/aacp", NULL };
struct decoder_plugin aacPlugin = {
"aac",
NULL,
NULL,
NULL,
aac_stream_decode,
aac_decode,
aacTagDup,
INPUT_PLUGIN_STREAM_FILE | INPUT_PLUGIN_STREAM_URL,
aac_suffixes,
aac_mimeTypes
.name = "aac",
.stream_decode = aac_stream_decode,
.file_decode = aac_decode,
.tag_dup = aacTagDup,
.stream_types = INPUT_PLUGIN_STREAM_FILE | INPUT_PLUGIN_STREAM_URL,
.suffixes = aac_suffixes,
.mime_types = aac_mimeTypes
};
#else

View File

@ -141,16 +141,11 @@ static struct tag *audiofileTagDup(char *file)
static const char *audiofileSuffixes[] = { "wav", "au", "aiff", "aif", NULL };
struct decoder_plugin audiofilePlugin = {
"audiofile",
NULL,
NULL,
NULL,
NULL,
audiofile_decode,
audiofileTagDup,
INPUT_PLUGIN_STREAM_FILE,
audiofileSuffixes,
NULL
.name = "audiofile",
.file_decode = audiofile_decode,
.tag_dup = audiofileTagDup,
.stream_types = INPUT_PLUGIN_STREAM_FILE,
.suffixes = audiofileSuffixes,
};
#else

View File

@ -464,16 +464,13 @@ static const char *flac_mime_types[] = { "audio/x-flac",
NULL };
struct decoder_plugin flacPlugin = {
"flac",
flac_plugin_init,
NULL,
NULL,
flac_decode,
NULL,
flacTagDup,
INPUT_PLUGIN_STREAM_URL | INPUT_PLUGIN_STREAM_FILE,
flacSuffixes,
flac_mime_types
.name = "flac",
.init = flac_plugin_init,
.stream_decode = flac_decode,
.tag_dup = flacTagDup,
.stream_types = INPUT_PLUGIN_STREAM_URL | INPUT_PLUGIN_STREAM_FILE,
.suffixes = flacSuffixes,
.mime_types = flac_mime_types
};
#else /* !HAVE_FLAC */

View File

@ -272,16 +272,12 @@ static const char *modSuffixes[] = { "amf",
};
struct decoder_plugin modPlugin = {
"mod",
NULL,
mod_finishMikMod,
NULL,
NULL,
mod_decode,
modTagDup,
INPUT_PLUGIN_STREAM_FILE,
modSuffixes,
NULL
.name = "mod",
.finish = mod_finishMikMod,
.file_decode = mod_decode,
.tag_dup = modTagDup,
.stream_types = INPUT_PLUGIN_STREAM_FILE,
.suffixes = modSuffixes,
};
#else

View File

@ -1122,16 +1122,13 @@ static const char *mp3_suffixes[] = { "mp3", "mp2", NULL };
static const char *mp3_mimeTypes[] = { "audio/mpeg", NULL };
struct decoder_plugin mp3Plugin = {
"mp3",
mp3_plugin_init,
NULL,
NULL,
mp3_decode,
NULL,
mp3_tagDup,
INPUT_PLUGIN_STREAM_FILE | INPUT_PLUGIN_STREAM_URL,
mp3_suffixes,
mp3_mimeTypes
.name = "mp3",
.init = mp3_plugin_init,
.stream_decode = mp3_decode,
.tag_dup = mp3_tagDup,
.stream_types = INPUT_PLUGIN_STREAM_FILE | INPUT_PLUGIN_STREAM_URL,
.suffixes = mp3_suffixes,
.mime_types = mp3_mimeTypes
};
#else

View File

@ -416,16 +416,12 @@ static const char *mp4_suffixes[] = { "m4a", "mp4", NULL };
static const char *mp4_mimeTypes[] = { "audio/mp4", "audio/m4a", NULL };
struct decoder_plugin mp4Plugin = {
"mp4",
NULL,
NULL,
NULL,
mp4_decode,
NULL,
mp4TagDup,
INPUT_PLUGIN_STREAM_FILE | INPUT_PLUGIN_STREAM_URL,
mp4_suffixes,
mp4_mimeTypes
.name = "mp4",
.stream_decode = mp4_decode,
.tag_dup = mp4TagDup,
.stream_types = INPUT_PLUGIN_STREAM_FILE | INPUT_PLUGIN_STREAM_URL,
.suffixes = mp4_suffixes,
.mime_types = mp4_mimeTypes,
};
#else

View File

@ -303,16 +303,11 @@ static struct tag *mpcTagDup(char *file)
static const char *mpcSuffixes[] = { "mpc", NULL };
struct decoder_plugin mpcPlugin = {
"mpc",
NULL,
NULL,
NULL,
mpc_decode,
NULL,
mpcTagDup,
INPUT_PLUGIN_STREAM_URL | INPUT_PLUGIN_STREAM_FILE,
mpcSuffixes,
NULL
.name = "mpc",
.stream_decode = mpc_decode,
.tag_dup = mpcTagDup,
.stream_types = INPUT_PLUGIN_STREAM_URL | INPUT_PLUGIN_STREAM_FILE,
.suffixes = mpcSuffixes,
};
#else

View File

@ -348,16 +348,13 @@ static const char *oggflac_mime_types[] = { "audio/x-flac+ogg",
NULL };
struct decoder_plugin oggflacPlugin = {
"oggflac",
NULL,
NULL,
oggflac_try_decode,
oggflac_decode,
NULL,
oggflac_TagDup,
INPUT_PLUGIN_STREAM_URL | INPUT_PLUGIN_STREAM_FILE,
oggflac_Suffixes,
oggflac_mime_types
.name = "oggflac",
.try_decode = oggflac_try_decode,
.stream_decode = oggflac_decode,
.tag_dup = oggflac_TagDup,
.stream_types = INPUT_PLUGIN_STREAM_URL | INPUT_PLUGIN_STREAM_FILE,
.suffixes = oggflac_Suffixes,
.mime_types = oggflac_mime_types
};
#else /* !HAVE_FLAC */

View File

@ -382,16 +382,13 @@ static const char *oggvorbis_MimeTypes[] = { "application/ogg",
NULL };
struct decoder_plugin oggvorbisPlugin = {
"oggvorbis",
NULL,
NULL,
oggvorbis_try_decode,
oggvorbis_decode,
NULL,
oggvorbis_TagDup,
INPUT_PLUGIN_STREAM_URL | INPUT_PLUGIN_STREAM_FILE,
oggvorbis_Suffixes,
oggvorbis_MimeTypes
.name = "oggvorbis",
.try_decode = oggvorbis_try_decode,
.stream_decode = oggvorbis_decode,
.tag_dup = oggvorbis_TagDup,
.stream_types = INPUT_PLUGIN_STREAM_URL | INPUT_PLUGIN_STREAM_FILE,
.suffixes = oggvorbis_Suffixes,
.mime_types = oggvorbis_MimeTypes
};
#else /* !HAVE_OGGVORBIS */

View File

@ -567,16 +567,14 @@ static char const *wavpackSuffixes[] = { "wv", NULL };
static char const *wavpackMimeTypes[] = { "audio/x-wavpack", NULL };
struct decoder_plugin wavpackPlugin = {
"wavpack",
NULL,
NULL,
wavpack_trydecode,
wavpack_streamdecode,
wavpack_filedecode,
wavpack_tagdup,
INPUT_PLUGIN_STREAM_FILE | INPUT_PLUGIN_STREAM_URL,
wavpackSuffixes,
wavpackMimeTypes
.name = "wavpack",
.try_decode = wavpack_trydecode,
.stream_decode = wavpack_streamdecode,
.file_decode = wavpack_filedecode,
.tag_dup = wavpack_tagdup,
.stream_types = INPUT_PLUGIN_STREAM_FILE | INPUT_PLUGIN_STREAM_URL,
.suffixes = wavpackSuffixes,
.mime_types = wavpackMimeTypes
};
#else /* !HAVE_WAVPACK */