From caf68ab21e373594866ef2b26736d3ae02ac6659 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Tue, 13 Dec 2011 11:29:11 +0100 Subject: Add a list_foreach makro for GList Saves around 1-2 lines per foreach, and should be more error prone. --- src/pa-sink-ctl.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/pa-sink-ctl.h') diff --git a/src/pa-sink-ctl.h b/src/pa-sink-ctl.h index d8cd5bb..f56b17c 100644 --- a/src/pa-sink-ctl.h +++ b/src/pa-sink-ctl.h @@ -67,4 +67,7 @@ change_callback(pa_context* c, gint success, gpointer); g_memdup(&(data), sizeof(data))); \ } while (0) +#define list_foreach(list, el) \ + for (GList *__l = (list); __l && ((el) = __l->data); __l = __l->next) + #endif -- cgit