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: replace macro is_shell_metachar with inli...



details:   https://anonhg.NetBSD.org/src/rev/5087dadd9748
branches:  trunk
changeset: 984112:5087dadd9748
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Jun 21 18:54:41 2021 +0000

description:
make: replace macro is_shell_metachar with inline function

No functional change.

diffstat:

 usr.bin/make/metachar.c |   6 +++---
 usr.bin/make/metachar.h |  10 +++++++---
 2 files changed, 10 insertions(+), 6 deletions(-)

diffs (52 lines):

diff -r 47492a9f0edf -r 5087dadd9748 usr.bin/make/metachar.c
--- a/usr.bin/make/metachar.c   Mon Jun 21 18:25:20 2021 +0000
+++ b/usr.bin/make/metachar.c   Mon Jun 21 18:54:41 2021 +0000
@@ -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 @@
  * 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 */
diff -r 47492a9f0edf -r 5087dadd9748 usr.bin/make/metachar.h
--- a/usr.bin/make/metachar.h   Mon Jun 21 18:25:20 2021 +0000
+++ b/usr.bin/make/metachar.h   Mon Jun 21 18:54:41 2021 +0000
@@ -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)



Home | Main Index | Thread Index | Old Index