Module Name: src
Committed By: rillig
Date: Sat Sep 5 13:36:25 UTC 2020
Modified Files:
src/usr.bin/make: hash.c
Log Message:
make(1): make Hash_Table independent from -funsigned-char
This only makes a difference for Hash_Table keys outside the ASCII
character set, and these are barely used in practice, if at all.
The effects of this change can only be seen in debug mode, when printing
the full contents of the variable namespaces. In this output, the order
of the entries might change.
All other use cases stay the same as before.
To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/usr.bin/make/hash.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/hash.c
diff -u src/usr.bin/make/hash.c:1.29 src/usr.bin/make/hash.c:1.30
--- src/usr.bin/make/hash.c:1.29 Tue Sep 1 21:11:31 2020
+++ src/usr.bin/make/hash.c Sat Sep 5 13:36:25 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: hash.c,v 1.29 2020/09/01 21:11:31 rillig Exp $ */
+/* $NetBSD: hash.c,v 1.30 2020/09/05 13:36:25 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: hash.c,v 1.29 2020/09/01 21:11:31 rillig Exp $";
+static char rcsid[] = "$NetBSD: hash.c,v 1.30 2020/09/05 13:36:25 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)hash.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: hash.c,v 1.29 2020/09/01 21:11:31 rillig Exp $");
+__RCSID("$NetBSD: hash.c,v 1.30 2020/09/05 13:36:25 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -111,7 +111,7 @@ static void RebuildTable(Hash_Table *);
/* The default: this one matches Gosling's emacs */
#define HASH(h, key, p) do { \
for (h = 0, p = key; *p;) \
- h = (h << 5) - h + *p++; \
+ h = (h << 5) - h + (unsigned char)*p++; \
} while (0)
#endif