From 6cd96099d6e224010d54164be85a0d123d6e543a Mon Sep 17 00:00:00 2001 From: Okan Demirmen Date: Wed, 7 Nov 2012 21:01:49 +0000 Subject: now that we have FOREACH_SAFE queue macros, use them where appropriate; from Tiago Cunha. --- app/cwm/conf.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'app/cwm') diff --git a/app/cwm/conf.c b/app/cwm/conf.c index 196ade342..25813adf3 100644 --- a/app/cwm/conf.c +++ b/app/cwm/conf.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: conf.c,v 1.104 2012/11/07 20:37:55 okan Exp $ + * $OpenBSD: conf.c,v 1.105 2012/11/07 21:01:48 okan Exp $ */ #include @@ -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; -- cgit v1.2.3