aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/output_init.c5
-rw-r--r--src/output_list.c10
-rw-r--r--src/output_list.h6
3 files changed, 7 insertions, 14 deletions
diff --git a/src/output_init.c b/src/output_init.c
index 96f87f512..5bf8b93c0 100644
--- a/src/output_init.c
+++ b/src/output_init.c
@@ -49,12 +49,9 @@
static const struct audio_output_plugin *
audio_output_detect(GError **error)
{
- const struct audio_output_plugin *plugin;
- unsigned i;
-
g_warning("Attempt to detect audio output device");
- audio_output_plugins_for_each(plugin, i) {
+ audio_output_plugins_for_each(plugin) {
if (plugin->test_default_device == NULL)
continue;
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");
diff --git a/src/output_list.h b/src/output_list.h
index ee5102218..85497a6c6 100644
--- a/src/output_list.h
+++ b/src/output_list.h
@@ -29,7 +29,9 @@ audio_output_plugin_get(const char *name);
void audio_output_plugin_print_all_types(FILE * fp);
-#define audio_output_plugins_for_each(plugin, i) \
- for (i = 0; (plugin = audio_output_plugins[i]) != NULL; ++i)
+#define audio_output_plugins_for_each(plugin) \
+ for (const struct audio_output_plugin *plugin, \
+ *const*output_plugin_iterator = &audio_output_plugins[0]; \
+ (plugin = *output_plugin_iterator) != NULL; ++output_plugin_iterator)
#endif