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/c9df6004f843
branches:  trunk
changeset: 1023023:c9df6004f843
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 1a9b7bdb6758 -r c9df6004f843 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