Convert to use the <sys/queue.h> macros rather than fiddling with the queue

structure internals.

Reviewed by:	markm
This commit is contained in:
Ben Smithurst 2000-12-29 18:04:54 +00:00
parent ccf67a960f
commit d0d78e1303
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=70486
4 changed files with 11 additions and 13 deletions

View File

@ -102,7 +102,7 @@ check_excludes(const char *fname, const char *path)
/* fnmatch(3) has a funny return value convention... */
#define MATCH(g, n) (fnmatch((g), (n), FNM_PATHNAME) == 0)
for (e = excludes.lh_first; e != 0; e = e->link.le_next) {
LIST_FOREACH(e, &excludes, link) {
if (e->pathname && MATCH(e->glob, path)
|| MATCH(e->glob, fname))
return 1;

View File

@ -420,10 +420,10 @@ cmdhelp(int mode, int which)
struct carg *
getarg(struct cargs * _args, int ch)
{
struct carg *c = _args->lh_first;
struct carg *c = LIST_FIRST(_args);
while (c != NULL && c->ch != ch)
c = c->list.le_next;
c = LIST_NEXT(c, list);
return c;
}

View File

@ -891,9 +891,9 @@ pw_gidpolicy(struct userconf * cnf, struct cargs * args, char *nam, gid_t prefer
if ((grp = GETGRNAM(nam)) != NULL)
gid = grp->gr_gid;
}
a_gid = grpargs.lh_first;
a_gid = LIST_FIRST(&grpargs);
while (a_gid != NULL) {
struct carg *t = a_gid->list.le_next;
struct carg *t = LIST_NEXT(a_gid, list);
LIST_REMOVE(a_gid, list);
a_gid = t;
}

View File

@ -378,12 +378,11 @@ make_menus(void)
if (cp->nzones < 0) {
cp->continent->nitems++;
} else {
for (zp = cp->zones.tqh_first; zp;
zp = zp->link.tqe_next) {
TAILQ_FOREACH(zp, &cp->zones, link) {
cont = zp->continent;
for (zp2 = cp->zones.tqh_first;
for (zp2 = TAILQ_FIRST(&cp->zones);
zp2->continent != cont;
zp2 = zp2->link.tqe_next)
zp2 = TAILQ_NEXT(zp2, link))
;
if (zp2 == zp)
zp->continent->nitems++;
@ -428,8 +427,7 @@ make_menus(void)
if (cp->submenu == 0)
errx(1, "malloc for submenu");
cp->nzones = 0;
for (zp = cp->zones.tqh_first; zp;
zp = zp->link.tqe_next) {
TAILQ_FOREACH(zp, &cp->zones, link) {
cont = zp->continent;
dmi = &cp->submenu[cp->nzones];
memset(dmi, 0, sizeof *dmi);
@ -441,9 +439,9 @@ make_menus(void)
dmi->selected = 0;
dmi->data = zp;
for (zp2 = cp->zones.tqh_first;
for (zp2 = TAILQ_FIRST(&cp->zones);
zp2->continent != cont;
zp2 = zp2->link.tqe_next)
zp2 = TAILQ_NEXT(zp2, link))
;
if (zp2 != zp)
continue;