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): replace Hash_Table macros with inline ...



details:   https://anonhg.NetBSD.org/src/rev/2528714bd995
branches:  trunk
changeset: 938087:2528714bd995
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Sep 01 21:00:15 2020 +0000

description:
make(1): replace Hash_Table macros with inline functions

diffstat:

 usr.bin/make/hash.h |  29 +++++++++++------------------
 1 files changed, 11 insertions(+), 18 deletions(-)

diffs (44 lines):

diff -r 1fef915460fb -r 2528714bd995 usr.bin/make/hash.h
--- a/usr.bin/make/hash.h       Tue Sep 01 20:54:00 2020 +0000
+++ b/usr.bin/make/hash.h       Tue Sep 01 21:00:15 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hash.h,v 1.19 2020/08/29 11:13:43 rillig Exp $ */
+/*     $NetBSD: hash.h,v 1.20 2020/09/01 21:00:15 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -114,24 +114,17 @@
     Hash_Entry         *hashEntryPtr;  /* Next entry to check in current bucket. */
 } Hash_Search;
 
-/*
- * Macros.
- */
-
-/*
- * void * Hash_GetValue(h)
- *     Hash_Entry *h;
- */
+static inline void * MAKE_ATTR_UNUSED
+Hash_GetValue(Hash_Entry *h)
+{
+    return h->clientPtr;
+}
 
-#define Hash_GetValue(h) ((h)->clientPtr)
-
-/*
- * Hash_SetValue(h, val);
- *     Hash_Entry *h;
- *     char *val;
- */
-
-#define Hash_SetValue(h, val) ((h)->clientPtr = (val))
+static inline void MAKE_ATTR_UNUSED
+Hash_SetValue(Hash_Entry *h, void *datum)
+{
+    h->clientPtr = datum;
+}
 
 void Hash_InitTable(Hash_Table *, int);
 void Hash_DeleteTable(Hash_Table *);



Home | Main Index | Thread Index | Old Index