Module Name: src
Committed By: rillig
Date: Wed Dec 30 10:46:11 UTC 2020
Modified Files:
src/usr.bin/xlint/common: emit.c lint.h
src/usr.bin/xlint/lint1: emit1.c func.c init.c lint1.h mem1.c scan.l
src/usr.bin/xlint/lint2: chk.c lint2.h read.c
Log Message:
lint: rename more _nxt members to _next
To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/xlint/common/emit.c
cvs rdiff -u -r1.17 -r1.18 src/usr.bin/xlint/common/lint.h
cvs rdiff -u -r1.26 -r1.27 src/usr.bin/xlint/lint1/emit1.c
cvs rdiff -u -r1.32 -r1.33 src/usr.bin/xlint/lint1/func.c
cvs rdiff -u -r1.45 -r1.46 src/usr.bin/xlint/lint1/init.c
cvs rdiff -u -r1.39 -r1.40 src/usr.bin/xlint/lint1/lint1.h
cvs rdiff -u -r1.20 -r1.21 src/usr.bin/xlint/lint1/mem1.c
cvs rdiff -u -r1.99 -r1.100 src/usr.bin/xlint/lint1/scan.l
cvs rdiff -u -r1.28 -r1.29 src/usr.bin/xlint/lint2/chk.c
cvs rdiff -u -r1.10 -r1.11 src/usr.bin/xlint/lint2/lint2.h
cvs rdiff -u -r1.32 -r1.33 src/usr.bin/xlint/lint2/read.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/xlint/common/emit.c
diff -u src/usr.bin/xlint/common/emit.c:1.7 src/usr.bin/xlint/common/emit.c:1.8
--- src/usr.bin/xlint/common/emit.c:1.7 Mon Dec 28 21:24:55 2020
+++ src/usr.bin/xlint/common/emit.c Wed Dec 30 10:46:11 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: emit.c,v 1.7 2020/12/28 21:24:55 rillig Exp $ */
+/* $NetBSD: emit.c,v 1.8 2020/12/30 10:46:11 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: emit.c,v 1.7 2020/12/28 21:24:55 rillig Exp $");
+__RCSID("$NetBSD: emit.c,v 1.8 2020/12/30 10:46:11 rillig Exp $");
#endif
#include <ctype.h>
@@ -71,7 +71,7 @@ outopen(const char *name)
/* Create output buffer */
ob.o_len = 1024;
- ob.o_end = (ob.o_buf = ob.o_nxt = xmalloc(ob.o_len)) + ob.o_len;
+ ob.o_end = (ob.o_buf = ob.o_next = xmalloc(ob.o_len)) + ob.o_len;
}
/*
@@ -94,10 +94,10 @@ outxbuf(void)
{
ptrdiff_t coffs;
- coffs = ob.o_nxt - ob.o_buf;
+ coffs = ob.o_next - ob.o_buf;
ob.o_len *= 2;
ob.o_end = (ob.o_buf = xrealloc(ob.o_buf, ob.o_len)) + ob.o_len;
- ob.o_nxt = ob.o_buf + coffs;
+ ob.o_next = ob.o_buf + coffs;
}
/*
@@ -109,14 +109,14 @@ outclr(void)
{
size_t sz;
- if (ob.o_buf != ob.o_nxt) {
+ if (ob.o_buf != ob.o_next) {
outchar('\n');
- sz = ob.o_nxt - ob.o_buf;
+ sz = ob.o_next - ob.o_buf;
if (sz > ob.o_len)
errx(1, "internal error: outclr() 1");
if (fwrite(ob.o_buf, sz, 1, lout) != 1)
err(1, "cannot write to %s", loname);
- ob.o_nxt = ob.o_buf;
+ ob.o_next = ob.o_buf;
}
}
@@ -127,9 +127,9 @@ void
outchar(int c)
{
- if (ob.o_nxt == ob.o_end)
+ if (ob.o_next == ob.o_end)
outxbuf();
- *ob.o_nxt++ = (char)c;
+ *ob.o_next++ = (char)c;
}
/*
@@ -193,9 +193,9 @@ outstrg(const char *s)
{
while (*s != '\0') {
- if (ob.o_nxt == ob.o_end)
+ if (ob.o_next == ob.o_end)
outxbuf();
- *ob.o_nxt++ = *s++;
+ *ob.o_next++ = *s++;
}
}
@@ -206,9 +206,9 @@ void
outint(int i)
{
- if ((size_t)(ob.o_end - ob.o_nxt) < 3 * sizeof (int))
+ if ((size_t)(ob.o_end - ob.o_next) < 3 * sizeof (int))
outxbuf();
- ob.o_nxt += sprintf(ob.o_nxt, "%d", i);
+ ob.o_next += sprintf(ob.o_next, "%d", i);
}
/*
Index: src/usr.bin/xlint/common/lint.h
diff -u src/usr.bin/xlint/common/lint.h:1.17 src/usr.bin/xlint/common/lint.h:1.18
--- src/usr.bin/xlint/common/lint.h:1.17 Mon Dec 28 21:24:55 2020
+++ src/usr.bin/xlint/common/lint.h Wed Dec 30 10:46:11 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: lint.h,v 1.17 2020/12/28 21:24:55 rillig Exp $ */
+/* $NetBSD: lint.h,v 1.18 2020/12/30 10:46:11 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -131,7 +131,7 @@ typedef struct ob {
char *o_buf; /* buffer */
char *o_end; /* first byte after buffer */
size_t o_len; /* length of buffer */
- char *o_nxt; /* next free byte in buffer */
+ char *o_next; /* next free byte in buffer */
} ob_t;
typedef struct type type_t;
Index: src/usr.bin/xlint/lint1/emit1.c
diff -u src/usr.bin/xlint/lint1/emit1.c:1.26 src/usr.bin/xlint/lint1/emit1.c:1.27
--- src/usr.bin/xlint/lint1/emit1.c:1.26 Wed Dec 30 10:26:12 2020
+++ src/usr.bin/xlint/lint1/emit1.c Wed Dec 30 10:46:11 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: emit1.c,v 1.26 2020/12/30 10:26:12 rillig Exp $ */
+/* $NetBSD: emit1.c,v 1.27 2020/12/30 10:46:11 rillig Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: emit1.c,v 1.26 2020/12/30 10:26:12 rillig Exp $");
+__RCSID("$NetBSD: emit1.c,v 1.27 2020/12/30 10:46:11 rillig Exp $");
#endif
#include <ctype.h>
@@ -173,13 +173,13 @@ ttos(type_t *tp)
if (tob.o_buf == NULL) {
tob.o_len = 64;
- tob.o_buf = tob.o_nxt = xmalloc(tob.o_len);
+ tob.o_buf = tob.o_next = xmalloc(tob.o_len);
tob.o_end = tob.o_buf + tob.o_len;
}
tmp = ob;
ob = tob;
- ob.o_nxt = ob.o_buf;
+ ob.o_next = ob.o_buf;
outtype(tp);
outchar('\0');
tob = ob;
Index: src/usr.bin/xlint/lint1/func.c
diff -u src/usr.bin/xlint/lint1/func.c:1.32 src/usr.bin/xlint/lint1/func.c:1.33
--- src/usr.bin/xlint/lint1/func.c:1.32 Wed Dec 30 10:26:12 2020
+++ src/usr.bin/xlint/lint1/func.c Wed Dec 30 10:46:11 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: func.c,v 1.32 2020/12/30 10:26:12 rillig Exp $ */
+/* $NetBSD: func.c,v 1.33 2020/12/30 10:46:11 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: func.c,v 1.32 2020/12/30 10:26:12 rillig Exp $");
+__RCSID("$NetBSD: func.c,v 1.33 2020/12/30 10:46:11 rillig Exp $");
#endif
#include <stdlib.h>
@@ -159,7 +159,7 @@ pushctrl(int env)
ci = xcalloc(1, sizeof (cstk_t));
ci->c_env = env;
- ci->c_nxt = cstk;
+ ci->c_next = cstk;
cstk = ci;
}
@@ -175,10 +175,10 @@ popctrl(int env)
if (cstk == NULL || cstk->c_env != env)
LERROR("popctrl()");
- cstk = (ci = cstk)->c_nxt;
+ cstk = (ci = cstk)->c_next;
while ((cl = ci->c_clst) != NULL) {
- ci->c_clst = cl->cl_nxt;
+ ci->c_clst = cl->cl_next;
free(cl);
}
@@ -432,7 +432,7 @@ label(int typ, sym_t *sym, tnode_t *tn)
case T_CASE:
/* find the stack entry for the innermost switch statement */
- for (ci = cstk; ci != NULL && !ci->c_switch; ci = ci->c_nxt)
+ for (ci = cstk; ci != NULL && !ci->c_switch; ci = ci->c_next)
continue;
if (ci == NULL) {
@@ -478,7 +478,7 @@ label(int typ, sym_t *sym, tnode_t *tn)
free(v);
/* look if we had this value already */
- for (cl = ci->c_clst; cl != NULL; cl = cl->cl_nxt) {
+ for (cl = ci->c_clst; cl != NULL; cl = cl->cl_next) {
if (cl->cl_val.v_quad == nv.v_quad)
break;
}
@@ -495,7 +495,7 @@ label(int typ, sym_t *sym, tnode_t *tn)
*/
cl = xcalloc(1, sizeof (clst_t));
STRUCT_ASSIGN(cl->cl_val, nv);
- cl->cl_nxt = ci->c_clst;
+ cl->cl_next = ci->c_clst;
ci->c_clst = cl;
}
}
@@ -505,7 +505,7 @@ label(int typ, sym_t *sym, tnode_t *tn)
case T_DEFAULT:
/* find the stack entry for the innermost switch statement */
- for (ci = cstk; ci != NULL && !ci->c_switch; ci = ci->c_nxt)
+ for (ci = cstk; ci != NULL && !ci->c_switch; ci = ci->c_next)
continue;
if (ci == NULL) {
@@ -647,7 +647,7 @@ switch2(void)
esym != NULL; esym = esym->s_next) {
nenum++;
}
- for (cl = cstk->c_clst; cl != NULL; cl = cl->cl_nxt)
+ for (cl = cstk->c_clst; cl != NULL; cl = cl->cl_next)
nclab++;
if (hflag && eflag && nenum != nclab && !cstk->c_default) {
/* enumeration value(s) not handled in switch */
@@ -924,7 +924,7 @@ dobreak(void)
ci = cstk;
while (ci != NULL && !ci->c_loop && !ci->c_switch)
- ci = ci->c_nxt;
+ ci = ci->c_next;
if (ci == NULL) {
/* break outside loop or switch */
@@ -948,7 +948,7 @@ docont(void)
{
cstk_t *ci;
- for (ci = cstk; ci != NULL && !ci->c_loop; ci = ci->c_nxt)
+ for (ci = cstk; ci != NULL && !ci->c_loop; ci = ci->c_next)
continue;
if (ci == NULL) {
@@ -974,7 +974,7 @@ doreturn(tnode_t *tn)
cstk_t *ci;
op_t op;
- for (ci = cstk; ci->c_nxt != NULL; ci = ci->c_nxt)
+ for (ci = cstk; ci->c_next != NULL; ci = ci->c_next)
continue;
if (tn != NULL) {
Index: src/usr.bin/xlint/lint1/init.c
diff -u src/usr.bin/xlint/lint1/init.c:1.45 src/usr.bin/xlint/lint1/init.c:1.46
--- src/usr.bin/xlint/lint1/init.c:1.45 Wed Dec 30 10:26:12 2020
+++ src/usr.bin/xlint/lint1/init.c Wed Dec 30 10:46:11 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: init.c,v 1.45 2020/12/30 10:26:12 rillig Exp $ */
+/* $NetBSD: init.c,v 1.46 2020/12/30 10:46:11 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: init.c,v 1.45 2020/12/30 10:26:12 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.46 2020/12/30 10:46:11 rillig Exp $");
#endif
#include <ctype.h>
@@ -126,7 +126,7 @@ initstack_init(void)
/* free memory used in last initialisation */
while ((istk = initstk) != NULL) {
- initstk = istk->i_nxt;
+ initstk = istk->i_next;
free(istk);
}
@@ -158,7 +158,7 @@ initstack_pop_item(void)
tyname(buf, sizeof buf, istk->i_type ? istk->i_type : istk->i_subt),
istk->i_brace, istk->i_remaining, istk->i_namedmem));
- initstk = istk->i_nxt;
+ initstk = istk->i_next;
free(istk);
istk = initstk;
lint_assert(istk != NULL);
@@ -265,7 +265,7 @@ initstack_push(void)
* Inside of other aggregate types must not be an incomplete
* type.
*/
- lint_assert(istk->i_nxt->i_nxt == NULL);
+ lint_assert(istk->i_next->i_next == NULL);
istk->i_remaining = 1;
lint_assert(istk->i_type->t_tspec == ARRAY);
istk->i_type->t_dim++;
@@ -277,7 +277,7 @@ initstack_push(void)
!tspec_is_scalar(istk->i_type->t_tspec));
initstk = xcalloc(1, sizeof (istk_t));
- initstk->i_nxt = istk;
+ initstk->i_next = istk;
initstk->i_type = istk->i_subt;
lint_assert(initstk->i_type->t_tspec != FUNC);
@@ -291,13 +291,13 @@ again:
DPRINTF(("%s: ARRAY %s brace=%d\n", __func__,
namedmem->n_name, istk->i_brace));
goto pop;
- } else if (istk->i_nxt->i_namedmem) {
+ } else if (istk->i_next->i_namedmem) {
istk->i_brace = 1;
DPRINTF(("%s ARRAY brace=%d, namedmem=%d\n", __func__,
- istk->i_brace, istk->i_nxt->i_namedmem));
+ istk->i_brace, istk->i_next->i_namedmem));
}
- if (incompl(istk->i_type) && istk->i_nxt->i_nxt != NULL) {
+ if (incompl(istk->i_type) && istk->i_next->i_next != NULL) {
/* initialisation of an incomplete type */
error(175);
initerr = 1;
@@ -373,7 +373,7 @@ again:
if (namedmem) {
DPRINTF(("%s: pop\n", __func__));
pop:
- inxt = initstk->i_nxt;
+ inxt = initstk->i_next;
free(istk);
initstk = inxt;
goto again;
@@ -470,7 +470,7 @@ init_lbrace(void)
return;
if ((initsym->s_scl == AUTO || initsym->s_scl == REG) &&
- initstk->i_nxt == NULL) {
+ initstk->i_next == NULL) {
if (tflag && !tspec_is_scalar(initstk->i_subt->t_tspec))
/* no automatic aggregate initialization in trad. C*/
warning(188);
@@ -529,7 +529,7 @@ mkinit(tnode_t *tn)
* without braces is done by ASSIGN
*/
if ((sc == AUTO || sc == REG) &&
- initsym->s_type->t_tspec != ARRAY && initstk->i_nxt == NULL) {
+ initsym->s_type->t_tspec != ARRAY && initstk->i_next == NULL) {
ln = getnnode(initsym, 0);
ln->tn_type = tduptyp(ln->tn_type);
ln->tn_type->t_const = 0;
Index: src/usr.bin/xlint/lint1/lint1.h
diff -u src/usr.bin/xlint/lint1/lint1.h:1.39 src/usr.bin/xlint/lint1/lint1.h:1.40
--- src/usr.bin/xlint/lint1/lint1.h:1.39 Wed Dec 30 10:35:38 2020
+++ src/usr.bin/xlint/lint1/lint1.h Wed Dec 30 10:46:11 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: lint1.h,v 1.39 2020/12/30 10:35:38 rillig Exp $ */
+/* $NetBSD: lint1.h,v 1.40 2020/12/30 10:46:11 rillig Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@@ -274,7 +274,7 @@ typedef struct sbuf {
size_t sb_len; /* length (without '\0') */
int sb_hash; /* hash value */
sym_t *sb_sym; /* symbol table entry */
- struct sbuf *sb_nxt; /* for freelist */
+ struct sbuf *sb_next; /* for freelist */
} sbuf_t;
@@ -365,7 +365,7 @@ typedef struct istk {
u_int i_namedmem : 1; /* has c9x named members */
sym_t *i_mem; /* next structure member */
int i_remaining; /* # of remaining elements */
- struct istk *i_nxt; /* previous level */
+ struct istk *i_next; /* previous level */
} istk_t;
/*
@@ -384,7 +384,7 @@ typedef struct pqinf {
*/
typedef struct clst {
val_t cl_val;
- struct clst *cl_nxt;
+ struct clst *cl_next;
} clst_t;
/*
@@ -409,7 +409,7 @@ typedef struct cstk {
tnode_t *c_f3expr; /* end of loop expr in for() */
pos_t c_fpos; /* position of end of loop expr */
pos_t c_cfpos; /* same for csrc_pos */
- struct cstk *c_nxt; /* outer control statement */
+ struct cstk *c_next; /* outer control statement */
} cstk_t;
typedef struct {
Index: src/usr.bin/xlint/lint1/mem1.c
diff -u src/usr.bin/xlint/lint1/mem1.c:1.20 src/usr.bin/xlint/lint1/mem1.c:1.21
--- src/usr.bin/xlint/lint1/mem1.c:1.20 Tue Dec 29 11:35:11 2020
+++ src/usr.bin/xlint/lint1/mem1.c Wed Dec 30 10:46:11 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: mem1.c,v 1.20 2020/12/29 11:35:11 rillig Exp $ */
+/* $NetBSD: mem1.c,v 1.21 2020/12/30 10:46:11 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: mem1.c,v 1.20 2020/12/29 11:35:11 rillig Exp $");
+__RCSID("$NetBSD: mem1.c,v 1.21 2020/12/30 10:46:11 rillig Exp $");
#endif
#include <sys/types.h>
@@ -55,7 +55,7 @@ typedef struct fn {
char *fn_name;
size_t fn_len;
int fn_id;
- struct fn *fn_nxt;
+ struct fn *fn_next;
} fn_t;
static fn_t *fnames;
@@ -70,7 +70,7 @@ srchfn(const char *s, size_t len)
{
fn_t *fn;
- for (fn = fnames; fn != NULL; fn = fn->fn_nxt) {
+ for (fn = fnames; fn != NULL; fn = fn->fn_next) {
if (fn->fn_len == len && memcmp(fn->fn_name, s, len) == 0)
break;
}
@@ -146,7 +146,7 @@ fnnalloc(const char *s, size_t len)
fn->fn_name[len] = '\0';
fn->fn_len = len;
fn->fn_id = nxt_id++;
- fn->fn_nxt = fnames;
+ fn->fn_next = fnames;
fnames = fn;
/* Write id of this filename to the output file. */
outclr();
Index: src/usr.bin/xlint/lint1/scan.l
diff -u src/usr.bin/xlint/lint1/scan.l:1.99 src/usr.bin/xlint/lint1/scan.l:1.100
--- src/usr.bin/xlint/lint1/scan.l:1.99 Wed Dec 30 10:35:38 2020
+++ src/usr.bin/xlint/lint1/scan.l Wed Dec 30 10:46:11 2020
@@ -1,5 +1,5 @@
%{
-/* $NetBSD: scan.l,v 1.99 2020/12/30 10:35:38 rillig Exp $ */
+/* $NetBSD: scan.l,v 1.100 2020/12/30 10:46:11 rillig Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@@ -35,7 +35,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: scan.l,v 1.99 2020/12/30 10:35:38 rillig Exp $");
+__RCSID("$NetBSD: scan.l,v 1.100 2020/12/30 10:46:11 rillig Exp $");
#endif
#include <ctype.h>
@@ -417,11 +417,11 @@ allocsb(void)
sbuf_t *sb;
if ((sb = sbfrlst) != NULL) {
- sbfrlst = sb->sb_nxt;
+ sbfrlst = sb->sb_next;
#ifdef BLKDEBUG
(void)memset(sb, 0, sizeof (*sb));
#else
- sb->sb_nxt = NULL;
+ sb->sb_next = NULL;
#endif
} else {
sb = xmalloc(sizeof (sbuf_t));
@@ -438,7 +438,7 @@ freesb(sbuf_t *sb)
{
(void)memset(sb, ZERO, sizeof (*sb));
- sb->sb_nxt = sbfrlst;
+ sb->sb_next = sbfrlst;
sbfrlst = sb;
}
Index: src/usr.bin/xlint/lint2/chk.c
diff -u src/usr.bin/xlint/lint2/chk.c:1.28 src/usr.bin/xlint/lint2/chk.c:1.29
--- src/usr.bin/xlint/lint2/chk.c:1.28 Wed Dec 30 10:26:12 2020
+++ src/usr.bin/xlint/lint2/chk.c Wed Dec 30 10:46:11 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: chk.c,v 1.28 2020/12/30 10:26:12 rillig Exp $ */
+/* $NetBSD: chk.c,v 1.29 2020/12/30 10:46:11 rillig Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: chk.c,v 1.28 2020/12/30 10:26:12 rillig Exp $");
+__RCSID("$NetBSD: chk.c,v 1.29 2020/12/30 10:46:11 rillig Exp $");
#endif
#include <ctype.h>
@@ -251,7 +251,7 @@ chkvtui(hte_t *hte, sym_t *def, sym_t *d
return;
t1 = (tp1 = TP(def->s_type)->t_subt)->t_tspec;
- for (call = hte->h_calls; call != NULL; call = call->f_nxt) {
+ for (call = hte->h_calls; call != NULL; call = call->f_next) {
tp2 = TP(call->f_type)->t_subt;
eq = eqtype(tp1, tp2, 1, 0, 0, (dowarn = 0, &dowarn));
if (!call->f_rused) {
@@ -368,14 +368,14 @@ chkfaui(hte_t *hte, sym_t *def, sym_t *d
}
if (tp1 == NULL) {
call1 = calls;
- calls = calls->f_nxt;
+ calls = calls->f_next;
if ((tp1 = TP(call1->f_type))->t_tspec != FUNC)
return;
pos1p = &call1->f_pos;
}
n = 1;
- for (call = calls; call != NULL; call = call->f_nxt) {
+ for (call = calls; call != NULL; call = call->f_next) {
if ((tp2 = TP(call->f_type))->t_tspec != FUNC)
continue;
ap1 = tp1->t_args;
@@ -416,7 +416,7 @@ chkfaui(hte_t *hte, sym_t *def, sym_t *d
if (def == NULL || (!def->s_prfl && !def->s_scfl))
continue;
as = def->s_prfl ? def->s_nprfl : def->s_nscfl;
- for (ai = call->f_args; ai != NULL; ai = ai->a_nxt) {
+ for (ai = call->f_args; ai != NULL; ai = ai->a_next) {
if (ai->a_num == as)
break;
}
@@ -537,7 +537,7 @@ chkau(hte_t *hte, int n, sym_t *def, sym
* information for the n-th argument, if this was
* a constant, otherwise to NULL
*/
- for ( ; ai1 != NULL; ai1 = ai1->a_nxt) {
+ for ( ; ai1 != NULL; ai1 = ai1->a_next) {
if (ai1->a_num == n)
break;
}
@@ -546,7 +546,7 @@ chkau(hte_t *hte, int n, sym_t *def, sym
* of the (second) call, if this was a constant,
* otherwise to NULL
*/
- for (ai = call->f_args; ai != NULL; ai = ai->a_nxt) {
+ for (ai = call->f_args; ai != NULL; ai = ai->a_next) {
if (ai->a_num == n)
break;
}
@@ -575,7 +575,7 @@ chkau(hte_t *hte, int n, sym_t *def, sym
}
} else if (t1 == PTR && tspec_is_int(t2)) {
- for (ai = call->f_args; ai != NULL; ai = ai->a_nxt) {
+ for (ai = call->f_args; ai != NULL; ai = ai->a_next) {
if (ai->a_num == n)
break;
}
@@ -1096,7 +1096,7 @@ chkrvu(hte_t *hte, sym_t *def)
/* function has return value */
used = ignored = 0;
- for (call = hte->h_calls; call != NULL; call = call->f_nxt) {
+ for (call = hte->h_calls; call != NULL; call = call->f_next) {
used |= call->f_rused || call->f_rdisc;
ignored |= !call->f_rused && !call->f_rdisc;
}
@@ -1109,7 +1109,7 @@ chkrvu(hte_t *hte, sym_t *def)
}
} else {
/* function has no return value */
- for (call = hte->h_calls; call != NULL; call = call->f_nxt) {
+ for (call = hte->h_calls; call != NULL; call = call->f_next) {
if (call->f_rused)
/* %s value is used( %s ), but none ret. */
msg(10, hte->h_name, mkpos(&call->f_pos));
Index: src/usr.bin/xlint/lint2/lint2.h
diff -u src/usr.bin/xlint/lint2/lint2.h:1.10 src/usr.bin/xlint/lint2/lint2.h:1.11
--- src/usr.bin/xlint/lint2/lint2.h:1.10 Wed Dec 30 10:26:12 2020
+++ src/usr.bin/xlint/lint2/lint2.h Wed Dec 30 10:46:11 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: lint2.h,v 1.10 2020/12/30 10:26:12 rillig Exp $ */
+/* $NetBSD: lint2.h,v 1.11 2020/12/30 10:46:11 rillig Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@@ -87,7 +87,7 @@ typedef struct arginf {
u_int a_ncon : 1; /* msb of argument is set */
u_int a_fmt : 1; /* a_fstrg points to format string */
char *a_fstrg; /* format string */
- struct arginf *a_nxt; /* information for next const. argument */
+ struct arginf *a_next; /* information for next const. argument */
} arginf_t;
/*
@@ -154,7 +154,7 @@ typedef struct fcall {
u_int f_rdisc : 1; /* return value discarded (casted to void) */
u_short f_type; /* types of expected return value and args */
arginf_t *f_args; /* information about constant arguments */
- struct fcall *f_nxt; /* next call of same function */
+ struct fcall *f_next; /* next call of same function */
} fcall_t;
/*
@@ -163,7 +163,7 @@ typedef struct fcall {
*/
typedef struct usym {
pos_t u_pos; /* position */
- struct usym *u_nxt; /* next usage */
+ struct usym *u_next; /* next usage */
} usym_t;
/*
@@ -177,9 +177,9 @@ typedef struct hte {
sym_t *h_syms; /* declarations and definitions */
sym_t **h_lsym; /* points to s_next of last decl./def. */
fcall_t *h_calls; /* function calls */
- fcall_t **h_lcall; /* points to f_nxt of last call */
+ fcall_t **h_lcall; /* points to f_next of last call */
usym_t *h_usyms; /* usage info */
- usym_t **h_lusym; /* points to u_nxt of last usage info */
+ usym_t **h_lusym; /* points to u_next of last usage info */
struct hte *h_link; /* next hte with same hash function */
struct hte *h_hte; /* pointer to other htes (for renames */
} hte_t;
Index: src/usr.bin/xlint/lint2/read.c
diff -u src/usr.bin/xlint/lint2/read.c:1.32 src/usr.bin/xlint/lint2/read.c:1.33
--- src/usr.bin/xlint/lint2/read.c:1.32 Wed Dec 30 10:26:12 2020
+++ src/usr.bin/xlint/lint2/read.c Wed Dec 30 10:46:11 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: read.c,v 1.32 2020/12/30 10:26:12 rillig Exp $ */
+/* $NetBSD: read.c,v 1.33 2020/12/30 10:46:11 rillig Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: read.c,v 1.32 2020/12/30 10:26:12 rillig Exp $");
+__RCSID("$NetBSD: read.c,v 1.33 2020/12/30 10:46:11 rillig Exp $");
#endif
#include <ctype.h>
@@ -79,7 +79,7 @@ static size_t nfnames;
typedef struct thtab {
const char *th_name;
u_short th_idx;
- struct thtab *th_nxt;
+ struct thtab *th_next;
} thtab_t;
static thtab_t **thtab; /* hash table */
type_t **tlst; /* array for indexed access */
@@ -326,7 +326,7 @@ funccall(pos_t *posp, const char *cp)
ai->a_fstrg = inpqstrg(cp, &cp);
}
*lai = ai;
- lai = &ai->a_nxt;
+ lai = &ai->a_next;
break;
}
}
@@ -347,7 +347,7 @@ funccall(pos_t *posp, const char *cp)
fcall->f_type = inptype(cp, &cp);
*hte->h_lcall = fcall;
- hte->h_lcall = &fcall->f_nxt;
+ hte->h_lcall = &fcall->f_next;
if (*cp != '\0')
inperr("trailing line data: %s", cp);
@@ -544,7 +544,7 @@ usedsym(pos_t *posp, const char *cp)
hte->h_used = 1;
*hte->h_lusym = usym;
- hte->h_lusym = &usym->u_nxt;
+ hte->h_lusym = &usym->u_next;
}
/*
@@ -986,7 +986,7 @@ findtype(const char *cp, size_t len, int
{
thtab_t *thte;
- for (thte = thtab[h]; thte != NULL; thte = thte->th_nxt) {
+ for (thte = thtab[h]; thte != NULL; thte = thte->th_next) {
if (strncmp(thte->th_name, cp, len) != 0)
continue;
if (thte->th_name[len] == '\0')
@@ -1026,7 +1026,7 @@ storetyp(type_t *tp, const char *cp, siz
thte = xalloc(sizeof (thtab_t));
thte->th_name = name;
thte->th_idx = tidx;
- thte->th_nxt = thtab[h];
+ thte->th_next = thtab[h];
thtab[h] = thte;
return (u_short)tidx++;
@@ -1215,11 +1215,11 @@ mkstatic(hte_t *hte)
if (sym->s_pos.p_src != sym1->s_pos.p_src)
ofnd = 1;
}
- for (call = hte->h_calls; call != NULL && !ofnd; call = call->f_nxt) {
+ for (call = hte->h_calls; call != NULL && !ofnd; call = call->f_next) {
if (call->f_pos.p_src != sym1->s_pos.p_src)
ofnd = 1;
}
- for (usym = hte->h_usyms; usym != NULL && !ofnd; usym = usym->u_nxt) {
+ for (usym = hte->h_usyms; usym != NULL && !ofnd; usym = usym->u_next) {
if (usym->u_pos.p_src != sym1->s_pos.p_src)
ofnd = 1;
}
@@ -1273,26 +1273,26 @@ mkstatic(hte_t *hte)
}
for (callp = &hte->h_calls; (call = *callp) != NULL; ) {
if (call->f_pos.p_src == sym1->s_pos.p_src) {
- (*callp) = call->f_nxt;
- if (hte->h_lcall == &call->f_nxt)
+ (*callp) = call->f_next;
+ if (hte->h_lcall == &call->f_next)
hte->h_lcall = callp;
- call->f_nxt = NULL;
+ call->f_next = NULL;
*nhte->h_lcall = call;
- nhte->h_lcall = &call->f_nxt;
+ nhte->h_lcall = &call->f_next;
} else {
- callp = &call->f_nxt;
+ callp = &call->f_next;
}
}
for (usymp = &hte->h_usyms; (usym = *usymp) != NULL; ) {
if (usym->u_pos.p_src == sym1->s_pos.p_src) {
- (*usymp) = usym->u_nxt;
- if (hte->h_lusym == &usym->u_nxt)
+ (*usymp) = usym->u_next;
+ if (hte->h_lusym == &usym->u_next)
hte->h_lusym = usymp;
- usym->u_nxt = NULL;
+ usym->u_next = NULL;
*nhte->h_lusym = usym;
- nhte->h_lusym = &usym->u_nxt;
+ nhte->h_lusym = &usym->u_next;
} else {
- usymp = &usym->u_nxt;
+ usymp = &usym->u_next;
}
}