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(1): use consistent definition for MAKE_INLINE



details:   https://anonhg.NetBSD.org/src/rev/28be2dac4398
branches:  trunk
changeset: 942531:28be2dac4398
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Nov 10 00:32:12 2020 +0000

description:
make(1): use consistent definition for MAKE_INLINE

diffstat:

 usr.bin/make/buf.h         |   8 ++++----
 usr.bin/make/hash.h        |   6 +++---
 usr.bin/make/lst.h         |   6 +++---
 usr.bin/make/make.h        |  44 +++++++++++++++++++++++---------------------
 usr.bin/make/make_malloc.h |   4 ++--
 usr.bin/make/metachar.h    |   4 ++--
 usr.bin/make/nonints.h     |   4 ++--
 usr.bin/make/var.c         |   8 ++++----
 8 files changed, 43 insertions(+), 41 deletions(-)

diffs (290 lines):

diff -r 79274cdf3d9a -r 28be2dac4398 usr.bin/make/buf.h
--- a/usr.bin/make/buf.h        Tue Nov 10 00:19:19 2020 +0000
+++ b/usr.bin/make/buf.h        Tue Nov 10 00:32:12 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: buf.h,v 1.35 2020/11/07 14:11:58 rillig Exp $  */
+/*     $NetBSD: buf.h,v 1.36 2020/11/10 00:32:12 rillig Exp $  */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -94,7 +94,7 @@
 void Buf_Expand_1(Buffer *);
 
 /* Buf_AddByte adds a single byte to a buffer. */
-static inline MAKE_ATTR_UNUSED void
+MAKE_INLINE void
 Buf_AddByte(Buffer *buf, char byte)
 {
     size_t old_len = buf->len++;
@@ -106,13 +106,13 @@
     end[1] = '\0';
 }
 
-static inline MAKE_ATTR_UNUSED size_t
+MAKE_INLINE size_t
 Buf_Len(const Buffer *buf)
 {
     return buf->len;
 }
 
-static inline MAKE_ATTR_UNUSED Boolean
+MAKE_INLINE Boolean
 Buf_EndsWith(const Buffer *buf, char ch)
 {
     return buf->len > 0 && buf->data[buf->len - 1] == ch;
diff -r 79274cdf3d9a -r 28be2dac4398 usr.bin/make/hash.h
--- a/usr.bin/make/hash.h       Tue Nov 10 00:19:19 2020 +0000
+++ b/usr.bin/make/hash.h       Tue Nov 10 00:32:12 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hash.h,v 1.31 2020/10/25 19:19:07 rillig Exp $ */
+/*     $NetBSD: hash.h,v 1.32 2020/11/10 00:32:12 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -103,13 +103,13 @@
     HashEntry *entry;          /* Next entry to check in current bucket. */
 } HashIter;
 
-static inline MAKE_ATTR_UNUSED void *
+MAKE_INLINE void *
 HashEntry_Get(HashEntry *h)
 {
     return h->value;
 }
 
