summaryrefslogtreecommitdiff
path: root/usr.bin/vi/common/api.c
diff options
context:
space:
mode:
authorPierre-Yves Ritschard <pyr@cvs.openbsd.org>2007-05-14 12:32:30 +0000
committerPierre-Yves Ritschard <pyr@cvs.openbsd.org>2007-05-14 12:32:30 +0000
commit90dd085fee995925a925a00bbf035d6f03cca3c0 (patch)
tree46a962f512b5c4aabbe912fbb63af2e743101d6a /usr.bin/vi/common/api.c
parentb5c62abed48b5d9ad76863db362da20fa3f63928 (diff)
use sys/queue macros instead of accessing fields directly.
no binary change. ok krw@
Diffstat (limited to 'usr.bin/vi/common/api.c')
-rw-r--r--usr.bin/vi/common/api.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/usr.bin/vi/common/api.c b/usr.bin/vi/common/api.c
index 1c796467336..23ed2ec0ac7 100644
--- a/usr.bin/vi/common/api.c
+++ b/usr.bin/vi/common/api.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: api.c,v 1.12 2003/04/15 08:08:02 deraadt Exp $ */
+/* $OpenBSD: api.c,v 1.13 2007/05/14 12:32:29 pyr Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -51,8 +51,7 @@ api_fscreen(id, name)
gp = __global_list;
/* Search the displayed list. */
- for (tsp = gp->dq.cqh_first;
- tsp != (void *)&gp->dq; tsp = tsp->q.cqe_next)
+ CIRCLEQ_FOREACH(tsp, &gp->dq, q)
if (name == NULL) {
if (id == tsp->id)
return (tsp);
@@ -60,8 +59,7 @@ api_fscreen(id, name)
return (tsp);
/* Search the hidden list. */
- for (tsp = gp->hq.cqh_first;
- tsp != (void *)&gp->hq; tsp = tsp->q.cqe_next)
+ CIRCLEQ_FOREACH(tsp, &gp->hq, q)
if (name == NULL) {
if (id == tsp->id)
return (tsp);
@@ -214,11 +212,11 @@ api_nextmark(sp, next, namep)
{
LMARK *mp;
- mp = sp->ep->marks.lh_first;
+ mp = LIST_FIRST(&sp->ep->marks);
if (next)
- for (; mp != NULL; mp = mp->q.le_next)
+ LIST_FOREACH(mp, &sp->ep->marks, q)
if (mp->name == *namep) {
- mp = mp->q.le_next;
+ mp = LIST_NEXT(mp, q);
break;
}
if (mp == NULL)