Module Name:    src
Committed By:   rillig
Date:           Sun Aug 22 13:21:48 UTC 2021

Modified Files:
        src/usr.bin/xlint/lint2: read.c

Log Message:
lint: clean up error handling in lint2

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


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/usr.bin/xlint/lint2/read.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/lint2/read.c
diff -u src/usr.bin/xlint/lint2/read.c:1.54 src/usr.bin/xlint/lint2/read.c:1.55
--- src/usr.bin/xlint/lint2/read.c:1.54	Sun Aug 22 13:12:39 2021
+++ src/usr.bin/xlint/lint2/read.c	Sun Aug 22 13:21:48 2021
@@ -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 @@ decldef(pos_t *posp, const char *cp)
 		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 @@ decldef(pos_t *posp, const char *cp)
 			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 @@ gettlen(const char *cp, const char **epp
 			(void)parse_int(&cp);
 			break;
 		default:
-			inperr("bad value: %c\n", cp[-1]);
+			inperr("bad value: %c", cp[-1]);
 		}
 		break;
 	default:

Reply via email to