Module Name: src Committed By: rillig Date: Mon Jun 21 18:54:41 UTC 2021
Modified Files: src/usr.bin/make: metachar.c metachar.h Log Message: make: replace macro is_shell_metachar with inline function No functional change. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/usr.bin/make/metachar.c cvs rdiff -u -r1.16 -r1.17 src/usr.bin/make/metachar.h 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/make/metachar.c diff -u src/usr.bin/make/metachar.c:1.9 src/usr.bin/make/metachar.c:1.10 --- src/usr.bin/make/metachar.c:1.9 Tue Jan 19 20:51:46 2021 +++ src/usr.bin/make/metachar.c Mon Jun 21 18:54:41 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: metachar.c,v 1.9 2021/01/19 20:51:46 rillig Exp $ */ +/* $NetBSD: metachar.c,v 1.10 2021/06/21 18:54:41 rillig Exp $ */ /* * Copyright (c) 2015 The NetBSD Foundation, Inc. @@ -39,7 +39,7 @@ #include "metachar.h" -MAKE_RCSID("$NetBSD: metachar.c,v 1.9 2021/01/19 20:51:46 rillig Exp $"); +MAKE_RCSID("$NetBSD: metachar.c,v 1.10 2021/06/21 18:54:41 rillig Exp $"); /* * The following array is used to make a fast determination of which @@ -48,7 +48,7 @@ MAKE_RCSID("$NetBSD: metachar.c,v 1.9 20 * directly by us. */ -unsigned char _metachar[128] = { +const unsigned char _metachar[128] = { /* nul soh stx etx eot enq ack bel */ 1, 0, 0, 0, 0, 0, 0, 0, /* bs ht nl vt np cr so si */ Index: src/usr.bin/make/metachar.h diff -u src/usr.bin/make/metachar.h:1.16 src/usr.bin/make/metachar.h:1.17 --- src/usr.bin/make/metachar.h:1.16 Sat Apr 3 11:08:40 2021 +++ src/usr.bin/make/metachar.h Mon Jun 21 18:54:41 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: metachar.h,v 1.16 2021/04/03 11:08:40 rillig Exp $ */ +/* $NetBSD: metachar.h,v 1.17 2021/06/21 18:54:41 rillig Exp $ */ /* * Copyright (c) 2015 The NetBSD Foundation, Inc. @@ -33,9 +33,13 @@ #include "make.h" -extern unsigned char _metachar[]; +extern const unsigned char _metachar[]; -#define is_shell_metachar(c) (_metachar[(c) & 0x7f] != 0) +MAKE_INLINE bool +is_shell_metachar(char c) +{ + return _metachar[c & 0x7f] != 0; +} MAKE_INLINE bool needshell(const char *cmd)