Module Name: src
Committed By: rillig
Date: Sun Mar 21 10:30:28 UTC 2021
Modified Files:
src/usr.bin/xlint/lint1: decl.c func.c lint1.h
Log Message:
lint: rename d_fargs, d_fdpos and d_fpsyms to be less abbreviated
No functional change.
To generate a diff of this commit:
cvs rdiff -u -r1.155 -r1.156 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.80 -r1.81 src/usr.bin/xlint/lint1/func.c
cvs rdiff -u -r1.79 -r1.80 src/usr.bin/xlint/lint1/lint1.h
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/lint1/decl.c
diff -u src/usr.bin/xlint/lint1/decl.c:1.155 src/usr.bin/xlint/lint1/decl.c:1.156
--- src/usr.bin/xlint/lint1/decl.c:1.155 Sun Mar 21 10:25:40 2021
+++ src/usr.bin/xlint/lint1/decl.c Sun Mar 21 10:30:28 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.155 2021/03/21 10:25:40 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.156 2021/03/21 10:30:28 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: decl.c,v 1.155 2021/03/21 10:25:40 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.156 2021/03/21 10:30:28 rillig Exp $");
#endif
#include <sys/param.h>
@@ -639,8 +639,8 @@ popdecl(void)
* parameter type list.
*/
if (di->d_dlsyms != NULL) {
- *di->d_ldlsym = dcs->d_fpsyms;
- dcs->d_fpsyms = di->d_dlsyms;
+ *di->d_ldlsym = dcs->d_func_proto_syms;
+ dcs->d_func_proto_syms = di->d_dlsyms;
}
break;
case ABSTRACT:
@@ -1396,16 +1396,16 @@ add_function(sym_t *decl, sym_t *args)
* The symbols are removed from the symbol table by popdecl() after
* add_function(). To be able to restore them if this is a function
* definition, a pointer to the list of all symbols is stored in
- * dcs->d_next->d_fpsyms. Also a list of the arguments (concatenated
- * by s_next) is stored in dcs->d_next->d_fargs.
+ * dcs->d_next->d_func_proto_syms. Also a list of the arguments
+ * (concatenated by s_next) is stored in dcs->d_next->d_func_args.
* (dcs->d_next must be used because *dcs is the declaration stack
* element created for the list of params and is removed after
* add_function())
*/
if (dcs->d_next->d_ctx == EXTERN &&
decl->s_type == dcs->d_next->d_type) {
- dcs->d_next->d_fpsyms = dcs->d_dlsyms;
- dcs->d_next->d_fargs = args;
+ dcs->d_next->d_func_proto_syms = dcs->d_dlsyms;
+ dcs->d_next->d_func_args = args;
}
tpp = &decl->s_type;
@@ -1602,7 +1602,7 @@ declarator_name(sym_t *sym)
sym->s_type = dcs->d_type;
- dcs->d_fpsyms = NULL;
+ dcs->d_func_proto_syms = NULL;
return sym;
}
@@ -2483,7 +2483,7 @@ check_func_lint_directives(void)
* number of arguments.
*/
narg = 0;
- for (arg = dcs->d_fargs; arg != NULL; arg = arg->s_next)
+ for (arg = dcs->d_func_args; arg != NULL; arg = arg->s_next)
narg++;
if (nargusg > narg) {
/* argument number mismatch with directive: ** %s ** */
@@ -2512,7 +2512,7 @@ check_func_lint_directives(void)
if (printflike_argnum != -1 || scanflike_argnum != -1) {
narg = printflike_argnum != -1
? printflike_argnum : scanflike_argnum;
- arg = dcs->d_fargs;
+ arg = dcs->d_func_args;
for (n = 1; n < narg; n++)
arg = arg->s_next;
if (arg->s_type->t_tspec != PTR ||
Index: src/usr.bin/xlint/lint1/func.c
diff -u src/usr.bin/xlint/lint1/func.c:1.80 src/usr.bin/xlint/lint1/func.c:1.81
--- src/usr.bin/xlint/lint1/func.c:1.80 Sun Mar 21 10:21:07 2021
+++ src/usr.bin/xlint/lint1/func.c Sun Mar 21 10:30:28 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: func.c,v 1.80 2021/03/21 10:21:07 rillig Exp $ */
+/* $NetBSD: func.c,v 1.81 2021/03/21 10:30:28 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.80 2021/03/21 10:21:07 rillig Exp $");
+__RCSID("$NetBSD: func.c,v 1.81 2021/03/21 10:30:28 rillig Exp $");
#endif
#include <stdlib.h>
@@ -223,7 +223,7 @@ funcdef(sym_t *fsym)
* Put all symbols declared in the argument list back to the
* symbol table.
*/
- for (sym = dcs->d_fpsyms; sym != NULL; sym = sym->s_dlnxt) {
+ for (sym = dcs->d_func_proto_syms; sym != NULL; sym = sym->s_dlnxt) {
if (sym->s_block_level != -1) {
lint_assert(sym->s_block_level == 1);
inssym(1, sym);
@@ -282,7 +282,7 @@ funcdef(sym_t *fsym)
* if this is an old style definition and we had already a
* prototype.
*/
- dcs->d_fdpos = fsym->s_def_pos;
+ dcs->d_func_def_pos = fsym->s_def_pos;
if ((rdsym = dcs->d_redeclared_symbol) != NULL) {
@@ -378,7 +378,7 @@ funcend(void)
warning(216, funcsym->s_name);
/* Print warnings for unused arguments */
- arg = dcs->d_fargs;
+ arg = dcs->d_func_args;
n = 0;
while (arg != NULL && (nargusg == -1 || n < nargusg)) {
check_usage_sym(dcs->d_asm, arg);
@@ -396,8 +396,9 @@ funcend(void)
if (dcs->d_scl == EXTERN && funcsym->s_inline) {
outsym(funcsym, funcsym->s_scl, DECL);
} else {
- outfdef(funcsym, &dcs->d_fdpos, cstmt->c_had_return_value,
- funcsym->s_osdef, dcs->d_fargs);
+ outfdef(funcsym, &dcs->d_func_def_pos,
+ cstmt->c_had_return_value, funcsym->s_osdef,
+ dcs->d_func_args);
}
/*
@@ -406,7 +407,7 @@ funcend(void)
*/
lint_assert(dcs->d_next == NULL);
lint_assert(dcs->d_ctx == EXTERN);
- rmsyms(dcs->d_fpsyms);
+ rmsyms(dcs->d_func_proto_syms);
/* must be set on level 0 */
reached = true;
Index: src/usr.bin/xlint/lint1/lint1.h
diff -u src/usr.bin/xlint/lint1/lint1.h:1.79 src/usr.bin/xlint/lint1/lint1.h:1.80
--- src/usr.bin/xlint/lint1/lint1.h:1.79 Sun Mar 21 10:25:40 2021
+++ src/usr.bin/xlint/lint1/lint1.h Sun Mar 21 10:30:28 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: lint1.h,v 1.79 2021/03/21 10:25:40 rillig Exp $ */
+/* $NetBSD: lint1.h,v 1.80 2021/03/21 10:30:28 rillig Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@@ -350,12 +350,12 @@ typedef struct dinfo {
bool d_packed : 1;
bool d_used : 1;
type_t *d_tagtyp; /* tag during member declaration */
- sym_t *d_fargs; /* list of arguments during function def. */
- pos_t d_fdpos; /* position of function definition */
+ sym_t *d_func_args; /* list of arguments during function def. */
+ pos_t d_func_def_pos; /* position of function definition */
sym_t *d_dlsyms; /* first symbol declared at this level */
sym_t **d_ldlsym; /* points to s_dlnxt in last symbol decl.
at this level */
- sym_t *d_fpsyms; /* symbols defined in prototype */
+ sym_t *d_func_proto_syms; /* symbols defined in prototype */
struct dinfo *d_next; /* next level */
} dinfo_t;