From 795de22c71693a23ee8b53734fc66a6b3a127a49 Mon Sep 17 00:00:00 2001 From: rillig Date: Tue, 1 Sep 2020 20:54:00 +0000 Subject: [PATCH] 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. --- usr.bin/make/targ.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/usr.bin/make/targ.c b/usr.bin/make/targ.c index ed86b9316d3a..c98abbed5705 100644 --- a/usr.bin/make/targ.c +++ b/usr.bin/make/targ.c @@ -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 #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 @@ static Lst allGNs; /* List of all the GNodes */ #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 @@ void Targ_Init(void) { allTargets = Lst_Init(); - Hash_InitTable(&targets, HTSIZE); + Hash_InitTable(&targets, 191); } void