Module Name:    src
Committed By:   rillig
Date:           Thu Aug 19 20:08:25 UTC 2021

Modified Files:
        src/usr.bin/xlint/lint1: lex.c

Log Message:
lint: clean up lex_integer_constant

When lexing an integer constant, it does not make sense to check for
'struct', 'void' or other types.  Furthermore, the constants were listed
in some random-looking order, which made the code hard to read.


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/usr.bin/xlint/lint1/lex.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/lex.c
diff -u src/usr.bin/xlint/lint1/lex.c:1.63 src/usr.bin/xlint/lint1/lex.c:1.64
--- src/usr.bin/xlint/lint1/lex.c:1.63	Thu Aug 19 08:59:22 2021
+++ src/usr.bin/xlint/lint1/lex.c	Thu Aug 19 20:08:25 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: lex.c,v 1.63 2021/08/19 08:59:22 christos Exp $ */
+/* $NetBSD: lex.c,v 1.64 2021/08/19 20:08:25 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: lex.c,v 1.63 2021/08/19 08:59:22 christos Exp $");
+__RCSID("$NetBSD: lex.c,v 1.64 2021/08/19 20:08:25 rillig Exp $");
 #endif
 
 #include <ctype.h>
@@ -665,30 +665,7 @@ lex_integer_constant(const char *yytext,
 #endif
 		break;
 #endif
-		/* LINTED206: (enumeration values not handled in switch) */
-	case STRUCT:
-	case VOID:
-	case LDOUBLE:
-	case FUNC:
-	case ARRAY:
-	case PTR:
-	case ENUM:
-	case UNION:
-	case SIGNED:
-	case NOTSPEC:
-	case DOUBLE:
-	case FLOAT:
-	case USHORT:
-	case SHORT:
-	case UCHAR:
-	case SCHAR:
-	case CHAR:
-	case BOOL:
-	case UNSIGN:
-	case FCOMPLEX:
-	case DCOMPLEX:
-	case LCOMPLEX:
-	case COMPLEX:
+	default:
 		break;
 	}
 

Reply via email to