Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/xlint/lint1 lint: rename d_nedecl to d_nonempty_decl
details: https://anonhg.NetBSD.org/src/rev/050e1a3c0c43
branches: trunk
changeset: 960558:050e1a3c0c43
user: rillig <rillig%NetBSD.org@localhost>
date: Sun Mar 21 10:25:40 2021 +0000
description:
lint: rename d_nedecl to d_nonempty_decl
No functional change.
diffstat:
usr.bin/xlint/lint1/cgram.y | 12 ++++++------
usr.bin/xlint/lint1/decl.c | 22 +++++++++++-----------
usr.bin/xlint/lint1/lint1.h | 7 ++++---
3 files changed, 21 insertions(+), 20 deletions(-)
diffs (166 lines):
diff -r 14f5c5c99f16 -r 050e1a3c0c43 usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y Sun Mar 21 10:21:07 2021 +0000
+++ b/usr.bin/xlint/lint1/cgram.y Sun Mar 21 10:25:40 2021 +0000
@@ -1,5 +1,5 @@
%{
-/* $NetBSD: cgram.y,v 1.194 2021/03/21 09:54:02 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.195 2021/03/21 10:25:40 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: cgram.y,v 1.194 2021/03/21 09:54:02 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.195 2021/03/21 10:25:40 rillig Exp $");
#endif
#include <limits.h>
@@ -410,7 +410,7 @@
if (dcs->d_scl == TYPEDEF) {
/* typedef declares no type name */
warning(72);
- } else if (!dcs->d_nedecl) {
+ } else if (!dcs->d_nonempty_decl) {
/* empty declaration */
warning(2);
}
@@ -488,7 +488,7 @@
}
| declmods deftyp notype_init_decls T_SEMI
| declaration_specifiers deftyp T_SEMI {
- if (!dcs->d_nedecl) {
+ if (!dcs->d_nonempty_decl) {
/* empty declaration */
warning(2);
} else {
@@ -497,7 +497,7 @@
}
}
| declaration_specifiers deftyp type_init_decls T_SEMI {
- if (dcs->d_nedecl) {
+ if (dcs->d_nonempty_decl) {
/* '%s' declared in argument declaration list */
warning(3, type_name(dcs->d_type));
}
@@ -521,7 +521,7 @@
if (dcs->d_scl == TYPEDEF) {
/* typedef declares no type name */
warning(72);
- } else if (!dcs->d_nedecl) {
+ } else if (!dcs->d_nonempty_decl) {
/* empty declaration */
warning(2);
}
diff -r 14f5c5c99f16 -r 050e1a3c0c43 usr.bin/xlint/lint1/decl.c
--- a/usr.bin/xlint/lint1/decl.c Sun Mar 21 10:21:07 2021 +0000
+++ b/usr.bin/xlint/lint1/decl.c Sun Mar 21 10:25:40 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.154 2021/03/21 10:21:07 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.155 2021/03/21 10:25:40 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.154 2021/03/21 10:21:07 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.155 2021/03/21 10:25:40 rillig Exp $");
#endif
#include <sys/param.h>
@@ -717,7 +717,7 @@
dcs->d_inline = false;
dcs->d_mscl = false;
dcs->d_terr = false;
- dcs->d_nedecl = false;
+ dcs->d_nonempty_decl = false;
dcs->d_notyp = false;
}
@@ -1659,7 +1659,7 @@
tag = newtag(tag, scl, decl, semi);
} else {
/* a new tag, no empty declaration */
- dcs->d_next->d_nedecl = true;
+ dcs->d_next->d_nonempty_decl = true;
if (scl == ENUM_TAG && !decl) {
if (!tflag && (sflag || pflag))
/* forward reference to enum type */
@@ -1682,7 +1682,7 @@
tag->s_block_level = -1;
tag->s_type = tp = getblk(sizeof (type_t));
tp->t_packed = dcs->d_packed;
- dcs->d_next->d_nedecl = true;
+ dcs->d_next->d_nonempty_decl = true;
}
if (tp->t_tspec == NOTSPEC) {
@@ -1724,14 +1724,14 @@
warning(45, storage_class_name(tag->s_scl),
tag->s_name);
}
- dcs->d_next->d_nedecl = true;
+ dcs->d_next->d_nonempty_decl = true;
} else if (decl) {
/* "struct a { ... } " */
if (hflag)
/* redefinition hides earlier one: %s */
warning(43, tag->s_name);
tag = pushdown(tag);
- dcs->d_next->d_nedecl = true;
+ dcs->d_next->d_nonempty_decl = true;
} else if (tag->s_scl != scl) {
/* base type is really '%s %s' */
warning(45, storage_class_name(tag->s_scl),
@@ -1743,7 +1743,7 @@
tag->s_name);
}
tag = pushdown(tag);
- dcs->d_next->d_nedecl = true;
+ dcs->d_next->d_nonempty_decl = true;
}
} else {
if (tag->s_scl != scl) {
@@ -1751,15 +1751,15 @@
error(46, storage_class_name(tag->s_scl));
print_previous_declaration(-1, tag);
tag = pushdown(tag);
- dcs->d_next->d_nedecl = true;
+ dcs->d_next->d_nonempty_decl = true;
} else if (decl && !is_incomplete(tag->s_type)) {
/* (%s) tag redeclared */
error(46, storage_class_name(tag->s_scl));
print_previous_declaration(-1, tag);
tag = pushdown(tag);
- dcs->d_next->d_nedecl = true;
+ dcs->d_next->d_nonempty_decl = true;
} else if (semi || decl) {
- dcs->d_next->d_nedecl = true;
+ dcs->d_next->d_nonempty_decl = true;
}
}
return tag;
diff -r 14f5c5c99f16 -r 050e1a3c0c43 usr.bin/xlint/lint1/lint1.h
--- a/usr.bin/xlint/lint1/lint1.h Sun Mar 21 10:21:07 2021 +0000
+++ b/usr.bin/xlint/lint1/lint1.h Sun Mar 21 10:25:40 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lint1.h,v 1.78 2021/03/21 10:21:07 rillig Exp $ */
+/* $NetBSD: lint1.h,v 1.79 2021/03/21 10:25:40 rillig Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@@ -341,8 +341,9 @@
bool d_inline : 1; /* inline in declaration specifiers */
bool d_mscl : 1; /* multiple storage classes */
bool d_terr : 1; /* invalid type combination */
- bool d_nedecl : 1; /* if at least one tag is declared */
- bool d_vararg : 1; /* ... in the current function decl. */
+ bool d_nonempty_decl : 1; /* if at least one tag is declared
+ * ... in the current function decl. */
+ bool d_vararg : 1;
bool d_proto : 1; /* current function decl. is prototype */
bool d_notyp : 1; /* set if no type specifier was present */
bool d_asm : 1; /* set if d_ctx == AUTO and asm() present */
Home |
Main Index |
Thread Index |
Old Index