summary refs log tree commit diff
path: root/conf.c
diff options
context:
space:
mode:
authorokan <okan>2012-11-07 21:01:48 +0000
committerokan <okan>2012-11-07 21:01:48 +0000
commit7f1851b8f60ad4aead8668e8ea37e8e85d315383 (patch)
tree52214fa29f4af98cc13f708b9e3c5948f14eeab5 /conf.c
parentbd252183338229977adc77849a857b597908f71c (diff)
downloadcwm-7f1851b8f60ad4aead8668e8ea37e8e85d315383.tar.gz
cwm-7f1851b8f60ad4aead8668e8ea37e8e85d315383.tar.xz
cwm-7f1851b8f60ad4aead8668e8ea37e8e85d315383.zip
now that we have FOREACH_SAFE queue macros, use them where appropriate;
from Tiago Cunha.
Diffstat (limited to 'conf.c')
-rw-r--r--conf.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/conf.c b/conf.c
index df3566a..1e8415f 100644
--- a/conf.c
+++ b/conf.c
@@ -512,10 +512,7 @@ conf_unbind(struct conf *c, struct keybinding *unbind)
 {
 	struct keybinding	*key = NULL, *keynxt;
 
-	for (key = TAILQ_FIRST(&c->keybindingq);
-	    key != TAILQ_END(&c->keybindingq); key = keynxt) {
-		keynxt = TAILQ_NEXT(key, entry);
-
+	TAILQ_FOREACH_SAFE(key, &c->keybindingq, entry, keynxt) {
 		if (key->modmask != unbind->modmask)
 			continue;
 
@@ -597,10 +594,7 @@ conf_mouseunbind(struct conf *c, struct mousebinding *unbind)
 {
 	struct mousebinding	*mb = NULL, *mbnxt;
 
-	for (mb = TAILQ_FIRST(&c->mousebindingq);
-	    mb != TAILQ_END(&c->mousebindingq); mb = mbnxt) {
-		mbnxt = TAILQ_NEXT(mb, entry);
-
+	TAILQ_FOREACH_SAFE(mb, &c->mousebindingq, entry, mbnxt) {
 		if (mb->modmask != unbind->modmask)
 			continue;