aboutsummaryrefslogtreecommitdiffstats
path: root/src/output_list.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-06-12 20:29:47 +0200
committerMax Kellermann <max@duempel.org>2012-06-12 20:31:32 +0200
commit992c2fa2d4f0b3fae9bd26144c14e6a4e0ce9a75 (patch)
tree5717c974ffab5091808f406c05df3af77abd3dc8 /src/output_list.h
parented915fed9253c23755fda6cc48ece61fa8f5d3b0 (diff)
downloadmpd-992c2fa2d4f0b3fae9bd26144c14e6a4e0ce9a75.tar.gz
mpd-992c2fa2d4f0b3fae9bd26144c14e6a4e0ce9a75.tar.xz
mpd-992c2fa2d4f0b3fae9bd26144c14e6a4e0ce9a75.zip
output_list: declare variables inside _plugins_for_each()
Don't require the caller to provide them.
Diffstat (limited to 'src/output_list.h')
-rw-r--r--src/output_list.h6
1 files changed, 4 insertions, 2 deletions
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