-static inline MAKE_ATTR_UNUSED void
+MAKE_INLINE void
 HashEntry_Set(HashEntry *h, void *datum)
 {
     h->value = datum;
diff -r 79274cdf3d9a -r 28be2dac4398 usr.bin/make/lst.h
--- a/usr.bin/make/lst.h        Tue Nov 10 00:19:19 2020 +0000
+++ b/usr.bin/make/lst.h        Tue Nov 10 00:32:12 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lst.h,v 1.84 2020/10/28 02:43:16 rillig Exp $  */
+/*     $NetBSD: lst.h,v 1.85 2020/11/10 00:32:12 rillig Exp $  */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -118,7 +118,7 @@
 
 /* Get information about a list */
 
-static inline MAKE_ATTR_UNUSED Boolean
+MAKE_INLINE Boolean
 Lst_IsEmpty(List *list) { return list->first == NULL; }
 
 /* Find the first node that contains the given datum, or NULL. */
@@ -173,7 +173,7 @@
 
 /* Return the pointer to the given item in the vector.
  * The returned data is valid until the next modifying operation. */
-static inline MAKE_ATTR_UNUSED void *
+MAKE_INLINE void *
 Vector_Get(Vector *v, size_t i)
 {
     unsigned char *items = v->items;
diff -r 79274cdf3d9a -r 28be2dac4398 usr.bin/make/make.h
--- a/usr.bin/make/make.h       Tue Nov 10 00:19:19 2020 +0000
+++ b/usr.bin/make/make.h       Tue Nov 10 00:32:12 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: make.h,v 1.204 2020/11/08 23:38:02 rillig Exp $        */
+/*     $NetBSD: make.h,v 1.205 2020/11/10 00:32:12 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -130,6 +130,8 @@
 #define MAKE_ATTR_PRINTFLIKE(fmtarg, firstvararg)      /* delete */
 #endif
 
+#define MAKE_INLINE static inline MAKE_ATTR_UNUSED
+
 /*
  * A boolean type is defined as an integer, not an enum, for historic reasons.
  * The only allowed values are the constants TRUE and FALSE (1 and 0).
@@ -657,31 +659,31 @@
 Boolean GNode_ShouldExecute(GNode *gn);
 
 /* See if the node was seen on the left-hand side of a dependency operator. */
-static MAKE_ATTR_UNUSED Boolean
+MAKE_INLINE Boolean
 GNode_IsTarget(const GNode *gn)
 {
     return (gn->type & OP_OPMASK) != 0;
 }
 
-static MAKE_ATTR_UNUSED const char *
+MAKE_INLINE const char *
 GNode_Path(const GNode *gn)
 {
     return gn->path != NULL ? gn->path : gn->name;
 }
 
-static MAKE_ATTR_UNUSED const char *
+MAKE_INLINE const char *
 GNode_VarTarget(GNode *gn) { return Var_ValueDirect(TARGET, gn); }
-static MAKE_ATTR_UNUSED const char *
+MAKE_INLINE const char *
 GNode_VarOodate(GNode *gn) { return Var_ValueDirect(OODATE, gn); }
-static MAKE_ATTR_UNUSED const char *
+MAKE_INLINE const char *
 GNode_VarAllsrc(GNode *gn) { return Var_ValueDirect(ALLSRC, gn); }
-static MAKE_ATTR_UNUSED const char *
+MAKE_INLINE const char *
 GNode_VarImpsrc(GNode *gn) { return Var_ValueDirect(IMPSRC, gn); }
-static MAKE_ATTR_UNUSED const char *
+MAKE_INLINE const char *
 GNode_VarPrefix(GNode *gn) { return Var_ValueDirect(PREFIX, gn); }
-static MAKE_ATTR_UNUSED const char *
+MAKE_INLINE const char *
 GNode_VarArchive(GNode *gn) { return Var_ValueDirect(ARCHIVE, gn); }
-static MAKE_ATTR_UNUSED const char *
+MAKE_INLINE const char *
 GNode_VarMember(GNode *gn) { return Var_ValueDirect(MEMBER, gn); }
 
 #ifdef __GNUC__
@@ -710,43 +712,43 @@
 #define KILLPG(pid, sig)       killpg((pid), (sig))
 #endif
 
-static inline MAKE_ATTR_UNUSED Boolean
+MAKE_INLINE Boolean
 ch_isalnum(char ch) { return isalnum((unsigned char)ch) != 0; }
-static inline MAKE_ATTR_UNUSED Boolean
+MAKE_INLINE Boolean
 ch_isalpha(char ch) { return isalpha((unsigned char)ch) != 0; }
-static inline MAKE_ATTR_UNUSED Boolean
+MAKE_INLINE Boolean
 ch_isdigit(char ch) { return isdigit((unsigned char)ch) != 0; }
-static inline MAKE_ATTR_UNUSED Boolean
+MAKE_INLINE Boolean
 ch_isspace(char ch) { return isspace((unsigned char)ch) != 0; }
-static inline MAKE_ATTR_UNUSED Boolean
+MAKE_INLINE Boolean
 ch_isupper(char ch) { return isupper((unsigned char)ch) != 0; }
-static inline MAKE_ATTR_UNUSED char
+MAKE_INLINE char
 ch_tolower(char ch) { return (char)tolower((unsigned char)ch); }
-static inline MAKE_ATTR_UNUSED char
+MAKE_INLINE char
 ch_toupper(char ch) { return (char)toupper((unsigned char)ch); }
 
-static inline MAKE_ATTR_UNUSED void
+MAKE_INLINE void
 cpp_skip_whitespace(const char **pp)
 {
     while (ch_isspace(**pp))
        (*pp)++;
 }
 
-static inline MAKE_ATTR_UNUSED void
+MAKE_INLINE void
 cpp_skip_hspace(const char **pp)
 {
     while (**pp == ' ' || **pp == '\t')
        (*pp)++;
 }
 
-static inline MAKE_ATTR_UNUSED void
+MAKE_INLINE void
 pp_skip_whitespace(char **pp)
 {
     while (ch_isspace(**pp))
        (*pp)++;
 }
 
-static inline MAKE_ATTR_UNUSED void
+MAKE_INLINE void
 pp_skip_hspace(char **pp)
 {
     while (**pp == ' ' || **pp == '\t')
diff -r 79274cdf3d9a -r 28be2dac4398 usr.bin/make/make_malloc.h
--- a/usr.bin/make/make_malloc.h        Tue Nov 10 00:19:19 2020 +0000
+++ b/usr.bin/make/make_malloc.h        Tue Nov 10 00:32:12 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: make_malloc.h,v 1.12 2020/10/19 23:43:55 rillig Exp $  */
+/*     $NetBSD: make_malloc.h,v 1.13 2020/11/10 00:32:12 rillig Exp $  */
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -46,7 +46,7 @@
  *
  * The case of a NULL pointer happens especially often after Var_Value,
  * since only environment variables need to be freed, but not others. */
-static inline MAKE_ATTR_UNUSED void
+MAKE_INLINE void
 bmake_free(void *p)
 {
     if (p != NULL)
diff -r 79274cdf3d9a -r 28be2dac4398 usr.bin/make/metachar.h
--- a/usr.bin/make/metachar.h   Tue Nov 10 00:19:19 2020 +0000
+++ b/usr.bin/make/metachar.h   Tue Nov 10 00:32:12 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: metachar.h,v 1.11 2020/10/31 18:20:00 rillig Exp $     */
+/*     $NetBSD: metachar.h,v 1.12 2020/11/10 00:32:12 rillig Exp $     */
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 
 #define is_shell_metachar(c)   _metachar[(c) & 0x7f]
 
-static inline MAKE_ATTR_UNUSED int
+MAKE_INLINE int
 needshell(const char *cmd)
 {
        while (!is_shell_metachar(*cmd) && *cmd != ':' && *cmd != '=')
diff -r 79274cdf3d9a -r 28be2dac4398 usr.bin/make/nonints.h
--- a/usr.bin/make/nonints.h    Tue Nov 10 00:19:19 2020 +0000
+++ b/usr.bin/make/nonints.h    Tue Nov 10 00:32:12 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nonints.h,v 1.159 2020/11/08 16:58:33 rillig Exp $     */
+/*     $NetBSD: nonints.h,v 1.160 2020/11/10 00:32:12 rillig Exp $     */
 
 /*-
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -156,7 +156,7 @@
 } Words;
 
 Words Str_Words(const char *, Boolean);
-static inline MAKE_ATTR_UNUSED void
+MAKE_INLINE void
 Words_Free(Words w) {
     free(w.words);
     free(w.freeIt);
diff -r 79274cdf3d9a -r 28be2dac4398 usr.bin/make/var.c
--- a/usr.bin/make/var.c        Tue Nov 10 00:19:19 2020 +0000
+++ b/usr.bin/make/var.c        Tue Nov 10 00:32:12 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.683 2020/11/08 23:38:02 rillig Exp $ */
+/*     $NetBSD: var.c,v 1.684 2020/11/10 00:32:12 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -130,7 +130,7 @@
 #include "metachar.h"
 
 /*     "@(#)var.c      8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.683 2020/11/08 23:38:02 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.684 2020/11/10 00:32:12 rillig Exp $");
 
 #define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1)
 #define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2)
@@ -1985,7 +1985,7 @@
 }
 
 /* Test whether mod starts with modname, followed by a delimiter. */
-static Boolean
+MAKE_INLINE Boolean
 ModMatch(const char *mod, const char *modname, char endc)
 {
     size_t n = strlen(modname);
@@ -1994,7 +1994,7 @@
 }
 
 /* Test whether mod starts with modname, followed by a delimiter or '='. */
-static inline Boolean
+MAKE_INLINE Boolean
 ModMatchEq(const char *mod, const char *modname, char endc)
 {
     size_t n = strlen(modname);



Home | Main Index | Thread Index | Old Index