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: move scl_name from print.c to decl.c



details:   https://anonhg.NetBSD.org/src/rev/9dd141f66016
branches:  trunk
changeset: 1022588:9dd141f66016
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Jul 25 22:14:36 2021 +0000

description:
lint: move scl_name from print.c to decl.c

It is only needed there.

diffstat:

 usr.bin/xlint/lint1/Makefile   |   4 +-
 usr.bin/xlint/lint1/decl.c     |  18 ++++++++++++-
 usr.bin/xlint/lint1/externs1.h |   7 +----
 usr.bin/xlint/lint1/print.c    |  55 ------------------------------------------
 4 files changed, 19 insertions(+), 65 deletions(-)

diffs (137 lines):

diff -r 56e105d65b54 -r 9dd141f66016 usr.bin/xlint/lint1/Makefile
--- a/usr.bin/xlint/lint1/Makefile      Sun Jul 25 22:03:42 2021 +0000
+++ b/usr.bin/xlint/lint1/Makefile      Sun Jul 25 22:14:36 2021 +0000
@@ -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 @@
 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=
diff -r 56e105d65b54 -r 9dd141f66016 usr.bin/xlint/lint1/decl.c
--- a/usr.bin/xlint/lint1/decl.c        Sun Jul 25 22:03:42 2021 +0000
+++ b/usr.bin/xlint/lint1/decl.c        Sun Jul 25 22:14:36 2021 +0000
@@ -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 @@
        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.
  *
diff -r 56e105d65b54 -r 9dd141f66016 usr.bin/xlint/lint1/externs1.h
--- a/usr.bin/xlint/lint1/externs1.h    Sun Jul 25 22:03:42 2021 +0000
+++ b/usr.bin/xlint/lint1/externs1.h    Sun Jul 25 22:14:36 2021 +0000
@@ -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 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,
diff -r 56e105d65b54 -r 9dd141f66016 usr.bin/xlint/lint1/print.c
--- a/usr.bin/xlint/lint1/print.c       Sun Jul 25 22:03:42 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*     $NetBSD: print.c,v 1.15 2021/06/20 20:59:08 rillig Exp $        */
-
-/*-
- * Copyright (c) 2003 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Christos Zoulas.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#if HAVE_NBTOOL_CONFIG_H
-#include "nbtool_config.h"
-#endif
-
-#include <sys/cdefs.h>
-#ifndef lint
-__RCSID("$NetBSD: print.c,v 1.15 2021/06/20 20:59:08 rillig Exp $");
-#endif
-
-#include "lint1.h"
-
-/* Return the name of the "storage class" in the wider sense. */
-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];
-}



Home | Main Index | Thread Index | Old Index