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): inline constant for hash table size



details:   https://anonhg.NetBSD.org/src/rev/c0534ecea86a
branches:  trunk
changeset: 943382:c0534ecea86a
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Sep 01 20:54:00 2020 +0000

description:
make(1): inline constant for hash table size

The name HTSIZE didn't provide any explanation for the value 191, and it
is obvious that this is a hash table size.  Therefore giving the
constant a name didn't explain anything or make it less magic.

diffstat:

 usr.bin/make/targ.c |  10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diffs (44 lines):

diff -r 00589fa1b65a -r c0534ecea86a usr.bin/make/targ.c
--- a/usr.bin/make/targ.c       Tue Sep 01 20:34:51 2020 +0000
+++ b/usr.bin/make/targ.c       Tue Sep 01 20:54:00 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: targ.c,v 1.80 2020/08/30 14:11:42 rillig Exp $ */
+/*     $NetBSD: targ.c,v 1.81 2020/09/01 20:54:00 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: targ.c,v 1.80 2020/08/30 14:11:42 rillig Exp $";
+static char rcsid[] = "$NetBSD: targ.c,v 1.81 2020/09/01 20:54:00 rillig Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)targ.c     8.2 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: targ.c,v 1.80 2020/08/30 14:11:42 rillig Exp $");
+__RCSID("$NetBSD: targ.c,v 1.81 2020/09/01 20:54:00 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -140,8 +140,6 @@
 #endif
 static Hash_Table targets;     /* a hash table of same */
 
-#define HTSIZE 191             /* initial size of hash table */
-
 static int TargPrintOnlySrc(void *, void *);
 static int TargPrintName(void *, void *);
 #ifdef CLEANUP
@@ -152,7 +150,7 @@
 Targ_Init(void)
 {
     allTargets = Lst_Init();
-    Hash_InitTable(&targets, HTSIZE);
+    Hash_InitTable(&targets, 191);
 }
 
 void



Home | Main Index | Thread Index | Old Index