Module Name: src Committed By: rillig Date: Sat Apr 16 20:08:35 UTC 2022
Modified Files: src/usr.bin/xlint/lint1: lex.c Log Message: lint: remove null marker from keyword table No functional change. To generate a diff of this commit: cvs rdiff -u -r1.122 -r1.123 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.122 src/usr.bin/xlint/lint1/lex.c:1.123 --- src/usr.bin/xlint/lint1/lex.c:1.122 Sat Apr 16 20:02:55 2022 +++ src/usr.bin/xlint/lint1/lex.c Sat Apr 16 20:08:35 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: lex.c,v 1.122 2022/04/16 20:02:55 rillig Exp $ */ +/* $NetBSD: lex.c,v 1.123 2022/04/16 20:08:35 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.122 2022/04/16 20:02:55 rillig Exp $"); +__RCSID("$NetBSD: lex.c,v 1.123 2022/04/16 20:08:35 rillig Exp $"); #endif #include <ctype.h> @@ -220,7 +220,6 @@ static const struct keyword { kwdef_gcc_attr( "warn_unused_result", T_AT_WARN_UNUSED_RESULT), kwdef_gcc_attr( "weak", T_AT_WEAK), kwdef_keyword( "while", T_WHILE), - kwdef(NULL, 0, 0, 0, 0, 0, 0, 0, 0), #undef kwdef #undef kwdef_token #undef kwdef_sclass @@ -415,9 +414,10 @@ add_keyword(const struct keyword *kw, bo void initscan(void) { - const struct keyword *kw; + const struct keyword *kw, *end; - for (kw = keywords; kw->kw_name != NULL; kw++) { + end = keywords + sizeof(keywords) / sizeof(keywords[0]); + for (kw = keywords; kw != end; kw++) { if ((kw->kw_c90 || kw->kw_c99) && tflag) continue; /* FIXME: C99 and GCC are independent. */