better comparison idiom; found with -Wall

ok oga@
This commit is contained in:
okan 2009-01-11 21:33:45 +00:00
parent 590169ce24
commit 0aca400461

20
parse.y
View File

@ -471,17 +471,17 @@ conf_clear(struct conf *c)
struct cmd *cmd; struct cmd *cmd;
struct mousebinding *mb; struct mousebinding *mb;
while (cmd = TAILQ_FIRST(&c->cmdq)) { while ((cmd = TAILQ_FIRST(&c->cmdq)) != NULL) {
TAILQ_REMOVE(&c->cmdq, cmd, entry); TAILQ_REMOVE(&c->cmdq, cmd, entry);
free(cmd); free(cmd);
} }
while (kb = TAILQ_FIRST(&c->keybindingq)) { while ((kb = TAILQ_FIRST(&c->keybindingq)) != NULL) {
TAILQ_REMOVE(&c->keybindingq, kb, entry); TAILQ_REMOVE(&c->keybindingq, kb, entry);
free(kb); free(kb);
} }
while (ag = TAILQ_FIRST(&c->autogroupq)) { while ((ag = TAILQ_FIRST(&c->autogroupq)) != NULL) {
TAILQ_REMOVE(&c->autogroupq, ag, entry); TAILQ_REMOVE(&c->autogroupq, ag, entry);
free(ag->class); free(ag->class);
if (ag->name) if (ag->name)
@ -490,12 +490,12 @@ conf_clear(struct conf *c)
free(ag); free(ag);
} }
while (wm = TAILQ_FIRST(&c->ignoreq)) { while ((wm = TAILQ_FIRST(&c->ignoreq)) != NULL) {
TAILQ_REMOVE(&c->ignoreq, wm, entry); TAILQ_REMOVE(&c->ignoreq, wm, entry);
free(wm); free(wm);
} }
while (mb = TAILQ_FIRST(&c->mousebindingq)) { while ((mb = TAILQ_FIRST(&c->mousebindingq)) != NULL) {
TAILQ_REMOVE(&c->mousebindingq, mb, entry); TAILQ_REMOVE(&c->mousebindingq, mb, entry);
free(mb); free(mb);
} }
@ -541,27 +541,27 @@ parse_config(const char *filename, struct conf *xconf)
xconf->flags = conf->flags; xconf->flags = conf->flags;
while (cmd = TAILQ_FIRST(&conf->cmdq)) { while ((cmd = TAILQ_FIRST(&conf->cmdq)) != NULL) {
TAILQ_REMOVE(&conf->cmdq, cmd, entry); TAILQ_REMOVE(&conf->cmdq, cmd, entry);
TAILQ_INSERT_TAIL(&xconf->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_REMOVE(&conf->keybindingq, kb, entry);
TAILQ_INSERT_TAIL(&xconf->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_REMOVE(&conf->autogroupq, ag, entry);
TAILQ_INSERT_TAIL(&xconf->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_REMOVE(&conf->ignoreq, wm, entry);
TAILQ_INSERT_TAIL(&xconf->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_REMOVE(&conf->mousebindingq, mb, entry);
TAILQ_INSERT_TAIL(&xconf->mousebindingq, mb, entry); TAILQ_INSERT_TAIL(&xconf->mousebindingq, mb, entry);
} }