diff options
author | Okan Demirmen <okan@cvs.openbsd.org> | 2012-11-07 21:01:49 +0000 |
---|---|---|
committer | Okan Demirmen <okan@cvs.openbsd.org> | 2012-11-07 21:01:49 +0000 |
commit | 6cd96099d6e224010d54164be85a0d123d6e543a (patch) | |
tree | 1f85492a55b8f373df714abe7cd27924ac5c379d | |
parent | 7316206d7bab40fbae7d194af391c52afefb0ecd (diff) |
now that we have FOREACH_SAFE queue macros, use them where appropriate;
from Tiago Cunha.
-rw-r--r-- | app/cwm/conf.c | 12 |
1 files changed, 3 insertions, 9 deletions
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 <sys/param.h> @@ -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; |