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.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/output_list.h') 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 -- cgit v1.2.3