Module Name: src Committed By: rillig Date: Tue Sep 1 20:54:00 UTC 2020
Modified Files: src/usr.bin/make: targ.c Log Message: 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. To generate a diff of this commit: cvs rdiff -u -r1.80 -r1.81 src/usr.bin/make/targ.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/targ.c diff -u src/usr.bin/make/targ.c:1.80 src/usr.bin/make/targ.c:1.81 --- src/usr.bin/make/targ.c:1.80 Sun Aug 30 14:11:42 2020 +++ src/usr.bin/make/targ.c Tue Sep 1 20:54:00 2020 @@ -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 @@ static Lst allGNs; /* List of all the #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