Module Name: src
Committed By: rillig
Date: Tue Nov 10 00:32:13 UTC 2020
Modified Files:
src/usr.bin/make: buf.h hash.h lst.h make.h make_malloc.h metachar.h
nonints.h var.c
Log Message:
make(1): use consistent definition for MAKE_INLINE
To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/usr.bin/make/buf.h
cvs rdiff -u -r1.31 -r1.32 src/usr.bin/make/hash.h
cvs rdiff -u -r1.84 -r1.85 src/usr.bin/make/lst.h
cvs rdiff -u -r1.204 -r1.205 src/usr.bin/make/make.h
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/make/make_malloc.h
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/make/metachar.h
cvs rdiff -u -r1.159 -r1.160 src/usr.bin/make/nonints.h
cvs rdiff -u -r1.683 -r1.684 src/usr.bin/make/var.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/make/buf.h
diff -u src/usr.bin/make/buf.h:1.35 src/usr.bin/make/buf.h:1.36
--- src/usr.bin/make/buf.h:1.35 Sat Nov 7 14:11:58 2020
+++ src/usr.bin/make/buf.h Tue Nov 10 00:32:12 2020
@@ -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 @@ typedef struct Buffer {
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 @@ Buf_AddByte(Buffer *buf, char byte)
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;
Index: src/usr.bin/make/hash.h
diff -u src/usr.bin/make/hash.h:1.31 src/usr.bin/make/hash.h:1.32
--- src/usr.bin/make/hash.h:1.31 Sun Oct 25 19:19:07 2020
+++ src/usr.bin/make/hash.h Tue Nov 10 00:32:12 2020
@@ -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 @@ typedef struct HashIter {
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;
Index: src/usr.bin/make/lst.h
diff -u src/usr.bin/make/lst.h:1.84 src/usr.bin/make/lst.h:1.85
--- src/usr.bin/make/lst.h:1.84 Wed Oct 28 02:43:16 2020
+++ src/usr.bin/make/lst.h Tue Nov 10 00:32:12 2020
@@ -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 @@ void Lst_Destroy(List *, LstFreeProc);
/* 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 @@ void Vector_Init(Vector *, size_t);
/* 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;
Index: src/usr.bin/make/make.h
diff -u src/usr.bin/make/make.h:1.204 src/usr.bin/make/make.h:1.205
--- src/usr.bin/make/make.h:1.204 Sun Nov 8 23:38:02 2020
+++ src/usr.bin/make/make.h Tue Nov 10 00:32:12 2020
@@ -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 @@ void GNode_FprintDetails(FILE *, const c
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 @@ GNode_VarMember(GNode *gn) { return Var_
#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')
Index: src/usr.bin/make/make_malloc.h
diff -u src/usr.bin/make/make_malloc.h:1.12 src/usr.bin/make/make_malloc.h:1.13
--- src/usr.bin/make/make_malloc.h:1.12 Mon Oct 19 23:43:55 2020
+++ src/usr.bin/make/make_malloc.h Tue Nov 10 00:32:12 2020
@@ -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 @@ char *bmake_strsedup(const char *, const
*
* 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)
Index: src/usr.bin/make/metachar.h
diff -u src/usr.bin/make/metachar.h:1.11 src/usr.bin/make/metachar.h:1.12
--- src/usr.bin/make/metachar.h:1.11 Sat Oct 31 18:20:00 2020
+++ src/usr.bin/make/metachar.h Tue Nov 10 00:32:12 2020
@@ -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 @@ extern unsigned char _metachar[];
#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 != '=')
Index: src/usr.bin/make/nonints.h
diff -u src/usr.bin/make/nonints.h:1.159 src/usr.bin/make/nonints.h:1.160
--- src/usr.bin/make/nonints.h:1.159 Sun Nov 8 16:58:33 2020
+++ src/usr.bin/make/nonints.h Tue Nov 10 00:32:12 2020
@@ -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 @@ typedef struct Words {
} 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);
Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.683 src/usr.bin/make/var.c:1.684
--- src/usr.bin/make/var.c:1.683 Sun Nov 8 23:38:02 2020
+++ src/usr.bin/make/var.c Tue Nov 10 00:32:12 2020
@@ -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 @@ ParseModifierPart(
}
/* 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 @@ ModMatch(const char *mod, const char *mo
}
/* 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);