Module Name:    src
Committed By:   rillig
Date:           Tue Sep  1 21:00:15 UTC 2020

Modified Files:
        src/usr.bin/make: hash.h

Log Message:
make(1): replace Hash_Table macros with inline functions


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/usr.bin/make/hash.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/hash.h
diff -u src/usr.bin/make/hash.h:1.19 src/usr.bin/make/hash.h:1.20
--- src/usr.bin/make/hash.h:1.19	Sat Aug 29 11:13:43 2020
+++ src/usr.bin/make/hash.h	Tue Sep  1 21:00:15 2020
@@ -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 @@ typedef struct Hash_Search {
     Hash_Entry 	*hashEntryPtr;	/* Next entry to check in current bucket. */
 } Hash_Search;
 
-/*
- * Macros.
- */
-
-/*
- * void * Hash_GetValue(h)
- *     Hash_Entry *h;
- */
-
-#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_GetValue(Hash_Entry *h)
+{
+    return h->clientPtr;
+}
+
+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 *);

Reply via email to