Module Name: src
Committed By: rillig
Date: Sat Dec 2 21:47:05 UTC 2023
Modified Files:
src/usr.bin/xlint/lint1: debug.c decl.c lex.c lint1.h tree.c
Log Message:
lint: rename NOSCL to NO_SCL
For symmetry with NO_TSPEC. No functional change.
To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/usr.bin/xlint/lint1/debug.c
cvs rdiff -u -r1.379 -r1.380 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.192 -r1.193 src/usr.bin/xlint/lint1/lex.c
cvs rdiff -u -r1.202 -r1.203 src/usr.bin/xlint/lint1/lint1.h
cvs rdiff -u -r1.581 -r1.582 src/usr.bin/xlint/lint1/tree.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/lint1/debug.c
diff -u src/usr.bin/xlint/lint1/debug.c:1.63 src/usr.bin/xlint/lint1/debug.c:1.64
--- src/usr.bin/xlint/lint1/debug.c:1.63 Tue Oct 17 19:29:09 2023
+++ src/usr.bin/xlint/lint1/debug.c Sat Dec 2 21:47:05 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: debug.c,v 1.63 2023/10/17 19:29:09 rillig Exp $ */
+/* $NetBSD: debug.c,v 1.64 2023/12/02 21:47:05 rillig Exp $ */
/*-
* Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID)
-__RCSID("$NetBSD: debug.c,v 1.63 2023/10/17 19:29:09 rillig Exp $");
+__RCSID("$NetBSD: debug.c,v 1.64 2023/12/02 21:47:05 rillig Exp $");
#endif
#include <stdlib.h>
@@ -385,7 +385,7 @@ debug_sym(const char *prefix, const sym_
debug_word(sym->s_osdef, "old-style");
debug_word(sym->s_inline, "inline");
debug_word(sym->s_ext_sym != NULL, "has-external");
- debug_word(sym->s_scl != NOSCL, scl_name(sym->s_scl));
+ debug_word(sym->s_scl != NO_SCL, scl_name(sym->s_scl));
debug_word(sym->s_keyword == NULL, def_name(sym->s_def));
if (sym->s_def_pos.p_file != NULL)
@@ -441,7 +441,7 @@ debug_decl_level(const decl_level *dl)
{
debug_printf("kind=%s", decl_level_kind_name(dl->d_kind));
- if (dl->d_scl != NOSCL)
+ if (dl->d_scl != NO_SCL)
debug_printf(" %s", scl_name(dl->d_scl));
if (dl->d_type != NULL)
debug_printf(" '%s'", type_name(dl->d_type));
Index: src/usr.bin/xlint/lint1/decl.c
diff -u src/usr.bin/xlint/lint1/decl.c:1.379 src/usr.bin/xlint/lint1/decl.c:1.380
--- src/usr.bin/xlint/lint1/decl.c:1.379 Thu Sep 14 21:53:02 2023
+++ src/usr.bin/xlint/lint1/decl.c Sat Dec 2 21:47:05 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.379 2023/09/14 21:53:02 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.380 2023/12/02 21:47:05 rillig Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID)
-__RCSID("$NetBSD: decl.c,v 1.379 2023/09/14 21:53:02 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.380 2023/12/02 21:47:05 rillig Exp $");
#endif
#include <sys/param.h>
@@ -206,7 +206,7 @@ dcs_add_storage_class(scl_t sc)
warning(83);
}
- if (dcs->d_scl == NOSCL)
+ if (dcs->d_scl == NO_SCL)
dcs->d_scl = sc;
else if ((dcs->d_scl == EXTERN && sc == THREAD_LOCAL)
|| (dcs->d_scl == THREAD_LOCAL && sc == EXTERN))
@@ -607,7 +607,7 @@ dcs_begin_type(void)
dcs->d_complex_mod = NO_TSPEC;
dcs->d_sign_mod = NO_TSPEC;
dcs->d_rank_mod = NO_TSPEC;
- dcs->d_scl = NOSCL;
+ dcs->d_scl = NO_SCL;
dcs->d_type = NULL;
dcs->d_redeclared_symbol = NULL;
dcs->d_qual = (type_qualifiers) { .tq_const = false };
@@ -630,14 +630,14 @@ dcs_adjust_storage_class(void)
if (dcs->d_scl == REG || dcs->d_scl == AUTO) {
/* illegal storage class */
error(8);
- dcs->d_scl = NOSCL;
+ dcs->d_scl = NO_SCL;
}
} else if (dcs->d_kind == DLK_OLD_STYLE_PARAMS ||
dcs->d_kind == DLK_PROTO_PARAMS) {
- if (dcs->d_scl != NOSCL && dcs->d_scl != REG) {
+ if (dcs->d_scl != NO_SCL && dcs->d_scl != REG) {
/* only 'register' is valid as storage class ... */
error(9);
- dcs->d_scl = NOSCL;
+ dcs->d_scl = NO_SCL;
}
}
}
@@ -1431,9 +1431,9 @@ check_function_definition(sym_t *sym, bo
sym_t *
declarator_name(sym_t *sym)
{
- scl_t sc = NOSCL;
+ scl_t sc = NO_SCL;
- if (sym->s_scl == NOSCL)
+ if (sym->s_scl == NO_SCL)
dcs->d_redeclared_symbol = NULL;
else if (sym->s_defparam) {
sym->s_defparam = false;
@@ -1458,7 +1458,7 @@ declarator_name(sym_t *sym)
* or this is a function definition.
*/
sc = dcs->d_scl;
- if (sc == NOSCL || sc == THREAD_LOCAL) {
+ if (sc == NO_SCL || sc == THREAD_LOCAL) {
sc = EXTERN;
sym->s_def = TDEF;
} else if (sc == STATIC)
@@ -1474,13 +1474,13 @@ declarator_name(sym_t *sym)
sym->s_param = true;
/* FALLTHROUGH */
case DLK_OLD_STYLE_PARAMS:
- lint_assert(dcs->d_scl == NOSCL || dcs->d_scl == REG);
+ lint_assert(dcs->d_scl == NO_SCL || dcs->d_scl == REG);
sym->s_register = dcs->d_scl == REG;
sc = AUTO;
sym->s_def = DEF;
break;
case DLK_AUTO:
- if ((sc = dcs->d_scl) == NOSCL) {
+ if ((sc = dcs->d_scl) == NO_SCL) {
/*
* XXX somewhat ugly because we don't know whether this
* is AUTO or EXTERN (functions). If we are wrong, it
@@ -1504,7 +1504,7 @@ declarator_name(sym_t *sym)
default:
lint_assert(dcs->d_kind == DLK_ABSTRACT);
/* try to continue after syntax errors */
- sc = NOSCL;
+ sc = NO_SCL;
}
sym->s_scl = sc;
@@ -1520,7 +1520,7 @@ sym_t *
old_style_function_parameter_name(sym_t *sym)
{
- if (sym->s_scl != NOSCL) {
+ if (sym->s_scl != NO_SCL) {
if (block_level == sym->s_block_level) {
/* redeclaration of formal parameter '%s' */
error(21, sym->s_name);
@@ -1619,7 +1619,7 @@ make_tag_type(sym_t *tag, tspec_t kind,
}
if (tag != NULL) {
- if (tag->s_scl != NOSCL)
+ if (tag->s_scl != NO_SCL)
tag = new_tag(tag, scl, decl, semi);
else {
/* a new tag, no empty declaration */
@@ -1632,7 +1632,7 @@ make_tag_type(sym_t *tag, tspec_t kind,
warning(42);
}
}
- if (tag->s_scl == NOSCL) {
+ if (tag->s_scl == NO_SCL) {
tag->s_scl = scl;
tag->s_type = tp =
block_zero_alloc(sizeof(*tp), "type");
@@ -1739,7 +1739,7 @@ sym_t *
enumeration_constant(sym_t *sym, int val, bool impl)
{
- if (sym->s_scl != NOSCL) {
+ if (sym->s_scl != NO_SCL) {
if (sym->s_block_level == block_level) {
/* no hflag, because this is illegal */
if (sym->s_param) {
@@ -2659,7 +2659,7 @@ declare_local(sym_t *dsym, bool has_init
/* Correct a mistake done in declarator_name(). */
if (dsym->s_type->t_tspec == FUNC) {
dsym->s_def = DECL;
- if (dcs->d_scl == NOSCL)
+ if (dcs->d_scl == NO_SCL)
dsym->s_scl = EXTERN;
}
@@ -3095,7 +3095,7 @@ check_global_variable(const sym_t *sym)
if (scl == TYPEDEF || scl == BOOL_CONST || scl == ENUM_CONST)
return;
- if (scl == NOSCL)
+ if (scl == NO_SCL)
return; /* May be caused by a syntax error. */
lint_assert(scl == EXTERN || scl == STATIC);
Index: src/usr.bin/xlint/lint1/lex.c
diff -u src/usr.bin/xlint/lint1/lex.c:1.192 src/usr.bin/xlint/lint1/lex.c:1.193
--- src/usr.bin/xlint/lint1/lex.c:1.192 Sat Aug 26 10:43:53 2023
+++ src/usr.bin/xlint/lint1/lex.c Sat Dec 2 21:47:05 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: lex.c,v 1.192 2023/08/26 10:43:53 rillig Exp $ */
+/* $NetBSD: lex.c,v 1.193 2023/12/02 21:47:05 rillig Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID)
-__RCSID("$NetBSD: lex.c,v 1.192 2023/08/26 10:43:53 rillig Exp $");
+__RCSID("$NetBSD: lex.c,v 1.193 2023/12/02 21:47:05 rillig Exp $");
#endif
#include <ctype.h>
@@ -1394,7 +1394,7 @@ mktempsym(type_t *tp)
(void)snprintf(s, 64, "%.8u_tmp", n++);
scl = dcs->d_scl;
- if (scl == NOSCL)
+ if (scl == NO_SCL)
scl = block_level > 0 ? AUTO : EXTERN;
sym->s_name = s;
Index: src/usr.bin/xlint/lint1/lint1.h
diff -u src/usr.bin/xlint/lint1/lint1.h:1.202 src/usr.bin/xlint/lint1/lint1.h:1.203
--- src/usr.bin/xlint/lint1/lint1.h:1.202 Thu Sep 14 21:08:12 2023
+++ src/usr.bin/xlint/lint1/lint1.h Sat Dec 2 21:47:05 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: lint1.h,v 1.202 2023/09/14 21:08:12 rillig Exp $ */
+/* $NetBSD: lint1.h,v 1.203 2023/12/02 21:47:05 rillig Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@@ -206,7 +206,7 @@ typedef enum {
* storage classes and related things
*/
typedef enum {
- NOSCL,
+ NO_SCL,
EXTERN, /* external symbols (independent of decl_t) */
STATIC, /* static symbols (local and global) */
AUTO, /* automatic symbols (except register) */
Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.581 src/usr.bin/xlint/lint1/tree.c:1.582
--- src/usr.bin/xlint/lint1/tree.c:1.581 Wed Sep 13 20:31:58 2023
+++ src/usr.bin/xlint/lint1/tree.c Sat Dec 2 21:47:05 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: tree.c,v 1.581 2023/09/13 20:31:58 rillig Exp $ */
+/* $NetBSD: tree.c,v 1.582 2023/12/02 21:47:05 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID)
-__RCSID("$NetBSD: tree.c,v 1.581 2023/09/13 20:31:58 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.582 2023/12/02 21:47:05 rillig Exp $");
#endif
#include <float.h>
@@ -486,7 +486,7 @@ tnode_t *
build_name(sym_t *sym, bool is_funcname)
{
- if (sym->s_scl == NOSCL && !in_gcc_attribute) {
+ if (sym->s_scl == NO_SCL && !in_gcc_attribute) {
sym->s_scl = EXTERN;
sym->s_def = DECL;
if (is_funcname)
@@ -1968,7 +1968,7 @@ struct_or_union_member(tnode_t *tn, op_t
return nested_mem;
}
- if (msym->s_scl == NOSCL) {
+ if (msym->s_scl == NO_SCL) {
remove_unknown_member(tn, msym);
return msym;
}