Rename SIMPLEQ_* to STAILQ_* in /usr/src/usr.bin
Index: ctfconv/dw.c
===================================================================
RCS file: /cvs/src/usr.bin/ctfconv/dw.c,v
retrieving revision 1.4
diff -u -p -r1.4 dw.c
--- ctfconv/dw.c 27 Sep 2017 08:59:38 -0000 1.4
+++ ctfconv/dw.c 25 Dec 2020 16:23:20 -0000
@@ -372,7 +372,7 @@ dw_attr_parse(struct dwbuf *dwbuf, struc
return error;
}
- SIMPLEQ_INSERT_TAIL(davq, dav, dav_next);
+ STAILQ_INSERT_TAIL(davq, dav, dav_next);
return 0;
}
@@ -381,12 +381,12 @@ dw_attr_purge(struct dwaval_queue *davq)
{
struct dwaval *dav;
- while ((dav = SIMPLEQ_FIRST(davq)) != NULL) {
- SIMPLEQ_REMOVE_HEAD(davq, dav_next);
+ while ((dav = STAILQ_FIRST(davq)) != NULL) {
+ STAILQ_REMOVE_HEAD(davq, dav_next);
pfree(&dav_pool, dav);
}
- SIMPLEQ_INIT(davq);
+ STAILQ_INIT(davq);
}
static int
@@ -412,7 +412,7 @@ dw_die_parse(struct dwbuf *dwbuf, size_t
continue;
}
- SIMPLEQ_FOREACH(dab, dabq, dab_next) {
+ STAILQ_FOREACH(dab, dabq, dab_next) {
if (dab->dab_code == code)
break;
}
@@ -426,9 +426,9 @@ dw_die_parse(struct dwbuf *dwbuf, size_t
die->die_lvl = lvl;
die->die_dab = dab;
die->die_offset = doff;
- SIMPLEQ_INIT(&die->die_avals);
+ STAILQ_INIT(&die->die_avals);
- SIMPLEQ_FOREACH(dat, &dab->dab_attrs, dat_next) {
+ STAILQ_FOREACH(dat, &dab->dab_attrs, dat_next) {
error = dw_attr_parse(dwbuf, dat, psz, &die->die_avals);
if (error != 0) {
dw_attr_purge(&die->die_avals);
@@ -439,7 +439,7 @@ dw_die_parse(struct dwbuf *dwbuf, size_t
if (dab->dab_children == DW_CHILDREN_yes)
lvl++;
- SIMPLEQ_INSERT_TAIL(dieq, die, die_next);
+ STAILQ_INSERT_TAIL(dieq, die, die_next);
}
return 0;
@@ -450,13 +450,13 @@ dw_die_purge(struct dwdie_queue *dieq)
{
struct dwdie *die;
- while ((die = SIMPLEQ_FIRST(dieq)) != NULL) {
- SIMPLEQ_REMOVE_HEAD(dieq, die_next);
+ while ((die = STAILQ_FIRST(dieq)) != NULL) {
+ STAILQ_REMOVE_HEAD(dieq, die_next);
dw_attr_purge(&die->die_avals);
pfree(&die_pool, die);
}
- SIMPLEQ_INIT(dieq);
+ STAILQ_INIT(dieq);
}
int
@@ -484,9 +484,9 @@ dw_ab_parse(struct dwbuf *abseg, struct
dab->dab_code = code;
dab->dab_tag = tag;
dab->dab_children = children;
- SIMPLEQ_INIT(&dab->dab_attrs);
+ STAILQ_INIT(&dab->dab_attrs);
- SIMPLEQ_INSERT_TAIL(dabq, dab, dab_next);
+ STAILQ_INSERT_TAIL(dabq, dab, dab_next);
for (;;) {
struct dwattr *dat;
@@ -506,7 +506,7 @@ dw_ab_parse(struct dwbuf *abseg, struct
dat->dat_attr = attr;
dat->dat_form = form;
- SIMPLEQ_INSERT_TAIL(&dab->dab_attrs, dat, dat_next);
+ STAILQ_INSERT_TAIL(&dab->dab_attrs, dat, dat_next);
}
}
@@ -518,19 +518,19 @@ dw_dabq_purge(struct dwabbrev_queue *dab
{
struct dwabbrev *dab;
- while ((dab = SIMPLEQ_FIRST(dabq)) != NULL) {
+ while ((dab = STAILQ_FIRST(dabq)) != NULL) {
struct dwattr *dat;
- SIMPLEQ_REMOVE_HEAD(dabq, dab_next);
- while ((dat = SIMPLEQ_FIRST(&dab->dab_attrs)) != NULL) {
- SIMPLEQ_REMOVE_HEAD(&dab->dab_attrs, dat_next);
+ STAILQ_REMOVE_HEAD(dabq, dab_next);
+ while ((dat = STAILQ_FIRST(&dab->dab_attrs)) != NULL) {
+ STAILQ_REMOVE_HEAD(&dab->dab_attrs, dat_next);
pfree(&dat_pool, dat);
}
pfree(&dab_pool, dab);
}
- SIMPLEQ_INIT(dabq);
+ STAILQ_INIT(dabq);
}
int
@@ -599,8 +599,8 @@ dw_cu_parse(struct dwbuf *info, struct d
dcu->dcu_version = version;
dcu->dcu_abbroff = abbroff;
dcu->dcu_psize = psz;
- SIMPLEQ_INIT(&dcu->dcu_abbrevs);
- SIMPLEQ_INIT(&dcu->dcu_dies);
+ STAILQ_INIT(&dcu->dcu_abbrevs);
+ STAILQ_INIT(&dcu->dcu_dies);
error = dw_ab_parse(&abseg, &dcu->dcu_abbrevs);
if (error != 0) {
Index: ctfconv/dw.h
===================================================================
RCS file: /cvs/src/usr.bin/ctfconv/dw.h,v
retrieving revision 1.2
diff -u -p -r1.2 dw.h
--- ctfconv/dw.h 11 Aug 2017 14:58:56 -0000 1.2
+++ ctfconv/dw.h 25 Dec 2020 16:23:20 -0000
@@ -25,13 +25,13 @@ struct dwbuf {
};
struct dwattr {
- SIMPLEQ_ENTRY(dwattr) dat_next;
+ STAILQ_ENTRY(dwattr) dat_next;
uint64_t dat_attr;
uint64_t dat_form;
};
struct dwaval {
- SIMPLEQ_ENTRY(dwaval) dav_next;
+ STAILQ_ENTRY(dwaval) dav_next;
struct dwattr *dav_dat; /* corresponding attribute */
union {
struct dwbuf _buf;
@@ -55,27 +55,27 @@ struct dwaval {
#define dav_u8 AV._V._T._u8
};
-SIMPLEQ_HEAD(dwaval_queue, dwaval);
+STAILQ_HEAD(dwaval_queue, dwaval);
struct dwdie {
- SIMPLEQ_ENTRY(dwdie) die_next;
+ STAILQ_ENTRY(dwdie) die_next;
struct dwabbrev *die_dab;
size_t die_offset;
uint8_t die_lvl;
struct dwaval_queue die_avals;
};
-SIMPLEQ_HEAD(dwdie_queue, dwdie);
+STAILQ_HEAD(dwdie_queue, dwdie);
struct dwabbrev {
- SIMPLEQ_ENTRY(dwabbrev) dab_next;
+ STAILQ_ENTRY(dwabbrev) dab_next;
uint64_t dab_code;
uint64_t dab_tag;
uint8_t dab_children;
- SIMPLEQ_HEAD(, dwattr) dab_attrs;
+ STAILQ_HEAD(, dwattr) dab_attrs;
};
-SIMPLEQ_HEAD(dwabbrev_queue, dwabbrev);
+STAILQ_HEAD(dwabbrev_queue, dwabbrev);
struct dwcu {
uint64_t dcu_length;
Index: ctfconv/itype.h
===================================================================
RCS file: /cvs/src/usr.bin/ctfconv/itype.h,v
retrieving revision 1.5
diff -u -p -r1.5 itype.h
--- ctfconv/itype.h 11 Nov 2019 19:10:35 -0000 1.5
+++ ctfconv/itype.h 25 Dec 2020 16:23:20 -0000
@@ -36,7 +36,7 @@ struct itype {
TAILQ_ENTRY(itype) it_symb; /* itype: global queue of symbol */
RB_ENTRY(itype) it_node; /* itype: per-type tree of types */
- SIMPLEQ_HEAD(, itref) it_refs; /* itype: backpointing refs */
+ STAILQ_HEAD(, itref) it_refs; /* itype: backpointing refs */
TAILQ_HEAD(, imember) it_members;/* itype: members of struct/union */
@@ -83,7 +83,7 @@ struct imember {
* merging duplicated types.
*/
struct itref {
- SIMPLEQ_ENTRY(itref) ir_next;
+ STAILQ_ENTRY(itref) ir_next;
struct itype *ir_itp;
};
Index: ctfconv/parse.c
===================================================================
RCS file: /cvs/src/usr.bin/ctfconv/parse.c,v
retrieving revision 1.13
diff -u -p -r1.13 parse.c
--- ctfconv/parse.c 7 Nov 2019 13:42:54 -0000 1.13
+++ ctfconv/parse.c 25 Dec 2020 16:23:20 -0000
@@ -203,7 +203,7 @@ it_new(uint64_t index, size_t off, const
assert((name != NULL) || !(flags & (ITF_FUNC|ITF_OBJ)));
it = pmalloc(&it_pool, sizeof(*it));
- SIMPLEQ_INIT(&it->it_refs);
+ STAILQ_INIT(&it->it_refs);
TAILQ_INIT(&it->it_members);
it->it_off = off;
it->it_ref = ref;
@@ -258,7 +258,7 @@ it_merge(struct itype *fwd, struct itype
assert(fwd->it_flags & ITF_FORWARD);
assert(fwd->it_type == it->it_type);
assert(TAILQ_EMPTY(&fwd->it_members));
- assert(SIMPLEQ_EMPTY(&it->it_refs));
+ assert(STAILQ_EMPTY(&it->it_refs));
fwd->it_off = it->it_off;
fwd->it_ref = it->it_ref;
@@ -366,14 +366,14 @@ ir_add(struct itype *it, struct itype *t
{
struct itref *ir;
- SIMPLEQ_FOREACH(ir, &tmp->it_refs, ir_next) {
+ STAILQ_FOREACH(ir, &tmp->it_refs, ir_next) {
if (ir->ir_itp == it)
return;
}
ir = pmalloc(&ir_pool, sizeof(*ir));
ir->ir_itp = it;
- SIMPLEQ_INSERT_TAIL(&tmp->it_refs, ir, ir_next);
+ STAILQ_INSERT_TAIL(&tmp->it_refs, ir, ir_next);
}
void
@@ -381,8 +381,8 @@ ir_purge(struct itype *it)
{
struct itref *ir;
- while ((ir = SIMPLEQ_FIRST(&it->it_refs)) != NULL) {
- SIMPLEQ_REMOVE_HEAD(&it->it_refs, ir_next);
+ while ((ir = STAILQ_FIRST(&it->it_refs)) != NULL) {
+ STAILQ_REMOVE_HEAD(&it->it_refs, ir_next);
pfree(&ir_pool, ir);
}
}
@@ -548,10 +548,10 @@ cu_merge(struct dwcu *dcu, struct itype_
struct imember *im;
/* Substitute references */
- while ((ir = SIMPLEQ_FIRST(&old->it_refs)) != NULL) {
+ while ((ir = STAILQ_FIRST(&old->it_refs)) != NULL) {
it = ir->ir_itp;
- SIMPLEQ_REMOVE_HEAD(&old->it_refs, ir_next);
+ STAILQ_REMOVE_HEAD(&old->it_refs, ir_next);
pfree(&ir_pool, ir);
if (it->it_refp == old)
@@ -617,7 +617,7 @@ cu_parse(struct dwcu *dcu, struct itype_
assert(RB_EMPTY(cuot));
- SIMPLEQ_FOREACH(die, &dcu->dcu_dies, die_next) {
+ STAILQ_FOREACH(die, &dcu->dcu_dies, die_next) {
uint64_t tag = die->die_dab->dab_tag;
switch (tag) {
@@ -728,7 +728,7 @@ parse_base(struct dwdie *die, size_t psz
uint16_t encoding, enc = 0, bits = 0;
int type;
- SIMPLEQ_FOREACH(dav, &die->die_avals, dav_next) {
+ STAILQ_FOREACH(dav, &die->die_avals, dav_next) {
switch (dav->dav_dat->dat_attr) {
case DW_AT_encoding:
enc = dav2val(dav, psz);
@@ -810,7 +810,7 @@ parse_refers(struct dwdie *die, size_t p
const char *name = NULL;
size_t ref = 0, size = 0;
- SIMPLEQ_FOREACH(dav, &die->die_avals, dav_next) {
+ STAILQ_FOREACH(dav, &die->die_avals, dav_next) {
switch (dav->dav_dat->dat_attr) {
case DW_AT_name:
name = dav2str(dav);
@@ -851,7 +851,7 @@ parse_array(struct dwdie *die, size_t ps
const char *name = NULL;
size_t ref = 0;
- SIMPLEQ_FOREACH(dav, &die->die_avals, dav_next) {
+ STAILQ_FOREACH(dav, &die->die_avals, dav_next) {
switch (dav->dav_dat->dat_attr) {
case DW_AT_name:
name = dav2str(dav);
@@ -881,7 +881,7 @@ parse_enum(struct dwdie *die, size_t psz
const char *name = NULL;
size_t size = 0;
- SIMPLEQ_FOREACH(dav, &die->die_avals, dav_next) {
+ STAILQ_FOREACH(dav, &die->die_avals, dav_next) {
switch (dav->dav_dat->dat_attr) {
case DW_AT_byte_size:
size = dav2val(dav, psz);
@@ -917,14 +917,14 @@ subparse_subrange(struct dwdie *die, siz
* This loop assumes that the children of a DIE are just
* after it on the list.
*/
- while ((die = SIMPLEQ_NEXT(die, die_next)) != NULL) {
+ while ((die = STAILQ_NEXT(die, die_next)) != NULL) {
uint64_t tag = die->die_dab->dab_tag;
size_t nelems = 0;
if (tag != DW_TAG_subrange_type)
break;
- SIMPLEQ_FOREACH(dav, &die->die_avals, dav_next) {
+ STAILQ_FOREACH(dav, &die->die_avals, dav_next) {
switch (dav->dav_dat->dat_attr) {
case DW_AT_count:
nelems = dav2val(dav, psz);
@@ -959,7 +959,7 @@ subparse_enumerator(struct dwdie *die, s
* This loop assumes that the children of a DIE are just
* after it on the list.
*/
- while ((die = SIMPLEQ_NEXT(die, die_next)) != NULL) {
+ while ((die = STAILQ_NEXT(die, die_next)) != NULL) {
uint64_t tag = die->die_dab->dab_tag;
size_t val = 0;
const char *name = NULL;
@@ -967,7 +967,7 @@ subparse_enumerator(struct dwdie *die, s
if (tag != DW_TAG_enumerator)
break;
- SIMPLEQ_FOREACH(dav, &die->die_avals, dav_next) {
+ STAILQ_FOREACH(dav, &die->die_avals, dav_next) {
switch (dav->dav_dat->dat_attr) {
case DW_AT_name:
name = dav2str(dav);
@@ -1004,7 +1004,7 @@ parse_struct(struct dwdie *die, size_t p
size_t size = 0;
int forward = 0;
- SIMPLEQ_FOREACH(dav, &die->die_avals, dav_next) {
+ STAILQ_FOREACH(dav, &die->die_avals, dav_next) {
switch (dav->dav_dat->dat_attr) {
case DW_AT_declaration:
forward = dav2val(dav, psz);
@@ -1049,7 +1049,7 @@ subparse_member(struct dwdie *die, size_
* This loop assumes that the children of a DIE are just
* after it on the list.
*/
- while ((die = SIMPLEQ_NEXT(die, die_next)) != NULL) {
+ while ((die = STAILQ_NEXT(die, die_next)) != NULL) {
int64_t tag = die->die_dab->dab_tag;
name = NULL;
@@ -1072,7 +1072,7 @@ subparse_member(struct dwdie *die, size_
it->it_flags |= ITF_UNRES_MEMB;
- SIMPLEQ_FOREACH(dav, &die->die_avals, dav_next) {
+ STAILQ_FOREACH(dav, &die->die_avals, dav_next) {
switch (dav->dav_dat->dat_attr) {
case DW_AT_name:
name = dav2str(dav);
@@ -1126,7 +1126,7 @@ subparse_arguments(struct dwdie *die, si
* This loop assumes that the children of a DIE are after it
* on the list.
*/
- while ((die = SIMPLEQ_NEXT(die, die_next)) != NULL) {
+ while ((die = STAILQ_NEXT(die, die_next)) != NULL) {
uint64_t tag = die->die_dab->dab_tag;
if (tag == DW_TAG_unspecified_parameters) {
@@ -1157,7 +1157,7 @@ subparse_arguments(struct dwdie *die, si
it->it_flags |= ITF_UNRES_MEMB;
- SIMPLEQ_FOREACH(dav, &die->die_avals, dav_next) {
+ STAILQ_FOREACH(dav, &die->die_avals, dav_next) {
switch (dav->dav_dat->dat_attr) {
case DW_AT_type:
ref = dav2val(dav, psz);
@@ -1184,7 +1184,7 @@ parse_function(struct dwdie *die, size_t
const char *name = NULL;
size_t ref = 0;
- SIMPLEQ_FOREACH(dav, &die->die_avals, dav_next) {
+ STAILQ_FOREACH(dav, &die->die_avals, dav_next) {
switch (dav->dav_dat->dat_attr) {
case DW_AT_name:
name = dav2str(dav);
@@ -1234,7 +1234,7 @@ parse_funcptr(struct dwdie *die, size_t
const char *name = NULL;
size_t ref = 0;
- SIMPLEQ_FOREACH(dav, &die->die_avals, dav_next) {
+ STAILQ_FOREACH(dav, &die->die_avals, dav_next) {
switch (dav->dav_dat->dat_attr) {
case DW_AT_name:
name = dav2str(dav);
@@ -1272,7 +1272,7 @@ parse_variable(struct dwdie *die, size_t
size_t ref = 0;
int forward = 0, global = 0;
- SIMPLEQ_FOREACH(dav, &die->die_avals, dav_next) {
+ STAILQ_FOREACH(dav, &die->die_avals, dav_next) {
switch (dav->dav_dat->dat_attr) {
case DW_AT_declaration:
forward = dav2val(dav, psz);
Index: ctfconv/pool.c
===================================================================
RCS file: /cvs/src/usr.bin/ctfconv/pool.c,v
retrieving revision 1.3
diff -u -p -r1.3 pool.c
--- ctfconv/pool.c 29 Aug 2017 21:10:20 -0000 1.3
+++ ctfconv/pool.c 25 Dec 2020 16:23:20 -0000
@@ -36,7 +36,7 @@ struct pool_item {
SLIST_ENTRY(pool_item) pi_list;
};
-SIMPLEQ_HEAD(, pool) pool_head = SIMPLEQ_HEAD_INITIALIZER(pool_head);
+STAILQ_HEAD(, pool) pool_head = STAILQ_HEAD_INITIALIZER(pool_head);
void
pool_init(struct pool *pp, const char *name, size_t nmemb, size_t size)
@@ -50,7 +50,7 @@ pool_init(struct pool *pp, const char *n
pp->pr_nitems = 0;
pp->pr_nfree = 0;
- SIMPLEQ_INSERT_TAIL(&pool_head, pp, pr_list);
+ STAILQ_INSERT_TAIL(&pool_head, pp, pr_list);
}
void *
@@ -98,7 +98,7 @@ pool_dump(void)
{
struct pool *pp;
- SIMPLEQ_FOREACH(pp, &pool_head, pr_list)
+ STAILQ_FOREACH(pp, &pool_head, pr_list)
printf("%s: %zd items, %zd free\n", pp->pr_name, pp->pr_nitems,
pp->pr_nfree);
}
Index: ctfconv/pool.h
===================================================================
RCS file: /cvs/src/usr.bin/ctfconv/pool.h,v
retrieving revision 1.2
diff -u -p -r1.2 pool.h
--- ctfconv/pool.h 11 Aug 2017 14:58:56 -0000 1.2
+++ ctfconv/pool.h 25 Dec 2020 16:23:20 -0000
@@ -22,7 +22,7 @@
#ifndef NOPOOL
struct pool {
- SIMPLEQ_ENTRY(pool) pr_list; /* list of all pools */
+ STAILQ_ENTRY(pool) pr_list; /* list of all pools */
const char *pr_name; /* identifier */
SLIST_HEAD(, pool_item) pr_free; /* free list */
size_t pr_nmemb; /* # of items per allocation */
Index: paste/paste.c
===================================================================
RCS file: /cvs/src/usr.bin/paste/paste.c,v
retrieving revision 1.26
diff -u -p -r1.26 paste.c
--- paste/paste.c 4 Aug 2018 19:19:37 -0000 1.26
+++ paste/paste.c 25 Dec 2020 16:23:20 -0000
@@ -93,7 +93,7 @@ main(int argc, char *argv[])
}
struct list {
- SIMPLEQ_ENTRY(list) entries;
+ STAILQ_ENTRY(list) entries;
FILE *fp;
int cnt;
char *name;
@@ -102,7 +102,7 @@ struct list {
void
parallel(char **argv)
{
- SIMPLEQ_HEAD(, list) head = SIMPLEQ_HEAD_INITIALIZER(head);
+ STAILQ_HEAD(, list) head = STAILQ_HEAD_INITIALIZER(head);
struct list *lp;
char *line, *p;
size_t linesize;
@@ -121,7 +121,7 @@ parallel(char **argv)
err(1, "%s", p);
lp->cnt = cnt;
lp->name = p;
- SIMPLEQ_INSERT_TAIL(&head, lp, entries);
+ STAILQ_INSERT_TAIL(&head, lp, entries);
}
line = NULL;
@@ -129,7 +129,7 @@ parallel(char **argv)
for (opencnt = cnt; opencnt;) {
output = 0;
- SIMPLEQ_FOREACH(lp, &head, entries) {
+ STAILQ_FOREACH(lp, &head, entries) {
if (lp->fp == NULL) {
if (output && lp->cnt &&
(ch = delim[(lp->cnt - 1) % delimcnt]))
Index: sdiff/sdiff.c
===================================================================
RCS file: /cvs/src/usr.bin/sdiff/sdiff.c,v
retrieving revision 1.37
diff -u -p -r1.37 sdiff.c
--- sdiff/sdiff.c 28 Sep 2018 18:21:52 -0000 1.37
+++ sdiff/sdiff.c 25 Dec 2020 16:23:20 -0000
@@ -36,7 +36,7 @@
/* A single diff line. */
struct diffline {
- SIMPLEQ_ENTRY(diffline) diffentries;
+ STAILQ_ENTRY(diffline) diffentries;
char *left;
char div;
char *right;
@@ -58,7 +58,7 @@ static void prompt(const char *, const c
__dead static void usage(void);
static char *xfgets(FILE *);
-SIMPLEQ_HEAD(, diffline) diffhead = SIMPLEQ_HEAD_INITIALIZER(diffhead);
+STAILQ_HEAD(, diffline) diffhead = STAILQ_HEAD_INITIALIZER(diffhead);
size_t line_width; /* width of a line (two columns and divider) */
size_t width; /* width of each column */
size_t file1ln, file2ln; /* line number of file1 and file2 */
@@ -782,7 +782,7 @@ enqueue(char *left, char div, char *righ
diffp->left = left;
diffp->div = div;
diffp->right = right;
- SIMPLEQ_INSERT_TAIL(&diffhead, diffp, diffentries);
+ STAILQ_INSERT_TAIL(&diffhead, diffp, diffentries);
}
/*
@@ -873,11 +873,11 @@ processq(void)
char divc, *left, *right;
/* Don't process empty queue. */
- if (SIMPLEQ_EMPTY(&diffhead))
+ if (STAILQ_EMPTY(&diffhead))
return;
/* Remember the divider. */
- divc = SIMPLEQ_FIRST(&diffhead)->div;
+ divc = STAILQ_FIRST(&diffhead)->div;
left = NULL;
right = NULL;
@@ -885,7 +885,7 @@ processq(void)
* Go through set of diffs, concatenating each line in left or
* right column into two long strings, `left' and `right'.
*/
- SIMPLEQ_FOREACH(diffp, &diffhead, diffentries) {
+ STAILQ_FOREACH(diffp, &diffhead, diffentries) {
/*
* Print changed lines if -s was given,
* print all lines if -s was not given.
@@ -902,9 +902,9 @@ processq(void)
}
/* Empty queue and free each diff line and its elements. */
- while (!SIMPLEQ_EMPTY(&diffhead)) {
- diffp = SIMPLEQ_FIRST(&diffhead);
- SIMPLEQ_REMOVE_HEAD(&diffhead, diffentries);
+ while (!STAILQ_EMPTY(&diffhead)) {
+ diffp = STAILQ_FIRST(&diffhead);
+ STAILQ_REMOVE_HEAD(&diffhead, diffentries);
freediff(diffp);
}
@@ -951,10 +951,10 @@ static void
printc(FILE *file1, size_t file1end, FILE *file2, size_t file2end)
{
struct fileline {
- SIMPLEQ_ENTRY(fileline) fileentries;
+ STAILQ_ENTRY(fileline) fileentries;
char *line;
};
- SIMPLEQ_HEAD(, fileline) delqhead = SIMPLEQ_HEAD_INITIALIZER(delqhead);
+ STAILQ_HEAD(, fileline) delqhead = STAILQ_HEAD_INITIALIZER(delqhead);
/* Read lines to be deleted. */
for (; file1ln <= file1end; ++file1ln) {
@@ -969,11 +969,11 @@ printc(FILE *file1, size_t file1end, FIL
if (!(linep = malloc(sizeof(struct fileline))))
err(2, "printc");
linep->line = line1;
- SIMPLEQ_INSERT_TAIL(&delqhead, linep, fileentries);
+ STAILQ_INSERT_TAIL(&delqhead, linep, fileentries);
}
/* Process changed lines.. */
- for (; !SIMPLEQ_EMPTY(&delqhead) && file2ln <= file2end;
+ for (; !STAILQ_EMPTY(&delqhead) && file2ln <= file2end;
++file2ln) {
struct fileline *del;
char *add;
@@ -982,9 +982,9 @@ printc(FILE *file1, size_t file1end, FIL
if (!(add = xfgets(file2)))
errx(2, "error reading add in change");
- del = SIMPLEQ_FIRST(&delqhead);
+ del = STAILQ_FIRST(&delqhead);
enqueue(del->line, '|', add);
- SIMPLEQ_REMOVE_HEAD(&delqhead, fileentries);
+ STAILQ_REMOVE_HEAD(&delqhead, fileentries);
/*
* Free fileline structure but not its elements since
* they are queued up.
@@ -1006,12 +1006,12 @@ printc(FILE *file1, size_t file1end, FIL
processq();
/* Process remaining lines to delete. */
- while (!SIMPLEQ_EMPTY(&delqhead)) {
+ while (!STAILQ_EMPTY(&delqhead)) {
struct fileline *filep;
- filep = SIMPLEQ_FIRST(&delqhead);
+ filep = STAILQ_FIRST(&delqhead);
enqueue(filep->line, '<', NULL);
- SIMPLEQ_REMOVE_HEAD(&delqhead, fileentries);
+ STAILQ_REMOVE_HEAD(&delqhead, fileentries);
free(filep);
}
processq();
Index: vmstat/vmstat.c
===================================================================
RCS file: /cvs/src/usr.bin/vmstat/vmstat.c,v
retrieving revision 1.150
diff -u -p -r1.150 vmstat.c
--- vmstat/vmstat.c 28 Nov 2019 16:27:26 -0000 1.150
+++ vmstat/vmstat.c 25 Dec 2020 16:23:20 -0000
@@ -1027,14 +1027,14 @@ dopool_sysctl(void)
void
dopool_kvm(void)
{
- SIMPLEQ_HEAD(,pool) pool_head;
+ STAILQ_HEAD(,pool) pool_head;
struct pool pool, *pp = &pool;
struct kinfo_pool pi;
long total = 0, inuse = 0;
u_long addr;
kread(X_POOLHEAD, &pool_head, sizeof(pool_head));
- addr = (u_long)SIMPLEQ_FIRST(&pool_head);
+ addr = (u_long)STAILQ_FIRST(&pool_head);
while (addr != 0) {
char name[32];
@@ -1076,7 +1076,7 @@ dopool_kvm(void)
inuse += (pi.pr_nget - pi.pr_nput) * pi.pr_size;
total += pi.pr_npages * pi.pr_pgsize;
- addr = (u_long)SIMPLEQ_NEXT(pp, pr_poollist);
+ addr = (u_long)STAILQ_NEXT(pp, pr_poollist);
}
inuse /= 1024;