diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2011-12-13 11:29:11 +0100 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2011-12-13 16:30:37 +0100 |
commit | caf68ab21e373594866ef2b26736d3ae02ac6659 (patch) | |
tree | 012f32148fefd64d057926aa09ab19cf331873f7 /src/pa-sink-ctl.h | |
parent | eb6b66cde77a03e0a42999fdf6d5abdb9c373ca6 (diff) | |
download | pa-sink-ctl-caf68ab21e373594866ef2b26736d3ae02ac6659.tar.gz pa-sink-ctl-caf68ab21e373594866ef2b26736d3ae02ac6659.tar.bz2 pa-sink-ctl-caf68ab21e373594866ef2b26736d3ae02ac6659.zip |
Add a list_foreach makro for GList
Saves around 1-2 lines per foreach, and should be more error prone.
Diffstat (limited to 'src/pa-sink-ctl.h')
-rw-r--r-- | src/pa-sink-ctl.h | 3 |
1 files changed, 3 insertions, 0 deletions
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 |