Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make make: inline strcmp when parsing conditions



details:   https://anonhg.NetBSD.org/src/rev/f89e65ffc1ff
branches:  trunk
changeset: 1021632:f89e65ffc1ff
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Jun 11 14:52:03 2021 +0000

description:
make: inline strcmp when parsing conditions

GCC 10 does not do that even though it could easily.

No functional change.

diffstat:

 usr.bin/make/cond.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 3680475c8f1d -r f89e65ffc1ff usr.bin/make/cond.c
--- a/usr.bin/make/cond.c       Fri Jun 11 14:42:52 2021 +0000
+++ b/usr.bin/make/cond.c       Fri Jun 11 14:52:03 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cond.c,v 1.266 2021/06/11 14:42:52 rillig Exp $        */
+/*     $NetBSD: cond.c,v 1.267 2021/06/11 14:52:03 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -95,7 +95,7 @@
 #include "dir.h"
 
 /*     "@(#)cond.c     8.2 (Berkeley) 1/2/94"  */
-MAKE_RCSID("$NetBSD: cond.c,v 1.266 2021/06/11 14:42:52 rillig Exp $");
+MAKE_RCSID("$NetBSD: cond.c,v 1.267 2021/06/11 14:52:03 rillig Exp $");
 
 /*
  * The parsing of conditional expressions is based on this grammar:
@@ -400,7 +400,8 @@
 static bool
 is_separator(char ch)
 {
-       return ch == '\0' || ch_isspace(ch) || strchr("!=><)", ch) != NULL;
+       return ch == '\0' || ch_isspace(ch) || ch == '!' || ch == '=' ||
+              ch == '>' || ch == '<' || ch == ')' /* but not '(' */;
 }
 
 /*



Home | Main Index | Thread Index | Old Index