Module Name: src
Committed By: rillig
Date: Wed Dec 22 15:47:42 UTC 2021
Modified Files:
src/usr.bin/xlint/lint1: lex.c
Log Message:
lint: remove redundant EOF tests in lexer
No functional change.
To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 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.94 src/usr.bin/xlint/lint1/lex.c:1.95
--- src/usr.bin/xlint/lint1/lex.c:1.94 Wed Dec 22 15:20:08 2021
+++ src/usr.bin/xlint/lint1/lex.c Wed Dec 22 15:47:42 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: lex.c,v 1.94 2021/12/22 15:20:08 rillig Exp $ */
+/* $NetBSD: lex.c,v 1.95 2021/12/22 15:47:42 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.94 2021/12/22 15:20:08 rillig Exp $");
+__RCSID("$NetBSD: lex.c,v 1.95 2021/12/22 15:47:42 rillig Exp $");
#endif
#include <ctype.h>
@@ -945,12 +945,7 @@ get_escaped_char(int delim)
warning(82);
v = 0;
n = 0;
- /*
- * TODO: remove the redundant EOF test once the test
- * controlling_expression_with_comma_operator is
- * fixed in d_c99_bool_strict_syshdr.c.
- */
- while ((c = inpc()) != EOF && isxdigit(c)) {
+ while (c = inpc(), isxdigit(c)) {
c = isdigit(c) ?
c - '0' : toupper(c) - 'A' + 10;
v = (v << 4) + c;
@@ -1140,12 +1135,7 @@ lex_comment(void)
eoc = false;
/* Skip whitespace after the start of the comment */
- /*
- * TODO: remove the redundant EOF test once the test
- * controlling_expression_with_comma_operator is fixed in
- * d_c99_bool_strict_syshdr.c.
- */
- while ((c = inpc()) != EOF && isspace(c))
+ while (c = inpc(), isspace(c))
continue;
/* Read the potential keyword to keywd */