Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/xlint/lint2 lint: clean up error handling in lint2



details:   https://anonhg.NetBSD.org/src/rev/3b097d06d7f5
branches:  trunk
changeset: 1023071:3b097d06d7f5
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Aug 22 13:21:48 2021 +0000

description:
lint: clean up error handling in lint2

These are edge cases that don't happen in practice, therefore reduce the
size of the binary.

diffstat:

 usr.bin/xlint/lint2/read.c |  16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diffs (63 lines):

diff -r 52fa02ad2868 -r 3b097d06d7f5 usr.bin/xlint/lint2/read.c
--- a/usr.bin/xlint/lint2/read.c        Sun Aug 22 13:12:39 2021 +0000
+++ b/usr.bin/xlint/lint2/read.c        Sun Aug 22 13:21:48 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: read.c,v 1.54 2021/08/22 13:12:39 rillig Exp $ */
+/* $NetBSD: read.c,v 1.55 2021/08/22 13:21:48 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: read.c,v 1.54 2021/08/22 13:12:39 rillig Exp $");
+__RCSID("$NetBSD: read.c,v 1.55 2021/08/22 13:21:48 rillig Exp $");
 #endif
 
 #include <ctype.h>
@@ -393,17 +393,17 @@
                switch (c) {
                case 'd':
                        if (sym.s_def != NODECL)
-                               inperr("nodecl %c", c);
+                               inperr("def");
                        sym.s_def = DEF;
                        break;
                case 'e':
                        if (sym.s_def != NODECL)
-                               inperr("nodecl %c", c);
+                               inperr("decl");
                        sym.s_def = DECL;
                        break;
                case 'i':
                        if (sym.s_inline)
-                               inperr("inline %c", c);
+                               inperr("inline");
                        sym.s_inline = true;
                        break;
                case 'o':
@@ -423,12 +423,12 @@
                        break;
                case 't':
                        if (sym.s_def != NODECL)
-                               inperr("nodecl %c", c);
+                               inperr("tdef");
                        sym.s_def = TDEF;
                        break;
                case 'u':
                        if (used)
-                               inperr("used %c", c);
+                               inperr("used");
                        used = true;
                        break;
                case 'v':
@@ -894,7 +894,7 @@
                        (void)parse_int(&cp);
                        break;
                default:
-                       inperr("bad value: %c\n", cp[-1]);
+                       inperr("bad value: %c", cp[-1]);
                }
                break;
        default:



Home | Main Index | Thread Index | Old Index