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

@@ -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 */