Module Name: src
Committed By: rillig
Date: Sun Jul 25 22:14:37 UTC 2021
Modified Files:
src/usr.bin/xlint/lint1: Makefile decl.c externs1.h
Removed Files:
src/usr.bin/xlint/lint1: print.c
Log Message:
lint: move scl_name from print.c to decl.c
It is only needed there.
To generate a diff of this commit:
cvs rdiff -u -r1.79 -r1.80 src/usr.bin/xlint/lint1/Makefile
cvs rdiff -u -r1.209 -r1.210 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.120 -r1.121 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.15 -r0 src/usr.bin/xlint/lint1/print.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/Makefile
diff -u src/usr.bin/xlint/lint1/Makefile:1.79 src/usr.bin/xlint/lint1/Makefile:1.80
--- src/usr.bin/xlint/lint1/Makefile:1.79 Sat Jul 10 09:14:38 2021
+++ src/usr.bin/xlint/lint1/Makefile Sun Jul 25 22:14:36 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.79 2021/07/10 09:14:38 rillig Exp $
+# $NetBSD: Makefile,v 1.80 2021/07/25 22:14:36 rillig Exp $
.include <bsd.own.mk>
@@ -6,7 +6,7 @@ PROG= lint1
SRCS= cgram.y \
ckbool.c ckctype.c ckgetopt.c \
decl.c emit.c emit1.c err.c func.c init.c inittyp.c lex.c \
- main1.c mem.c mem1.c oper.c print.c scan.l tree.c tyname.c
+ main1.c mem.c mem1.c oper.c scan.l tree.c tyname.c
MAN= lint.7
YHEADER=
Index: src/usr.bin/xlint/lint1/decl.c
diff -u src/usr.bin/xlint/lint1/decl.c:1.209 src/usr.bin/xlint/lint1/decl.c:1.210
--- src/usr.bin/xlint/lint1/decl.c:1.209 Fri Jul 23 16:48:48 2021
+++ src/usr.bin/xlint/lint1/decl.c Sun Jul 25 22:14:36 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.209 2021/07/23 16:48:48 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.210 2021/07/25 22:14:36 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.209 2021/07/23 16:48:48 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.210 2021/07/25 22:14:36 rillig Exp $");
#endif
#include <sys/param.h>
@@ -133,6 +133,20 @@ initdecl(void)
typetab[UNSIGN].t_tspec = UNSIGN;
}
+/* Return the name of the "storage class" in the wider sense. */
+static const char *
+scl_name(scl_t scl)
+{
+ static const char *const names[] = {
+ "none", "extern", "static", "auto", "register", "typedef",
+ "struct", "union", "enum", "member of struct", "member of union",
+ "compile-time constant", "abstract", "argument",
+ "prototype argument", "inline"
+ };
+
+ return names[scl];
+}
+
/*
* Returns a shared type structure for arithmetic types and void.
*
Index: src/usr.bin/xlint/lint1/externs1.h
diff -u src/usr.bin/xlint/lint1/externs1.h:1.120 src/usr.bin/xlint/lint1/externs1.h:1.121
--- src/usr.bin/xlint/lint1/externs1.h:1.120 Tue Jul 20 19:44:36 2021
+++ src/usr.bin/xlint/lint1/externs1.h Sun Jul 25 22:14:36 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: externs1.h,v 1.120 2021/07/20 19:44:36 rillig Exp $ */
+/* $NetBSD: externs1.h,v 1.121 2021/07/25 22:14:36 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -340,11 +340,6 @@ extern void lex_unknown_character(int);
extern int lex_input(void);
/*
- * print.c
- */
-const char *scl_name(scl_t);
-
-/*
* ckbool.c
*/
extern bool typeok_scalar_strict_bool(op_t, const mod_t *, int,