From 963e9b82062a051458d0bce7b0de289a4a812716 Mon Sep 17 00:00:00 2001 From: okan Date: Sun, 11 Jan 2009 21:33:45 +0000 Subject: better comparison idiom; found with -Wall ok oga@ --- parse.y | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/parse.y b/parse.y index e80c1cb..194185f 100644 --- a/parse.y +++ b/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.13 2008/06/16 19:09:48 mk Exp $ */ +/* $OpenBSD: parse.y,v 1.14 2009/01/11 21:33:45 okan Exp $ */ /* * Copyright (c) 2002, 2003, 2004 Henning Brauer @@ -471,17 +471,17 @@ conf_clear(struct conf *c) struct cmd *cmd; struct mousebinding *mb; - while (cmd = TAILQ_FIRST(&c->cmdq)) { + while ((cmd = TAILQ_FIRST(&c->cmdq)) != NULL) { TAILQ_REMOVE(&c->cmdq, cmd, entry); free(cmd); } - while (kb = TAILQ_FIRST(&c->keybindingq)) { + while ((kb = TAILQ_FIRST(&c->keybindingq)) != NULL) { TAILQ_REMOVE(&c->keybindingq, kb, entry); free(kb); } - while (ag = TAILQ_FIRST(&c->autogroupq)) { + while ((ag = TAILQ_FIRST(&c->autogroupq)) != NULL) { TAILQ_REMOVE(&c->autogroupq, ag, entry); free(ag->class); if (ag->name) @@ -490,12 +490,12 @@ conf_clear(struct conf *c) free(ag); } - while (wm = TAILQ_FIRST(&c->ignoreq)) { + while ((wm = TAILQ_FIRST(&c->ignoreq)) != NULL) { TAILQ_REMOVE(&c->ignoreq, wm, entry); free(wm); } - while (mb = TAILQ_FIRST(&c->mousebindingq)) { + while ((mb = TAILQ_FIRST(&c->mousebindingq)) != NULL) { TAILQ_REMOVE(&c->mousebindingq, mb, entry); free(mb); } @@ -541,27 +541,27 @@ parse_config(const char *filename, struct conf *xconf) xconf->flags = conf->flags; - while (cmd = TAILQ_FIRST(&conf->cmdq)) { + while ((cmd = TAILQ_FIRST(&conf->cmdq)) != NULL) { TAILQ_REMOVE(&conf->cmdq, cmd, entry); TAILQ_INSERT_TAIL(&xconf->cmdq, cmd, entry); } - while (kb = TAILQ_FIRST(&conf->keybindingq)) { + while ((kb = TAILQ_FIRST(&conf->keybindingq)) != NULL) { TAILQ_REMOVE(&conf->keybindingq, kb, entry); TAILQ_INSERT_TAIL(&xconf->keybindingq, kb, entry); } - while (ag = TAILQ_FIRST(&conf->autogroupq)) { + while ((ag = TAILQ_FIRST(&conf->autogroupq)) != NULL) { TAILQ_REMOVE(&conf->autogroupq, ag, entry); TAILQ_INSERT_TAIL(&xconf->autogroupq, ag, entry); } - while (wm = TAILQ_FIRST(&conf->ignoreq)) { + while ((wm = TAILQ_FIRST(&conf->ignoreq)) != NULL) { TAILQ_REMOVE(&conf->ignoreq, wm, entry); TAILQ_INSERT_TAIL(&xconf->ignoreq, wm, entry); } - while (mb = TAILQ_FIRST(&conf->mousebindingq)) { + while ((mb = TAILQ_FIRST(&conf->mousebindingq)) != NULL) { TAILQ_REMOVE(&conf->mousebindingq, mb, entry); TAILQ_INSERT_TAIL(&xconf->mousebindingq, mb, entry); } -- cgit v1.2.3-2-gb3c3