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: clean up lex_integer_constant



details:   https://anonhg.NetBSD.org/src/rev/5c5295d34e6e
branches:  trunk
changeset: 985340:5c5295d34e6e
user:      rillig <rillig%NetBSD.org@localhost>
date:      Thu Aug 19 20:08:25 2021 +0000

description:
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.

diffstat:

 usr.bin/xlint/lint1/lex.c |  29 +++--------------------------
 1 files changed, 3 insertions(+), 26 deletions(-)

diffs (50 lines):

diff -r 28ca5c9b0d50 -r 5c5295d34e6e usr.bin/xlint/lint1/lex.c
--- a/usr.bin/xlint/lint1/lex.c Thu Aug 19 18:39:34 2021 +0000
+++ b/usr.bin/xlint/lint1/lex.c Thu Aug 19 20:08:25 2021 +0000
@@ -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 @@
 #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;
        }
 



Home | Main Index | Thread Index | Old Index