From 8aa29d5a66e127b4b14ef439d77250051ccddea0 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 12 Jun 2012 20:22:35 +0200 Subject: output_list: simplify audio_output_plugins_for_each() call --- src/output_list.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/output_list.c') diff --git a/src/output_list.c b/src/output_list.c index 8238f581b..bc5e7d749 100644 --- a/src/output_list.c +++ b/src/output_list.c @@ -99,8 +99,8 @@ audio_output_plugin_get(const char *name) const struct audio_output_plugin *plugin; audio_output_plugins_for_each(plugin, i) - if (strcmp(audio_output_plugins[i]->name, name) == 0) - return audio_output_plugins[i]; + if (strcmp(plugin->name, name) == 0) + return plugin; return NULL; } -- cgit v1.2.3 From ed915fed9253c23755fda6cc48ece61fa8f5d3b0 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 12 Jun 2012 20:30:55 +0200 Subject: output_list: make the list truly "const" --- src/output_list.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/output_list.c') diff --git a/src/output_list.c b/src/output_list.c index bc5e7d749..07f2fa555 100644 --- a/src/output_list.c +++ b/src/output_list.c @@ -39,7 +39,7 @@ extern const struct audio_output_plugin recorder_output_plugin; extern const struct audio_output_plugin winmm_output_plugin; extern const struct audio_output_plugin ffado_output_plugin; -const struct audio_output_plugin *audio_output_plugins[] = { +const struct audio_output_plugin *const audio_output_plugins[] = { #ifdef HAVE_SHOUT &shoutPlugin, #endif -- cgit v1.2.3 From 992c2fa2d4f0b3fae9bd26144c14e6a4e0ce9a75 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 12 Jun 2012 20:29:47 +0200 Subject: output_list: declare variables inside _plugins_for_each() Don't require the caller to provide them. --- src/output_list.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/output_list.c') diff --git a/src/output_list.c b/src/output_list.c index 07f2fa555..bc7a6abd8 100644 --- a/src/output_list.c +++ b/src/output_list.c @@ -95,10 +95,7 @@ const struct audio_output_plugin *const audio_output_plugins[] = { const struct audio_output_plugin * audio_output_plugin_get(const char *name) { - unsigned int i; - const struct audio_output_plugin *plugin; - - audio_output_plugins_for_each(plugin, i) + audio_output_plugins_for_each(plugin) if (strcmp(plugin->name, name) == 0) return plugin; @@ -107,10 +104,7 @@ audio_output_plugin_get(const char *name) void audio_output_plugin_print_all_types(FILE * fp) { - unsigned i; - const struct audio_output_plugin *plugin; - - audio_output_plugins_for_each(plugin, i) + audio_output_plugins_for_each(plugin) fprintf(fp, "%s ", plugin->name); fprintf(fp, "\n"); -- cgit v1.2.3 From ae70875f45c6d7f1bb0f703179035709d909978a Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 12 Jun 2012 22:29:04 +0200 Subject: cmdline: consistent plugin listings --- src/output_list.c | 9 --------- 1 file changed, 9 deletions(-) (limited to 'src/output_list.c') diff --git a/src/output_list.c b/src/output_list.c index bc7a6abd8..aac05c212 100644 --- a/src/output_list.c +++ b/src/output_list.c @@ -101,12 +101,3 @@ audio_output_plugin_get(const char *name) return NULL; } - -void audio_output_plugin_print_all_types(FILE * fp) -{ - audio_output_plugins_for_each(plugin) - fprintf(fp, "%s ", plugin->name); - - fprintf(fp, "\n"); - fflush(fp); -} -- cgit v1.2.3